Adds or updates tags for a Region switch resource. You can assign metadata to your resources in the form of tags, which are key-value pairs.
Parameters:
-
arn
(PlanArn)
–
The Amazon Resource Name (ARN) for a tag that you add to a resource.
-
tags
(Tags)
–
Tags that you add to a resource. You can add a maximum of 50 tags in Region switch.
Raises:
Source code in docs_src/capo_arc_region_switch/_services/arc_regionswitch.py
| def tag_resource(
self,
arn: "capo_arc_region_switch.types.plan_arn.PlanArn",
tags: "capo_arc_region_switch.types.tags.Tags",
*,
config_overrides: Optional[ARCRegionswitchClientConfig] = None,
) -> "capo_arc_region_switch.types.tag_resource_response.TagResourceResponse":
"""<p>Adds or updates tags for a Region switch resource. You can assign metadata to your resources in the form of tags, which are key-value pairs.</p>
Args:
arn: <p>The Amazon Resource Name (ARN) for a tag that you add to a resource.</p>
tags: <p>Tags that you add to a resource. You can add a maximum of 50 tags in Region switch.</p>
Raises:
capo_arc_region_switch.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p> <p>HTTP Status Code: 500</p>
capo_arc_region_switch.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p> <p>HTTP Status Code: 404</p>
capo_arc_region_switch.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_arc_region_switch.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_arc_region_switch.types.tag_resource_response.TagResourceResponse"
]:
import capo_arc_region_switch._operations.arc_region_switch.tag_resource
output, http_response = (
capo_arc_region_switch._operations.arc_region_switch.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_arc_region_switch.types.tag_resource_request.TagResourceRequest = {
"arn": arn,
"tags": tags,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|