All Products
Search
Document Center

Cloud Enterprise Network:ListTagResources

最終更新日:Oct 22, 2024

Queries the information about tags that are added to a Cloud Enterprise Network (CEN) instance.

Operation description

To call this operation, you must set at least one of ResourceId.N and Tag.N.Key.

  • If you set only ResourceId.N, the tags that are added to the specified CEN instances are returned.

  • If you set only Tag.N.Key, the CEN instances that have the specified tags are returned.

  • If you set both ResourceId.N and Tag.N.Key, the specified tags that are added to the specified CEN instances are returned.

    • Make sure that the CEN instance specified by ResourceId.N has the tag specified by Tag.N.Key. Otherwise, the response returns null.
    • If multiple tag keys are specified, the logical operator among these tag keys is AND.

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
cen:ListTagResourcesget
  • CenInstance
    acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceTypestringYes

The type of the resource to which you want to add the tag. Valid values:

Cen: CEN instance

BandwidthPackage: bandwidth plan

TransitRouter: transit router

TransitRouterVpcAttachment: virtual private cloud (VPC) connection

TransitRouterVbrAttachment: virtual border router (VBR) connection

TransitRouterPeerAttachment: inter-region connection

TransitRouterVpnAttachment: VPN connection

TransitRouterRouteTable: route table

Flowlog: flow log

TransitRouterMulticastDomain: multicast domain

cen
NextTokenstringNo

The token that determines the start point of the query. Valid values:

  • If this is your first query and no next queries are to be sent, ignore this parameter.
  • If a subsequent query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
FFmyTO70tTpLG6I3FmYAXGKPd****
PageSizeintegerNo

The number of entries to return on each page. Valid values: 1 to 50. Default value: 10.

10
ResourceIdarrayNo

The IDs of the CEN instances.

You can specify at most 20 IDs in each call.

stringNo

The IDs of the CEN instances.

You can specify at most 20 IDs in each call.

cen-8z69wtwqel33lq****
Tagarray<object>No

The information about the tags that are added to the CEN instance.

You can query at most 20 tags in each call.

objectNo

The information about the tags that are added to the CEN instance.

You can query at most 20 tags in each call.

KeystringNo

The tag key.

The tag key cannot exceed 64 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify at most 20 tag keys.

test
ValuestringNo

The tag value.

The tag value cannot exceed 128 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify at most 20 tag values.

Bp
RegionIdstringNo

The ID of the region where the resource is deployed.

You can ignore this parameter if ResourceType is set to Cen or BandwidthPackage.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

The response.

NextTokenstring

The token that determines the start point of the query. Valid values:

  • If NextToken was not returned, it indicates that no additional results exist.
  • If NextToken was returned in the previous query, specify the value to obtain the next set of results.
FFmyTO70tTpLG6I3FmYAXGKPd****
RequestIdstring

The ID of the request.

165B5C86-2033-5954-A89D-4CD83BA06C85
TagResourcesarray<object>

A list of resources and tags.

TagResourceobject
ResourceTypestring

The type of the resource. Valid values:

Cen: CEN instance

BandwidthPackage: bandwidth plan

TransitRouter: transit router

TransitRouterVpcAttachment: virtual private cloud (VPC) connection

TransitRouterVbrAttachment: virtual border router (VBR) connection

TransitRouterPeerAttachment: inter-region connection

TransitRouterVpnAttachment: VPN connection

TransitRouterRouteTable: route table

Flowlog: flow log

TransitRouterMulticastDomain: multicast domain

CEN
TagValuestring

The tag value.

Bp
ResourceIdstring

The ID of the CEN instance.

cen-8z69wtwqel33lq****
TagKeystring

The tag key.

test

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidTagKeyThe tag keys are not valid.The error message returned because the specified tag key is invalid.
400InvalidTagValueThe tag values are not valid.The error message returned because the specified tag value is invalid.
400MissingParam%s-
400InvalidInstanceType.NotFoundThe instance type is not foundThe error message returned because the specified instance type does not exist.
400InvalidInstanceIds.NotFoundThe instanceIds are not foundThe error message returned because the specified instance does not exist.
400Forbidden.TagKeysThe request do not allow to operate the tag keysThe error message returned because you cannot manage the specified tag key.
400QuotaExceeded.TagNumCustom Tags quota exceededThe error message returned because the number of tags has reached the upper limit.
400InvalidTagScope.NotFoundThe tag scope is not foundThe error message returned because the specified tag scope is invalid.
400Forbidden.NotAllowedCategaryThe System tag is not validThe error message returned because you cannot configure system tags.
400Forbidden.TagKeysThe request does not allow operate this tagkeysThe error message returned because you cannot manage the specified tag key.
400SizeLimitExceeded.ResourceIdNumThe ResourceIds parameter's number is exceed , Valid : 20-
400BothEmpty.TagsAndResourcesBoth of Tags and ResourceIds is empty.The error message returned because the Tags and ResourceIds parameters are not set.
400IllegalParam.NextTokenThe parameter NextToken is invalid.The error message returned because the NextToken parameter is set to an invalid value. Check the value and try again.
400IllegalParam.RegionThe specified region is invalid.The error message returned because the specified region is invalid.
400InvalidParameterInvalid parameter.The error message returned because the parameter is set to an invalid value.
400UnauthorizedThe AccessKeyId is unauthorized.The error message returned because you do not have the permissions to perform this operation.

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

Change history

Change timeSummary of changesOperation
No change history