Skip to content

untag_resource

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

Removes a tag or set of tags from an OpenSearch Serverless resource. For more information, see Tagging Amazon OpenSearch Serverless collections.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the resource to remove tags from. The resource must be active (not in the DELETING state), and must be owned by the account ID included in the request.

  • tag_keys (TagKeys) –

    The tag or set of tags to remove from the resource. All tag keys in the request must be unique.

Raises:

  • ConflictException –

    When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.

  • InternalServerException –

    Thrown when an error internal to the service occurs while processing a request.

  • ResourceNotFoundException –

    Thrown when accessing or deleting a resource that does not exist.

  • ValidationException –

    Thrown when the HTTP request contains invalid input or is missing required input.

  • UnknownServiceError –

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

Source code in docs_src/capo_opensearchserverless/_services/open_search_serverless.py
def untag_resource(
    self,
    resource_arn: "capo_opensearchserverless.types.arn.Arn",
    tag_keys: "capo_opensearchserverless.types.tag_keys.TagKeys",
    *,
    config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
) -> (
    "capo_opensearchserverless.types.untag_resource_response.UntagResourceResponse"
):
    """<p>Removes a tag or set of tags from an OpenSearch Serverless resource. For more information, see <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-collection.html">Tagging Amazon OpenSearch Serverless collections</a>.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource to remove tags from. The resource must be active (not in the <code>DELETING</code> state), and must be owned by the account ID included in the request.</p>
        tag_keys: <p>The tag or set of tags to remove from the resource. All tag keys in the request must be unique.</p>

    Raises:
        capo_opensearchserverless.errors.conflict_exception.ConflictException: <p>When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.</p>
        capo_opensearchserverless.errors.internal_server_exception.InternalServerException: <p>Thrown when an error internal to the service occurs while processing a request.</p>
        capo_opensearchserverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>Thrown when accessing or deleting a resource that does not exist.</p>
        capo_opensearchserverless.errors.validation_exception.ValidationException: <p>Thrown when the HTTP request contains invalid input or is missing required input.</p>
        capo_opensearchserverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_opensearchserverless._operations.open_search_serverless.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_opensearchserverless.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