Skip to content

untag_resource async

untag_resource(
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    resource_arn: Optional[ResourceARN] = None,
    tag_keys: Optional[TagKeys] = None,
) -> UntagResourceResponse

This action removes a tag from an Amazon FSx resource.

Parameters:

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

    The ARN of the Amazon FSx resource to untag.

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

    A list of keys of tags on the resource to untag. In case the tag key doesn't exist, the call will still succeed to be idempotent.

Raises:

  • BadRequest –

    A generic error indicating a failure with a client request.

  • InternalServerError –

    A generic error indicating a server-side failure.

  • NotServiceResourceError –

    The resource specified for the tagging operation is not a resource type owned by Amazon FSx. Use the API of the relevant service to perform the operation.

  • ResourceDoesNotSupportTagging –

    The resource specified does not support tagging.

  • ResourceNotFound –

    The resource specified by the Amazon Resource Name (ARN) can't be found.

  • UnknownServiceError –

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

Examples:

To untag a resource This operation untags an Amazon FSx resource.

>>> await client.untag_resource(resource_arn='arn:aws:fsx:us-east-1:012345678912:file-system/fs-0498eed5fe91001ec', tag_keys=['Name'])
Source code in docs_src/capo_fsx/_services/async_f_sx.py
async def untag_resource(
    self,
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    resource_arn: Optional["capo_fsx.types.resource_arn.ResourceARN"] = None,
    tag_keys: Optional["capo_fsx.types.tag_keys.TagKeys"] = None,
) -> "capo_fsx.types.untag_resource_response.UntagResourceResponse":
    """<p>This action removes a tag from an Amazon FSx resource.</p>

    Args:
        resource_arn: <p>The ARN of the Amazon FSx resource to untag.</p>
        tag_keys: <p>A list of keys of tags on the resource to untag. In case the tag key doesn't exist, the call will still succeed to be idempotent.</p>

    Raises:
        capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
        capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
        capo_fsx.errors.not_service_resource_error.NotServiceResourceError: <p>The resource specified for the tagging operation is not a resource type owned by Amazon FSx. Use the API of the relevant service to perform the operation. </p>
        capo_fsx.errors.resource_does_not_support_tagging.ResourceDoesNotSupportTagging: <p>The resource specified does not support tagging. </p>
        capo_fsx.errors.resource_not_found.ResourceNotFound: <p>The resource specified by the Amazon Resource Name (ARN) can't be found.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To untag a resource
        This operation untags an Amazon FSx resource.

        >>> await client.untag_resource(resource_arn='arn:aws:fsx:us-east-1:012345678912:file-system/fs-0498eed5fe91001ec', tag_keys=['Name'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fsx.types.untag_resource_request.UntagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_fsx.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.untag_resource

        (
            output,
            http_response,
        ) = await capo_fsx._operations.aws_simba_api_service_v20180301.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_fsx.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