Update the S3 bucket lifecycle rule configuration
Updates the lifecycle rule configuration for an S3 bucket, adjusting settings such as actions, expiration, or version retention to manage object lifecycle policies effectively.
HTTP method and endpoint
PATCH /protocols/s3/services/{svm.uuid}/buckets/{s3_bucket.uuid}/rules/{name}
Introduced in
ONTAP 9.13
Usage notes
Updates the S3 bucket lifecycle rule configuration.
Important notes
-
The following fields can be modified for a bucket:
-
actions- Lifecycle Management actions associated with the rule. -
enabled- Lifecycle Management rule is enabled or not.. -
object_age_days- Number of days since creation after which objects can be deleted. -
object_expiry_date- Specific date from when objects can expire. -
expired_object_delete_marker- Cleanup object delete markers. -
new_non_current_versions- Number of latest non-current versions to be retained. -
non_current_days- Number of days after which non-current versions can be deleted. -
after_initiation_days- Number of days of initiation after which uploads can be aborted.
Related ONTAP commands
-
vserver object-store-server bucket lifecycle-management-rule modify
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
s3_bucket.uuid |
string |
path |
True |
The unique identifier of the bucket. |
name |
string |
path |
True |
The name of the lifecycle management rule to be applied on the bucket. |
return_timeout |
integer |
query |
False |
The number of seconds to allow the call to execute before returning. When doing a POST, PATCH, or DELETE operation on a single record, the default is 0 seconds. This means that if an asynchronous operation is started, the server immediately returns HTTP code 202 (Accepted) along with a link to the job. If a non-zero value is specified for POST, PATCH, or DELETE operations, ONTAP waits that length of time to see if the job completes so it can return something other than 202.
|
svm.uuid |
string |
path |
True |
UUID of the SVM to which this object belongs.
|
Request Body
| Name | Type | Description |
|---|---|---|
abort_incomplete_multipart_upload |
Specifies a way to perform abort_incomplete_multipart_upload action on filtered objects within a bucket. It cannot be specified with tags. |
|
enabled |
boolean |
Specifies whether or not the associated rule is enabled. |
expiration |
Specifies a way to perform expiration action on filtered objects within a bucket. |
|
non_current_version_expiration |
Specifies a way to perform non_current_version_expiration action on filtered objects within a bucket. |
|
svm |
Specifies the name of the SVM where this bucket exists. |
|
uuid |
string |
Specifies the unique identifier of the bucket. |
Example request
{
"expiration": {
"object_age_days": 100,
"object_expiry_date": "2039-09-22 20:00:00 -0400"
},
"svm": {
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "414b29a1-3b26-11e9-bd58-0050568ea055"
}
Response
Status: 200, Ok
| Name | Type | Description |
|---|---|---|
num_records |
integer |
Number of records |
records |
array[s3_bucket_lifecycle_rule] |
Example response
{
"num_records": 1,
"records": [
{
"expiration": {
"object_age_days": 100,
"object_expiry_date": "2039-09-22 20:00:00 -0400"
},
"svm": {
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "414b29a1-3b26-11e9-bd58-0050568ea055"
}
]
}
Response
Status: 202, Accepted
Error
Status: Default
ONTAP Error Response Codes
| Error code | Message |
|---|---|
92405861 |
"The specified SVM UUID or bucket UUID does not exist."; |
92406114 |
"The Expiration action requires specifying either object_expiry_date, object_age_days or expired_object_delete_marker."; |
92406115 |
"The NonCurrentVersionExpiration action requires either new_non_current_versions or non_current_days."; |
92406116 |
"The AbortIncompleteMultipartUpload action requires after_initiation_days."; |
92406117 |
"The "Expiration" action cannot have both an expiry date and an age."; |
92406118 |
"Using Lifecycle Management rules requires an effective cluster version of 9.13.1 ."; |
92406122 |
""expired_object_delete_marker" cannot be specified with "object_age_days" or "object_expiry_date"."; |
92406131 |
"Lifecycle Management rule "testcheck2" for bucket "testbuck1" in SVM "vs0" cannot be created because "non_current_days" must be specified along with "new_non_current_versions"."; |
92406132 |
"Lifecycle Management rule " |
92406132 //end row //start row |
"Lifecycle Management rule " |
92406132 //end row //start row |
"Lifecycle Management rule " |
92406133 //end row //start row |
"Lifecycle Management rule for bucket in Vserver is invalid. The object_expiry_date must be later than January 1, 1970."; //end row //start row |
92406135 //end row //start row |
"MetroCluster is configured on cluster. Object Expiration is not supported in a MetroCluster configuration."; //end row //start row |
92406136 //end row //start row |
"Lifecycle Management rule "rule1" for bucket "buck1" in SVM "vs0" is invalid. The "object_expiry_date" must be at midnight GMT."; //end row //start row |
92406139 //end row //start row |
"Lifecycle Management rule for bucket in Vserver with action is a stale entry. Contact technical support for assistance."; //end row //start row |
92406142 //end row //start row |
"Lifecycle Management rule "rule1" for bucket "buck1" in SVM "vs0" with action "Expiration" cannot have "expired_object_delete_marker" disabled. To disable "expired_object_delete_marker", run the "vserver object-store-server bucket lifecycle-management-rule delete" command."; //end row //start row |
92406146 //end row //start row |
"Lifecycle Management rule "rule1" for bucket "buck1" in SVM "vs0" already exists. Delete the rule and then try the operation again."; //end row //start row |
92406148 //end row //start row |
"Lifecycle Management rule "rule1" for bucket "buck1" in SVM "vs0" cannot have "new_non_current_versions" more than 100."; //end row //start row |
92406149 //end row //start row |
"Lifecycle Management rule "rule1" for bucket "buck1" in SVM "vs0" requires an action to be specified. Retry the operation after adding an action."; //end row |
|Name |Type |Description
|href |string a|
[#_links] [.api-collapsible-fifth-title] _links [#abort_incomplete_multipart_upload] [.api-collapsible-fifth-title] abort_incomplete_multipart_upload Specifies a way to perform abort_incomplete_multipart_upload action on filtered objects within a bucket. It cannot be specified with tags. [cols=3*,options=header] |
|Name |Type |Description
|after_initiation_days |integer a|Number of days of initiation after which uploads can be aborted.
[#expiration] [.api-collapsible-fifth-title] expiration Specifies a way to perform expiration action on filtered objects within a bucket. [cols=3*,options=header] |
|Name |Type |Description
|expired_object_delete_marker |boolean a|Cleanup object delete markers.
|object_age_days |integer a|Number of days since creation after which objects can be deleted. This cannot be used along with object_expiry_date.
|object_expiry_date |string a|Specific date from when objects can expire. This cannot be used with object_age_days.
[#non_current_version_expiration] [.api-collapsible-fifth-title] non_current_version_expiration Specifies a way to perform non_current_version_expiration action on filtered objects within a bucket. [cols=3*,options=header] |
|Name |Type |Description
|new_non_current_versions |integer a|Number of latest non-current versions to be retained.
|non_current_days |integer a|Number of days after which non-current versions can be deleted.
[#object_filter] [.api-collapsible-fifth-title] object_filter Specifies a way to filter objects within a bucket. [cols=3*,options=header] |
|Name |Type |Description
|prefix |string a|A prefix that is matched against object-names within a bucket.
|size_greater_than |integer a|Size of the object greater than specified for which the corresponding lifecycle rule is to be applied.
|size_less_than |integer a|Size of the object smaller than specified for which the corresponding lifecycle rule is to be applied.
|tags
|array[string]
a|An array of key-value paired tags of the form
[#svm] [.api-collapsible-fifth-title] svm Specifies the name of the SVM where this bucket exists. [cols=3*,options=header] |
|Name |Type |Description
|name |string a|The name of the SVM. This field cannot be specified in a PATCH method.
|uuid |string a|The unique identifier of the SVM. This field cannot be specified in a PATCH method.
[#s3_bucket_lifecycle_rule] [.api-collapsible-fifth-title] s3_bucket_lifecycle_rule Information about the lifecycle management rule of a bucket. [cols=3*,options=header] |
|Name |Type |Description
|abort_incomplete_multipart_upload |abort_incomplete_multipart_upload a|Specifies a way to perform abort_incomplete_multipart_upload action on filtered objects within a bucket. It cannot be specified with tags.
|enabled |boolean a|Specifies whether or not the associated rule is enabled.
|expiration |expiration a|Specifies a way to perform expiration action on filtered objects within a bucket.
|non_current_version_expiration |non_current_version_expiration a|Specifies a way to perform non_current_version_expiration action on filtered objects within a bucket.
|svm |svm a|Specifies the name of the SVM where this bucket exists.
|uuid |string a|Specifies the unique identifier of the bucket.
[#collection_links] [.api-collapsible-fifth-title] collection_links [#error_arguments] [.api-collapsible-fifth-title] error_arguments [cols=3*,options=header] |
|Name |Type |Description
|code |string a|Argument code
|message |string a|Message argument
[#returned_error] [.api-collapsible-fifth-title] returned_error [cols=3*,options=header] |
|Name |Type |Description
|arguments |array[error_arguments] a|Message arguments
|code |string a|Error code
|message |string a|Error message
|target |string a|The target parameter that caused the error.
==== |