Applies tags to the specified resource.
Parameters:
-
resource_arn
(ResourceArn)
–
The Amazon Resource Name (ARN) of the resource to apply tags to.
-
tags
(RequestTagMap)
–
The list of tags to apply to the resource.
Raises:
Source code in docs_src/capo_odb/_services/odb.py
| def tag_resource(
self,
resource_arn: "capo_odb.types.resource_arn.ResourceArn",
tags: "capo_odb.types.request_tag_map.RequestTagMap",
*,
config_overrides: Optional[odbClientConfig] = None,
) -> "capo_odb.types.tag_resource_response.TagResourceResponse":
"""<p>Applies tags to the specified resource.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource to apply tags to.</p>
tags: <p>The list of tags to apply to the resource.</p>
Raises:
capo_odb.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a resource that doesn't exist. Make sure you provided the correct resource and try again.</p>
capo_odb.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded the service quota.</p>
capo_odb.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_odb.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_odb.types.tag_resource_response.TagResourceResponse"
]:
import capo_odb._operations.odb.tag_resource
output, http_response = capo_odb._operations.odb.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_odb.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
|