Skip to content

tag_resource async

tag_resource(
    resource_arn: GlueResourceArn,
    tags_to_add: TagsMap,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
) -> TagResourceResponse

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:

  • resource_arn (GlueResourceArn) –

    The ARN of the Glue resource to which to add the tags. For more information about Glue resource ARNs, see the Glue ARN string pattern.

  • tags_to_add (TagsMap) –

    Tags to add to this resource.

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async 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[AsyncGlueClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_glue._operations.aws_glue.tag_resource

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.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_glue.types.tag_resource_request.TagResourceRequest = {
        "resource_arn": resource_arn,
        "tags_to_add": tags_to_add,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output