object sla.update(object/array slaids)
This method allows to update existing SLA entries.
This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.
(object/array)
SLA properties to be updated.
The slaid
property must be defined for each SLA, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.
Additionally to the standard SLA properties, the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
service_tags | array | SLA service tags to replace the current SLA service tags. |
schedule | array | SLA schedule to replace the current one. Specifying parameter as empty will be interpreted as a 24x7 schedule. |
excluded_downtimes | array | SLA excluded downtimes to replace the current ones. |
(object)
מחזירה אובייקט המכיל את המזהים של SLAs המעודכנים תחת המאפיין slaids
.
Make SLA with ID "5" to be calculated at monthly intervals for NoSQL related services, without changing its schedule or excluded downtimes; set SLO to 95%.
{
"jsonrpc": "2.0",
"method": "sla.update",
"params": [
{
"slaid": "5",
"name": "NoSQL Database engines",
"slo": "95",
"period": 2,
"service_tags": [
{
"tag": "Database",
"operator": "0",
"value": "Redis"
},
{
"tag": "Database",
"operator": "0",
"value": "MongoDB"
}
]
}
],
"id": 1
}
Response:
Switch the SLA with ID "5" to a 24x7 schedule.
{
"jsonrpc": "2.0",
"method": "service.update",
"params": {
"slaid": "5",
"schedule": []
},
"id": 1
}
Response:
Add a planned 4 hour long RAM upgrade downtime on the 6th of April, 2022, while keeping (needs to be defined anew) a previously existing software upgrade planned on the 4th of July for the SLA with ID "5".
{
"jsonrpc": "2.0",
"method": "service.update",
"params": {
"slaid": "5",
"excluded_downtimes": [
{
"name": "Software version upgrade rollout",
"period_from": "1648760400",
"period_to": "1648764900"
},
{
"name": "RAM upgrade",
"period_from": "1649192400",
"period_to": "1649206800"
}
]
},
"id": 1
}
Response:
CSla::update() בתוך ui/include/classes/api/services/CSla.php.