backup_configurations
Creates, updates, deletes, gets or lists a backup_configurations resource.
Overview
| Name | backup_configurations |
| Type | Resource |
| Id | clickhouse.backups.backup_configurations |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
backup_period_in_hours | number | The interval in hours between each backup. (wire: backupPeriodInHours) |
backup_retention_period_in_hours | number | The minimum duration in hours for which the backups are available. Must be a whole number of days between 24 (1 day) and 1080 (45 days) — i.e. a multiple of 24. (wire: backupRetentionPeriodInHours) |
backup_start_time | string | The time in HH:MM format for the backups to be performed (evaluated in UTC timezone). When defined the backup period resets to every 24 hours. (wire: backupStartTime) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_id, organization_id | Returns the service backup configuration. | |
update | update | service_id, organization_id | Updates service backup configuration. Requires ADMIN auth key role. Setting the properties with null value, will reset the properties to theirs default values. |
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.
| Name | Datatype | Description |
|---|---|---|
organization_id | string | ClickHouse 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) |
service_id | string (uuid) | ID of the service. (wire: serviceId) |
SELECT examples
- get
Returns the service backup configuration.
SELECT
backup_period_in_hours,
backup_retention_period_in_hours,
backup_start_time
FROM clickhouse.backups.backup_configurations
WHERE service_id = '{{ service_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
UPDATE examples
- update
Updates service backup configuration. Requires ADMIN auth key role. Setting the properties with null value, will reset the properties to theirs default values.
UPDATE clickhouse.backups.backup_configurations
SET
backup_period_in_hours = {{ backup_period_in_hours }},
backup_retention_period_in_hours = {{ backup_retention_period_in_hours }},
backup_start_time = '{{ backup_start_time }}'
WHERE
service_id = '{{ service_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
RETURNING
request_id,
result,
status;