[comment]: # translation:outdated

[comment]: # ({c7a5132c-2587902b})
# sla.get

[comment]: # ({/c7a5132c-2587902b})

[comment]: # ({19361ddd-bfd5de7f})
### Опис

`integer/array sla.get(object parameters)`

Метод омогућава преузимање SLA објеката према датим параметрима.

::: noteclassic
Овај метод је доступан корисницима било које врсте. Дозволе
за позивање методе може се опозвати у подешавањима улоге корисника. Погледајте [Корисничке
улоге](/manual/web_interface/frontend_sections/users/user_roles)
за више информација.
:::

[comment]: # ({/19361ddd-bfd5de7f})

[comment]: # ({f104dcc3-e7637a1d})
### Параметри

`(object)` Параметри који дефинишу жељени излаз.

Метод подржава следеће параметре.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Description|
|--|--|------ |
|imageids|ID/array|Враћа само слике са датим ID-ијевима.|
|sysmapids|ID/array|Враћа слике које се користе на датим мапама.|
|select\_image|flag|Враћа својство `image` са Base64 кодираном сликом.|
|sortfield|string/array|Сортира резултат према датим својствима.<br><br>Могуће вредности: `imageid`, `name`.|
|countOutput|boolean|Ови параметри су описани у [референтном коментару](/manual/api/reference_commentary#common_get_method_parameters).|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/f104dcc3-e7637a1d})

[comment]: # ({07ca11ca-7223bab1})
### Повратне вредности

`(integer/array)` Враћа или:

-  низ објеката;
-  број преузетих објеката, ако је коришћен параметар `countOutput `.

[comment]: # ({/07ca11ca-7223bab1})

[comment]: # ({b41637d2-b41637d2})
### Примери

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({578ccfee-cd4e4011})
#### Преузимање свих SLA-евима

Преузми све податке о свим SLA-евима и њиховим својствима.

[Захтев](/manual/api#performing-requests):

```json
{
    "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
}
```

Одговор:

```json
{
    "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
}
```

[comment]: # ({/578ccfee-cd4e4011})

[comment]: # ({1f2163e3-05e3cf18})
### Извор

CSla:get() у *ui/include/classes/api/services/CSla.php*.

[comment]: # ({/1f2163e3-05e3cf18})
