FORGE: Added including script
[myslice.git] / forge / script / PlcApi / deleteSlice.py
1 #!/usr/bin/python
2
3 import xmlrpclib
4 import Auth
5 import sys
6
7 plc_host='www.planet-lab.eu'
8 slice_pref='upmc_'
9
10 api_url='https://%s:443/PLCAPI/'%plc_host
11 plc_api=xmlrpclib.ServerProxy(api_url, allow_none=True)
12
13 slice_name = slice_pref+raw_input('Give the name of the slice : ')
14
15 try:
16         returnCode = plc_api.DeleteSlice(Auth.auth, slice_name)
17 except Exception, why:
18         print "An error occured while trying to delete the slice "+slice_name
19         print why
20         sys.exit(2)
21 if returnCode != 1:
22         print "An error occured while trying to delete the slice "+slice_name