This is a translation of the original English documentation page. Help us make it better.

sla.create

Description

object sla.create(object/array SLAs)

This method allows to create new SLA objects.

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.

Parameters

(object/array) SLA objects to create.

Additionally to the standard SLA properties, the method accepts the following parameters.

Parameter Type Description
service_tags
(required)
array SLA service tags to be created for the SLA.
At least one service tag must be specified.
schedule array SLA schedule to be created for the SLA.
Specifying an empty parameter will be interpreted as a 24x7 schedule.
Default: 24x7 schedule.
excluded_downtimes array SLA excluded downtimes to be created for the SLA.

戻り値

(object) slaidsプロパティの下で作成されたSLAのIDを含むオブジェクトを返します。 返されるIDの順序は、渡されたSLAの順序と一致します。

SLAの作成

次のSLAエントリを作成するように指示します。 * SQLエンジン関連サービスの稼働時間を追跡 * 土曜日の最後の時間を除くすべての平日のカスタムスケジュール * 2022年の最終発効日 * 7月4日の深夜から始まる1時間15分の計画されたダウンタイム * SLAウィークリーレポートの計算をオンに * 最小許容SLOを99.9995%に

Request:

{
           "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"
                       }
                   ]
               }
           ],
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

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

ソース

CSla::create() in ui/include/classes/api/services/CSla.php.