sla.get
説明
integer/array sla.get(object parameters)
このメソッドを使用すると、指定されたパラメーターに従ってSLAオブジェクトを取得できます。
このメソッドはどのタイプのユーザーでも利用可能です。このメソッドを呼び出す権限は、ユーザーロール設定で取り消すことができます。詳しくはユーザーの役割を参照してください。
パラメータ
(object) 必要な出力を定義するパラメータ。
このメソッドは以下のパラメータをサポートしています。
| パラメータ | Type | 説明 |
|---|---|---|
| slaids | ID/array | 指定されたIDを持つSLAのみを返します。 |
| serviceids | ID/array | 特定のサービスに一致するSLAのみを返します。 |
| selectSchedule | query | SLAスケジュールを含む schedule プロパティを返します。count をサポートします。 |
| selectExcludedDowntimes | query | SLAの除外ダウンタイムを含む excluded_downtimes プロパティを返します。count をサポートします。 |
| selectServiceTags | query | SLAのサービスタグを含む service_tags プロパティを返します。count をサポートします。 |
| sortfield | string/array | 指定されたプロパティで結果をソートします。 指定可能な値: slaid, name, period, slo, effective_date, timezone, status, description。 |
| countOutput | boolean | これらのパラメータについては、リファレンスコメントで説明されています。 |
| editable | boolean | |
| excludeSearch | boolean | |
| filter | object | |
| limit | integer | |
| output | query | |
| preservekeys | boolean | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | boolean |
戻り値
(integer/array) 以下のいずれかを返します。
- オブジェクトの配列
countOutputパラメータが使用されている場合は、取得したオブジェクト数
例
すべてのSLAの取得
すべてのSLAとそのプロパティに関するすべてのデータを取得します。
{
"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
}
レスポンス:
{
"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
}
ソース
ui/include/classes/api/services/CSla.php 内の CSla:get()。