Skip to content

Commit

Permalink
Update batch-expiry template (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
krisis authored Oct 25, 2023
1 parent bd46dd5 commit bab1249
Showing 1 changed file with 32 additions and 36 deletions.
68 changes: 32 additions & 36 deletions batch-job.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,45 +147,41 @@ const BatchJobKeyRotateTemplate = `keyrotate:
// for batch expiring objects
const BatchJobExpireTemplate = `expire:
apiVersion: v1
bucket: BUCKET
prefix: PREFIX
# optional flags
flags:
filter:
olderThan: "7d" # match objects older than this value (e.g. 7d10h31s)
createdBefore: "date" # match objects created before "date"
bucket: mybucket # Bucket where this job will expire matching objects from
prefix: myprefix # (Optional) Prefix under which this job will expire objects matching the rules below.
rules:
- type: object # objects with zero ore more older versions
name: NAME # match object names that satisfy the wildcard expression.
olderThan: 70h # match objects older than this value
createdBefore: "2006-01-02T15:04:05.00Z" # match objects created before "date"
tags:
- key: "name"
value: "pick*" # match objects with tag 'name', all values starting with 'pick'
- key: name
value: pick* # match objects with tag 'name', all values starting with 'pick'
metadata:
- key: "content-type"
value: "image/*" # match objects with 'content-type', all values starting with 'image/'
- key: content-type
value: image/* # match objects with 'content-type', all values starting with 'image/'
size:
lesserThan: "" # match objects with size lesser than this value (e.g. 10KiB)
greaterThan: "" # match objects with size greater than this value (e.g. 10KiB)
name:
endsWith: "" # match objects ending with this string
contains: "" # match objects that contain this string
startsWith: "" # match objects starting with this string
# number of versions to retain
# e.g.
# maxVersions: 0 # expire all versions
# maxVersions: 1 # expire all versions except latest
# maxVersions: 10 # expire all versions higher than 10
maxVersions: 0 # default
notify:
endpoint: "https://notify.endpoint" # notification endpoint to receive job completion status
token: "Bearer xxxxx" # optional authentication token for the notification endpoint
retry:
attempts: 10 # number of retries for the job before giving up
delay: "500ms" # least amount of delay between each retry
lesserThan: 10MiB # match objects with size lesser than this value (e.g. 10MiB)
greaterThan: 1MiB # match objects with size greater than this value (e.g. 1MiB)
purge:
# retainVersions: 0 # (default) delete all versions of the object. This option is the fastest.
# retainVersions: 5 # keep the latest 5 versions of the object.
- type: deleted # objects with delete marker as their latest version
name: NAME # match object names that satisfy the wildcard expression.
olderThan: 10h # match objects older than this value (e.g. 7d10h31s)
createdBefore: "2006-01-02T15:04:05.00Z" # match objects created before "date"
purge:
# retainVersions: 0 # (default) delete all versions of the object. This option is the fastest.
# retainVersions: 5 # keep the latest 5 versions of the object including delete markers.
notify:
endpoint: https://notify.endpoint # notification endpoint to receive job completion status
token: Bearer xxxxx # optional authentication token for the notification endpoint
retry:
attempts: 10 # number of retries for the job before giving up
delay: 500ms # least amount of delay between each retry
`

// BatchJobResult returned by StartBatchJob
Expand Down

0 comments on commit bab1249

Please sign in to comment.