Skip to content

add_tags

add_tags(
    arn: ARN,
    tag_list: TagList,
    *,
    config_overrides: Optional[ElasticsearchServiceClientConfig] = None,
) -> None

Attaches tags to an existing Elasticsearch domain. Tags are a set of case-sensitive key value pairs. An Elasticsearch domain may have up to 10 tags. See Tagging Amazon Elasticsearch Service Domains for more information.

Parameters:

  • arn (ARN) –

    Specify the ARN for which you want to add the tags.

  • tag_list (TagList) –

    List of Tag that need to be added for the Elasticsearch domain.

Raises:

  • BaseException –

    An error occurred while processing the request.

  • InternalException –

    The request processing has failed because of an unknown error, exception or failure (the failure is internal to the service) . Gives http status code of 500.

  • LimitExceededException –

    An exception for trying to create more than allowed resources or sub-resources. Gives http status code of 409.

  • ValidationException –

    An exception for missing / invalid input fields. Gives http status code of 400.

  • UnknownServiceError –

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

Source code in docs_src/capo_elasticsearch_service/_services/elasticsearch_service.py
def add_tags(
    self,
    arn: "capo_elasticsearch_service.types.arn.ARN",
    tag_list: "capo_elasticsearch_service.types.tag_list.TagList",
    *,
    config_overrides: Optional[ElasticsearchServiceClientConfig] = None,
) -> None:
    """<p>Attaches tags to an existing Elasticsearch domain. Tags are a set of case-sensitive key value pairs. An Elasticsearch domain may have up to 10 tags. See <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-awsresorcetagging" target="_blank"> Tagging Amazon Elasticsearch Service Domains for more information.</a></p>

    Args:
        arn: <p> Specify the <code>ARN</code> for which you want to add the tags.</p>
        tag_list: <p> List of <code>Tag</code> that need to be added for the Elasticsearch domain. </p>

    Raises:
        capo_elasticsearch_service.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_elasticsearch_service.errors.internal_exception.InternalException: <p>The request processing has failed because of an unknown error, exception or failure (the failure is internal to the service) . Gives http status code of 500.</p>
        capo_elasticsearch_service.errors.limit_exceeded_exception.LimitExceededException: <p>An exception for trying to create more than allowed resources or sub-resources. Gives http status code of 409.</p>
        capo_elasticsearch_service.errors.validation_exception.ValidationException: <p>An exception for missing / invalid input fields. Gives http status code of 400.</p>
        capo_elasticsearch_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_elasticsearch_service.types.add_tags_request.AddTagsRequest]",
    ) -> OperationResponse[None]:
        import capo_elasticsearch_service._operations.amazon_elasticsearch_service2015.add_tags

        output, http_response = (
            capo_elasticsearch_service._operations.amazon_elasticsearch_service2015.add_tags.add_tags(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AddTags")
    )
    input_: capo_elasticsearch_service.types.add_tags_request.AddTagsRequest = {
        "arn": arn,
        "tag_list": tag_list,
    }

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