[comment]: # ({new-f5d7e62f})
# sla.create

[comment]: # ({/new-f5d7e62f})

[comment]: # ({new-c44d5a50})
### Description

`object sla.create(object/array SLAs)`

This method allows to create new SLA objects.

::: noteclassic
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](/manual/web_interface/frontend_sections/users/user_roles)
for more information.
:::

[comment]: # ({/new-c44d5a50})

[comment]: # ({new-69be5e01})
### Parameters

`(object/array)` SLA objects to create.

Additionally to the [standard SLA properties](object#sla), the
method accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Description|
|--|--|------|
|service_tags|array|[SLA service tags](/manual/api/reference/sla/object#sla-service-tag) to be created for the SLA.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *required*|
|schedule|array|[SLA schedule](/manual/api/reference/sla/object#sla-schedule) to be created for the SLA.<br>Specifying an empty parameter will be interpreted as a 24x7 schedule.<br>Default: 24x7 schedule.|
|excluded_downtimes|array|[SLA excluded downtimes](/manual/api/reference/sla/object#sla-excluded-downtime) to be created for the SLA.|

[comment]: # ({/new-69be5e01})

[comment]: # ({ce6a7025-f5eb6cfd})
### החזר ערכים

`(object)` מחזירה אובייקט המכיל את המזהים של SLAs שנוצרו
תחת נכס ה'שלידות'. סדר המזהים המוחזרים תואם
סדר ה-SLAs שעברו.

[comment]: # ({/ce6a7025-f5eb6cfd})

[comment]: # ({b41637d2-b41637d2})
### דוגמאות

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

[comment]: # ({a9e10253-fc6bed3c})
#### יצירת SLA

הוראה ליצור ערך SLA עבור:
* מעקב אחר זמן פעולה עבור שירותים הקשורים למנועי SQL;
* לוח זמנים מותאם אישית של כל ימי השבוע למעט השעה האחרונה בשבת;
* תאריך תוקף של היום האחרון של שנת 2022;
* עם זמן השבתה מתוכנן של שעה ו-15 דקות החל מחצות ב-4 ביולי;
* חישוב דוח שבועי של SLA יופעל;
* SLO המינימלי המקובל יהיה 99.9995%.

[comment]: # ({/a9e10253-fc6bed3c})

[comment]: # ({new-18749288})

[Request](/manual/api#performing-requests):

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

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "slaids": [
            "5"
        ]
    },
    "id": 1
}
```

[comment]: # ({/new-18749288})

[comment]: # ({0350a23a-fda6729e})
### מקור

CSla::create()‎ בתוך *ui/include/classes/api/services/CSla.php*.

[comment]: # ({/0350a23a-fda6729e})
