Skip to content

tag_resource async

tag_resource(
    resource_arn: AmazonResourceArn,
    tags: TagList,
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
) -> TagResourceResponse

Associates a given tag to a resource in your account. A tag is a key-value pair which can be added to an Amazon Lookout for Equipment resource as metadata. Tags can be used for organizing your resources as well as helping you to search and filter by tag. Multiple tags can be added to a resource, either when you create it, or later. Up to 50 tags can be associated with each resource.

Parameters:

  • resource_arn (AmazonResourceArn) –

    The Amazon Resource Name (ARN) of the specific resource to which the tag should be associated.

  • tags (TagList) –

    The tag or tags to be associated with a specific resource. Both the tag key and value are specified.

Raises:

Source code in docs_src/capo_lookoutequipment/_services/async_lookout_equipment.py
async def tag_resource(
    self,
    resource_arn: "capo_lookoutequipment.types.amazon_resource_arn.AmazonResourceArn",
    tags: "capo_lookoutequipment.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
) -> "capo_lookoutequipment.types.tag_resource_response.TagResourceResponse":
    """<p>Associates a given tag to a resource in your account. A tag is a key-value pair which can be added to an Amazon Lookout for Equipment resource as metadata. Tags can be used for organizing your resources as well as helping you to search and filter by tag. Multiple tags can be added to a resource, either when you create it, or later. Up to 50 tags can be associated with each resource. </p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the specific resource to which the tag should be associated. </p>
        tags: <p>The tag or tags to be associated with a specific resource. Both the tag key and value are specified. </p>

    Raises:
        capo_lookoutequipment.errors.access_denied_exception.AccessDeniedException: <p>The request could not be completed because you do not have access to the resource. </p>
        capo_lookoutequipment.errors.internal_server_exception.InternalServerException: <p> Processing of the request has failed because of an unknown error, exception or failure. </p>
        capo_lookoutequipment.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource requested could not be found. Verify the resource ID and retry your request. </p>
        capo_lookoutequipment.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> Resource limitations have been exceeded. </p>
        capo_lookoutequipment.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_lookoutequipment.errors.validation_exception.ValidationException: <p> The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized. </p>
        capo_lookoutequipment.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.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_lookoutequipment.types.tag_resource_request.TagResourceRequest = {
        "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