On this page
sla.get
Apraksts
integer/array sla.get(object parameters)
Metode ļauj izgūt SLA objektus atbilstoši norādītajiem parametriem.
Šī metode ir pieejama jebkura tipa lietotājiem. Atļaujas izsaukt šo metodi var tikt atsauktas lietotāja lomas iestatījumos. Plašāku informāciju skatiet sadaļā Lietotāju lomas.
Parametri
(object) Parametri, kas nosaka vēlamo izvadi.
Metode atbalsta šādus parametrus.
| Parametrs | Tips | Apraksts |
|---|---|---|
| slaids | ID/array | Atgriezt tikai SLA ar norādītajiem ID. |
| serviceids | ID/array | Atgriezt tikai SLA, kas atbilst konkrētajiem pakalpojumiem. |
| selectSchedule | query | Atgriezt schedule īpašību ar SLA grafikiem.Atbalsta count. |
| selectExcludedDowntimes | query | Atgriezt excluded_downtimes īpašību ar SLA izslēgtajām dīkstāvēm.Atbalsta count. |
| selectServiceTags | query | Atgriezt service_tags īpašību ar SLA pakalpojumu birkām.Atbalsta count. |
| sortfield | string/array | Kārtot rezultātu pēc norādītajām īpašībām. Iespējamās vērtības: slaid, name, period, slo, effective_date, timezone, status, description. |
| countOutput | boolean | Šie parametri ir aprakstīti atsauces komentārā. |
| editable | boolean | |
| excludeSearch | boolean | |
| filter | object | |
| limit | integer | |
| output | query | |
| preservekeys | boolean | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | boolean |
Atgrieztās vērtības
(integer/array) Atgriež vienu no šīm vērtībām:
- objektu masīvu;
- izgūto objektu skaitu, ja ir izmantots parametrs
countOutput.
Piemēri
Visu SLA izgūšana
Izgūstiet visus datus par visiem SLA un to īpašībām.
{
"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
}
Atbilde:
{
"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
}
Avots
CSla:get() failā ui/include/classes/api/services/CSla.php.