Queries the binding relationships between hosts and tags in ApsaraDB MyBase.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | No | ListTagResources |
The operation that you want to perform. Set the value to ListTagResources. |
RegionId | String | Yes | ap-southeast-1 |
The region ID of the host. |
ResourceType | String | Yes | DEDICATEDHOST |
The type of the resource. Set the value to DEDICATEDHOST. |
ResourceId.N | String | No | ch-t4n4dcdvu6840**** |
The ID of host N. You can specify multiple host IDs. N specifies the sequence number of the host. The following examples are provided:
|
Tag.N.Key | String | No | demokey |
The key of tag N.
|
Tag.N.Value | String | No | demovalue |
The value of tag N.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 2853CAA0-D7A2-5CAB-B3A8-BDE2994F320C |
The ID of the request. |
TagResources | Array of TagResources |
The information about hosts and tags. |
|
TagValue | String | demovalue |
The value of the tag. |
ResourceType | String | ALIYUN::CDDC::DEDICATEDHOST |
The type of the resource. The return value is ALIYUN::CDDC::DEDICATEDHOST. This value indicates a host in the ApsaraDB MyBase dedicated cluster. |
ResourceId | String | ch-t4n4dcdvu6840**** |
The ID of the host. |
TagKey | String | demokey |
The key of the tag. |
Examples
Sample requests
http(s)://cddc.aliyuncs.com/?Action=ListTagResources
&RegionId=ap-southeast-1
&ResourceType=DEDICATEDHOST
&ResourceId=["ch-t4n4dcdvu6840****"]
&Tag=[{"Key":"demokey","Value":"demovalue"}]
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListTagResourcesResponse>
<RequestId>2853CAA0-D7A2-5CAB-B3A8-BDE2994F320C</RequestId>
<TagResources>
<TagValue>demovalue</TagValue>
<ResourceType>ALIYUN::CDDC::DEDICATEDHOST</ResourceType>
<ResourceId>ch-t4n4dcdvu6840****</ResourceId>
<TagKey>demokey</TagKey>
</TagResources>
</ListTagResourcesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "2853CAA0-D7A2-5CAB-B3A8-BDE2994F320C",
"TagResources" : [ {
"TagValue" : "demovalue",
"ResourceType" : "ALIYUN::CDDC::DEDICATEDHOST",
"ResourceId" : "ch-t4n4dcdvu6840****",
"TagKey" : "demokey"
} ]
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter.TagValue | The Tag.%s.Value parameter - %s is invalid | The error message returned because the specified tag value is a null value or exceeds 128 characters in length. |
400 | InvalidParameter.TagKey | The Tag.%s.Key parameter - %s is invalid | The error message returned because the specified tag key is a null value or exceeds 128 characters in length. |
400 | InvalidDedicatedHostId.NotFound | The parameter - ResourceIds.N is not found. | The error message returned because the resource that corresponds to the specified resource ID cannot be found. |
400 | MissingParameter.ResourceIds | The parameter - ResourceIds.N should not be null. | The error message returned because the resource IDs cannot be null values. |
For a list of error codes, visit the API Error Center.