]> git.proxmox.com Git - ceph.git/blame - ceph/examples/boto3/get_notification.py
import ceph 15.2.14
[ceph.git] / ceph / examples / boto3 / get_notification.py
CommitLineData
9f95a23c
TL
1#!/usr/bin/python
2
3import boto3
4import sys
5
6if len(sys.argv) != 3:
ec96510d 7 print('Usage: ' + sys.argv[0] + ' <bucket> <notification>')
9f95a23c
TL
8 sys.exit(1)
9
10# bucket name as first argument
11bucketname = sys.argv[1]
12 # notification name as second argument
13notification_name = sys.argv[2]
14
15# endpoint and keys from vstart
16endpoint = 'http://127.0.0.1:8000'
17access_key='0555b35654ad1656d804'
18secret_key='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
19
20client = boto3.client('s3',
21 endpoint_url=endpoint,
22 aws_access_key_id=access_key,
23 aws_secret_access_key=secret_key)
24
25# getting a specific notification configuration is an extension to AWS S3 API
26
ec96510d
FG
27print(client.get_bucket_notification_configuration(Bucket=bucketname,
28 Notification=notification_name))