Skip to content

untag_resource

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

Removes tags from an agent context, connection, curation policy, customer-owned ontology, or ontology induction.

Parameters:

  • resource_arn (TaggableResourceArn) –

    The ARN of the resource to untag.

  • tag_keys (TagKeyList) –

    The keys of the tags to remove, 1–200 per request.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.

  • InternalServerException –

    The request failed because of an internal error. Retry the request.

  • ThrottlingException –

    The request was denied because it exceeded a request rate quota. Wait, then retry the request.

  • ValidationException –

    The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.

  • ConflictException –

    The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.

  • ResourceNotFoundException –

    The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.

  • UnknownServiceError –

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

Examples:

Remove a tag from a connection The following example removes the team tag from the connection conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b.

>>> client.untag_resource(resource_arn='arn:aws:context:us-east-1:111122223333:connection/conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b', tag_keys=['team'])
Source code in docs_src/capo_context/_services/context.py
def untag_resource(
    self,
    resource_arn: "capo_context.types.taggable_resource_arn.TaggableResourceArn",
    tag_keys: "capo_context.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[ContextClientConfig] = None,
) -> "capo_context.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes tags from an agent context, connection, curation policy, customer-owned ontology, or ontology induction.</p>

    Args:
        resource_arn: <p>The ARN of the resource to untag.</p>
        tag_keys: <p>The keys of the tags to remove, 1–200 per request.</p>

    Raises:
        capo_context.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.</p>
        capo_context.errors.internal_server_exception.InternalServerException: <p>The request failed because of an internal error. Retry the request.</p>
        capo_context.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a request rate quota. Wait, then retry the request.</p>
        capo_context.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.</p>
        capo_context.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.</p>
        capo_context.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.</p>
        capo_context.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Remove a tag from a connection
        The following example removes the team tag from the connection conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b.

        >>> client.untag_resource(resource_arn='arn:aws:context:us-east-1:111122223333:connection/conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b', tag_keys=['team'])
    """

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

        output, http_response = (
            capo_context._operations.context.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_context.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