sla.get

Description

integer/array sla.get(object parameters)

The method allows to retrieve SLA objects according to the given parameters.

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.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
slaids string/array Return only SLAs with the given IDs.
serviceids string/array Return only SLAs matching the specific services.
selectSchedule query Return a schedule property with SLA schedules.

Supports count.
selectExcludedDowntimes query Return an excluded_downtimes property with SLA excluded downtimes.

Supports count.
selectServiceTags query Return a service_tags property with SLA service tags.

Supports count.
sortfield string/array Sort the result by the given properties.

Possible values: slaid, name, period, slo, effective_date, timezone, status, description.
countOutput boolean These parameters being common for all get methods are described in detail in the reference commentary.
editable boolean
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

Visszatérési értékek

(egész szám/tömb) A következőket adja vissza:

  • objektumok tömbje;
  • a letöltött objektumok száma, ha a "countOutput" paramétert használták.

Példák

Retrieving all SLAs

Retrieve all data about all SLAs and their properties.

Request:

{
           "jsonrpc": "2.0",
           "method": "sla.get",
           "params": {
               "output": "extend",
               "selectSchedule": ["period_from", "period_to"],
               "selectExcludedDowntimes": ["name", "period_from", "period_to"],
               "selectServiceTags": ["tag", "operator", "value"],
               "preservekeys": true
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "1": {
                   "slaid": "1",
                   "name": "Database Uptime",
                   "period": "1",
                   "slo": "99.9995",
                   "effective_date": "1672444800",
                   "timezone": "America/Toronto",
                   "status": "1",
                   "description": "Provide excellent uptime for main SQL database engines.",
                   "service_tags": [
                       {
                           "tag": "Database",
                           "operator": "0",
                           "value": "MySQL"
                       },
                       {
                           "tag": "Database",
                           "operator": "0",
                           "value": "PostgreSQL"
                       }
                   ],
                   "schedule": [
                       {
                           "period_from": "0",
                           "period_to": "601200"
                       }
                   ],
                   "excluded_downtimes": [
                       {
                           "name": "Software version upgrade rollout",
                           "period_from": "1648760400",
                           "period_to": "1648764900"
                       }
                   ]
               }
           },
           "id": 1
       }

Forrás

CSla:get() az ui/include/classes/api/services/CSla.php-ban.