Tags an AWS TNB resource.
A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value. You can use tags to search and filter your resources or track your Amazon Web Services costs.
Parameters:
-
resource_arn
(TNBResourceArn)
–
-
tags
(TagMap)
–
A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value. You can use tags to search and filter your resources or track your Amazon Web Services costs.
Raises:
Source code in docs_src/capo_tnb/_services/async_tnb.py
| async def tag_resource(
self,
resource_arn: "capo_tnb.types.tnb_resource_arn.TNBResourceArn",
tags: "capo_tnb.types.tag_map.TagMap",
*,
config_overrides: Optional[AsynctnbClientConfig] = None,
) -> "capo_tnb.types.tag_resource_output.TagResourceOutput":
"""<p>Tags an AWS TNB resource.</p> <p>A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value. You can use tags to search and filter your resources or track your Amazon Web Services costs.</p>
Args:
resource_arn: <p>Resource ARN.</p>
tags: <p>A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value. You can use tags to search and filter your resources or track your Amazon Web Services costs.</p>
Raises:
capo_tnb.errors.access_denied_exception.AccessDeniedException: <p>Insufficient permissions to make request.</p>
capo_tnb.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred. Problem on the server.</p>
capo_tnb.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource that doesn't exist.</p>
capo_tnb.errors.throttling_exception.ThrottlingException: <p>Exception caused by throttling.</p>
capo_tnb.errors.validation_exception.ValidationException: <p>Unable to process the request because the client provided input failed to satisfy request constraints.</p>
capo_tnb.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_tnb.types.tag_resource_input.TagResourceInput]",
) -> AsyncOperationResponse[
"capo_tnb.types.tag_resource_output.TagResourceOutput"
]:
import capo_tnb._operations.tnb.tag_resource
(
output,
http_response,
) = await capo_tnb._operations.tnb.tag_resource.async_tag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_tnb.types.tag_resource_input.TagResourceInput",
) -> dict[str, Any]:
import capo_tnb.types.tag_resource_input
return capo_tnb.types.tag_resource_input.redact_sensitive(input_)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("TagResource", redact_input=_redact_input),
)
input_: capo_tnb.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
|