All Products
Search
Document Center

:DescribeTagKeys

最終更新日:Aug 16, 2023

Queries tag keys.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
ResourceType String No VPC

The resource type. Valid values:

  • VPC: virtual private cloud (VPC)
  • VSWITCH: vSwitch
  • ROUTETABLE: route table
  • EIP: elastic IP address (EIP)
  • VPNGATEWAY: VPN gateway
  • NATGATEWAY: NAT gateway
  • COMMONBANDWIDTHPACKAGE: EIP bandwidth plan
  • PREFIXLIST: prefix list
  • PUBLICIPADDRESSPOOL: IP address pool
  • IPV4GATEWAY: IPv4 gateway
  • IPV6GATEWAY: IPv6 gateway
  • NETWORKACL: network access control list (ACL)
  • TRAFFICMIRRORFILTER: traffic mirror filter
  • TRAFFICMIRRORSESSION: traffic mirror session
  • FLOWLOG: flow log
  • HAVIP: high availability virtual IP address (HAVIP)
  • DHCPOPTIONSSET: DHCP options set
  • GATEWAYENDPOINT: gateway endpoint
Note The values are case-insensitive.
Keyword String No keyword

The key of tag N to add to the resource.

RegionId String Yes cn-hangzhou

The ID of the region to which the resource belongs.

You can call the DescribeRegions operation to query the most recent region list.

NextToken String No FFmyTO70tTpLG6I3FmYAXGKPd****

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

  • If this is your first query and no next queries are to be sent, ignore this parameter.
  • If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
MaxResult Integer No 50

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

Action String Yes DescribeTagKeys

The operation that you want to perform. Set the value to DescribeTagKeys.

ResourceId.N String No vpc-bp16qjewdsunr41m1****

The resource ID. You can enter at most 50 IDs.

Note If you specify this parameter, you must specify ResourceType.

Response parameters

Parameter Type Example Description
NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If no value is returned for NextToken, no next queries are sent.
  • If the value returned of NextToken is not empty, the value indicates the token that is used for the next query.
RequestId String DE65F6B7-7566-4802-9007-96F2494AC512

The request ID.

TagKeys Array of TagKey

The list of tag keys.

TagKey
Type String Custom

The type of the tag key. Valid values:

  • Custom
  • System
TagKey String FinanceDept

The key of tag N.

Examples

Sample requests

http(s)://[Endpoint]/?ResourceType=VPC
&Keyword=keyword
&RegionId=cn-hangzhou
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResult=50
&Action=DescribeTagKeys
&ResourceId=["vpc-bp16qjewdsunr41m1****"]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeTagKeysResponse>
    <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
    <RequestId>DE65F6B7-7566-4802-9007-96F2494AC512</RequestId>
    <TagKeys>
        <Type>Custom</Type>
        <TagKey>FinanceDept</TagKey>
    </TagKeys>
</DescribeTagKeysResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId" : "DE65F6B7-7566-4802-9007-96F2494AC512",
  "TagKeys" : [ {
    "Type" : "Custom",
    "TagKey" : "FinanceDept"
  } ]
}

Error codes

HttpCode Error code Error message Description
400 BothEmpty.TagsAndResources The specified Tags and ResourcesIds are not allow to both empty. ResourceId.N and Tag.N are not specified. You must specify at least one of the parameters.
400 MissingParameter.TagKey The input parameter TagKey that is mandatory for processing this request is not supplied. TagKey is not specified.
400 MissingParameter.TagValue The input parameter TagValue that is mandatory for processing this request is not supplied. TagValue is not specified.
400 InvalidTagKey The tag keys are not valid. The tag index is invalid.
400 InvalidTagValue The tag values are not valid. The tag value is invalid.
400 InvalidInstanceType.NotFound The instance type is not found The instance type is not found.
400 InvalidInstanceIds.NotFound The instanceIds are not found The instance ID is not found.
400 Forbidden.TagKeys The request do not allow to operate the tag keys You do not have the permissions to specify TagKeys.
400 QuotaExceeded.TagNum Custom Tags quota exceeded The upper limit is reached.
400 Forbidden.NotAllowedCategary The System tag is not valid The system tag is invalid.
400 Forbidden.TagKeys The request does not allow operate this tagkeys You cannot manage the tag key by calling the operation.
400 Forbidden.TagKey.Duplicated The specified tag key already exists. The tag resources are duplicate.
400 SizeLimitExceeded.TagNum The maximum number of tags is exceeded. The number of tags has reached the upper limit.
400 SizeLimitExceeded.ResourceId The maximum number of resource IDs is exceeded. The number of resource group IDs exceeds the upper limit.
403 Forbidden User not authorized to operate on the specified resource. You are unauthorized to perform the operation on the specified resource. Acquire the required permissions and try again.

For a list of error codes, see Service error codes.