Buckets
List Buckets
client.r2.buckets.list(BucketListParams { account_id, cursor, direction, 5 more } params, RequestOptionsoptions?): BucketListResponse { buckets }
GET/accounts/{account_id}/r2/buckets
Get Bucket
client.r2.buckets.get(stringbucketName, BucketGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): Bucket { creation_date, jurisdiction, location, 2 more }
GET/accounts/{account_id}/r2/buckets/{bucket_name}
Create Bucket
client.r2.buckets.create(BucketCreateParams { account_id, name, locationHint, 2 more } params, RequestOptionsoptions?): Bucket { creation_date, jurisdiction, location, 2 more }
POST/accounts/{account_id}/r2/buckets
Patch Bucket
client.r2.buckets.edit(stringbucketName, BucketEditParams { account_id, storage_class, jurisdiction } params, RequestOptionsoptions?): Bucket { creation_date, jurisdiction, location, 2 more }
PATCH/accounts/{account_id}/r2/buckets/{bucket_name}
Delete Bucket
client.r2.buckets.delete(stringbucketName, BucketDeleteParams { account_id, jurisdiction } params, RequestOptionsoptions?): BucketDeleteResponse
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}
BucketsLifecycle
Get Object Lifecycle Rules
client.r2.buckets.lifecycle.get(stringbucketName, LifecycleGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): LifecycleGetResponse { rules }
GET/accounts/{account_id}/r2/buckets/{bucket_name}/lifecycle
Put Object Lifecycle Rules
client.r2.buckets.lifecycle.update(stringbucketName, LifecycleUpdateParams { account_id, rules, jurisdiction } params, RequestOptionsoptions?): LifecycleUpdateResponse
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/lifecycle
BucketsCORS
Get Bucket CORS Policy
client.r2.buckets.cors.get(stringbucketName, CORSGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): CORSGetResponse { rules }
GET/accounts/{account_id}/r2/buckets/{bucket_name}/cors
Put Bucket CORS Policy
client.r2.buckets.cors.update(stringbucketName, CORSUpdateParams { account_id, rules, jurisdiction } params, RequestOptionsoptions?): CORSUpdateResponse
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/cors
Delete Bucket CORS Policy
client.r2.buckets.cors.delete(stringbucketName, CORSDeleteParams { account_id, jurisdiction } params, RequestOptionsoptions?): CORSDeleteResponse
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}/cors
BucketsDomains
BucketsDomainsCustom
List Custom Domains of Bucket
client.r2.buckets.domains.custom.list(stringbucketName, CustomListParams { account_id, jurisdiction } params, RequestOptionsoptions?): CustomListResponse { domains }
GET/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom
Get Custom Domain Settings
client.r2.buckets.domains.custom.get(stringbucketName, stringdomain, CustomGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): CustomGetResponse { domain, enabled, status, 4 more }
GET/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}
Attach Custom Domain To Bucket
client.r2.buckets.domains.custom.create(stringbucketName, CustomCreateParams { account_id, domain, enabled, 4 more } params, RequestOptionsoptions?): CustomCreateResponse { domain, enabled, ciphers, minTLS }
POST/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom
Configure Custom Domain Settings
client.r2.buckets.domains.custom.update(stringbucketName, stringdomain, CustomUpdateParams { account_id, ciphers, enabled, 2 more } params, RequestOptionsoptions?): CustomUpdateResponse { domain, ciphers, enabled, minTLS }
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}
Remove Custom Domain From Bucket
client.r2.buckets.domains.custom.delete(stringbucketName, stringdomain, CustomDeleteParams { account_id, jurisdiction } params, RequestOptionsoptions?): CustomDeleteResponse { domain }
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}
BucketsDomainsManaged
Get r2.dev Domain of Bucket
client.r2.buckets.domains.managed.list(stringbucketName, ManagedListParams { account_id, jurisdiction } params, RequestOptionsoptions?): ManagedListResponse { bucketId, domain, enabled }
GET/accounts/{account_id}/r2/buckets/{bucket_name}/domains/managed
Update r2.dev Domain of Bucket
client.r2.buckets.domains.managed.update(stringbucketName, ManagedUpdateParams { account_id, enabled, jurisdiction } params, RequestOptionsoptions?): ManagedUpdateResponse { bucketId, domain, enabled }
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/domains/managed
BucketsEvent Notifications
List Event Notification Rules
client.r2.buckets.eventNotifications.list(stringbucketName, EventNotificationListParams { account_id, jurisdiction } params, RequestOptionsoptions?): EventNotificationListResponse { bucketName, queues }
GET/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration
Get Event Notification Rule
client.r2.buckets.eventNotifications.get(stringbucketName, stringqueueId, EventNotificationGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): EventNotificationGetResponse { queueId, queueName, rules }
GET/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}
Create Event Notification Rule
client.r2.buckets.eventNotifications.update(stringbucketName, stringqueueId, EventNotificationUpdateParams { account_id, rules, jurisdiction } params, RequestOptionsoptions?): EventNotificationUpdateResponse
PUT/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}
Delete Event Notification Rules
client.r2.buckets.eventNotifications.delete(stringbucketName, stringqueueId, EventNotificationDeleteParams { account_id, jurisdiction } params, RequestOptionsoptions?): EventNotificationDeleteResponse
DELETE/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}
BucketsLocks
Get Bucket Lock Rules
client.r2.buckets.locks.get(stringbucketName, LockGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): LockGetResponse { rules }
GET/accounts/{account_id}/r2/buckets/{bucket_name}/lock
Put Bucket Lock Rules
client.r2.buckets.locks.update(stringbucketName, LockUpdateParams { account_id, rules, jurisdiction } params, RequestOptionsoptions?): LockUpdateResponse
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/lock
BucketsMetrics
Get Account-Level Metrics
client.r2.buckets.metrics.list(MetricListParams { account_id } params, RequestOptionsoptions?): MetricListResponse { infrequentAccess, standard }
GET/accounts/{account_id}/r2/metrics
BucketsSippy
Get Sippy Configuration
client.r2.buckets.sippy.get(stringbucketName, SippyGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): Sippy { destination, enabled, source }
GET/accounts/{account_id}/r2/buckets/{bucket_name}/sippy
Enable Sippy
client.r2.buckets.sippy.update(stringbucketName, SippyUpdateParamsparams, RequestOptionsoptions?): Sippy { destination, enabled, source }
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/sippy
Disable Sippy
client.r2.buckets.sippy.delete(stringbucketName, SippyDeleteParams { account_id, jurisdiction } params, RequestOptionsoptions?): SippyDeleteResponse { enabled }
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}/sippy