Help Center> Cloud Eye> API Reference> API v2> Resource Tags> Querying Tags of a Type of Resources in a Cloud Eye Project
Updated on 2024-05-16 GMT+08:00

Querying Tags of a Type of Resources in a Cloud Eye Project

Function

Querying tags of a type of resources in a Cloud Eye project.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/{resource_type}/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the tenant ID.

Minimum: 1

Maximum: 64

Regex Pattern: ^[a-zA-Z0-9-]{1,64}$

resource_type

Yes

String

Specifies the resource type, which can be CES-alarm (alarm rule), CES-dashboard, or CES-resourceGroup.

Minimum: 1

Maximum: 32

Enumeration values:

  • CES-alarm

  • CES-dashboard

  • CES-resourceGroup

  • CES-qualityMonitor

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

No

String

Specifies the MIME type of the request body. The default type is application/json; charset=UTF-8.

Default: application/json; charset=UTF-8

Minimum: 1

Maximum: 64

X-Auth-Token

Yes

String

Specifies the user token.

Minimum: 1

Maximum: 16384

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of Tag objects

Specifies tenant tags.

Array Length: 0 - 20

Table 4 Tag

Parameter

Type

Description

key

String

Specifies a tag key. A tag key can contain up to 128 Unicode characters. key must be specified.

Minimum: 0

Maximum: 128

values

Array of strings

Specifies tag values. Each value can contain up to 255 Unicode characters. If values is not specified, any parameter value can be queried.

Minimum: 0

Maximum: 255

Array Length: 0 - 20

Status code: 404

Table 5 Response body parameters

Parameter

Type

Description

http_code

Integer

Specifies the HTTP status code. 200: OK 404: Resource not found.

Minimum: 3

Maximum: 3

Enumeration values:

  • 200

  • 404

message

GoAPIErrorResponseMsg object

Specifies the error message.

Table 6 GoAPIErrorResponseMsg

Parameter

Type

Description

details

String

Specifies the error message.

Minimum: 0

Maximum: 1024

code

String

Specifies the service error codes.

Minimum: 1

Maximum: 16

Example Requests

None

Example Responses

Status code: 200

OK

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

Status Codes

Status Code

Description

200

OK

404

Resource not found.

Error Codes

See Error Codes.