Queries tag rules.

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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeDynamicTagRuleList

The operation that you want to perform. Set the value to DescribeDynamicTagRuleList.

TagRegionId String No cn-hangzhou

The ID of the region to which the tags belong.

TagKey String No tagkey1

The tag key.

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

TagValue String No *

The tag value.

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

PageNumber String No 1

The number of the page to return.

Pages start from page 1. Default value: 1.

PageSize String No 30

The number of entries to return on each page.

Default value: 30.

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

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code.

Note The value 200 indicates that the call was successful.
Message String The specified resource is not found.

The error message.

PageNumber String 1

The page number of the returned page.

PageSize String 30

The number of entries returned per page.

RequestId String 0D50523D-8D59-4A61-B58E-E2286ECFB3A9

The ID of the request.

Success Boolean true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.
TagGroupList Array of TagGroup

The tag rules of application groups.

TagGroup
ContactGroupList List CloudMonitor

The alert contact group.

DynamicTagRuleId String 1536df65-a719-429d-8813-73cc40d7****

The ID of the tag rule.

MatchExpress Array of MatchExpress

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

MatchExpress
TagValue String *

The tag value.

The TagValue and TagValueMatchFunction parameters must be used in pairs.

TagValueMatchFunction String all

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: includes
  • notContains: excludes
  • equals: equals
MatchExpressFilterRelation String or

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

  • and
  • or
Note Only one logical operator can be used in a request.
RegionId String cn-hangzhou

The ID of the region to which the tags belong.

Status String FINISH

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

  • RUNNING
  • FINISH
TagKey String tagkey1

The tag key.

TemplateIdList List 71****

The IDs of the alert templates.

Total Integer 2

The total number of returned entries.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeDynamicTagRuleList
&<Common request parameters>
&=tagkey1

Sample success responses

XML format

<DescribeDynamicTagRuleListResponse>
	  <PageSize>30</PageSize>
	  <PageNumber>1</PageNumber>
	  <Total>2</Total>
	  <TagGroupList>
		    <TagGroup>
			      <Status>FINISH</Status>
			      <ContactGroupList>
				        <ContactGroupList>CloudMonitor</ContactGroupList>
			      </ContactGroupList>
			      <MatchExpressFilterRelation>or</MatchExpressFilterRelation>
			      <DynamicTagRuleId>1536df65-a719-429d-8813-73cc40d7****</DynamicTagRuleId>
			      <TemplateIdList>
				        <TemplateIdList>71****</TemplateIdList>
			      </TemplateIdList>
			      <TagKey>tagkey1</TagKey>
			      <MatchExpress>
				        <MatchExpress>
					          <TagValue>*</TagValue>
					          <TagValueMatchFunction>all</TagValueMatchFunction>
				        </MatchExpress>
			      </MatchExpress>
			      <RegionId>cn-hangzhou</RegionId>
		    </TagGroup>
		    <TagGroup>
			      <Status>FINISH</Status>
			      <ContactGroupList>
				        <ContactGroupList>CloudMonitor</ContactGroupList>
			      </ContactGroupList>
			      <MatchExpressFilterRelation>or</MatchExpressFilterRelation>
			      <DynamicTagRuleId>56e8cebb-b3d7-4a91-9880-78a8c84f****</DynamicTagRuleId>
			      <TemplateIdList>
				        <TemplateIdList>71****</TemplateIdList>
			      </TemplateIdList>
			      <TagKey>tagkey1</TagKey>
			      <MatchExpress>
				        <MatchExpress>
					          <TagValue>*</TagValue>
					          <TagValueMatchFunction>all</TagValueMatchFunction>
				        </MatchExpress>
			      </MatchExpress>
			      <RegionId>cn-hangzhou</RegionId>
		    </TagGroup>
	  </TagGroupList>
	  <Code>200</Code>
	  <Success>true</Success>
</DescribeDynamicTagRuleListResponse>

JSON format

{
    "PageSize": 30,
    "PageNumber": 1,
    "Total": 2,
    "TagGroupList": {
        "TagGroup": [
            {
                "Status": "FINISH",
                "ContactGroupList": {
                    "ContactGroupList": [
                        "CloudMonitor"
                    ]
                },
                "MatchExpressFilterRelation": "or",
                "DynamicTagRuleId": "1536df65-a719-429d-8813-73cc40d7****",
                "TemplateIdList": {
                    "TemplateIdList": "71****"
                },
                "TagKey": "tagkey1",
                "MatchExpress": {
                    "MatchExpress": [
                        {
                            "TagValue": "*",
                            "TagValueMatchFunction": "all"
                        }
                    ]
                },
                "RegionId": "cn-hangzhou"
            },
            {
                "Status": "FINISH",
                "ContactGroupList": {
                    "ContactGroupList": [
                        "CloudMonitor"
                    ]
                },
                "MatchExpressFilterRelation": "or",
                "DynamicTagRuleId": "56e8cebb-b3d7-4a91-9880-78a8c84f****",
                "TemplateIdList": {
                    "TemplateIdList": "71****"
                },
                "TagKey": "tagkey1",
                "MatchExpress": {
                    "MatchExpress": [
                        {
                            "TagValue": "*",
                            "TagValueMatchFunction": "all"
                        }
                    ]
                },
                "RegionId": "cn-hangzhou"
            }
        ]
    },
    "Code": 200,
    "Success": true
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParameterValue Illegal parameters. The error code returned because one or more parameters are invalid.
404 ResourceNotFound The specified resource is not found. The error message returned because the specified resource is not found.

For a list of error codes, visit the API Error Center.