PutBucketLifecycle 操作を呼び出して、バケットのライフサイクルルールを設定できます。
操作説明
-
最大 1,000 個のルールを設定できます。
-
オブジェクトが複数のルールに一致する場合、最も早い有効期限が設定されているルールが適用されます。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ens:PutBucketLifecycle |
none |
*All Resource
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| BucketName |
string |
必須 |
バケットの名前。 |
test |
| RuleId |
string |
任意 |
ルールを識別するための一意の ID。最大長は 255 バイトです。
|
b8f93xxxxx4881xxxxxc71d991 |
| Status |
string |
必須 |
ルールのステータス。有効な値:
|
Enabled |
| Prefix |
string |
任意 |
ルールが適用されるプレフィックス。重複するプレフィックスは設定できません。
|
image |
| CreatedBeforeDate |
string |
任意 |
オブジェクトの有効期限が切れる日付。この日付より前に最終更新されたオブジェクトにライフサイクルルールが適用されます。 ISO 8601 フォーマットと UTC 時間を使用してください。フォーマット: yyyy-MM-ddTHH:mm:ssZ。 説明
注:ExpirationDays と CreatedBeforeDate は相互排他的です。どちらか一方を指定してください。 |
2023-10-12T05:45:00Z |
| ExpirationDays |
integer |
任意 |
オブジェクトの最終更新日からライフサイクルルールが有効になるまでの日数。0 より大きい正の整数である必要があります。 説明
注:ExpirationDays と CreatedBeforeDate は相互排他的です。どちらか一方を指定してください。 |
5 |
| AllowSameActionOverlap |
string |
任意 |
重複するプレフィックスを許可するかどうか。有効な値:
|
false |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
応答スキーマ |
||
| RequestId |
string |
リクエスト ID。 |
62373E71-5521-4620-8AAB-133CCE49357A |
| RuleId |
string |
ルール ID。 |
b8f93xxxxx4881xxxxxc71d991 |
例
成功レスポンス
JSONJSON
{
"RequestId": "62373E71-5521-4620-8AAB-133CCE49357A",
"RuleId": "b8f93xxxxx4881xxxxxc71d991"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 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. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。