Retrieve S3 lifecycle rules for a bucket
Retrieves S3 lifecycle rules for a bucket to understand its associated management policies and configurations. This helps you ensure that the bucket's data lifecycle aligns with your storage policies or regulatory requirements.
HTTP method and endpoint
GET /protocols/s3/services/{svm.uuid}/buckets/{s3_bucket.uuid}/rules
Introduced in
ONTAP 9.13
Usage notes
Retrieves all S3 Lifecycle rules associated with a bucket. Note that in order to retrieve S3 bucket rule parameters, the 'fields' option should be set to '**'.
Related ONTAP commands
-
vserver object-store-server bucket lifecycle-management-rule show
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
expiration.expired_object_delete_marker |
boolean |
query |
False |
Filter by expiration.expired_object_delete_marker |
expiration.object_age_days |
integer |
query |
False |
Filter by expiration.object_age_days |
expiration.object_expiry_date |
string |
query |
False |
Filter by expiration.object_expiry_date |
object_filter.size_greater_than |
integer |
query |
False |
Filter by object_filter.size_greater_than |
object_filter.tags |
string |
query |
False |
Filter by object_filter.tags |
object_filter.prefix |
string |
query |
False |
Filter by object_filter.prefix |
object_filter.size_less_than |
integer |
query |
False |
Filter by object_filter.size_less_than |
enabled |
boolean |
query |
False |
Filter by enabled |
bucket_name |
string |
query |
False |
Filter by bucket_name
|
name |
string |
query |
False |
Filter by name
|
svm.name |
string |
query |
False |
Filter by svm.name
|
abort_incomplete_multipart_upload.after_initiation_days |
integer |
query |
False |
Filter by abort_incomplete_multipart_upload.after_initiation_days |
uuid |
string |
query |
False |
Filter by uuid
|
non_current_version_expiration.non_current_days |
integer |
query |
False |
Filter by non_current_version_expiration.non_current_days |
non_current_version_expiration.new_non_current_versions |
integer |
query |
False |
Filter by non_current_version_expiration.new_non_current_versions |
s3_bucket.uuid |
string |
path |
True |
The unique identifier of the bucket. |
svm.uuid |
string |
path |
True |
UUID of the SVM to which this object belongs.
|
fields |
array[string] |
query |
False |
Specify the fields to return. |
max_records |
integer |
query |
False |
Limit the number of records returned. |
return_records |
boolean |
query |
False |
The default is true for GET calls. When set to false, only the number of records is returned.
|
return_timeout |
integer |
query |
False |
The number of seconds to allow the call to execute before returning. When iterating over a collection, the default is 15 seconds. ONTAP returns earlier if either max records or the end of the collection is reached.
|
order_by |
array[string] |
query |
False |
Order results by specified fields and optional [asc |
Response
Status: 200, Ok
| Name | Type | Description |
|---|---|---|
_links |
||
num_records |
integer |
Number of records |
records |
array[s3_bucket_lifecycle_rule] |
Example response
{
"_links": {
"next": {
"href": "/api/resourcelink"
},
"self": {
"href": "/api/resourcelink"
}
},
"num_records": 1,
"records": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"abort_incomplete_multipart_upload": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
}
},
"bucket_name": "bucket1",
"expiration": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"object_age_days": 100,
"object_expiry_date": "2039-09-23 00:00:00 +0000"
},
"name": "string",
"non_current_version_expiration": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
}
},
"object_filter": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"prefix": "/logs",
"size_greater_than": 10240,
"size_less_than": 10485760,
"tags": [
"project1=projA",
"project2=projB"
]
},
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "414b29a1-3b26-11e9-bd58-0050568ea055"
}
]
}
Error
Status: Default, Error
| Name | Type | Description |
|---|---|---|
error |
Example error
{
"error": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist",
"target": "uuid"
}
}
Definitions
See Definitions
href
| Name | Type | Description |
|---|---|---|
href |
string |
collection_links
| Name | Type | Description |
|---|---|---|
next |
||
self |
_links
| Name | Type | Description |
|---|---|---|
self |
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.
| Name | Type | Description |
|---|---|---|
_links |
||
after_initiation_days |
integer |
Number of days of initiation after which uploads can be aborted. |
expiration
Specifies a way to perform expiration action on filtered objects within a bucket.
| Name | Type | Description |
|---|---|---|
_links |
||
expired_object_delete_marker |
boolean |
Cleanup object delete markers. |
object_age_days |
integer |
Number of days since creation after which objects can be deleted. This cannot be used along with object_expiry_date. |
object_expiry_date |
string |
Specific date from when objects can expire. This cannot be used with object_age_days. |
non_current_version_expiration
Specifies a way to perform non_current_version_expiration action on filtered objects within a bucket.
| Name | Type | Description |
|---|---|---|
_links |
||
new_non_current_versions |
integer |
Number of latest non-current versions to be retained. |
non_current_days |
integer |
Number of days after which non-current versions can be deleted. |
object_filter
Specifies a way to filter objects within a bucket.
| Name | Type | Description |
|---|---|---|
_links |
||
prefix |
string |
A prefix that is matched against object-names within a bucket. |
size_greater_than |
integer |
Size of the object greater than specified for which the corresponding lifecycle rule is to be applied. |
size_less_than |
integer |
Size of the object smaller than specified for which the corresponding lifecycle rule is to be applied. |
tags |
array[string] |
An array of key-value paired tags of the form |
svm
Specifies the name of the SVM where this bucket exists.
| Name | Type | Description |
|---|---|---|
_links |
||
name |
string |
The name of the SVM. This field cannot be specified in a PATCH method. |
uuid |
string |
The unique identifier of the SVM. This field cannot be specified in a PATCH method. |
s3_bucket_lifecycle_rule
Information about the lifecycle management rule of a bucket.
| Name | Type | Description |
|---|---|---|
_links |
||
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. |
|
bucket_name |
string |
Specifies the name of the bucket. Bucket name is a string that can only contain the following combination of ASCII-range alphanumeric characters 0-9, a-z, ".", and "-". |
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. |
|
name |
string |
Bucket lifecycle management rule identifier. The length of the name can range from 0 to 256 characters. |
non_current_version_expiration |
Specifies a way to perform non_current_version_expiration action on filtered objects within a bucket. |
|
object_filter |
Specifies a way to filter objects within a bucket. |
|
svm |
Specifies the name of the SVM where this bucket exists. |
|
uuid |
string |
Specifies the unique identifier of the bucket. |
error_arguments
| Name | Type | Description |
|---|---|---|
code |
string |
Argument code |
message |
string |
Message argument |
returned_error
| Name | Type | Description |
|---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
target |
string |
The target parameter that caused the error. |