-
Notifications
You must be signed in to change notification settings - Fork 32
s3.putLifeCycleRule()
tbruyelle edited this page May 25, 2012
·
3 revisions
S3 helper for adding a new rule to the bucket's lifecycle configuration. If the rule already exists (identified by its id
) then it will be updated with the new prefix
and expireInDays
. If the bucket has no lifecycle, then it will be created with this unique rule.
s3.putLifeCycleRule(id, prefix, expireInDays, callback)
- 'id' - the rule id that will be added. Used as a reference for other action like delete.
- 'prefix' - the rule prefix: all the files that match this prefix will be impacted by this rule. Please note that it can't overlap an existing prefix, or S3 will return an error.
- 'expireInDays' - the expiration time in days: the files that match the 'prefix' will be automatically deleted when this duration expires.
- 'callback' - the callback that is executed when the processing finishes. It has a couple of arguments: error and result.
- If there's an error, the callback receives the error argument as Error instance.
- If the error argument is null, then the response argument contains the response.headers object as returned by the node.js core HTTPS client.