Updated on 2026-06-11 GMT+08:00

Querying Resource Tags

Function

This API is used to query tags of a specified instance.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

vpn::listTagsForResource

list

vpnGateways

  • g:EnterpriseProjectId
  • g:ResourceTag/<tag-key>

vpn::listTagsForResource

-

customerGateways

g:ResourceTag/<tag-key>

vpnConnections

  • g:EnterpriseProjectId
  • g:ResourceTag/<tag-key>

URI

GET /v5/{project_id}/{resource_type}/{resource_id}/tags

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID.

resource_type

String

Yes

  • Specifies the resource type.
  • Value range:

    vpn-gateway: S2C VPN gateway

    customer-gateway: customer gateway

    vpn-connection: VPN connection

resource_id

String

Yes

Indicates a resource ID.

Request

  • Request parameters

    None

  • Example request
    GET https://{Endpoint}/v5/{project_id}/{resource_type}/{resource_id}/tags

Response

  • Response parameters

    Returned status code 200: successful query

    Table 2 Parameters in the response body

    Parameter

    Type

    Description

    tags

    Array of ResourceTag objects

    Specifies the list of resource tags.

    Table 3 ResourceTag

    Parameter

    Type

    Description

    key

    String

    Specifies a tag key.

    value

    String

    Specifies a tag value.

  • Example response
    {
        "tags":[
            {
                "key":"key1",
                "value":"value1"
            }
        ]
    }

Status Codes

For details, see Status Codes.