Adds tags to a resource. A tag is a label you can assign to an Amazon Web Services resource. In Glue, you can tag only certain resources. For information about what resources you can tag, see Amazon Web Services Tags in Glue.
Parameters:
Raises:
Source code in docs_src/capo_glue/_services/glue.py
| def tag_resource(
self,
resource_arn: "capo_glue.types.glue_resource_arn.GlueResourceArn",
tags_to_add: "capo_glue.types.tags_map.TagsMap",
*,
config_overrides: Optional[GlueClientConfig] = None,
) -> "capo_glue.types.tag_resource_response.TagResourceResponse":
"""<p>Adds tags to a resource. A tag is a label you can assign to an Amazon Web Services resource. In Glue, you can tag only certain resources. For information about what resources you can tag, see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">Amazon Web Services Tags in Glue</a>.</p>
Args:
resource_arn: <p>The ARN of the Glue resource to which to add the tags. For more information about Glue resource ARNs, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-common.html#aws-glue-api-regex-aws-glue-arn-id">Glue ARN string pattern</a>.</p>
tags_to_add: <p>Tags to add to this resource.</p>
Raises:
capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_glue.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_glue.types.tag_resource_response.TagResourceResponse"
]:
import capo_glue._operations.aws_glue.tag_resource
output, http_response = (
capo_glue._operations.aws_glue.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_glue.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn,
"tags_to_add": tags_to_add,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|