Queries the tags bound to one or more Bastionhost instances.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListTagResources |
The operation that you want to perform. Set the value to ListTagResources. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the Bastionhost instance. |
ResourceType | String | Yes | INSTANCE |
The type of the resource. Set the value to INSTANCE, which indicates that the resource is a Bastionhost instance. |
ResourceId.N | RepeatList | No | bastionhost-cn-78v1gcxxxxx |
The ID of instance N. Valid values of N: 1 to 20. Note You can call the DescribeInstances operation to obtain the ID of the Bastionhost instance.
|
Tag.N.Key | String | No | test |
The key of tag N. Valid values of N: 1 to 20. |
Tag.N.Value | String | No | testapi |
The value of tag N. Valid values of N: 1 to 20. |
NextToken | String | No | 6EwFJmScBXFFC3nf.9Rq7HzA7APx7GWLbkZbjHrR6Pq39w |
The token for starting the next query. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
NextToken | String | 4ieSWJCwxvW3dk3wF.BqkrZmP72nWu5zJ5NWydMqyEs**** |
The token for starting the next query. |
RequestId | String | 134D6018-EB68-4B7C-BABF-4DB09023E014 |
The ID of the request. |
TagResources | Array |
The information about Bastionhost instances and the tags bound to Bastionhost instances. The following information is included: instance ID, resource type, tag key, and tag value. |
|
ResourceId | String | bastionhost-cn-78v1gc**** |
The ID of the instance. |
ResourceType | String | INSTANCE |
The type of the resource. The returned value is INSTANCE, which indicates that the resource is a Bastionhost instance. |
TagKey | String | test |
The key of the tag. |
TagValue | String | testapi |
The value of the tag. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=INSTANCE
&<Common request parameters>
Sample success responses
XML
format
<ListTagResourcesResponse>
<NextToken>6EwFJmScBXFFC3nf.9Rq7HzA7APx7GWLbkZbjHrR6P****</NextToken>
<RequestId>134D6018-EB68-4B7C-BABF-4DB09023E014</RequestId>
<TagResources>
<ResourceId>bastionhost-cn-78v1gc****</ResourceId>
<TagKey>test</TagKey>
<ResourceType>INSTANCE</ResourceType>
<TagValue>testapi</TagValue>
</TagResources>
</ListTagResourcesResponse>
JSON
format
{
"NextToken":"6EwFJmScBXFFC3nf.9Rq7HzA7APx7GWLbkZbjHrR6P****",
"RequestId":"134D6018-EB68-4B7C-BABF-4DB09023E014",
"TagResources":[
{
"ResourceId":"bastionhost-cn-78v1gc****",
"TagKey":"test",
"ResourceType":"INSTANCE",
"TagValue":"testapi"
}
]
}
Error codes
For a list of error codes, visit the API Error Center.