Queries the tags that are added to Cloud Enterprise Network (CEN) instances.

Usage notes

To call this operation, you must specify at least one of ResourceId.N and Tag.N.Key.

  • If you specify only ResourceId.N, the tags that are added to the specified CEN instances are queried.
  • If you specify only Tag.N.Key, the CEN instances that have the specified tags are queried.
  • If you specify both ResourceId.N and Tag.N.Key, the specified tags that are added to the specified CEN instances are queried.
    • Make sure that the CEN instance specified by ResourceId.N has the tag specified by Tag.N.Key. Otherwise, the response returns null.
    • If multiple tag keys are specified, the logical relation among these tag keys is AND.

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 No ListTagResources

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

ResourceType String Yes cen

The type of the resource. Set the value to cen.

ResourceId.N RepeatList No cen-8z69wtwqel33lq****

The ID of the resource. Valid values of N: 1 to 20.

Tag.N.Key String No test

The key of the tag. Valid values of N: 1 to 20. It can be at most 64 characters in length, and cannot contain http:// or https://. It must not start with aliyun or acs:.

Tag.N.Value String No Bp

The value of the tag. Valid values of N: 1 to 20. It can be at most 128 characters in length, and cannot contain http:// or https://. It must not start with aliyun or acs:.

NextToken String No 15399****

The token for returning the next page.

PageSize Integer No 10

The number of entries to return on each page. Default value: 10. Valid values: 1 to 50.

Response parameters

Parameter Type Example Description
NextToken String 15399****

The token for returning the next page.

RequestId String 165B5C86-2033-5954-A89D-4CD83BA06C85

The ID of the request.

TagResources Array of TagResource

The resources and tags.

TagResource
ResourceId String cen-8z69wtwqel33lq****

The ID of the resource.

ResourceType String CEN

The type of the resource.

TagKey String test

The key of the tag.

TagValue String Bp

The value of the tag.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListTagResources
&ResourceType=cen
&<Common request parameters>

Sample success responses

XML format

<ListTagResourcesResponse>
  <RequestId>165B5C86-2033-5954-A89D-4CD83BA06C85</RequestId>
  <NextToken>15399****</NextToken>
  <TagResources>
        <TagResource>
              <ResourceId>cen-8z69wtwqel33lq****</ResourceId>
              <TagKey>test</TagKey>
              <ResourceType>CEN</ResourceType>
              <TagValue>Bp</TagValue>
        </TagResource>
  </TagResources>
</ListTagResourcesResponse>

JSON format

{
    "RequestId": "165B5C86-2033-5954-A89D-4CD83BA06C85",
    "NextToken": "15399****",
    "TagResources": {
        "TagResource": [
            {
                "ResourceId": "cen-8z69wtwqel33lq****",
                "TagKey": "test",
                "ResourceType": "CEN",
                "TagValue": "Bp"
            }
        ]
    }
}

Error codes

HttpCode Error code Error message Description
400 InvalidTagKey The tag keys are not valid. The error message returned because the key of the tag is invalid.
400 IllegalParam.NextToken The parameter NextToken is invalid. The error message returned because the specified value of the NextToken parameter is invalid. Check the usage notes and change the value accordingly.

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