Updated on 2024-07-25 GMT+08:00

Querying Resource Tags

Function

This API is used to query resource tags.

Calling Method

For details, see Calling APIs.

URI

GET /v3/{project_id}/{resource_type}/{resource_id}/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

resource_id

Yes

String

Specifies the resource ID.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

tags

Array of Tag objects

Specifies the tag list.

sys_tags

Array of Tag objects

Specifies the list of queried tags. If no tag is matched, an empty array is returned.

request_id

String

Specifies the request ID.

Table 3 Tag

Parameter

Type

Description

Example Requests

Querying tags of a resource

https://{endpoint}/v3/cfa563efb77d4b6d9960781d82530fd8/dc-vgw/resource-instances/action

Example Responses

Status code: 200

OK

{
  "request_id" : "80ef5f21-b81a-4546-b23d-84272507d330",
  "tags" : [ {
    "key" : "key2",
    "value" : "value2"
  }, {
    "key" : "key1",
    "value" : "value1"
  }, {
    "key" : "key3",
    "value" : "value3"
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.