All Products
Search
Document Center

Cloud Enterprise Network:ListTagResources

Last Updated:Jul 23, 2026

Queries the tags bound to a Cloud Enterprise Network (CEN) instance.

Operation description

When you call the ListTagResources operation, you must specify at least one of the request parameters ResourceId.N and Tag.N.Key:

  • If you specify only ResourceId.N, the tags bound to the specified CEN instance are queried.

  • If you specify only Tag.N.Key, all CEN instances that have the specified tag key bound are queried.

  • If you specify both ResourceId.N and Tag.N.Key, the specified tags bound to the specified CEN instance are queried.
    • Make sure that the values of ResourceId.N and Tag.N.Key correspond to each other. Otherwise, an empty result is returned.

    • If you specify multiple tag keys, the tag keys are evaluated by using the logical AND operator.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cen:ListTagResources

get

*CenInstance

acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ResourceType

string

Yes

The resource type. Valid values:

Cen: CEN instance.

BandwidthPackage: bandwidth package instance.

TransitRouter: transit router instance.

TransitRouterVpcAttachment: VPC connection instance.

TransitRouterVbrAttachment: VBR connection instance.

TransitRouterPeerAttachment: inter-region connection instance.

TransitRouterVpnAttachment: VPN connection instance.

TransitRouterRouteTable: route table instance.

Flowlog: flow log instance.

TransitRouterMulticastDomain: multicast domain instance.

cen

NextToken

string

No

Specifies whether a next query token exists. Valid values:

  • If this is the first query or no next query exists, you do not need to specify this parameter.

  • If a next query exists, set the value to the NextToken value returned by the previous API call.

FFmyTO70tTpLG6I3FmYAXGKPd****

PageSize

integer

No

The number of entries per page for a paged query. Valid values: 1 to 50. Default value: 10.

10

ResourceId

array

No

The CEN instance ID.

You can specify up to 20 CEN instance IDs at a time.

cen-8z69wtwqel33lq****

string

No

The CEN instance ID.

You can specify up to 20 CEN instance IDs at a time.

cen-8z69wtwqel33lq****

Tag

array<object>

No

The tag information of the CEN instance.

You can query up to 20 tags at a time.

object

No

The tag information of the CEN instance.

You can query up to 20 tags at a time.

Key

string

No

The tag key.

A tag key can contain up to 64 characters and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify up to 20 tag keys at a time.

test

Value

string

No

The tag value.

A tag value can contain up to 128 characters and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify up to 20 tag values at a time.

Bp

RegionId

string

No

The region ID of the resource instance.

This parameter is not required when the resource type is Cen or BandwidthPackage. This parameter is required for all other resource types.

cn-hangzhou

Response elements

Element

Type

Description

Example

object

The response parameters.

NextToken

string

Indicates whether a next query token exists. Valid values:

  • If NextToken is empty, no next query exists.

  • If NextToken is returned, the value indicates the token for the next query.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The request ID.

165B5C86-2033-5954-A89D-4CD83BA06C85

TagResources

object

TagResource

array<object>

The list of resources and tags.

object

ResourceType

string

The resource type. Valid values:

Cen: a CEN instance.

BandwidthPackage: a bandwidth plan.

TransitRouter: a transit router.

TransitRouterVpcAttachment: a VPC connection.

TransitRouterVbrAttachment: a VBR connection.

TransitRouterPeerAttachment: an inter-region connection.

TransitRouterVpnAttachment: a VPN connection.

TransitRouterRouteTable: a route table.

Flowlog: a flow log.

TransitRouterMulticastDomain: a multicast domain.

CEN

TagValue

string

The tag value.

Bp

ResourceId

string

The ID of the CEN instance.

cen-8z69wtwqel33lq****

TagKey

string

The tag key.

test

Examples

Success response

JSON format

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "165B5C86-2033-5954-A89D-4CD83BA06C85",
  "TagResources": {
    "TagResource": [
      {
        "ResourceType": "CEN",
        "TagValue": "Bp",
        "ResourceId": "cen-8z69wtwqel33lq****",
        "TagKey": "test"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidTagKey The tag keys are not valid. The error message returned because the specified tag key is invalid.
400 InvalidTagValue The tag values are not valid. The error message returned because the specified tag value is invalid.
400 MissingParam %s
400 InvalidInstanceType.NotFound The instance type is not found The error message returned because the specified instance type does not exist.
400 InvalidInstanceIds.NotFound The instanceIds are not found The error message returned because the specified instance does not exist.
400 Forbidden.TagKeys The request do not allow to operate the tag keys The error message returned because you cannot manage the specified tag key.
400 QuotaExceeded.TagNum Custom Tags quota exceeded The error message returned because the number of tags has reached the upper limit.
400 InvalidTagScope.NotFound The tag scope is not found The error message returned because the specified tag scope is invalid.
400 Forbidden.NotAllowedCategary The System tag is not valid The error message returned because you cannot configure system tags.
400 SizeLimitExceeded.ResourceIdNum The ResourceIds parameter's number is exceed , Valid : 20
400 BothEmpty.TagsAndResources Both of Tags and ResourceIds is empty. The error message returned because the Tags and ResourceIds parameters are not set.
400 IllegalParam.NextToken The parameter NextToken is invalid. The error message returned because the NextToken parameter is set to an invalid value. Check the value and try again.
400 IllegalParam.Region The specified region is invalid.
400 InvalidParameter Invalid parameter. The error message returned because the parameter is set to an invalid value.
400 Unauthorized The AccessKeyId is unauthorized. The error message returned because you do not have the permissions to perform this operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.