GetTagKeys - Resource Groups Tagging API

GetTagKeys

Returns all tag keys currently in use in the specified AWS Region for the calling account.

This operation supports pagination, where the response can be sent in multiple pages. You should check the PaginationToken response parameter to determine if there are additional results available to return. Repeat the query, passing the PaginationToken response parameter value as an input to the next request until you recieve a null value. A null value for PaginationToken indicates that there are no more results waiting to be returned.

Request Syntax

{ "PaginationToken": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

PaginationToken

Specifies a PaginationToken response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: [\s\S]*

Required: No

Response Syntax

{ "PaginationToken": "string", "TagKeys": [ "string" ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

PaginationToken

A string that indicates that there is more data available than this response contains. To receive the next part of the response, specify this response value as the PaginationToken value in the request for the next page.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: [\s\S]*

TagKeys

A list of all tag keys in the AWS account.

Type: Array of strings

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: ^([\p{L}\p{Z}\p{N}_.:\/=+\-@]*)$

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServiceException

The request processing failed because of an unknown error, exception, or failure. You can retry the request.

HTTP Status Code: 500

InvalidParameterException

This error indicates one of the following:

  • A parameter is missing.

  • A malformed string was supplied for the request parameter.

  • An out-of-range value was supplied for the request parameter.

  • The target ID is invalid, unsupported, or doesn't exist.

  • You can't access the Amazon S3 bucket for report storage. For more information, see Additional Requirements for Organization-wide Tag Compliance Reports in the AWS Organizations User Guide.

HTTP Status Code: 400

PaginationTokenExpiredException

A PaginationToken is valid for a maximum of 15 minutes. Your request was denied because the specified PaginationToken has expired.

HTTP Status Code: 400

ThrottledException

The request was denied to limit the frequency of submitted requests.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of GetTagKeys.

Sample Request

POST / HTTP/1.1 Host: tagging.us-west-2.amazonaws.com Accept-Encoding: identity Content-Length: 2 X-Amz-Target: ResourceGroupsTaggingAPI_20170126.GetTagKeys X-Amz-Date: 20170421T214126Z User-Agent: aws-cli/1.11.79 Python/2.7.9 Windows/7 botocore/1.5.42 Content-Type: application/x-amz-json-1.1 Authorization: AUTHPARAMS {}

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: 462f0799-26db-11e7-a88c-a74e0c5622c9 Content-Type: application/x-amz-json-1.1 Content-Length: 79 Date: Fri, 21 Apr 2017 21:41:27 GMT { "PaginationToken": "", "TagKeys": [ "Example", "Example1", "Example2" ] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: