Querying Tags in a Project
Function
This API is used to query project tags.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/{resource_type}/tags
|
Parameter |
Mandatory |
Parameter Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
|
resource_type |
Yes |
String |
Resource type.
|
Request Parameter
|
Parameter |
Mandatory |
Parameter Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The token can be queried by calling the IAM API. (The token is the value of X-Subject-Token in the response header.) |
Response Parameters
Status code: 200
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
tags |
Array of tags objects |
Tags. |
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
key |
String |
Key. The value can contain up to 128 characters. |
|
values |
Array of strings |
Specifies tag values. Each value can contain a maximum of 255 characters. |
Status code: 400
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error |
Object |
Error message. |
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error_code |
String |
Error code |
|
error_msg |
String |
Error message |
Status code: 403
|
Parameter |
Response body parameter |
Description |
|---|---|---|
|
error |
Object |
Error message. |
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error_code |
String |
Error code |
|
error_msg |
String |
Error message |
Status code: 500
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error |
Object |
Error message. |
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error_code |
String |
Error code |
|
error_msg |
String |
Error message |
Example Request
/v1/{project_id}/{resource_type}/tags
Example Response
Status code: 200
Execution succeeded.
{
"tags" : [ {
"key" : "key1",
"values" : [ "value1", "value2" ]
}, {
"key" : "key2",
"values" : [ "value1", "value2" ]
} ]
}
Status code: 400
Failed
{
"error" : {
"error_code" : "DBSS.XXXX",
"error_msg" : "XXX"
}
}
Status Code
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
|
400 |
Failed |
|
403 |
Authentication failed. |
|
500 |
Server error. |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.