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

Usage notes

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

  • If you set only ResourceId.N, the tags that are added to the specified CEN instances are returned.
  • If you set only Tag.N.Key, the CEN instances that have the specified tags are returned.
  • If you set both ResourceId.N and Tag.N.Key, the specified tags that are added to the specified CEN instances are returned.
    • 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 operator 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 Yes 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, which specifies CEN instances.

NextToken String No FFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If this is your first query or no next query is to be sent, ignore this parameter.
  • If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
PageSize Integer No 10

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

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

The IDs of the CEN instances.

You can specify at most 20 IDs in each call.

Tag.N.Key String No test

The key of the tag.

The key cannot exceed 64 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify at most 20 tag keys.

Tag.N.Value String No Bp

The tag value.

The value cannot exceed 128 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify at most 20 tag values.

Response parameters

Parameter Type Example Description
NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If NextToken is empty, it indicates that no next query is to be sent.
  • If a value of NextToken is returned, the value is the token that is used for the next query.
RequestId String 165B5C86-2033-5954-A89D-4CD83BA06C85

The ID of the request.

TagResources Array of TagResource

The resources and tags.

TagResource
ResourceType String CEN

The type of the resource.

The value is cen, which specifies CEN instances.

TagValue String Bp

The tag value.

ResourceId String cen-8z69wtwqel33lq****

The ID of the CEN instance.

TagKey String test

The tag key.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListTagResources
&ResourceType=cen
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&PageSize=10
&ResourceId=["cen-8z69wtwqel33lq****"]
&Tag=[{"Key":"test","Value":"Bp"}]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error code

HttpCode Error code Error message Description
400 InvalidTagKey The tag keys are not valid. The error message returned because the specified tag key is invalid.
400 IllegalParam.NextToken The parameter NextToken is invalid. The error message returned because NextToken is set to an invalid value. Specify a valid value and try again.

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