Querying Resource Tags
Function
This API is used to query tags of a specific resource.
TMS uses this API to query all tags of a specified resource.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/{resource_type}/{resource_id}/tags
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource_type |
Yes |
String |
Resource type. |
|
resource_id |
Yes |
String |
Resource ID. |
|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that a resource belongs to. You can query the resources of a project by project ID. You can obtain the project ID from the API or console. Obtaining the Project ID Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Content-type |
Yes |
String |
Definition Content type.
Constraints N/A Range
Default Value N/A |
|
X-Auth-Token |
Yes |
String |
User token. You can call the IAM API to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
tags |
Array of WorkspaceTag objects |
Tag list. |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Tag key. It can contain a maximum of 128 Unicode characters. The tag key cannot be left blank. The system does not verify the character set of key when searching for resources. key cannot be empty, an empty string, or spaces. Before using key, delete single-byte character (SBC) spaces before and after the value. |
|
values |
Array of strings |
The tag value list. Each value can contain a maximum of 255 Unicode characters. Before verification and usage, delete SBC spaces before and after the value. The value can be an empty array but cannot be left blank. If values is left empty, it indicates any value. All values of a tag key are in the OR relationship. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Example Requests
None
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
400 |
Invalid parameter. |
|
401 |
Authentication failed. |
|
403 |
Insufficient permissions. |
|
404 |
No resources found. |
|
500 |
System 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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot