Skip to content

untag_resource

untag_resource(
    resource_arn: TaggableResourceArn,
    keys: TagKeyList,
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
) -> UntagResourceResponse

Removes tags from an Amazon Web Services resource.

Parameters:

  • resource_arn (TaggableResourceArn) –

    Specifies the Amazon Resource Name (ARN) of the resource to remove the tags from.

  • keys (TagKeyList) –

    Specifies the keys in the tags that you want to remove.

Raises:

Source code in docs_src/capo_datasync/_services/data_sync.py
def untag_resource(
    self,
    resource_arn: "capo_datasync.types.taggable_resource_arn.TaggableResourceArn",
    keys: "capo_datasync.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
) -> "capo_datasync.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes tags from an Amazon Web Services resource.</p>

    Args:
        resource_arn: <p>Specifies the Amazon Resource Name (ARN) of the resource to remove the tags from.</p>
        keys: <p>Specifies the keys in the tags that you want to remove.</p>

    Raises:
        capo_datasync.errors.internal_exception.InternalException: <p>This exception is thrown when an error occurs in the DataSync service.</p>
        capo_datasync.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_datasync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_datasync.types.untag_resource_request.UntagResourceRequest]",
    ) -> OperationResponse[
        "capo_datasync.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_datasync._operations.fmrs_service.untag_resource

        output, http_response = (
            capo_datasync._operations.fmrs_service.untag_resource.untag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UntagResource")
    )
    input_: capo_datasync.types.untag_resource_request.UntagResourceRequest = {
        "resource_arn": resource_arn,
        "keys": keys,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output