All Products
Search
Document Center

CDN:ListTagResources

Last Updated:Aug 06, 2024

Queries the tags that are attached to a resource.

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
cdn:ListTagResourcesget
  • Domain
    acs:cdn:*:{#accountId}:domain/{#DomainName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TagOwnerUidstringNo

The ID of the Alibaba Cloud account to which the tag belongs.

123xxxx
TagOwnerBidstringNo

The business ID of the tag owner.

26842
ResourceTypestringYes

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

DOMAIN
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results.

QpgBAAAAAABsb2dzL2RzLw==
ResourceIdarrayNo

The ID of the resource.

stringNo

The ID of the instance N. Valid values of N: 1 to 50.

example.com
Tagarray<object>No

The key-value pair of a tag.

objectNo
KeystringNo

The key of the tag.

testKey
ValuestringNo

The value of the tag.

testValue

Response parameters

ParameterTypeDescriptionExample
object
NextTokenstring

The pagination token that is used in the next request to retrieve a new page of results.

QpgBAAAAAABsb2dzL2RzLw==
RequestIdstring

The request ID.

64D28B53-5902-409B-94F6-FD46680144FE
TagResourcesarray<object>

The returned correspondence between the resource and tags.

object
TagValuestring

The value of the tag.

testValue
ResourceTypestring

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

DOMAIN
ResourceIdstring

The ID of the resource.

example.com
TagKeystring

The key of the tag.

testKey

Examples

Sample success responses

JSONformat

{
  "NextToken": "QpgBAAAAAABsb2dzL2RzLw==",
  "RequestId": "64D28B53-5902-409B-94F6-FD46680144FE",
  "TagResources": {
    "TagResource": [
      {
        "TagValue": "testValue",
        "ResourceType": "DOMAIN",
        "ResourceId": "example.com",
        "TagKey": "testKey"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidRegionId.MalformedThe specified RegionId is invalid.-
400MissParameter.TagOrResourceIdEither Tag or ResourceId must be specified.-
400TagIsInvalidThe number of Tag exceeds 20.-
400ResourceIdIsInvalidThe number of ResourceId exceeds 50.The number of resource IDs (ResourceId) cannot exceed 50.
400TagKeyIsInvalidThe specified TagKey is invalid.-
400TagValueIsInvalidThe specified TagValue is invalid.-

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