Skip to content

untag_resource async

untag_resource(
    resource_arn: str,
    tag_keys: TagKeys,
    *,
    config_overrides: Optional[AsyncampClientConfig] = None,
) -> UntagResourceResponse

Removes the specified tags from an Amazon Managed Service for Prometheus resource. The only resources that can be tagged are rule groups namespaces, scrapers, and workspaces.

Parameters:

  • resource_arn (str) –

    The ARN of the resource from which to remove a tag.

  • tag_keys (TagKeys) –

    The keys of the tags to remove.

Raises:

Source code in docs_src/capo_amp/_services/async_amp.py
async def untag_resource(
    self,
    resource_arn: str,
    tag_keys: "capo_amp.types.tag_keys.TagKeys",
    *,
    config_overrides: Optional[AsyncampClientConfig] = None,
) -> "capo_amp.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes the specified tags from an Amazon Managed Service for Prometheus resource. The only resources that can be tagged are rule groups namespaces, scrapers, and workspaces. </p>

    Args:
        resource_arn: <p>The ARN of the resource from which to remove a tag.</p>
        tag_keys: <p>The keys of the tags to remove.</p>

    Raises:
        capo_amp.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_amp.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_amp.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resources that doesn't exist.</p>
        capo_amp.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_amp.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_amp.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amp.types.untag_resource_request.UntagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_amp.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_amp._operations.amazon_prometheus_service.untag_resource

        (
            output,
            http_response,
        ) = await capo_amp._operations.amazon_prometheus_service.untag_resource.async_untag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UntagResource")
    )
    input_: capo_amp.types.untag_resource_request.UntagResourceRequest = {
        "resource_arn": resource_arn,
        "tag_keys": tag_keys,
    }

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