Skip to main content

backup_configurations

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

Overview​

Namebackup_configurations
TypeResource
Idclickhouse.backups.backup_configurations

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
backup_period_in_hoursnumberThe interval in hours between each backup. (wire: backupPeriodInHours)
backup_retention_period_in_hoursnumberThe 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_timestringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_id, organization_idReturns the service backup configuration.
updateupdateservice_id, organization_idUpdates 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.

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)
service_idstring (uuid)ID of the service. (wire: serviceId)

SELECT examples​

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​

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;