Skip to content

tag_resource

tag_resource(
    resource_arn: str,
    tags: TagMap,
    *,
    config_overrides: Optional[BackupSearchClientConfig] = None,
) -> TagResourceResponse

This operation puts tags on the resource you indicate.

Parameters:

  • resource_arn (str) –

    The Amazon Resource Name (ARN) that uniquely identifies the resource.

    This is the resource that will have the indicated tags.

  • tags (TagMap) –

    Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

Raises:

Source code in docs_src/capo_backupsearch/_services/backup_search.py
def tag_resource(
    self,
    resource_arn: str,
    tags: "capo_backupsearch.types.tag_map.TagMap",
    *,
    config_overrides: Optional[BackupSearchClientConfig] = None,
) -> "capo_backupsearch.types.tag_resource_response.TagResourceResponse":
    """<p>This operation puts tags on the resource you indicate.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) that uniquely identifies the resource.</p> <p>This is the resource that will have the indicated tags.</p>
        tags: <p>Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /. </p>

    Raises:
        capo_backupsearch.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_backupsearch.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_backupsearch.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_backupsearch.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_backupsearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found for this request.</p> <p>Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.</p>
        capo_backupsearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_backupsearch.types.tag_resource_request.TagResourceRequest]",
    ) -> OperationResponse[
        "capo_backupsearch.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_backupsearch._operations.cryo_backup_search_service.tag_resource

        output, http_response = (
            capo_backupsearch._operations.cryo_backup_search_service.tag_resource.tag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_backupsearch.types.tag_resource_request.TagResourceRequest = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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