Updated on 2024-05-28 GMT+08:00

Querying Resource Tags

Function

This API is used to query tags attached to the specified resource.

Debugging

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

URI

GET /v1/organizations/{resource_type}/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

resource_type

Yes

String

Resource type. It can be organizations:policies, organizations:ous, organizations:accounts, or organizations:roots.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Security-Token

No

String

Security token (session token) of your temporary security credentials. If a temporary security credential is used, this header is required.

Minimum: 1

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tags

Array of TagsDTO objects

A custom key-value pair.

Table 4 TagsDTO

Parameter

Type

Description

key

String

Key. Each tag key can contain a maximum of 127 Unicode characters and cannot be left blank.

Minimum: 1

Maximum: 128

values

Array of strings

List of values. Each value can contain a maximum of 255 Unicode characters.

Minimum: 0

Maximum: 255

Array Length: 0 - 10

Example Requests

Querying resource tags

GET https://{hostname}/v1/organizations/{resource_type}/tags

Example Responses

Status code: 200

Successful

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

Status Codes

Status Code

Description

200

Successful

Error Codes

See Error Codes.