Querying Project Tags
Function
This API is used to query all key pair tags of a user in a specified project.
Calling Method
For details, see Calling APIs.
URI
GET /v3/{project_id}/keypairs/tags
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details, see Obtaining a Project ID. Constraints N/A Range The value returned by the IAM API is used, which contains 32 characters. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| limit | No | Integer | Definition Number of records to be queried Constraints Range 1 to 1000 Default Value 1000 |
| offset | No | Integer | Definition Index location. The query starts from the next data specified by offset. When you query resources on subsequent pages, set offset to the location returned in the response body for the previous query. Constraints Range N/A Default Value The default value of offset is 0. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range Obtain the value by calling the IAM API for obtaining the user token. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| tags | Array of TagResponse objects | Definition Tag list, which is the value pairs of tag keys and values. key indicates the tag key. A key pair can have at most 20 keys. A key and its value must be unique and the key cannot be empty. Each key can contain at most 128 characters. value indicates the tag value. Each value can contain at most 255 characters. A search result matches all the values. Range N/A |
| total_count | Integer | Definition Number of tags in a list Range N/A |
Example Requests
None
Example Responses
Status code: 200
{
"total_count" : 2,
"tags" : [ {
"key" : "key1",
"values" : [ "val1" ]
}, {
"key" : "key2",
"values" : [ "val2" ]
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | |
| 400 | Invalid parameter. |
| 401 | Authorization failed. |
| 403 | Insufficient permissions. |
| 404 | Resource not found. |
| 500 | System error. |
Error Codes
See Error Codes.