アラートテンプレートをクエリします。
操作説明
このトピックでは、アラートテンプレートをクエリする方法の例を説明します。 この例では、応答で次のアラートテンプレートが返されます: ECS_Template1 と ECS_Template2。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
cms:DescribeMetricRuleTemplateList |
get |
*All Resource
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| Name |
string |
任意 |
アラートテンプレートの名前。 |
ECS_Template1 |
| Keyword |
string |
任意 |
アラートテンプレート名のキーワード。 |
ECS |
| TemplateId |
integer |
任意 |
アラートテンプレートの ID。 |
70**** |
| PageNumber |
integer |
任意 |
ページ番号。 デフォルト値:1。 |
1 |
| PageSize |
integer |
任意 |
1 ページあたりのエントリ数。 |
10 |
| History |
boolean |
任意 |
アラートテンプレートをアプリケーショングループに適用した履歴を表示するかどうかを指定します。 有効な値:
|
false |
| Order |
boolean |
任意 |
ソート順。 有効な値:
|
true |
| OrderBy |
string |
任意 |
ソート基準。 有効な値:
|
gmtCreate |
共通リクエストパラメーターの詳細については、「共通パラメーター」をご参照ください。
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| Code |
integer |
状態コード。 説明
状態コード 200 は、リクエストが成功したことを示します。 |
200 |
| Message |
string |
エラーメッセージ。 |
The Request is not authorization. |
| RequestId |
string |
リクエスト ID。 |
659401C0-6214-5C02-972A-CFA929D717B7 |
| Total |
integer |
返されたエントリの総数。 |
2 |
| Success |
boolean |
リクエストが成功したかどうかを示します。 有効な値:
|
true |
| Templates |
object |
||
| Template |
array<object> |
クエリされたアラートテンプレート。 |
|
|
array<object> |
なし |
||
| Description |
string |
アラートテンプレートの説明。 |
ECS的CPU使用率 |
| GmtCreate |
integer |
アラートテンプレートが作成されたときのタイムスタンプ。 単位:ミリ秒。 |
1646018798000 |
| Name |
string |
アラートテンプレートの名前。 |
ECS_Template1 |
| RestVersion |
integer |
アラートテンプレートのバージョン。 デフォルト値:0。 |
0 |
| GmtModified |
integer |
アラートテンプレートが変更されたときのタイムスタンプ。 単位:ミリ秒。 |
1646054798000 |
| TemplateId |
integer |
アラートテンプレートの ID。 |
70**** |
| ApplyHistories |
object |
||
| ApplyHistory |
array<object> |
アラートテンプレートをアプリケーショングループに適用した履歴。 |
|
|
object |
なし |
||
| GroupId |
integer |
アプリケーショングループの ID。 |
3607**** |
| GroupName |
string |
アプリケーショングループの名前。 |
ECS_Group |
| ApplyTime |
integer |
アラートテンプレートがアプリケーショングループに適用されたときのタイムスタンプ。 単位:ミリ秒。 |
1646055898000 |
例
成功レスポンス
JSONJSON
{
"Code": 200,
"Message": "The Request is not authorization.",
"RequestId": "659401C0-6214-5C02-972A-CFA929D717B7",
"Total": 2,
"Success": true,
"Templates": {
"Template": [
{
"Description": "ECS的CPU使用率",
"GmtCreate": 1646018798000,
"Name": "ECS_Template1",
"RestVersion": 0,
"GmtModified": 1646054798000,
"TemplateId": 0,
"ApplyHistories": {
"ApplyHistory": [
{
"GroupId": 0,
"GroupName": "ECS_Group",
"ApplyTime": 1646055898000
}
]
}
}
]
}
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。