Enable Sippy
client.r2.buckets.sippy.update(stringbucketName, SippyUpdateParamsparams, RequestOptionsoptions?): Sippy { destination, enabled, source }
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/sippy
Configures and enables Sippy on-demand migration for an R2 bucket. When a requested object is missing from R2, Sippy serves it from the configured source storage provider and copies it to R2.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Enable Sippy
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const sippy = await client.r2.buckets.sippy.update('example-bucket', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
console.log(sippy.destination);{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"destination": {
"accessKeyId": "accessKeyId",
"account": "account",
"bucket": "bucket",
"provider": "r2"
},
"enabled": true,
"source": {
"bucket": "bucket",
"bucketUrl": "bucketUrl",
"container": "container",
"provider": "aws",
"region": "region"
}
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"destination": {
"accessKeyId": "accessKeyId",
"account": "account",
"bucket": "bucket",
"provider": "r2"
},
"enabled": true,
"source": {
"bucket": "bucket",
"bucketUrl": "bucketUrl",
"container": "container",
"provider": "aws",
"region": "region"
}
},
"success": true
}