All Products
Search
Document Center

Application Real-Time Monitoring Service:CreateOrUpdateSilencePolicy

Last Updated:May 09, 2024

Creates or modifies a silence policy.

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
arms:CreateDispatchRuleWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
IdlongNo

The ID of the silence policy.

  • If you do not configure this parameter, a new silence policy is created.
  • If you configure this parameter, the specified silence policy is modified.
1234
NamestringYes

The name of the silence policy.

silencepolicy_test
MatchingRulesstringNo

The matching rules. The following code shows the format of matching rules:

[
     {
	 "matchingConditions": [
	 {
	 "value": "test", // The value of the matching condition. 
	 "key": "altertname", // The key of the matching condition. 
	 "operator": "eq" // The logical operator of the matching condition, including eq (equal to), neq (not equal to), in (contains), nin (does not contain), re (regular expression match), and nre (regular expression mismatch).   
	 }
	 ]
     }
	 ]
[ { "matchingConditions": [ { "value": "test", "key": "altertname", "operator": "eq" } ] } ]
RegionIdstringNo

The ID of the region.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

A5EC8221-08F2-4C95-9AF1-49FD998C****
SilencePolicyobject

A list of silence policies.

Idlong

The ID of the silence policy.

1234
Namestring

The name of the silence policy.

silencepolicy_test
MatchingRulesobject []

A list of matching rules.

MatchingConditionsobject []

A list of matching conditions.

Keystring

The key of the matching condition.

altertname
Valuestring

The value of the matching condition.

test
Operatorstring

The logical operator of the matching condition. Valid values:

  • eq: equal to
  • neq: not equal to
  • in: contains
  • nin: does not contain
  • re: regular expression match
  • nre: regular expression mismatch
eq

Examples

Sample success responses

JSONformat

{
  "RequestId": "A5EC8221-08F2-4C95-9AF1-49FD998C****",
  "SilencePolicy": {
    "Id": 1234,
    "Name": "silencepolicy_test",
    "MatchingRules": [
      {
        "MatchingConditions": [
          {
            "Key": "altertname",
            "Value": "test",
            "Operator": "eq"
          }
        ]
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2022-02-24Add Operationsee changesets