Skip to content

untag_resource async

untag_resource(
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    resource_arn: Optional[AmazonResourceName] = None,
    tag_keys: Optional[TagKeyList] = None,
) -> UntagResourceResponse

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

Removes a tag assigned to a Amazon GameLift Servers resource. You can 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 remove a tag from a resource, specify the unique ARN value for the resource and provide a string list containing one or more tags to remove. This operation succeeds even if the list includes tags that aren't assigned to 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 remove tags from. 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.

  • tag_keys (Optional[TagKeyList], default: None ) –

    A list of one or more tag keys to remove from the specified Amazon GameLift Servers resource.

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 untag_resource(
    self,
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    resource_arn: Optional[
        "capo_gamelift.types.amazon_resource_name.AmazonResourceName"
    ] = None,
    tag_keys: Optional["capo_gamelift.types.tag_key_list.TagKeyList"] = None,
) -> "capo_gamelift.types.untag_resource_response.UntagResourceResponse":
    """<p> <b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p> <p>Removes a tag assigned to a Amazon GameLift Servers resource. You can 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 remove a tag from a resource, specify the unique ARN value for the resource and provide a string list containing one or more tags to remove. This operation succeeds even if the list includes tags that aren't assigned to 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 remove tags from. 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>
        tag_keys: <p>A list of one or more tag keys to remove from the specified Amazon GameLift Servers resource. </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.untag_resource_request.UntagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_gamelift.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_gamelift._operations.game_lift.untag_resource

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UntagResource")
    )
    input_: capo_gamelift.types.untag_resource_request.UntagResourceRequest = {}
    if resource_arn is not None:
        input_["resource_arn"] = resource_arn
    if tag_keys is not None:
        input_["tag_keys"] = tag_keys

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