Summary:
List the services on a View, or create a service on a View.
URL:
http(s)://{server hostname}/api/service
Methods summary
- GET Method - list the services on a View.
- POST Method - create a service on a View.
GET Method detail
List the services on a View.
Request:
All parameters are optional.
As with query strings, separate parameters with '&', e.g. 'indirect=true&subservices=true'.
Because it is a URL, spaces must be replaced with '%20', e.g. 'My&20Network' instead of 'My Network'.
Name | Description |
---|---|
viewpath |
the View path to get services from. Should start with 'My&20Network' (HTML, URL encoding). If this value is net set, then the View path will default to 'All Objects', which would return all services. To access other users' View paths, prefix with the username and '::', e.g. 'user::My%20Network/AllObjects' Example: viewpath=My%20Network/test |
indirect |
if true, will also return services in child Views of the given View. This does not apply to consolidated calls. Example: indirect=true |
subservices |
if true, will also include subservices associated with retrieved services. This does not apply to consolidated calls. Example: subservices=true |
consolidate |
if true, will also retrieve service information from remote servers. Example: consolidate=true |
maxdepth |
maximum depth of child services to retrieve. If not set, this will default to 3. This applies only to consolidate=true. Example: maxdepth=5 |
Response:
Name | Description |
---|---|
objectId | object ID of this service. This is also referenced as 'serviceid' in other RESTful API calls. |
serverObjectId | server ID of the server on which this service exists. |
shortServiceName |
user-specified name of service. |
descriptiveAlias | user-specified short name of the service. |
serviceStatus | user-specified description of service. |
children |
gives the current status of the service.
|
subServices | lists any children services associated with this service. |
Examples:
INPUT
curl –u admin:admin https://localhost/api/service
OUTPUT
{
"value": [
{
"objectId": 819,
"serverId": "1758b1ea-2e6e-4bb2-82db-810a153293a2",
"serviceName": "test",
"shortServiceName": "",
"descriptiveAlias": "",
"serviceStatus": 1,
"children": null
"subServices": null
}
{
"objectId": 825,
"serverId": "1758b1ea-2e6e-4bb2-82db-810a153293a2",
"serviceName": "ok",
"shortServiceName": "",
"descriptiveAlias": "",
"serviceStatus": 1,
"children": null
"subServices": null
}
],
"count": 2
}
INPUT
curl –u admin:admin https://localhost/api/service?viewpath=My%20Network/te/te2&indirect=true&subservices=true
OUTPUT
{
"value": [
{
"objectId": 819,
"serverId": "1758b1ea-2e6e-4bb2-82db-810a153293a2",
"serviceName": "test",
"shortServiceName": "",
"descriptiveAlias": "",
"serviceStatus": 1,
"children": null
"subServices": null
}
],
"count": 1
}
POST Method detail
Create a new service on the selected View. Note that new services created this way do not contain any components, and must have them added via Service.
Request:
Name | Description |
---|---|
serviceName | user-specified name of service. |
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 | value in which the service will be considered to be degraded. |
raiseEvents | if the service will raise events upon a state change, either true or false. |
treatUnknownAsDown | if the service will treat Unknown statuses as Down, either true or false. |
serviceSlaGoal | SLA Availability goal in % (e.g. 99.0 = 99%). |
descriptiveAlias | user-specified description of service. |
parentViewPath |
not applicable when creating a service (will use the #viewId given). The View path of the service. |
parentServiceId | the parent service's ID. |
aggregateEnable | if traffic across all ports is aggregated. |
serviceTag |
service tag for reports. Can be:
|
shortServiceName | user-specified short name of service. |
All values except for serviceName can be left out and required fields will use the Default when Create value instead.
Example:
INPUT
curl –u admin:admin https://localhost/api/service?viewpath=My%20Network/te -X POST -H "content-type:application/json" -d
{
"serviceName": "test"
}
OUTPUT
{
"info": {
"serviceId": 819,
"serviceName": "test",
"serviceType": 0,
"serviceAtLeastValue": 0,
"serviceDegradedThreshold": 0,
"raiseEvents": true,
"serviceSlaGoal": 99.0,
"serviceWebImage": 0,
"descriptiveAlias": "",
"ownerId": "admin",
"hasAdminPermission": true,
"availableEyeServers": null,
"users": [
{
"first": 3,
"second": "admin",
},
{
"first": 4,
"second": "user",
}
],
"aggregateEnable": false,
"serviceTag": "Standard"
"message": "ok"
},
"componentIds": [
]
}
Comments
0 comments
Please sign in to leave a comment.