Skip to main content

backup_buckets

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

Overview

Namebackup_buckets
TypeResource
Idclickhouse.backups.backup_buckets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uuid)Unique backup bucket ID
access_key_idstringAccess Key ID (HMAC key) (wire: accessKeyId)
container_namestringContainer Name (wire: containerName)
iam_role_session_namestringAWS Role session name (wire: iamRoleSessionName)
bucket_pathstringBucket path (wire: bucketPath)
bucket_providerstringBucket provider (AWS) (wire: bucketProvider)
iam_role_arnstringAWS Role ARN (wire: iamRoleArn)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_id, organization_idThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Returns the service backup bucket.
createinsertservice_id, organization_idThis 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.
updateupdateservice_id, organization_idThis 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
deletedeleteservice_id, organization_idThis 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.

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 requested service. (wire: serviceId)

SELECT examples

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

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
;

UPDATE examples

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

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
;