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/async_odb.py
| async def tag_resource(
self,
resource_arn: "capo_odb.types.resource_arn.ResourceArn",
tags: "capo_odb.types.request_tag_map.RequestTagMap",
*,
config_overrides: Optional[AsyncodbClientConfig] = 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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_odb.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_odb.types.tag_resource_response.TagResourceResponse"
]:
import capo_odb._operations.odb.tag_resource
(
output,
http_response,
) = await capo_odb._operations.odb.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_odb.types.tag_resource_request.TagResourceRequest = {
"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
|