All Products
Search
Document Center

CloudMonitor:DescribeEventRuleAttribute

Last Updated:Jul 26, 2024

Queries the details of an event-triggered alert rule.

Operation description

This topic provides an example to show how to query the details of an event-triggered alert rule named testRule.

Debugging

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

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
cms:DescribeEventRuleAttributeget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RuleNamestringYes

The name of the event-triggered alert rule.

For information about how to obtain the name of an event-triggered alert rule, see DescribeEventRuleList .

testRule
SilenceTimestringNo

The mute period during which new alert notifications are not sent even if the trigger conditions are met.

Unit: seconds. Default value: 86400, which indicates one day.

Note Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.
86400

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

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The HTTP status code.

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

The error message.

The alert does not exist.
RequestIdstring

The request ID.

9AA3F210-C03D-4C86-8DB6-21C84FF692A1
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Resultobject

The details of the event-triggered alert rule.

EventTypestring

The event type. Valid values:

  • SYSTEM: system event
  • CUSTOM: custom event
SYSTEM
GroupIdstring

The ID of the application group.

3607****
Namestring

The name of the event-triggered alert rule.

test_DefaultEventRule_7378****
Descriptionstring

The description of the event-triggered alert rule.

Default group event rule.
Statestring

The status of the event-triggered alert rule. Valid values:

  • ENABLED
  • DISABLED
ENABLED
EventPatternobject

The event pattern. This parameter describes the trigger conditions of an event.

Productstring

The name of the cloud service.

CloudMonitor
LevelListarray
string

The level of the event-triggered alert rule. Valid values:

  • CRITICAL
  • WARN
  • INFO
["CRITICAL","WARN"]
StatusListarray
string

The status of the event.

Running
NameListarray
string

The name of the event.

Agent_Status_Running
EventTypeListarray

The types of the event-triggered alert rules.

string

The type of the event-triggered alert rule.

* indicates all types of alert rules.

*
SQLFilterstring

Indicates that logs are filtered based on the specified SQL statement. If the specified conditions are met, an alert is triggered.

ycccluster1 and (i-23ij0o82612 or Executed1) or Asimulated not 222
KeywordFilterObjobject

The keyword for filtering.

Keywordsarray

The keywords that are used to match events.

string

The keyword.

VMException
Relationstring

The relationship between multiple keywords in a condition. Valid values:

  • OR: The relationship between keywords is OR.
  • NOT: The keyword is excluded. The value NOT indicates that all events that do not contain the keywords are matched.
OR

Examples

Sample success responses

JSONformat

{
  "Code": "200",
  "Message": "The alert does not exist.",
  "RequestId": "9AA3F210-C03D-4C86-8DB6-21C84FF692A1",
  "Success": true,
  "Result": {
    "EventType": "SYSTEM",
    "GroupId": "3607****",
    "Name": "test_DefaultEventRule_7378****",
    "Description": "Default group event rule.",
    "State": "ENABLED",
    "EventPattern": {
      "Product": "CloudMonitor",
      "LevelList": {
        "LevelList": [
          "[\"CRITICAL\",\"WARN\"]    "
        ]
      },
      "StatusList": {
        "StatusList": [
          "Running"
        ]
      },
      "NameList": {
        "NameList": [
          "Agent_Status_Running"
        ]
      },
      "EventTypeList": {
        "EventTypeList": [
          "*"
        ]
      },
      "SQLFilter": "ycccluster1 and (i-23ij0o82612 or Executed1) or Asimulated not 222",
      "KeywordFilterObj": {
        "Keywords": {
          "keyword": [
            "VMException"
          ]
        },
        "Relation": "OR"
      }
    }
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterValueIllegal parameters.Illegal parameters.
403AccessForbiddenUser not authorized to operate on the specified resource.-
404%s%s-
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
2023-08-31The Error code has changed. The response structure of the API has changedView Change Details
2023-03-10The Error code has changed. The response structure of the API has changedView Change Details