All Products
Search
Document Center

CloudMonitor:DescribeMetricRuleTemplateList

Last Updated:Mar 01, 2024

Queries alert templates.

Operation description

This topic provides an example on how to query alert templates. In this example, the following alert templates are returned in the response: ECS_Template1 and ECS_Template2.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringNo

The name of the alert template.

ECS_Template1
KeywordstringNo

The keyword of the alert template name.

ECS
TemplateIdlongNo

The ID of the alert template.

70****
PageNumberlongNo

The page number.

Default value: 1.

1
PageSizelongNo

The number of entries per page.

10
HistorybooleanNo

Specifies whether to display the history of applying the alert templates to application groups. Valid values:

  • true
  • false (default)
false
OrderbooleanNo

The sorting order. Valid values:

  • true (default): ascending order
  • false: descending order
true
OrderBystringNo

The sorting basis. Valid values:

  • gmtMotified: sorts alert templates by modification time
  • gmtCreate (default): sorts alert templates by creation time
gmtCreate

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The status code.

Note The status code 200 indicates that the request was successful.
200
Messagestring

The error message.

The Request is not authorization.
RequestIdstring

The request ID.

659401C0-6214-5C02-972A-CFA929D717B7
Totallong

The total number of entries returned.

2
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Templatesobject []

The queried alert templates.

Descriptionstring

The description of the alert template.

GmtCreatelong

The timestamp when the alert template was created.

Unit: milliseconds.

1646018798000
Namestring

The name of the alert template.

ECS_Template1
RestVersionlong

The version of the alert template.

Default value: 0.

0
GmtModifiedlong

The timestamp when the alert template was modified.

Unit: milliseconds.

1646054798000
TemplateIdlong

The ID of the alert template.

70****
ApplyHistoriesobject []

The history of applying the alert templates to application groups.

GroupIdlong

The ID of the application group.

3607****
GroupNamestring

The name of the application group.

ECS_Group
ApplyTimelong

The timestamp when the alert template was applied to the application group.

Unit: milliseconds.

1646055898000

Examples

Sample success responses

JSONformat

{
  "Code": 200,
  "Message": "The Request is not authorization.",
  "RequestId": "659401C0-6214-5C02-972A-CFA929D717B7",
  "Total": 2,
  "Success": true,
  "Templates": {
    "Template": [
      {
        "Description": "",
        "GmtCreate": 1646018798000,
        "Name": "ECS_Template1",
        "RestVersion": 0,
        "GmtModified": 1646054798000,
        "TemplateId": 0,
        "ApplyHistories": {
          "ApplyHistory": [
            {
              "GroupId": 0,
              "GroupName": "ECS_Group",
              "ApplyTime": 1646055898000
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400ParameterInvalidIllegal parameters.-
403AccessForbiddenUser not authorized to operate on the specified resource.-
404ResourceNotFoundThe specified resource is not found.The specified resource is not found.
500InternalErrorThe request processing has failed due to some unknown error.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-03-22The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Order
    Added Input Parameters: OrderBy