Skip to content

tag_resource async

tag_resource(
    resource_arn: AmazonResourceName,
    tags: InputTags,
    *,
    config_overrides: Optional[AsyncServiceQuotasClientConfig] = None,
) -> TagResourceResponse

Adds tags to the specified applied quota. You can include one or more tags to add to the quota.

Parameters:

  • resource_arn (AmazonResourceName) –

    The Amazon Resource Name (ARN) for the applied quota. You can get this information by using the Service Quotas console, or by listing the quotas using the list-service-quotas CLI command or the ListServiceQuotas Amazon Web Services API operation.

  • tags (InputTags) –

    The tags that you want to add to the resource.

Raises:

Source code in docs_src/capo_service_quotas/_services/async_service_quotas.py
async def tag_resource(
    self,
    resource_arn: "capo_service_quotas.types.amazon_resource_name.AmazonResourceName",
    tags: "capo_service_quotas.types.input_tags.InputTags",
    *,
    config_overrides: Optional[AsyncServiceQuotasClientConfig] = None,
) -> "capo_service_quotas.types.tag_resource_response.TagResourceResponse":
    """<p>Adds tags to the specified applied quota. You can include one or more tags to add to the quota.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) for the applied quota. You can get this information by using the Service Quotas console, or by listing the quotas using the <a href="https://docs.aws.amazon.com/cli/latest/reference/service-quotas/list-service-quotas.html">list-service-quotas</a> CLI command or the <a href="https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html">ListServiceQuotas</a> Amazon Web Services API operation.</p>
        tags: <p>The tags that you want to add to the resource.</p>

    Raises:
        capo_service_quotas.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permission to perform this action.</p>
        capo_service_quotas.errors.illegal_argument_exception.IllegalArgumentException: <p>Invalid input was provided.</p>
        capo_service_quotas.errors.no_such_resource_exception.NoSuchResourceException: <p>The specified resource does not exist.</p>
        capo_service_quotas.errors.service_exception.ServiceException: <p>Something went wrong.</p>
        capo_service_quotas.errors.tag_policy_violation_exception.TagPolicyViolationException: <p>The specified tag is a reserved word and cannot be used.</p>
        capo_service_quotas.errors.too_many_requests_exception.TooManyRequestsException: <p>Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase for this quota.</p>
        capo_service_quotas.errors.too_many_tags_exception.TooManyTagsException: <p>You've exceeded the number of tags allowed for a resource. For more information, see <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/sq-tagging.html#sq-tagging-restrictions">Tag restrictions</a> in the <i>Service Quotas User Guide</i>.</p>
        capo_service_quotas.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_service_quotas._operations.service_quotas_v20190624.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_service_quotas.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