Querying Tags of a Resource
Function
This API is used to query resource tags.
Note: This api supports only resource type of Config. Currently, resource_type supports config:policyAssignments, config:aggregators, config:aggregationAuthorizations.
Calling Method
For details, see Calling APIs.
URI
GET /v1/resource-manager/{resource_type}/{resource_id}/tags
Parameter | Mandatory | Type | Description |
|---|---|---|---|
resource_type | Yes | String | Resource type. |
resource_id | Yes | String | Resource ID. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
tags | Array of ResourceTag objects | Tags. |
Parameter | Type | Description |
|---|---|---|
key | String | Tag key. A tag key can contain up to 128 Unicode characters and must comply with the character set specifications in section 3.1. Minimum: 1 Maximum: 128 |
value | String | Tag value. A tag value can contain up to 255 Unicode characters and must comply with the character set specifications in section 3.2. Minimum: 0 Maximum: 255 |
Status code: 400
Parameter | Type | Description |
|---|---|---|
error_code | String | Specifies the error code. |
error_msg | String | Specifies the error message. |
Status code: 401
Parameter | Type | Description |
|---|---|---|
error_code | String | Specifies the error code. |
error_msg | String | Specifies the error message. |
Status code: 403
Parameter | Type | Description |
|---|---|---|
error_code | String | Specifies the error code. |
error_msg | String | Specifies the error message. |
Status code: 404
Parameter | Type | Description |
|---|---|---|
error_code | String | Specifies the error code. |
error_msg | String | Specifies the error message. |
Status code: 500
Parameter | Type | Description |
|---|---|---|
error_code | String | Specifies the error code. |
error_msg | String | Specifies the error message. |
Example Requests
Querying Tags of a Specified Instance
GET https://{endpoint}/v1/resource-manager/{resource_type}/{resource_id}/tags Example Responses
Status code: 200
Succeeded.
{
"tags" : [ {
"key" : "key1",
"value" : "value1"
}, {
"key" : "key2",
"value" : "value2"
} ]
} Status Codes
Status Code | Description |
|---|---|
200 | Succeeded. |
400 | Invalid parameter. |
401 | Unauthorized. |
403 | Forbidden. |
404 | Resources not found. |
500 | Internal server error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

