Memanggil operasi PutBucketLifecycle untuk mengonfigurasi aturan siklus hidup untuk objek.
Deskripsi operasi
-
Mendukung maksimum 1.000 aturan.
-
Jika sebuah objek cocok dengan beberapa aturan secara bersamaan, aturan dengan pengatur waktu kedaluwarsa paling awal akan berlaku.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ens:PutBucketLifecycle |
none |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| BucketName |
string |
Yes |
Nama bucket. |
test |
| RuleId |
string |
No |
ID unik yang mengidentifikasi aturan. Panjang ID dapat mencapai 255 byte.
|
b8f93xxxxx4881xxxxxc71d991 |
| Status |
string |
Yes |
Status aturan. Nilai valid:
|
Enabled |
| Prefix |
string |
No |
Awalan tempat aturan berlaku. Awalan duplikat tidak didukung.
|
image |
| CreatedBeforeDate |
string |
No |
Tanggal kedaluwarsa. Layanan penyimpanan menjalankan aturan siklus hidup pada data yang pengatur waktu modifikasi terakhirnya lebih awal dari tanggal ini. Tanggal harus ditentukan dalam format ISO 8601 dan harus dalam UTC. Format: yyyy-MM-ddTHH:mm:ssZ. Catatan
ExpirationDays dan CreatedBeforeDate saling eksklusif. Anda harus menentukan salah satunya. |
2023-10-12T05:45:00Z |
| ExpirationDays |
integer |
No |
Jumlah hari setelah pengatur waktu modifikasi terakhir objek sebelum aturan siklus hidup berlaku. Nilai harus berupa bilangan bulat positif lebih besar dari 0. Catatan
ExpirationDays dan CreatedBeforeDate saling eksklusif. Anda harus menentukan salah satunya. |
5 |
| AllowSameActionOverlap |
string |
No |
Apakah tumpang tindih awalan diizinkan. Nilai valid:
|
false |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Skema Respons. |
||
| RequestId |
string |
ID permintaan. |
62373E71-5521-4620-8AAB-133CCE49357A |
| RuleId |
string |
ID aturan. |
b8f93xxxxx4881xxxxxc71d991 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "62373E71-5521-4620-8AAB-133CCE49357A",
"RuleId": "b8f93xxxxx4881xxxxxc71d991"
}
Kode kesalahan
|
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 | InvalidBucketName | Specified parameter BucketName is not valid. | |
| 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. | |
| 404 | NoSuchBucket | The specified bucket does not exist. | |
| 404 | NoSuchLifecycle | The bucket lifecycle does not exist. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.