Skip to main content

quotas

Creates, updates, deletes, gets or lists a quotas resource.

Overview

Namequotas
TypeResource
Idclickhouse.organizations.quotas

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringHuman-readable name of the quota. (example: Services per organization)
adjustablebooleanWhether the limit can be raised for the organization by contacting ClickHouse support.
descriptionstringExplanation of the resource the quota limits and how the limit is applied.
quota_codestringStable identifier of the quota. Use it to request a single quota by code. (services-per-organization, postgres-services-per-organization, replicas-per-warehouse, api-keys-per-organization) (example: services-per-organization) (wire: quotaCode)
scopestringGranularity at which the limit is applied. For example, replicas-per-warehouse is an organization-wide setting that limits each warehouse individually. (organization, warehouse) (example: organization)
usageintegerCurrent consumption of the quota. Omitted for quotas that do not report usage. Usage can exceed value when a limit was lowered after resources were created; existing resources are not affected.
valueintegerLimit currently applied to the organization, including any adjustments made for the organization. The value can change when the billing status of the organization changes.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectquota_code, organization_idDisclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Returns a single organization quota identified by its quota code. Responds with a not found error when the quota code is unknown or the quota does not apply to the organization.
listselectorganization_idDisclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Returns the resource quotas enforced for the organization together with their current usage where available. Quotas that do not apply to the organization are omitted. Quota values reflect the limits currently enforced, so they can be polled to detect changes, for example after a billing status change. The response contains one entry per quota code; quotas enforced per resource may additionally appear under resource-scoped endpoints in the future.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
organization_idstringClickHouse Cloud organization ID. Resolved from the CLICKHOUSE_ORG_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every query as WHERE organization_id = <uuid>. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: CLICKHOUSE_ORG_ID)
quota_codestringCode of the requested quota. (wire: quotaCode)

SELECT examples

Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Returns a single organization quota identified by its quota code. Responds with a not found error when the quota code is unknown or the quota does not apply to the organization.

SELECT
name,
adjustable,
description,
quota_code,
scope,
usage,
value
FROM clickhouse.organizations.quotas
WHERE quota_code = '{{ quota_code }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;