All Products
Search
Document Center

Virtual Private Cloud:ListTagResourcesForExpressConnect

Last Updated:Nov 27, 2024

Queries the tags that are added to an Express Connect circuit.

Operation description

  • If you want to query a specific object, you must specify ResourceId.N or Tag.N that consists of Tag.N.Key and Tag.N.Value in the request.
  • Tag.N is a resource tag that consists of a key-value pair. If you specify only Tag.N.Key, all tag values that are associated with the specified key are returned. If you specify only Tag.N.Value, an error message is returned.
  • If you specify Tag.N and ResourceId.N to filter tags, ResourceId.N must match all specified key-value pairs.
  • If you specify multiple key-value pairs, resources that contain these key-value pairs are returned.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ListTagResourcesForExpressConnectlist
*PhysicalConnection
acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId}
*VirtualBorderRouter
acs:vpc:{#regionId}:{#AccountId}:virtualborderrouter/{#VbrId}
*RouterInterface
acs:vpc:{#regionId}:{#AccountId}:routerinterface/{#RouterInterfaceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceTypestringYes

The type of the resource. Valid values:

  • PHYSICALCONNECTION: Express Connect circuit.
  • VIRTUALBORDERROUTER: virtual border router (VBR).
  • ROUTERINTERFACE: router interface.
PHYSICALCONNECTION
RegionIdstringYes

The ID of the region to which the resource resides.

You can call the DescribeRegions operation to obtain the region ID.

cn-hangzhou
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results.

  • You do not need to specify this parameter for the first request.
  • You must specify the token that is obtained from the previous query as the value of NextToken.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultsintegerNo

The number of entries per page. Valid values: 1 to 100. Default value: 20.

20
ResourceIdarrayNo

The resource IDs.

stringNo

The resource ID. You can specify up to 20 resource IDs.

pc-bp16qjewdsunr41m1****
Tagarray<object>No

The tags.

objectNo
KeystringNo

The key of the tag to add to the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

FinanceDept
ValuestringNo

The value of the tag to add to the resource. You can specify up to 20 tag values The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

FinanceJoshua

Response parameters

ParameterTypeDescriptionExample
object
NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results.

  • If NextToken is empty, no next page exists.
  • If a value is returned for NextToken, the value can be used in the next request to retrieve a new page of results.
FFmyTO70tTpLG6I3FmYAXGKPd****
RequestIdstring

The request ID.

54B48E3D-DF70-471B-AA93-08E683A1B45
TagResourcesarray<object>

The tags that are added to the resource.

TagResourceobject
ResourceTypestring

The type of the resource. Valid values:

  • PHYSICALCONNECTION: Express Connect circuit.
  • VIRTUALBORDERROUTER: VBR.
  • ROUTERINTERFACE: router interface.
PHYSICALCONNECTION
TagValuestring

The value of the tag that is added to the resource.

FinanceJoshua
ResourceIdstring

The resource ID.

pc-bp16qjewdsunr41m1****
TagKeystring

The key of the tag that is added to the resource.

FinanceDept

Examples

Sample success responses

JSONformat

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "TagResources": {
    "TagResource": [
      {
        "ResourceType": "PHYSICALCONNECTION",
        "TagValue": "FinanceJoshua",
        "ResourceId": "pc-bp16qjewdsunr41m1****",
        "TagKey": "FinanceDept"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidTagKeyThe tag keys are not valid.The tag index is invalid.
400InvalidTagValueThe tag values are not valid.The tag value is invalid.
400InvalidInstanceType.NotFoundThe instance type is not foundThe instance type is not found.
400InvalidInstanceIds.NotFoundThe instanceIds are not foundThe instance ID is not found.
400Forbidden.TagKeysThe request do not allow to operate the tag keysYou do not have the permissions to set the TagKeys parameter.
400QuotaExceeded.TagNumCustom Tags quota exceededThe upper limit is reached.
400Forbidden.TagKey.DuplicatedThe specified tag key already exists.The tag resources are duplicate.
400SizeLimitExceeded.TagNumThe maximum number of tags is exceeded.The number of tags has reached the upper limit.
400SizeLimitExceeded.ResourceIdThe maximum number of resource IDs is exceeded.The number of resource group IDs has reached the upper limit.
403ForbiddenUser not authorized to operate on the specified resource.You do not have the permissions to manage the specified resource. Apply for the permissions and try again.
403BothEmpty.TagsAndResourcesThe specified Tags and ResourcesIds are not allow to both empty.The tags and resource groups cannot be empty at the same time.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-11API Description Update. The Error code has changedView Change Details