Help Center/ Direct Connect/ API Reference/ APIs/ Tag management/ Querying Tags by Resource Type
Updated on 2023-12-07 GMT+08:00

Querying Tags by Resource Type

Function

This API is used to query the tags of a resource type in a specific project. TMS uses this API to list tags created by a tenant to facilitate tag creation and resource filtering on the console.

Calling Method

For details, see Calling APIs.

URI

GET /v3/{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 Direct Connect resource type.

  • dc-directconnect: connection
  • dc-vgw: virtual gateway
  • dc-vif: virtual interface

Enumeration values:

  • dc-directconnect
  • dc-vgw
  • dc-vif

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

tags

Array of Tag objects

Specifies the tags.

request_id

String

Specifies the request ID.

Table 3 Tag

Parameter

Type

Description

key

String

Specifies the tag key. The key can contain a maximum of 36 Unicode characters, including letters, digits, hyphens (-), and underscores (_).

Minimum: 0

Maximum: 36

value

String

Specifies the tag value. The value can contain a maximum of 43 Unicode characters, including letters, digits, hyphens (-), underscores (_), and periods (.).

Minimum: 0

Maximum: 43

Example Requests

GET https://{dc_endpoint}/v3/ed28c294165741faaeccab26913122a1/dc-directconnect/tags

Example Responses

Status code: 200

OK

{
  "tags" : [ {
    "key" : "department",
    "value" : "finance"
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.