r2_catalog_maintenance_configs
Creates, updates, deletes, gets or lists a r2_catalog_maintenance_configs resource.
Overview
| Name | r2_catalog_maintenance_configs |
| Type | Resource |
| Id | cloudflare.r2_data_catalog.r2_catalog_maintenance_configs |
Fields
The following fields are returned by SELECT queries:
- list_by_account
Maintenance configuration retrieved successfully.
| Name | Datatype | Description |
|---|---|---|
credential_status | string | Shows the credential configuration status. (present, absent) (example: present) |
maintenance_config | object | Configures maintenance for the catalog. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_by_account | select | account_id, bucket_name | Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status. | |
update_by_account | insert | account_id, bucket_name | Update 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
bucket_name | string | The R2 bucket name. |
SELECT examples
- list_by_account
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_by_account
- Manifest
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
;
# Description fields are for documentation purposes
- name: r2_catalog_maintenance_configs
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the r2_catalog_maintenance_configs resource.
- name: bucket_name
value: "{{ bucket_name }}"
description: Required parameter for the r2_catalog_maintenance_configs resource.
- name: compaction
description: |
Updates compaction configuration (all fields optional).
value:
state: "{{ state }}"
target_size_mb: "{{ target_size_mb }}"
- name: snapshot_expiration
description: |
Updates snapshot expiration configuration (all fields optional).
value:
max_snapshot_age: "{{ max_snapshot_age }}"
min_snapshots_to_keep: {{ min_snapshots_to_keep }}
state: "{{ state }}"