Configures lifecycle rules for objects.
Operation description
- You can configure up to 1,000 rules.
- If an object meets multiple rules, the rule that has the earliest expiration time prevails.
Debugging
Authorization information
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| BucketName | string | Yes | The name of the bucket. | test |
| RuleId | string | No | The unique ID of the rule. The ID of a lifecycle rule can be up to 255 bytes in length.
| 1 |
| Status | string | Yes | The status of the rule. Valid values:
| Enabled |
| Prefix | string | No | The prefix of a object name. The prefix must be unique.
| image |
| CreatedBeforeDate | string | No | The expiration time. EOS executes a lifecycle rule for objects that were last updated before the expiration time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
ExpirationDays and CreateBeforeDate are mutually exclusive.
| 2023-10-12T05:45:00Z |
| ExpirationDays | long | No | The number of days from when the objects were last modified to when the lifecycle rule takes effect. The value must be a positive integer that is greater than 0. Note
ExpirationDays and CreateBeforeDate are mutually exclusive.
| 5 |
| AllowSameActionOverlap | string | No | Specifies whether to allow overlapped prefixes. Valid values:
| false |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "62373E71-5521-4620-8AAB-133CCE49357A",
"RuleId": "b8f93xxxxx4881xxxxxc71d991"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | Invalid%s | The specified parameter %s is invalid. | - |
| 400 | InvalidArgument | Days and createBeforeDate can only choose one | - |
| 400 | InvalidArgument | One bucket not allow exceed one thousand items of LifecycleRules. | - |
| 400 | InvalidArgument | Overlap for same action type. | - |
| 400 | InvalidBucketName | Specified parameter BucketName is not valid. | The specified BucketName parameter is invalid. |
| 400 | InvalidLifecycleScheme | Specified parameter LifecycleScheme is not valid. | - |
| 400 | InvalidType | Specified parameter Type is not valid. | - |
| 400 | OperationDenied | Engine lifecycle scheme does't support replication lifecycle rule configuration. | - |
| 400 | NoPermission | Permission denied. | - |
| 400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. | - |
| 403 | AccessDenied | auth is not valid | - |
| 403 | UserDisable | The user has been disabled due to arrears. | The user has been disabled due to arrears. |
| 404 | NoSuchBucket | The specified bucket does not exist. | The requested bucket does not exist. |
| 404 | NoSuchLifecycle | The bucket lifecycle does not exist. | - |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-12-26 | The Error code has changed | View Change Details |
| 2024-08-12 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2024-04-17 | The Error code has changed | View Change Details |
