Skip to main content

Update the S3 bucket lifecycle rule configuration

Contributors

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

Introduced In: 9.13

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.

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

  • Default value: 1

  • Max value: 120

  • Min value: 0

svm.uuid

string

path

True

UUID of the SVM to which this object belongs.

  • Introduced in: 9.14

Request Body

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

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

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.

svm

svm

Specifies the name of the SVM where this bucket exists.

uuid

string

Specifies the unique identifier of the bucket.

Example request
{
  "_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-22 20:00:00 -0400"
  },
  "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"
}

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"
          }
        }
      },
      "bucket_name": "bucket1",
      "expiration": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "object_age_days": 100,
        "object_expiry_date": "2039-09-22 20:00:00 -0400"
      },
      "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"
    }
  ]
}

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 "" for bucket "" in SVM "" requires "object_age_days" to be greater than zero."; //end row //start row

92406132 //end row //start row

"Lifecycle Management rule "" for bucket "" in SVM "" requires "new_non_current_versions"