All Products
Search
Document Center

CloudMonitor:DescribeDynamicTagRuleList

Last Updated:Jul 26, 2024

Queries tag rules.

Operation description

This topic provides an example to show how to query tag rules that are related to tagkey1. The sample responses indicate that two tag rules are found. The rule IDs are 1536df65-a719-429d-8813-73cc40d7**** and 56e8cebb-b3d7-4a91-9880-78a8c84f****.

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

Request parameters

ParameterTypeRequiredDescriptionExample
TagRegionIdstringNo

The ID of the region to which the tags belong.

cn-hangzhou
TagKeystringNo

The tag key.

For more information about how to obtain a tag key, see DescribeTagKeyList .

tagkey1
TagValuestringNo

The tag value.

For more information about how to obtain a tag value, see DescribeTagKeyList .

*
PageNumberstringNo

The number of the page to return.

Pages start from page 1. Default value: 1.

1
PageSizestringNo

The number of entries to return on each page.

Minimum value: 1. Default value: 30.

30
DynamicTagRuleIdstringNo

The ID of the tag rule.

004155fa-15ba-466d-b61a-***********

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

0D50523D-8D59-4A61-B58E-E2286ECFB3A9
Successboolean

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.
true
Codestring

The HTTP status code.

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

The error message.

The specified resource is not found.
PageSizestring

The number of entries returned per page.

30
PageNumberstring

The page number of the returned page.

1
Totalinteger

The total number of returned entries.

2
TagGroupListarray<object>

The tag rules of application groups.

object
Statusstring

The status of adding instances that meet the tag rule to the application group. Valid values:

  • RUNNING
  • FINISH
FINISH
MatchExpressFilterRelationstring

The logical operator that is used between conditional expressions. Valid values:

  • and
  • or
Note Only one logical operator can be used in a request.
or
RegionIdstring

The ID of the region to which the tags belong.

cn-hangzhou
TagKeystring

The tag key.

tagkey1
DynamicTagRuleIdstring

The ID of the tag rule.

1536df65-a719-429d-8813-73cc40d7****
MatchExpressarray<object>

The conditional expressions used to create an application group based on the tag.

object
TagValuestring

The tag value.

The TagValue and TagValueMatchFunction parameters must be used in pairs.

*
TagValueMatchFunctionstring

The method that is used to match tag values. Valid values:

  • all: includes all
  • startWith: starts with a prefix
  • endWith: ends with a suffix
  • contains: contains
  • notContains: does not contain
  • equals: equals
all
TagKeystring

The tag key.

azone-version
TemplateIdListarray

The IDs of the alert templates.

string
71****
ContactGroupListarray

The alert contact group.

string
CloudMonitor

Examples

Sample success responses

JSONformat

{
  "RequestId": "0D50523D-8D59-4A61-B58E-E2286ECFB3A9",
  "Success": true,
  "Code": "200",
  "Message": "The specified resource is not found.",
  "PageSize": "30",
  "PageNumber": "1",
  "Total": 2,
  "TagGroupList": {
    "TagGroup": [
      {
        "Status": "FINISH",
        "MatchExpressFilterRelation": "or",
        "RegionId": "cn-hangzhou",
        "TagKey": "tagkey1",
        "DynamicTagRuleId": "1536df65-a719-429d-8813-73cc40d7****",
        "MatchExpress": {
          "MatchExpress": [
            {
              "TagValue": "*",
              "TagValueMatchFunction": "all",
              "TagKey": "azone-version"
            }
          ]
        },
        "TemplateIdList": {
          "TemplateIdList": [
            "71****"
          ]
        },
        "ContactGroupList": {
          "ContactGroupList": [
            "CloudMonitor"
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterValueIllegal parameters.Illegal parameters.
403AccessForbiddenUser not authorized to operate on the specified resource.-
404ResourceNotFoundThe specified resource is not found.The specified resource is not found.
500%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
2024-03-13The Error code has changed. The response structure of the API has changedView Change Details
2021-11-04API Description Update. The Error code has changed. The response structure of the API has changedView Change Details