Queries tag keys.

In this example, the tag keys that are added to a stack in the China (Hangzhou) region are queried.

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
Action String Yes ListTagKeys

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

RegionId String Yes cn-hangzhou

The region ID of the tag key. You can call the DescribeRegions operation to query the most recent region list.

ResourceType String Yes stack

The type of the resource. Valid values:

  • stack: stack
  • stackgroup: stack group
  • template: template
  • templatescratch: scenario
NextToken String No caeba0bbb2be03f84eb48b699f0*****

The token that determines the start point of the next query.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
NextToken String caeba0bbb2be03f84eb48b699f0*****

The token that is used to start the next query.

RequestId String C429473A-5C66-4661-B5F8-4F900CD4330A

The ID of the request.

Keys Array of String ["TagKey1","TagKey2"]

The list of tag keys. Separate multiple tag keys with commas (,).

Examples

Sample requests

http(s)://ros.aliyuncs.com/?Action=ListTagKeys
&RegionId=cn-hangzhou
&ResourceType=stack
&<Common request parameters>

Sample success responses

XML format

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

<ListTagKeysResponse>
		<Keys>TagKey1</Keys>
		<Keys>TagKey2</Keys>
		<NextToken>caeba0bbb2be03f84eb48b699f0*****</NextToken>
		<RequestId>FAD755D7-F21E-449A-932D-2C59DAF86B14</RequestId>
</ListTagKeysResponse>

JSON format

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

{
  "Keys" : [ "TagKey1", "TagKey2" ],
  "NextToken" : "caeba0bbb2be03f84eb48b699f0*****",
  "RequestId" : "FAD755D7-F21E-449A-932D-2C59DAF86B14"
}

Error codes

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