Returns all tag keys currently in use in the specified Amazon Web Services 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.
Parameters:
-
pagination_token
(Optional[PaginationToken], default:
None
)
–
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.
Raises:
-
InternalServiceException
–
The request processing failed because of an unknown error, exception, or failure. You can retry the request.
-
InvalidParameterException
–
The request failed because of one of the following reasons:
-
A required parameter is missing.
-
A provided string parameter is malformed.
-
An provided parameter value is out of range.
-
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 Amazon S3 bucket policy for report storage in the Tagging Amazon Web Services resources and Tag Editor user guide.
-
The partition specified in an ARN parameter in the request doesn't match the partition where you invoked the operation. The partition is specified by the second field of the ARN.
-
PaginationTokenExpiredException
–
The request failed because the specified PaginationToken has expired. A PaginationToken is valid for a maximum of 15 minutes.
-
ThrottledException
–
The request failed because it exceeded the allowed frequency of submitted requests.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_resource_groups_tagging_api/_services/async_resource_groups_tagging_api.py
| async def get_tag_keys(
self,
*,
config_overrides: Optional[AsyncResourceGroupsTaggingAPIClientConfig] = None,
pagination_token: Optional[
"capo_resource_groups_tagging_api.types.pagination_token.PaginationToken"
] = None,
) -> "capo_resource_groups_tagging_api.types.get_tag_keys_output.GetTagKeysOutput":
"""<p>Returns all tag keys currently in use in the specified Amazon Web Services Region for the calling account.</p> <p>This operation supports pagination, where the response can be sent in multiple pages. You should check the <code>PaginationToken</code> response parameter to determine if there are additional results available to return. Repeat the query, passing the <code>PaginationToken</code> response parameter value as an input to the next request until you recieve a <code>null</code> value. A null value for <code>PaginationToken</code> indicates that there are no more results waiting to be returned.</p>
Args:
pagination_token: <p>Specifies a <code>PaginationToken</code> response value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.</p>
Raises:
capo_resource_groups_tagging_api.errors.internal_service_exception.InternalServiceException: <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
capo_resource_groups_tagging_api.errors.invalid_parameter_exception.InvalidParameterException: <p>The request failed because of one of the following reasons:</p> <ul> <li> <p>A required parameter is missing.</p> </li> <li> <p>A provided string parameter is malformed.</p> </li> <li> <p>An provided parameter value is out of range.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn't exist.</p> </li> <li> <p>You can't access the Amazon S3 bucket for report storage. For more information, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tag-policies-orgs.html#bucket-policy">Amazon S3 bucket policy for report storage</a> in the <i>Tagging Amazon Web Services resources and Tag Editor</i> user guide. </p> </li> <li> <p>The partition specified in an ARN parameter in the request doesn't match the partition where you invoked the operation. The partition is specified by the second field of the ARN.</p> </li> </ul>
capo_resource_groups_tagging_api.errors.pagination_token_expired_exception.PaginationTokenExpiredException: <p>The request failed because the specified <code>PaginationToken</code> has expired. A <code>PaginationToken</code> is valid for a maximum of 15 minutes.</p>
capo_resource_groups_tagging_api.errors.throttled_exception.ThrottledException: <p>The request failed because it exceeded the allowed frequency of submitted requests.</p>
capo_resource_groups_tagging_api.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_resource_groups_tagging_api.types.get_tag_keys_input.GetTagKeysInput]",
) -> AsyncOperationResponse[
"capo_resource_groups_tagging_api.types.get_tag_keys_output.GetTagKeysOutput"
]:
import capo_resource_groups_tagging_api._operations.resource_groups_tagging_api_20170126.get_tag_keys
(
output,
http_response,
) = await capo_resource_groups_tagging_api._operations.resource_groups_tagging_api_20170126.get_tag_keys.async_get_tag_keys(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetTagKeys")
)
input_: capo_resource_groups_tagging_api.types.get_tag_keys_input.GetTagKeysInput = {}
if pagination_token is not None:
input_["pagination_token"] = pagination_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|