Commit f991ad47 authored by Martin Abbrent's avatar Martin Abbrent 💬
Browse files

Merge branch 'fix-enable-bucket-notification' into 'master'

Add filter for event types on bucket notifications

See merge request !3
parents c5caf8ec b3146eb6
Pipeline #51226 failed with stages
in 2 minutes and 9 seconds
PATCH = 11
PATCH = 12
__version__ = '{}.{}.{}'.format(MAJOR, MINOR, PATCH)
......@@ -157,14 +157,17 @@ class Mc:
lock_config = ObjectLockConfig(GOVERNANCE, 100, YEARS)
self.minio.set_object_lock_config(bucket_name, lock_config)
def enable_bucket_notification(self, bucket_name):
def enable_bucket_notification(self, bucket_name, event=['put']):
# Find notification targets
info = self._command(['admin', 'info', self.alias])
targets = info.get('info').get('sqsARN')
# add event listener
for target in targets:
self._command(['event', 'add', '{}/{}'.format(self.alias, bucket_name), target])
'event', 'add', '{}/{}'.format(self.alias, bucket_name), target,
'--event', ','.join(event)
def set_bucket_tags(self, bucket_name: str, plain_tags: dict):
bucket_tags = Tags.new_bucket_tags()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment