object service.getsla(object parameters)
This method allows to calculate availability information about services.
This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.
(object)
Parameters containing the IDs of the services and time intervals to calculate SLA.
Parameter | Type | Description |
---|---|---|
serviceids | string/array | IDs of services to return availability information for. |
intervals | array | Time intervals to return service layer availability information about. Each time interval must have the following parameters: - from - (timestamp) interval start time;- to - (timestamp) interval end time. |
(object)
Returns the following availability information about each service under the corresponding service ID.
Property | Type | Description |
---|---|---|
from | timestamp | Interval start time. |
to | timestamp | Interval end time. |
sla | float | SLA for the given time interval. |
okTime | integer | Time the service was in OK state, in seconds. |
problemTime | integer | Time the service was in problem state, in seconds. |
downtimeTime | integer | Time the service was in scheduled downtime, in seconds. |
Retrieve availability information about a service during a week.
Request:
{
"jsonrpc": "2.0",
"method": "service.getsla",
"params": {
"serviceids": "2",
"intervals": [
{
"from": 1352452201,
"to": 1353057001
}
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"2": [
{
"from": 1352452201,
"to": 1353057001,
"sla": 97.046296296296,
"okTime": 586936,
"problemTime": 17864,
"downtimeTime": 0
}
]
},
"id": 1
}
CService::getSla() in ui/include/classes/api/services/CService.php.