R2

R2

R2

Buckets

R2.Buckets

Methods

list(, ):
get/accounts/{account_id}/r2/buckets

Lists all R2 buckets on your account.

get(, , ):
get/accounts/{account_id}/r2/buckets/{bucket_name}

Gets properties of an existing R2 bucket.

create(, ):
post/accounts/{account_id}/r2/buckets

Creates a new R2 bucket.

edit(, , ):
patch/accounts/{account_id}/r2/buckets/{bucket_name}

Updates properties of an existing R2 bucket.

delete(, , ):
delete/accounts/{account_id}/r2/buckets/{bucket_name}

Deletes an existing R2 bucket.

Domain types

Bucket{…}

A single R2 bucket.

R2.Buckets.CORS

Methods

get(, , ):
get/accounts/{account_id}/r2/buckets/{bucket_name}/cors

Get the CORS policy for a bucket.

update(, , ):
put/accounts/{account_id}/r2/buckets/{bucket_name}/cors

Set the CORS policy for a bucket.

delete(, , ):
delete/accounts/{account_id}/r2/buckets/{bucket_name}/cors

Delete the CORS policy for a bucket.

R2Buckets

Domains

R2.Buckets.Domains

R2.Buckets.Domains.Custom

Methods

list(, , ):
get/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom

Gets a list of all custom domains registered with an existing R2 bucket.

get(, , , ):
get/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}

Get the configuration for a custom domain on an existing R2 bucket.

create(, , ):
post/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom

Register a new custom domain for an existing R2 bucket.

update(, , , ):
put/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}

Edit the configuration for a custom domain on an existing R2 bucket.

delete(, , , ):
delete/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}

Remove custom domain registration from an existing R2 bucket.

R2.Buckets.Domains.Managed

Methods

list(, , ):
get/accounts/{account_id}/r2/buckets/{bucket_name}/domains/managed

Gets state of public access over the bucket's R2-managed (r2.dev) domain.

update(, , ):
put/accounts/{account_id}/r2/buckets/{bucket_name}/domains/managed

Updates state of public access over the bucket's R2-managed (r2.dev) domain.

R2Buckets

Event Notifications

R2.Buckets.EventNotifications

Methods

list(, , ):
get/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration

List all event notification rules for a bucket.

get(, , , ):
get/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}

Get a single event notification rule.

update(, , , ):
put/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}

Create event notification rule.

delete(, , , ):
delete/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}

Delete an event notification rule. If no body is provided, all rules for specified queue will be deleted.

R2Buckets

Lifecycle

R2.Buckets.Lifecycle

Methods

get(, , ):
get/accounts/{account_id}/r2/buckets/{bucket_name}/lifecycle

Get object lifecycle rules for a bucket.

update(, , ):
put/accounts/{account_id}/r2/buckets/{bucket_name}/lifecycle

Set the object lifecycle rules for a bucket.

R2.Buckets.Locks

Methods

get(, , ):
get/accounts/{account_id}/r2/buckets/{bucket_name}/lock

Get lock rules for a bucket.

update(, , ):
put/accounts/{account_id}/r2/buckets/{bucket_name}/lock

Set lock rules for a bucket.

R2Buckets

Metrics

R2.Buckets.Metrics

Methods

list(, ):
get/accounts/{account_id}/r2/metrics

Get Storage/Object Count Metrics across all buckets in your account. Note that Account-Level Metrics may not immediately reflect the latest data.

R2.Buckets.SippyResource

Methods

get(, , ):
get/accounts/{account_id}/r2/buckets/{bucket_name}/sippy

Gets configuration for Sippy for an existing R2 bucket.

update(, , ):
put/accounts/{account_id}/r2/buckets/{bucket_name}/sippy

Sets configuration for Sippy for an existing R2 bucket.

delete(, , ):
delete/accounts/{account_id}/r2/buckets/{bucket_name}/sippy

Disables Sippy on this bucket.

Domain types

Provider = "r2"
Sippy{…}
R2

Super Slurper

R2.SuperSlurper

R2Super Slurper

Connectivity Precheck

R2.SuperSlurper.ConnectivityPrecheck

Methods

source(, ):
put/accounts/{account_id}/slurper/source/connectivity-precheck

Check whether tokens are valid against the source bucket

target(, ):
put/accounts/{account_id}/slurper/target/connectivity-precheck

Check whether tokens are valid against the target bucket

R2.SuperSlurper.Jobs

Methods

list(, ): <>
get/accounts/{account_id}/slurper/jobs

List jobs

get(, , ):
get/accounts/{account_id}/slurper/jobs/{job_id}

Get job details

create(, ):
post/accounts/{account_id}/slurper/jobs

Create a job

abortAll(, ):
put/accounts/{account_id}/slurper/jobs/abortAll

Abort all jobs

abort(, , ):
put/accounts/{account_id}/slurper/jobs/{job_id}/abort

Abort a job

pause(, , ):
put/accounts/{account_id}/slurper/jobs/{job_id}/pause

Pause a job

progress(, , ):
get/accounts/{account_id}/slurper/jobs/{job_id}/progress

Get job progress

resume(, , ):
put/accounts/{account_id}/slurper/jobs/{job_id}/resume

Resume a job

R2.SuperSlurper.Jobs.Logs

Methods

list(, , ): <>
get/accounts/{account_id}/slurper/jobs/{job_id}/logs

Get job logs

R2

Temporary Credentials

R2.TemporaryCredentials

Methods

create(, ):
post/accounts/{account_id}/r2/temp-access-credentials

Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.

Domain types

TemporaryCredential{…}