All Products
Search
Document Center

Application Real-Time Monitoring Service:ListPrometheusAlertTemplates

Last Updated:Nov 05, 2024

Queries the alert templates of Prometheus Service.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
arms:ListPrometheusAlertTemplatesnone
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringNo

The ID of the cluster.

c0bad479465464e1d8c1e641b0afb****
RegionIdstringYes

The ID of the region.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

9FEA6D00-317F-45E3-9004-7FB8B0B7****
PrometheusAlertTemplatesarray<object>

The returned struct.

PrometheusAlertTemplateobject
Typestring

The type of the alert rule.

Node
Descriptionstring

The content of the alert notification. Tags can be referenced in the {{$labels.xxx}} format.

The available memory on node {{ $labels.instance }} is less than 10%. Available memory: {{ $value }}%
Expressionstring

The expression of the alert rule.

node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10
Versionstring

The version of the alert rule.

1.0
Durationstring

The duration of the alert. Valid values: 1 to 1440. Unit: minutes.

1m
AlertNamestring

The name of the alert rule.

The available memory on the node is less than 10%
Labelsarray<object>

The tags of the alert rule.

Labelobject
Namestring

The name of the tag.

severity
Valuestring

The value of the tag.

warning
Annotationsarray<object>

The annotations of the alert rule.

Annotationobject
Namestring

The name of the annotation.

message
Valuestring

The value of the annotation.

The available memory on node {{ $labels.instance }} is less than 10%. Available memory: {{ $value }}%

Examples

Sample success responses

JSONformat

{
  "RequestId": "9FEA6D00-317F-45E3-9004-7FB8B0B7****",
  "PrometheusAlertTemplates": [
    {
      "Type": "Node\n",
      "Description": "The available memory on node {{ $labels.instance }} is less than 10%. Available memory: {{ $value }}%\n",
      "Expression": "node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10",
      "Version": "1.0",
      "Duration": "1m",
      "AlertName": "The available memory on the node is less than 10%\n",
      "Labels": [
        {
          "Name": "severity",
          "Value": "warning"
        }
      ],
      "Annotations": [
        {
          "Name": "message",
          "Value": "The available memory on node {{ $labels.instance }} is less than 10%. Available memory: {{ $value }}%\n"
        }
      ]
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history