Queries the relationship between ApsaraDB for MongoDB instances and tags.
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 instance. You can call the DescribeDBInstanceAttribute operation to query the region ID of the instance. |
ResourceType | String | Yes | INSTANCE |
The resource type. Set the value to INSTANCE. |
NextToken | String | No | 212db86**** |
The token used to start the next query to retrieve more results. Note This parameter is not required in the first query. If not all results are returned
in one query, you can pass in the NextToken value returned in the previous query to perform the query again.
|
ResourceId.N | String | No | Development team |
The ID of the instance. Note
|
Tag.N.Key | String | No | Development team |
The key of tag N. Note
|
Tag.N.Value | String | No | Environment 4.0 |
The value of tag N. Note N specifies the serial number of the tag. For example, Tag.1.Value specifies the value of the first tag and Tag.2.Value specifies the value of the second tag.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
NextToken | String | 212db86**** |
The token used to start the next query. Note If not all results are returned in the first query, this parameter is returned. You
can pass in the returned value of this parameter in the next query.
|
RequestId | String | 96017AF2-9AB1-4BC9-88D2-7966B3CD**** |
The ID of the request. |
TagResources | Array of TagResource |
Details about the tags of the instance. |
|
TagResource | |||
ResourceType | String | ALIYUN::DDS::INSTANCE |
The resource type. The return value is fixed to ALIYUN: KVSTORE: INSTANCE, indicating an ApsaraDB for MongoDB instance. |
TagValue | String | Environment 4.0 |
The value of the tag. |
ResourceId | String | dds-bp17e7a04960**** |
The ID of the resource. It is the ID of the ApsaraDB for MongoDB instance. |
TagKey | String | Development team |
The key of the tag. |
Examples
Sample requests
http(s)://mongodb.aliyuncs.com/?Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=INSTANCE
&Tag.1.Key=Development team
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListTagResourcesResponse>
<TagResources>
<TagResource>
<ResourceType>ALIYUN::DDS::INSTANCE</ResourceType>
<TagValue>Environment 4.0</TagValue>
<ResourceId>dds-bp17e7a04960****</ResourceId>
<TagKey>Development team</TagKey>
</TagResource>
<TagResource>
<ResourceType>ALIYUN::DDS::INSTANCE</ResourceType>
<TagValue>Environment 3.4</TagValue>
<ResourceId>dds-bp17e7a04960****</ResourceId>
<TagKey>Development team</TagKey>
</TagResource>
</TagResources>
<RequestId>96017AF2-9AB1-4BC9-88D2-7966B3CD****</RequestId>
</ListTagResourcesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TagResources" : {
"TagResource" : [ {
"ResourceType" : "ALIYUN::DDS::INSTANCE",
"TagValue":"Environment 4.0",
"ResourceId" : "dds-bp17e7a04960****",
"TagKey": "Development team",
}, {
"ResourceType" : "ALIYUN::DDS::INSTANCE",
"TagValue":"Environment 3.4",
"ResourceId" : "dds-bp17e7a04960****",
"TagKey": "Development team",
} ]
},
"RequestId" : "96017AF2-9AB1-4BC9-88D2-7966B3CD****"
}
Error codes
For a list of error codes, visit the API Error Center.