forked from jtriley/StarCluster
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathec2read-ict.py
37 lines (23 loc) · 949 Bytes
/
ec2read-ict.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
import boto.ec2.connection
from boto.ec2.regioninfo import RegionInfo
#e59c100351844ab785ca5133905ec184
#AWS_SECRET_ACCESS_KEY=54f80f17fd4140f8b24b36906453195d
connection = boto.ec2.connection.EC2Connection(
aws_access_key_id='e59c100351844ab785ca5133905ec184',
aws_secret_access_key='54f80f17fd4140f8b24b36906453195d',
port=8773,
region = RegionInfo(endpoint='tascloud.it.csiro.au'),
path = '/services/Cloud',
is_secure=False)
for res in connection.get_all_instances():
for inst in res.instances:
print inst
print connection.get_all_volumes()
print connection.get_all_snapshots()
print connection.get_all_key_pairs()
print connection.get_all_security_groups()
for image in connection.get_all_images():
print image, image.name
print connection.get_instance_attribute('i-0000031d', 'userData')
print connection.get_all_instances(filters = {'instance_id': 'i-0000031d'})