Querying Resource Tags
Function
You can use this API to query tags of a specific resource.
URI
GET /v2.0/resources/{resource_id}/tags
Parameter | Mandatory | Type | Description |
---|---|---|---|
resource_id | Yes | String | Specifies the resource ID. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | No | String | Specifies the project ID. This parameter is mandatory for region-level resources. |
resource_type | Yes | String | Specifies the resource type. |
Request
Parameter | Mandatory | Type | Description |
---|---|---|---|
X-Auth-Token | Yes | String | Specifies the user token. TMS is a global service. So you need to set scope to domain when calling an IAM API to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response
Status code: 200
Parameter | Type | Description |
---|---|---|
tags | Array of TagVo objects | Specifies resource tags. |
Parameter | Type | Description |
---|---|---|
key | String | Specifies the key. |
value | String | Specifies the value. |
Example Request
Querying tags of a resource
GET https://{Endpoint}/v2.0/resources/xxxx/tags?project_id=xxxx&resource_type=disk
Example Response
Status code: 200
Successful operation
{"tags" : [ {"key" : "key1","value" : "value1"}, {"key" : "key2","value" : "value2"} ]}
Status Codes
See Status Codes.
Error Codes
See Error Codes.
- Function
- URI
- Request
- Response
- Example Request
- Example Response
- Status Codes
- Error Codes