Skip to content

untag_resource

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

Removes tags from an Amazon Web Services X-Ray group or sampling rule. You cannot edit or delete system tags (those with an aws: prefix).

Parameters:

  • resource_arn (AmazonResourceName) –

    The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.

  • tag_keys (TagKeyList) –

    Keys for one or more tags that you want to remove from an X-Ray group or sampling rule.

Raises:

Source code in docs_src/capo_xray/_services/x_ray.py
def untag_resource(
    self,
    resource_arn: "capo_xray.types.amazon_resource_name.AmazonResourceName",
    tag_keys: "capo_xray.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[XRayClientConfig] = None,
) -> "capo_xray.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes tags from an Amazon Web Services X-Ray group or sampling rule. You cannot edit or delete system tags (those with an <code>aws:</code> prefix).</p>

    Args:
        resource_arn: <p>The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.</p>
        tag_keys: <p>Keys for one or more tags that you want to remove from an X-Ray group or sampling rule.</p>

    Raises:
        capo_xray.errors.invalid_request_exception.InvalidRequestException: <p>The request is missing required parameters or has invalid parameters.</p>
        capo_xray.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found. Verify that the name or Amazon Resource Name (ARN) of the resource is correct.</p>
        capo_xray.errors.throttled_exception.ThrottledException: <p>The request exceeds the maximum number of requests per second.</p>
        capo_xray.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_xray._operations.awsx_ray.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_xray.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