All Products
Search
Document Center

ApsaraDB for MyBase:ListTagResources

Last Updated:Oct 28, 2025

Queries the information about tags that are added to hosts.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
cddc:ListTagResourcesget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the host.

ap-southeast-1
ResourceTypestringYes

The resource type. Set the value to DEDICATEDHOST.

DEDICATEDHOST
ResourceIdarrayNo

The ID of host N. You can specify multiple host IDs.

stringNo

The ID of host N. You can specify multiple host IDs.

N specifies the serial number of the host. Examples:

  • ResourceId.1 specifies the ID of the first host.
  • ResourceId.2 specifies the ID of the second host.
ch-t4n4dcdvu6840****
Tagarray<object>No

The tags.

objectNo
KeystringNo

The key of tag N.

  • N specifies the serial number of the tag. Examples:

    • Tag.1.Key specifies the key of the first tag.
    • Tag.2.Key specifies the key of the second tag.
  • You must specify one of this parameter and ResourceId.N.

demokey
ValuestringNo

The value of tag N.

  • N specifies the serial number of the tag. Examples:

    • Tag.1.Value specifies the value of the first tag.
    • Tag.2.Value specifies the value of the second tag.
  • If no tag value exists, a value is automatically created.

demovalue

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

2853CAA0-D7A2-5CAB-B3A8-BDE2994F320C
TagResourcesarray<object>

The queried tags.

TagResourcesobject
TagValuestring

The tag value.

demovalue
ResourceTypestring

The resource type.

ALIYUN::CDDC::DEDICATEDHOST is returned, which indicates an ApsaraDB for MyBase host.

ALIYUN::CDDC::DEDICATEDHOST
ResourceIdstring

The host ID.

ch-t4n4dcdvu6840****
TagKeystring

The key of tag N.

demokey

Examples

Sample success responses

JSONformat

{
  "RequestId": "2853CAA0-D7A2-5CAB-B3A8-BDE2994F320C",
  "TagResources": [
    {
      "TagValue": "demovalue",
      "ResourceType": "ALIYUN::CDDC::DEDICATEDHOST",
      "ResourceId": "ch-t4n4dcdvu6840****",
      "TagKey": "demokey"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400MissingResourceTypeThe specified parameter ResourceType is not valid.-
400MissParameter.TagOrResourceIdThe parameter Tag.n or ResourceId.n is needed.-
400InvalidParameter.TagValueThe Tag.%s.Value parameter - %s is invalidThe Tag.%s.Value parameter - %s is invalid
400InvalidParameter.TagKeyThe Tag.%s.Key parameter - %s is invalidThe Tag.%s.Key parameter - %s is invalid
400NumberExceed.ResourceIdsThe ResourceIds parameter's number is exceed , Valid : 50-
400InvalidTagValue.MalformedThe specified parameter "Tag.n.Value" is not valid.-
400InvalidDedicatedHostId.NotFoundThe parameter - ResourceIds.N is not found.The parameter - ResourceIds.N is not found.
400InvalidParameter.ResourceTypeThe specified parameter "ResourceType" is not valid.-
400NumberExceed.TagsThe Tags parameter's number is exceed, Valid : 20.-
400MissingParameter.ResourceIdsThe parameter - ResourceIds.N should not be null.The parameter - ResourceIds.N should not be null.
400Duplicate.TagKeyThe Tag.N.Key contain duplicate key.-
400InvalidTagKey.MalformedThe Tag.N.Key parameter is invalid.-

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

Change history

Change timeSummary of changesOperation
No change history