-
Notifications
You must be signed in to change notification settings - Fork 10
REST: Server arrays management
Path: /rest/projects/(projectId)/server-arrays
Type: GET
Example:
Response:
[ {"id":1,"projectId":1,"name":"WebServers","description":"Servers with running tomcats"} ]
Path: /rest/projects/(projectId)/server-arrays
Type: POST
Input data:
{
"name":"WebServers",
"description":"Servers with running tomcats"
}
Request body consists form a single JSON map contains the following entries:
Entry name | Type | Mandatory | Description |
---|---|---|---|
name | String | Y | Name of the server array |
description | String | В | Description of the server array |
Example results:
Error on creation (common result object):
{
"isSuccess": false,
"isNotFound": false,
"variablesErrors" : {"fieldName": "Error message"},
"compoundServiceErrors" : ["Error message 1", "Error message 2"]
}
Successful creation:
{
"result": {
"id":2,
"projectId":1,
"name":"WebServers",
"description":"Some description"
},
"isSuccess":true
}
Path: /rest/projects/(projectId)/server-arrays/(arrayId)
Type: PUT
Example results:
Error on update: common result object
Successful update:
{
"result": {
"id":1,
"projectId":1,
"name":"Databse servers",
"description":"Oracle powered"
},
"isSuccess":true
}
Request body: Same as in create
Path: /rest/projects/(projectId)/server-arrays/(arrayId)
Type: DELETE
Example results: See common result object
Path: /rest/projects/(projectId)/server-arrays/(arrayId)/servers
Type: GET
Example:
Response:
[
{"id":9,
"arrayId":1,
"instanceId":"most powerfull server",
"address":"127.0.0.1",
"credentialsId": 1
}
]
Path: /rest/projects/(projectId)/server-arrays/(arrayId)/servers
Type: POST
Input data:
{"instanceId":"MyServer","address":"localhost", "credentialsId": 1}
Request body consists form a single JSON map contains the following entries:
Entry name | Type | Mandatory | Description |
---|---|---|---|
instanceId | String | В | Unique(per array) server id. Will be generated by genesis if not provided |
address | String | YВ | Domain name( should be resolvable via dns used by genesis) or ip address (ip 4 and ip 6 formats supported) |
credentialsId | Number | В | Id of of a credentials record from projects credentials store |
Example:
Response:
{
"result": {
"id":10,
"arrayId":1,
"instanceId":"46e51a09-207f-4e0b-ac62-693dd14f2122",
"address":"localhost"
},
"isSuccess":true
}
Path: /rest/projects/(projectId)/server-arrays/(arrayId)/servers/(serverId)
Type: DELETE
Response: See common result object