Skip to content

tag_resource async

tag_resource(
    resource_arn: ResourceArn,
    tags: Tags,
    *,
    config_overrides: Optional[AsyncBackupGatewayClientConfig] = None,
) -> TagResourceOutput

Tag the resource.

Parameters:

  • resource_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the resource to tag.

  • tags (Tags) –

    A list of tags to assign to the resource.

Raises:

Source code in docs_src/capo_backup_gateway/_services/async_backup_gateway.py
async def tag_resource(
    self,
    resource_arn: "capo_backup_gateway.types.resource_arn.ResourceArn",
    tags: "capo_backup_gateway.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncBackupGatewayClientConfig] = None,
) -> "capo_backup_gateway.types.tag_resource_output.TagResourceOutput":
    """<p>Tag the resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource to tag.</p>
        tags: <p>A list of tags to assign to the resource.</p>

    Raises:
        capo_backup_gateway.errors.internal_server_exception.InternalServerException: <p>The operation did not succeed because an internal error occurred. Try again later.</p>
        capo_backup_gateway.errors.throttling_exception.ThrottlingException: <p>TPS has been limited to protect against intentional or unintentional high request volumes.</p>
        capo_backup_gateway.errors.validation_exception.ValidationException: <p>The operation did not succeed because a validation error occurred.</p>
        capo_backup_gateway.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource that is required for the action wasn't found.</p>
        capo_backup_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup_gateway.types.tag_resource_input.TagResourceInput]",
    ) -> AsyncOperationResponse[
        "capo_backup_gateway.types.tag_resource_output.TagResourceOutput"
    ]:
        import capo_backup_gateway._operations.backup_on_premises_v20210101.tag_resource

        (
            output,
            http_response,
        ) = await capo_backup_gateway._operations.backup_on_premises_v20210101.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_backup_gateway.types.tag_resource_input.TagResourceInput = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output