Skip to content

list_tags_for_resource async

list_tags_for_resource(
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    resource_arn: Optional[AmazonResourceName] = None,
) -> ListTagsForResourceResponse

This API works with the following fleet types: EC2, Anywhere, Container

Retrieves all tags assigned to a Amazon GameLift Servers resource. Use resource tags to organize Amazon Web Services resources for a range of purposes. This operation handles the permissions necessary to manage tags for Amazon GameLift Servers resources that support tagging.

To list tags for a resource, specify the unique ARN value for the resource.

Learn more

Tagging Amazon Web Services Resources in the Amazon Web Services General Reference

Amazon Web Services Tagging Strategies

Related actions

All APIs by task

Parameters:

  • resource_arn (Optional[AmazonResourceName], default: None ) –

    The Amazon Resource Name (ARN) that uniquely identifies the Amazon GameLift Servers resource that you want to retrieve tags for. Amazon GameLift Servers includes resource ARNs in the data object for the resource. You can retrieve the ARN by calling a List or Describe operation for the resource type.

Raises:

  • InternalServiceException –

    The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

  • InvalidRequestException –

    One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

  • NotFoundException –

    The requested resource was not found. The resource was either not created yet or deleted.

  • TaggingFailedException –

    The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.

  • UnsupportedRegionException –

    The requested operation is not supported in the Region specified.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_gamelift/_services/async_game_lift.py
async def list_tags_for_resource(
    self,
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    resource_arn: Optional[
        "capo_gamelift.types.amazon_resource_name.AmazonResourceName"
    ] = None,
) -> "capo_gamelift.types.list_tags_for_resource_response.ListTagsForResourceResponse":
    """<p> <b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p> <p>Retrieves all tags assigned to a Amazon GameLift Servers resource. Use resource tags to organize Amazon Web Services resources for a range of purposes. This operation handles the permissions necessary to manage tags for Amazon GameLift Servers resources that support tagging.</p> <p>To list tags for a resource, specify the unique ARN value for the resource.</p> <p> <b>Learn more</b> </p> <p> <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i> </p> <p> <a href="http://aws.amazon.com/answers/account-management/aws-tagging-strategies/"> Amazon Web Services Tagging Strategies</a> </p> <p> <b>Related actions</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a> </p>

    Args:
        resource_arn: <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that uniquely identifies the Amazon GameLift Servers resource that you want to retrieve tags for. Amazon GameLift Servers includes resource ARNs in the data object for the resource. You can retrieve the ARN by calling a <code>List</code> or <code>Describe</code> operation for the resource type. </p>

    Raises:
        capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
        capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
        capo_gamelift.errors.not_found_exception.NotFoundException: <p>The requested resource was not found. The resource was either not created yet or deleted.</p>
        capo_gamelift.errors.tagging_failed_exception.TaggingFailedException: <p>The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.</p>
        capo_gamelift.errors.unsupported_region_exception.UnsupportedRegionException: <p>The requested operation is not supported in the Region specified.</p>
        capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_gamelift.types.list_tags_for_resource_request.ListTagsForResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_gamelift.types.list_tags_for_resource_response.ListTagsForResourceResponse"
    ]:
        import capo_gamelift._operations.game_lift.list_tags_for_resource

        (
            output,
            http_response,
        ) = await capo_gamelift._operations.game_lift.list_tags_for_resource.async_list_tags_for_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTagsForResource")
    )
    input_: capo_gamelift.types.list_tags_for_resource_request.ListTagsForResourceRequest = {}
    if resource_arn is not None:
        input_["resource_arn"] = resource_arn

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output