backup_buckets
Creates, updates, deletes, gets or lists a backup_buckets resource.
Overview
| Name | backup_buckets |
| Type | Resource |
| Id | clickhouse.backups.backup_buckets |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique backup bucket ID |
access_key_id | string | Access Key ID (HMAC key) (wire: accessKeyId) |
container_name | string | Container Name (wire: containerName) |
iam_role_session_name | string | AWS Role session name (wire: iamRoleSessionName) |
bucket_path | string | Bucket path (wire: bucketPath) |
bucket_provider | string | Bucket provider (AWS) (wire: bucketProvider) |
iam_role_arn | string | AWS Role ARN (wire: iamRoleArn) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_id, organization_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Returns the service backup bucket. | |
create | insert | service_id, organization_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Create service backup bucket. Requires ADMIN auth key role. | |
update | update | service_id, organization_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Update service backup bucket. Requires ADMIN auth key role. The secrets of the specified bucket provider are always required | |
delete | delete | service_id, organization_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Delete service backup bucket. Requires ADMIN auth key role. |
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 requested service. (wire: serviceId) |
SELECT examples
- get
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Returns the service backup bucket.
SELECT
id,
access_key_id,
container_name,
iam_role_session_name,
bucket_path,
bucket_provider,
iam_role_arn
FROM clickhouse.backups.backup_buckets
WHERE service_id = '{{ service_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
INSERT examples
- create
- Manifest
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Create service backup bucket. Requires ADMIN auth key role.
INSERT INTO clickhouse.backups.backup_buckets (
bucket_provider,
bucket_path,
iam_role_arn,
iam_role_session_name,
access_key_id,
secret_access_key,
container_name,
connection_string,
service_id,
organization_id
)
SELECT
'{{ bucket_provider }}',
'{{ bucket_path }}',
'{{ iam_role_arn }}',
'{{ iam_role_session_name }}',
'{{ access_key_id }}',
'{{ secret_access_key }}',
'{{ container_name }}',
'{{ connection_string }}',
'{{ service_id }}',
'{{ organization_id }}'
RETURNING
request_id,
result,
status
;
# Description fields are for documentation purposes
- name: backup_buckets
props:
- name: service_id
value: "{{ service_id }}"
description: Required parameter for the backup_buckets resource.
- name: organization_id
value: "{{ organization_id }}"
description: Required parameter for the backup_buckets resource.
- name: bucket_provider
value: "{{ bucket_provider }}"
description: |
Bucket provider
valid_values: ['AWS']
- name: bucket_path
value: "{{ bucket_path }}"
description: |
Bucket path
- name: iam_role_arn
value: "{{ iam_role_arn }}"
description: |
AWS Role ARN
- name: iam_role_session_name
value: "{{ iam_role_session_name }}"
description: |
AWS Role session name
- name: access_key_id
value: "{{ access_key_id }}"
description: |
Access Key ID (HMAC key)
- name: secret_access_key
value: "{{ secret_access_key }}"
description: |
Secret Access Key (HMAC secret key)
- name: container_name
value: "{{ container_name }}"
description: |
Container Name
- name: connection_string
value: "{{ connection_string }}"
description: |
Connection String
UPDATE examples
- update
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Update service backup bucket. Requires ADMIN auth key role. The secrets of the specified bucket provider are always required
UPDATE clickhouse.backups.backup_buckets
SET
bucket_provider = '{{ bucket_provider }}',
bucket_path = '{{ bucket_path }}',
iam_role_arn = '{{ iam_role_arn }}',
iam_role_session_name = '{{ iam_role_session_name }}',
access_key_id = '{{ access_key_id }}',
secret_access_key = '{{ secret_access_key }}',
container_name = '{{ container_name }}',
connection_string = '{{ connection_string }}'
WHERE
service_id = '{{ service_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
RETURNING
request_id,
result,
status;
DELETE examples
- delete
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Delete service backup bucket. Requires ADMIN auth key role.
DELETE FROM clickhouse.backups.backup_buckets
WHERE service_id = '{{ service_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
;