Querying Project Tags
Function
This API is used to list tags associated with a specified project. This API is synchronous. There are no accompanying APIs or specific scenarios.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/{resource_type}/tags
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. Constraints: N/A Range: 1 to 36 characters. Only letters, digits, and hyphens (-) are allowed. Default Value: N/A |
| resource_type | Yes | String | Definition: Resource type, used to specify the type of resource to be tagged. Constraints: Cannot be empty. Range Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| use_predefine_tags | Yes | Boolean | Definition: Whether to use predefined tags. Constraints: N/A Range Default Value: false. |
| engine_types | No | Array of strings | Definition: List of endpoint engine types. Range Constraints: N/A |
| offset | No | Integer | Definition: Page offset. Constraints: N/A Range: 0 to 10000. Default Value: 0. |
| limit | No | Integer | Definition: Number of records to query. Constraints: N/A Range: 1 to 1,000. Default Value: 1000. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition: User token. It is obtained by calling the Obtaining an IAM User Token API. Constraints: N/A Range: Up to 65,534 characters. Only letters, digits, and special characters are allowed. The token format is defined by IAM. For details about the character set, see the IAM documentation. Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total_count | Integer | Definition: Total number of project tag records. Range: 0 to 2,147,483,647. |
| tags | Array of V2ProjectResourceTag objects | Definition: Project tag list. Each element is a V2ProjectResourceTag object containing the key (tag key) and values (tag value list) fields. |
| Parameter | Type | Description |
|---|---|---|
| key | String | Definition: Key of a project resource tag. Range: 1 to 128 characters. Only letters, spaces, digits, underscores (_), periods (.), colons (:), backslashes (), equal signs (=), plus signs (+), minus signs (-), and at signs (@) are allowed. |
| values | Array of strings | Definition: List of project resource tag values. Each element is a string, and the array can contain up to 1,000 elements. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Range: 8 to 36 characters. |
| error_msg | String | Definition: Error description. Range: 2 to 512 characters. |
| solution_msg | String | Definition: Solution. Range: 0 to 4,096 characters. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Range: 8 to 36 characters. |
| error_msg | String | Definition: Error description. Range: 2 to 512 characters. |
| solution_msg | String | Definition: Solution. Range: 0 to 4,096 characters. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Range: 8 to 36 characters. |
| error_msg | String | Definition: Error description. Range: 2 to 512 characters. |
| solution_msg | String | Definition: Solution. Range: 0 to 4,096 characters. |
Status code: 408
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Range: 8 to 36 characters. |
| error_msg | String | Definition: Error description. Range: 2 to 512 characters. |
| solution_msg | String | Definition: Solution. Range: 0 to 4,096 characters. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Range: 8 to 36 characters. |
| error_msg | String | Definition: Error description. Range: 2 to 512 characters. |
| solution_msg | String | Definition: Solution. Range: 0 to 4,096 characters. |
Example Requests
Query tags of a specified resource type under a project.
GET /v2/{project_id}/{resource_type}/tags?use_predefine_tags=false Example Responses
Status code: 200
{
"total_count" : 1,
"tags" : [ {
"key" : "tag_key",
"values" : [ "tag_value" ]
} ]
} Status code: 400
{
"error_code" : "AIDataLake.00010151",
"error_msg" : "Parameter value is invalid.",
"solution_msg" : "Please input valid parameter value."
} Status code: 401
{
"error_code" : "APIGW.0301",
"error_msg" : "Incorrect IAM authentication information: decrypt token fail.",
"solution_msg" : "Check whether the IAM authentication information is correct."
} Status code: 403
{
"error_code" : "AIDataLake.00010150",
"error_msg" : "The operation is not allowed.",
"solution_msg" : "Check whether the operation is allowed in the current status."
} Status code: 408
{
"error_code" : "common.00000408",
"error_msg" : "timeout exception occurred",
"solution_msg" : "Try again later. If the problem persists, contact technical support."
} Status code: 500
{
"error_code" : "AIDataLake.00011001",
"error_msg" : "Internal error.",
"solution_msg" : "Contact technical support or try again later."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | Invalid request parameters. |
| 401 | Unauthorized. |
| 403 | Access denied. |
| 408 | Request timeout. |
| 500 | Internal server error. |
What is your overall rating for this page?
Thank 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