Skip to main content

r2_catalog_maintenance_configs

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

Overview

Namer2_catalog_maintenance_configs
TypeResource
Idcloudflare.r2_data_catalog.r2_catalog_maintenance_configs

Fields

The following fields are returned by SELECT queries:

Maintenance configuration retrieved successfully.

NameDatatypeDescription
credential_statusstringShows the credential configuration status. (present, absent) (example: present)
maintenance_configobjectConfigures maintenance for the catalog.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_accountselectaccount_id, bucket_nameRetrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.
update_by_accountinsertaccount_id, bucket_nameUpdate the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.

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
account_idstringThe Cloudflare account ID.
bucket_namestringThe R2 bucket name.

SELECT examples

Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.

SELECT
credential_status,
maintenance_config
FROM cloudflare.r2_data_catalog.r2_catalog_maintenance_configs
WHERE account_id = '{{ account_id }}' -- required
AND bucket_name = '{{ bucket_name }}' -- required
;

INSERT examples

Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.

INSERT INTO cloudflare.r2_data_catalog.r2_catalog_maintenance_configs (
compaction,
snapshot_expiration,
account_id,
bucket_name
)
SELECT
'{{ compaction }}',
'{{ snapshot_expiration }}',
'{{ account_id }}',
'{{ bucket_name }}'
RETURNING
errors,
messages,
result,
success
;