R2
Lifecycle
Lifecycle endpoint reference.
Get
Get the lifecycle configuration for a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->lifecycle()->get('ACCOUNT_ID', 'BUCKET_NAME', 'JURISDICTION');
Update
Set the lifecycle configuration for a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
rules | array | Yes | Lifecycle rules to set on the bucket. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->lifecycle()->update('ACCOUNT_ID', 'BUCKET_NAME', [], 'JURISDICTION');

