Skip to content

untag_resource

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

Removes tags from a behavior graph.

Parameters:

  • resource_arn (GraphArn) –

    The ARN of the behavior graph to remove the tags from.

  • tag_keys (TagKeyList) –

    The tag keys of the tags to remove from the behavior graph. You can remove up to 50 tags at a time.

Raises:

Source code in docs_src/capo_detective/_services/detective.py
def untag_resource(
    self,
    resource_arn: "capo_detective.types.graph_arn.GraphArn",
    tag_keys: "capo_detective.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[DetectiveClientConfig] = None,
) -> "capo_detective.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes tags from a behavior graph.</p>

    Args:
        resource_arn: <p>The ARN of the behavior graph to remove the tags from.</p>
        tag_keys: <p>The tag keys of the tags to remove from the behavior graph. You can remove up to 50 tags at a time.</p>

    Raises:
        capo_detective.errors.access_denied_exception.AccessDeniedException: <p>The request issuer does not have permission to access this resource or perform this operation.</p>
        capo_detective.errors.internal_server_exception.InternalServerException: <p>The request was valid but failed because of a problem with the service.</p>
        capo_detective.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request refers to a nonexistent resource.</p>
        capo_detective.errors.validation_exception.ValidationException: <p>The request parameters are invalid.</p>
        capo_detective.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_detective._operations.amazon_detective.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_detective.types.untag_resource_request.UntagResourceRequest = {
        "resource_arn": resource_arn,
        "tag_keys": tag_keys,
    }

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