backups
Creates, updates, deletes, gets or lists a backups resource.
Overview​
| Name | backups |
| Type | Resource |
| Id | clickhouse.backups.backups |
Fields​
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique backup ID. |
service_id | string | Name (wire: serviceId) |
backup_name | string | Backup name on the external backup bucket. (wire: backupName) |
bucket | object | Backup bucket where the backup is stored. |
duration_in_seconds | number | Time in seconds it took to perform the backup. If the status still in_progress, this is the time in seconds since the backup started until now. (wire: durationInSeconds) |
finished_at | string (date-time) | Backup finish timestamp. ISO-8601. Available only for finished backups (wire: finishedAt) |
size_in_bytes | number | Size of the backup in bytes. (wire: sizeInBytes) |
started_at | string (date-time) | Backup start timestamp. ISO-8601. (wire: startedAt) |
status | string | Status of the backup: 'done', 'error', 'in_progress'. (done, error, in_progress) |
type | string | Backup type ("full" or "incremental"). (full, incremental) |
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique backup ID. |
service_id | string | Name (wire: serviceId) |
backup_name | string | Backup name on the external backup bucket. (wire: backupName) |
bucket | object | Backup bucket where the backup is stored. |
duration_in_seconds | number | Time in seconds it took to perform the backup. If the status still in_progress, this is the time in seconds since the backup started until now. (wire: durationInSeconds) |
finished_at | string (date-time) | Backup finish timestamp. ISO-8601. Available only for finished backups (wire: finishedAt) |
size_in_bytes | number | Size of the backup in bytes. (wire: sizeInBytes) |
started_at | string (date-time) | Backup start timestamp. ISO-8601. (wire: startedAt) |
status | string | Status of the backup: 'done', 'error', 'in_progress'. (done, error, in_progress) |
type | string | Backup type ("full" or "incremental"). (full, incremental) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_id, backup_id, organization_id | Returns a single backup info. | |
list | select | service_id, organization_id | Returns a list of all backups for the service. The most recent backups comes first in the list. |
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 |
|---|---|---|
backup_id | string (uuid) | ID of the requested backup. (wire: backupId) |
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 the backup was created from. (wire: serviceId) |
SELECT examples​
- get
- list
Returns a single backup info.
SELECT
id,
service_id,
backup_name,
bucket,
duration_in_seconds,
finished_at,
size_in_bytes,
started_at,
status,
type
FROM clickhouse.backups.backups
WHERE service_id = '{{ service_id }}' -- required
AND backup_id = '{{ backup_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
Returns a list of all backups for the service. The most recent backups comes first in the list.
SELECT
id,
service_id,
backup_name,
bucket,
duration_in_seconds,
finished_at,
size_in_bytes,
started_at,
status,
type
FROM clickhouse.backups.backups
WHERE service_id = '{{ service_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;