Skip to main content
A newer release of this product is available.

Retrieve S3 lifecycle rules for a bucket

Contributors

GET /protocols/s3/services/{svm.uuid}/buckets/{s3_bucket.uuid}/rules

Introduced In: 9.13

Retrieves all S3 Lifecycle rules associated with a bucket. Note that in order to retrieve S3 bucket rule parametes, the 'fields' option should be set to '**'.

  • 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_less_than

integer

query

False

Filter by object_filter.size_less_than

object_filter.tags

string

query

False

Filter by object_filter.tags

object_filter.size_greater_than

integer

query

False

Filter by object_filter.size_greater_than

object_filter.prefix

string

query

False

Filter by object_filter.prefix

name

string

query

False

Filter by name

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

abort_incomplete_multipart_upload.after_initiation_days

integer

query

False

Filter by abort_incomplete_multipart_upload.after_initiation_days

enabled

boolean

query

False

Filter by enabled

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.

  • Default value: 1

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.

  • Default value: 1

  • Max value: 120

  • Min value: 0

order_by

array[string]

query

False

Order results by specified fields and optional [asc

Response

Status: 200, Ok
Name Type Description

_links

collection_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"
        }
      }
    },
    "expiration": {
      "_links": {
        "self": {
          "href": "/api/resourcelink"
        }
      }
    },
    "non_current_version_expiration": {
      "_links": {
        "self": {
          "href": "/api/resourcelink"
        }
      }
    },
    "object_filter": {
      "_links": {
        "self": {
          "href": "/api/resourcelink"
        }
      },
      "prefix": "/logs",
      "size_greater_than": 10485760,
      "size_less_than": 10240,
      "tags": [
        "project1=projA",
        "project2=projB"
      ]
    }
  }
}

Error

Status: Default, Error
Name Type Description

error

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

Name Type Description

next

href

self

href

Name Type Description

self

href

abort_incomplete_multipart_upload

Specifies a way to perform abort_incomplete_multipart_upload action on filtered objects within a bucket.

Name Type Description

_links

_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

_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.

object_expiry_date

string

Specific date from when objects can expire.

non_current_version_expiration

Specifies a way to perform non_current_version_expiration action on filtered objects within a bucket.

Name Type Description

_links

_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

_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 or <tag=value>.

s3_bucket_lifecycle_rule

Information about the lifecycle management rule of a bucket.

Name Type Description

_links

_links

abort_incomplete_multipart_upload

abort_incomplete_multipart_upload

Specifies a way to perform abort_incomplete_multipart_upload action on filtered objects within a bucket.

enabled

boolean

Specifies whether or not the associated rule is enabled.

expiration

expiration

Specifies a way to perform expiration action on filtered objects within a bucket.

name

string

Bucket lifecycle management rule identifier.

non_current_version_expiration

non_current_version_expiration

Specifies a way to perform non_current_version_expiration action on filtered objects within a bucket.

object_filter

object_filter

Specifies a way to filter objects within a bucket.

error_arguments

Name Type Description

code

string

Argument code

message

string

Message argument

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.