Adds or updates tags on the specified resource.
Parameters:
-
resource_arn
(TaggableResourceArn)
–
The Amazon Resource Name (ARN) of the resource.
-
tags
(AwsTagMap)
–
The tags to add or update on the resource.
Raises:
Source code in docs_src/capo_backup_external/_services/backup_external.py
| def tag_resource(
self,
resource_arn: "capo_backup_external.types.taggable_resource_arn.TaggableResourceArn",
tags: "capo_backup_external.types.aws_tag_map.AwsTagMap",
*,
config_overrides: Optional[BackupExternalClientConfig] = None,
) -> "capo_backup_external.types.tag_resource_output.TagResourceOutput":
"""Adds or updates tags on the specified resource.
Args:
resource_arn: The Amazon Resource Name (ARN) of the resource.
tags: The tags to add or update on the resource.
Raises:
capo_backup_external.errors.access_denied_exception.AccessDeniedException: The request was denied because you do not have permission to perform the requested operation.
capo_backup_external.errors.conflict_exception.ConflictException: The request conflicts with the current state of the specified resource.
capo_backup_external.errors.internal_server_exception.InternalServerException: The request failed because of an internal server error.
capo_backup_external.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource was not found.
capo_backup_external.errors.throttling_exception.ThrottlingException: The request was denied because the request rate is too high.
capo_backup_external.errors.validation_exception.ValidationException: The request contains invalid parameters.
capo_backup_external.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: The request would exceed a service quota.
capo_backup_external.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_backup_external.types.tag_resource_input.TagResourceInput]",
) -> OperationResponse[
"capo_backup_external.types.tag_resource_output.TagResourceOutput"
]:
import capo_backup_external._operations.backup_external.tag_resource
output, http_response = (
capo_backup_external._operations.backup_external.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_backup_external.types.tag_resource_input.TagResourceInput = {
"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
|