Adds a tag to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor. You can add a maximum of 50 tags in Internet Monitor.
A minimum of one tag is required for this call. It returns an error if you use the TagResource request with 0 tags.
Parameters:
-
resource_arn
(MonitorArn)
–
The Amazon Resource Name (ARN) for a tag that you add to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.
-
tags
(TagMap)
–
Tags that you add to a resource. You can add a maximum of 50 tags in Internet Monitor.
Raises:
Source code in docs_src/capo_internetmonitor/_services/async_internet_monitor.py
| async def tag_resource(
self,
resource_arn: "capo_internetmonitor.types.monitor_arn.MonitorArn",
tags: "capo_internetmonitor.types.tag_map.TagMap",
*,
config_overrides: Optional[AsyncInternetMonitorClientConfig] = None,
) -> "capo_internetmonitor.types.tag_resource_output.TagResourceOutput":
"""<p>Adds a tag to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor. You can add a maximum of 50 tags in Internet Monitor.</p> <p>A minimum of one tag is required for this call. It returns an error if you use the <code>TagResource</code> request with 0 tags.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) for a tag that you add to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.</p>
tags: <p>Tags that you add to a resource. You can add a maximum of 50 tags in Internet Monitor.</p>
Raises:
capo_internetmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
capo_internetmonitor.errors.bad_request_exception.BadRequestException: <p>A bad request was received.</p>
capo_internetmonitor.errors.internal_server_error_exception.InternalServerErrorException: <p>There was an internal server error.</p>
capo_internetmonitor.errors.not_found_exception.NotFoundException: <p>The request specifies something that doesn't exist.</p>
capo_internetmonitor.errors.too_many_requests_exception.TooManyRequestsException: <p>There were too many requests.</p>
capo_internetmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_internetmonitor.types.tag_resource_input.TagResourceInput]",
) -> AsyncOperationResponse[
"capo_internetmonitor.types.tag_resource_output.TagResourceOutput"
]:
import capo_internetmonitor._operations.internet_monitor20210603.tag_resource
(
output,
http_response,
) = await capo_internetmonitor._operations.internet_monitor20210603.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_internetmonitor.types.tag_resource_input.TagResourceInput = {
"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
|