Skip to main content

local_uploads

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

Overview

Namelocal_uploads
TypeResource
Idcloudflare.r2.local_uploads

Fields

The following fields are returned by SELECT queries:

Success Response.

NameDatatypeDescription
enabledbooleanWhether 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:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectbucket_name, account_idGet 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_configurationreplacebucket_name, account_id, enabledSet 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
bucket_namestringThe R2 bucket name.

SELECT examples

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

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;