- APIs V2 (Recommended)
- Tag Management
- Listing All Tags of a Tenant
Listing All Tags of a Tenant¶
Function¶
This API is used to query the tags of all resources owned by a tenant in a specific project.
URI¶
GET /v2/{project_id}/dcs/tags
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details, see Obtaining a Project ID. |
Request Parameters¶
None
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
key | String | Tag key. The key contains a maximum of 128 characters. |
values | Array of strings | Tag value. |
Status code: 400
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Status code: 500
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Example Requests¶
POST https://{dcs_endpoint}/v2/{project_id}/dcs/tags
Example Responses¶
Status code: 200
Successfully queried all tags of the tenant.
{
"tags" : [ {
"values" : [ "value1", "value2" ],
"key" : "1"
}, {
"values" : [ "value1", "value2" ],
"key" : "2"
} ]
}
Status Codes¶
Status Code | Description |
---|---|
200 | Successfully queried all tags of the tenant. |
400 | Invalid request. |
500 | Internal service error. |
Error Codes¶
See Error Codes.