All Products
Search
Document Center

Virtual Private Cloud:DescribeTagKeys

Last Updated:Dec 20, 2024

Queries tag keys.

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:DescribeTagKeysget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceTypestringNo

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
VPC
KeywordstringNo

The tag keys.

keyword
RegionIdstringYes

The region ID of the resource.

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

cn-hangzhou
NextTokenstringNo

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

  • If this is your first query or no next query is 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****
MaxResultintegerNo

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

50
ResourceIdarrayNo
stringNo

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

Note If you set this parameter, you must set ResourceType.
vpc-bp16qjewdsunr41m1****

Response parameters

ParameterTypeDescriptionExample
object

object

NextTokenstring

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

  • If the value of NextToken is not returned, it indicates that no next query is to be sent.
  • If a value of NextToken is returned, the value is the token that is used for the subsequent query.
FFmyTO70tTpLG6I3FmYAXGKPd****
RequestIdstring

The ID of the request.

DE65F6B7-7566-4802-9007-96F2494AC512
TagKeysarray<object>

The list of tag keys.

TagKeyobject
Typestring

The type of the tag key. Valid values:

  • Custom: custom
  • System: system
Custom
TagKeystring

The tag key.

FinanceDept

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400BothEmpty.TagsAndResourcesThe specified Tags and ResourcesIds are not allow to both empty.The tags and resource groups cannot be empty at the same time.
400MissingParameter.TagKeyThe input parameter TagKey that is mandatory for processing this request is not supplied.The TagKey parameter is not set.
400MissingParameter.TagValueThe input parameter TagValue that is mandatory for processing this request is not supplied.The TagValue parameter is not set.
400InvalidTagKeyThe tag keys are not valid.The tag index is invalid.
400InvalidTagValueThe tag values are not valid.The tag value is invalid.
400MissingParam%s-
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.NotAllowedCategaryThe System tag is not validThe error message returned because the system tag is invalid.
400Forbidden.TagKeysThe request does not allow operate this tagkeysThe error message returned because you cannot manage the tag key by calling the operation.
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.

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