Updated on 2024-08-09 GMT+08:00

Querying Tags of a Project

Function

Querying all tags of a resource type in a region.

URI

GET /v1/{project_id}/{resource_type}/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

resource_type

Yes

String

Specifies the resource type.

cph-server: cloud phone server

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of Tags objects

Specifies resource tag list.

Table 4 Tags

Parameter

Type

Description

key

String

Specifies the tag key.

  • A key can contain a maximum of 127 Unicode characters.

  • key must be specified.

values

Array of strings

Specifies the tag value list.

  • A maximum of 10 values are supported.

  • Values of the same tag must be unique.

  • Each tag value can contain a maximum of 255 Unicode characters.

  • If this parameter is left blank, any value can be used.

Example Requests

Querying all tags of a resource type in a region

GET https://{CPH Endpoint}/v1/{project_id}/{resource_type}/tags

Example Responses

Status code: 200

OK

{
  "tags" : [ {
    "key" : "key1",
    "values" : [ "value1", "value2" ]
  }, {
    "key" : "key2",
    "values" : [ "value1", "value2" ]
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.