Add tags to an accelerator resource.
For more information, see Tagging in Global Accelerator in the Global Accelerator Developer Guide.
Parameters:
-
resource_arn
(ResourceArn)
–
The Amazon Resource Name (ARN) of the Global Accelerator resource to add tags to. An ARN uniquely identifies a resource.
-
tags
(Tags)
–
The tags to add to a resource. A tag consists of a key and a value that you define.
Raises:
Source code in docs_src/capo_global_accelerator/_services/async_global_accelerator.py
| async def tag_resource(
self,
resource_arn: "capo_global_accelerator.types.resource_arn.ResourceArn",
tags: "capo_global_accelerator.types.tags.Tags",
*,
config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
) -> "capo_global_accelerator.types.tag_resource_response.TagResourceResponse":
"""<p>Add tags to an accelerator resource. </p> <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>. </p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the Global Accelerator resource to add tags to. An ARN uniquely identifies a resource.</p>
tags: <p>The tags to add to a resource. A tag consists of a key and a value that you define.</p>
Raises:
capo_global_accelerator.errors.accelerator_not_found_exception.AcceleratorNotFoundException: <p>The accelerator that you specified doesn't exist.</p>
capo_global_accelerator.errors.internal_service_error_exception.InternalServiceErrorException: <p>There was an internal error for Global Accelerator.</p>
capo_global_accelerator.errors.invalid_argument_exception.InvalidArgumentException: <p>An argument that you specified is invalid.</p>
capo_global_accelerator.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_global_accelerator.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_global_accelerator.types.tag_resource_response.TagResourceResponse"
]:
import capo_global_accelerator._operations.global_accelerator_v20180706.tag_resource
(
output,
http_response,
) = await capo_global_accelerator._operations.global_accelerator_v20180706.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_global_accelerator.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
|