Summary:
List, modify, add components to or delete a service.
URL:
http(s)://{server hostname}/api/service/{serviceId}
Methods summary
- GET Method - list details of a service.
- PUT Method - modifies settings of the service.
- POST Method - add or remove components to the service.
- DELETE Method - deletes the service.
GET Method detail
List details of a service.
Response:
Name | Description |
---|---|
serviceId | service ID of the service. |
serviceName | user-specified service name. |
serviceType |
type of service logic:
|
serviceAtLeastValue | if the service logic type (serviceType) is 4 At Least, the serviceAtLeastValue specifies the minimum number of components that should be OK for the service to be considered OK. |
serviceDegradedThreshold | if the service logic type (serviceType) is 4 At Least, the serviceDegradedThreshold value specifies the value at which the service will be considered to be degraded. |
raiseEvents | whether the service will raise events upon state change, either true or false. |
treatUnknownAsDown | whether the service will treat Unknown statuses as Down, either true or false. |
serviceSlaGoal | SLA availability goal in % (e.g. 99.0 = 99%) |
serviceWebImage | not used. |
descriptiveAlias | user-specified description of service. |
ownerId | string ID of the user who owns the service. |
hasAdminPermission | if the service was created by an Admin user (meaning that the service has access to components that may be admin only), either true or false. |
availableEyeServerId | list of external (remote) servers that the server accesses. |
defaultEyeServerId | default server from list of external (remote) servers. |
users | list of users that have access to this service. Consists of the username and their ID. |
aggregateEnable | if traffic across all ports is aggregated. |
serviceTag |
service tags for reports. Can be:
|
message | "OK" if no error occurred, otherwise the error message will appear here. |
Example:
INPUT
curl –u admin:admin https://localhost/api/service/819
OUTPUT
{
"info": [
{
"serviceId": 819,
"serviceName": "test",
"serviceType": 0,
"serviceAtLeastValue": 0
"serviceDegradedThreshold": 0,
"raiseEvents": true,
"treatUnknownAsDown": false,
"serviceSlaGoal": 99.0,
"serviceWebImage": 0,
"descriptiveAlias": "",
"ownerId": "admin",
"hasAdminPermission": true,
"availableEyeServers": null,
"defaultEyeServerId": null,
"users": [
{
"first": 3,
"second": "admin",
},
{
"first": 4,
"second": "user",
}
],
"aggregateEnable": false
"serviceTag": "Standard"
"message": "ok"
},
"componentIds": [
{
"serverId": "1758b1ea-2e6e-4bb2-82db-810a153293a2"
"objectId": "795"
}
]
}
PUT Method detail
Modify the settings of the service. Note, to modify the components of a service, you will need to use the POST method below.
Request:
See 'GET Method - Response' table above.
Example:
INPUT
curl –u admin:admin https://localhost/api/service/830 -X PUT -H "content-type:application/json" -d
{
"serviceName": "test1"
}
OUTPUT
{
"info": [
{
"serviceId": 830,
"serviceName": "test",
"serviceType": 0,
"serviceAtLeastValue": 0
"serviceDegradedThreshold": 0,
"raiseEvents": true,
"treatUnknownAsDown": false,
"serviceSlaGoal": 99.0,
"serviceWebImage": 0,
"descriptiveAlias": "",
"ownerId": "admin",
"hasAdminPermission": true,
"availableEyeServers": null,
"defaultEyeServerId": null,
"users": [
{
"first": 3,
"second": "admin",
},
{
"first": 4,
"second": "user",
}
],
"aggregateEnable": false
"serviceTag": "Standard"
"message": "ok"
},
"componentIds": [
{
"serverId": "1758b1ea-2e6e-4bb2-82db-810a153293a2"
"objectId": "795"
}
]
}
POST Method detail
Add or remove components to or from the service. You can retrieve device object keys by calling 'api/inventory'.
Request:
Name | Description |
---|---|
addList | a list of IDs for components to be added to the service. |
removeList | a list of IDS for components to be removed from the service. |
Response:
Returns the modified service if valid, otherwise returns the error message.
Example:
INPUT
curl –u admin:admin https://localhost/api/service/825 -X POST -H "content-type:application/json" -d
{
"addList": [
{
"serverId": "1758b1ea-2ege-4bb2-82db-810a153293a2",
"id": 795
}
]
}
OUTPUT
{
"info": [
{
"serviceId": 825,
"serviceName": "ok",
"serviceType": 0,
"serviceAtLeastValue": 0
"serviceDegradedThreshold": 0,
"raiseEvents": true,
"treatUnknownAsDown": false,
"serviceSlaGoal": 99.0,
"serviceWebImage": 0,
"descriptiveAlias": "",
"ownerId": "admin",
"hasAdminPermission": true,
"availableEyeServers": null,
"defaultEyeServerId": null,
"users": [
{
"first": 3,
"second": "admin",
},
{
"first": 4,
"second": "user",
}
],
"aggregateEnable": false
"serviceTag": "Standard"
"message": "ok"
},
"componentIds": [
{
"serverId": "1758b1ea-2e6e-4bb2-82db-810a153293a2"
"objectId": "795"
}
]
}
DELETE Method detail
Deletes the service.
Response:
"OK" messaged displayed when successfully deleted.
Example:
INPUT
curl –u admin:admin https://localhost/api/service/830 -X DELETE
OUTPUT
{
"message": "ok"
}
Comments
0 comments
Please sign in to leave a comment.