local_uploads
Creates, updates, deletes, gets or lists a local_uploads resource.
Overview
| Name | local_uploads |
| Type | Resource |
| Id | cloudflare.r2.local_uploads |
Fields
The following fields are returned by SELECT queries:
- list
Success Response.
| Name | Datatype | Description |
|---|---|---|
enabled | boolean | Whether local uploads is enabled for this bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | bucket_name, account_id | Get the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region. | |
r2_put_bucket_local_uploads_configuration | replace | bucket_name, account_id, enabled | Set the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region. |
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
Get the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.
SELECT
enabled
FROM cloudflare.r2.local_uploads
WHERE bucket_name = '{{ bucket_name }}' -- required
AND account_id = '{{ account_id }}' -- required
;
REPLACE examples
- r2_put_bucket_local_uploads_configuration
Set the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.
REPLACE cloudflare.r2.local_uploads
SET
enabled = {{ enabled }}
WHERE
bucket_name = '{{ bucket_name }}' --required
AND account_id = '{{ account_id }}' --required
AND enabled = {{ enabled }} --required
RETURNING
errors,
messages,
result,
success;