cleanup the cmdline area
[sfa.git] / tests / client / testAggregate.py
1 from geni.util.geniclient import *
2 from geni.util.credential import *
3 from pprint import pprint
4
5 cred = Credential(filename = 'tmack.pl.sa.cred')
6 slicehrn = 'planetlab.us.pl.tmack'
7 print cred.get_privileges().save_to_string()
8
9 r = GeniClient('https://128.112.139.120:12345', 'tmack.pkey', 'tmack.cert') 
10 a = GeniClient('https://128.112.139.120:12346', 'tmack.pkey', 'tmack.cert')
11
12 #pprint(r.list(cred, 'planetlab.us.princeton'))
13 pprint(a.get_policy(cred))
14
15 print "components at this aggregate"
16 components = a.list_components()
17 pprint(components)
18
19 print "resources being used by %(slicehrn)s" % locals()
20 tmack_components = a.list_resources(cred, slicehrn)
21 pprint(tmack_components)
22
23 #print "removing %(slicehrn)s from all nodes" % locals()
24 #a.delete_slice(cred, slicehrn)
25
26 print "adding %(slicehrn)s back to its original nodes" % locals()
27 a.list_resources(cred, slicehrn)
28 a.create_slice(cred, slicehrn, components)
29 a.list_resources(cred, slicehrn)
30
31