]> git.proxmox.com Git - ceph.git/blob - ceph/examples/rgw/boto3/topic_attributes.py
update ceph source to reef 18.1.2
[ceph.git] / ceph / examples / rgw / boto3 / topic_attributes.py
1 import sys
2 import boto3
3 from pprint import pprint
4
5 if len(sys.argv) == 2:
6 # topic arn as first argument
7 topic_arn = sys.argv[1]
8 else:
9 print ('Usage: ' + sys.argv[0] + ' <topic arn>')
10 sys.exit(1)
11
12 # endpoint and keys from vstart
13 endpoint = 'http://127.0.0.1:8000'
14 access_key='0555b35654ad1656d804'
15 secret_key='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
16
17 # Add info to client to get the topi attirubutes of a given topi
18 client = boto3.client('sns',
19 endpoint_url=endpoint,
20 aws_access_key_id=access_key,
21 aws_secret_access_key=secret_key)
22 # getting attributes of a specific topic is an extension to AWS sns
23 pprint(client.get_topic_attributes(TopicArn=topic_arn))