blob: ba7a29274b88af9f67556f5d023168c4e9c89e77 [file] [log] [blame]
peusterm58310762016-01-12 17:09:20 +01001#!/usr/bin/python
2"""
3 Simple CLI client to interact with a running emulator.
4
peusterm2ec74e12016-01-13 11:17:53 +01005 (c) 2016 by Manuel Peuster <manuel.peuster@upb.de>
6
peusterm58310762016-01-12 17:09:20 +01007 The CLI offers different tools, e.g., compute, network, ...
8 Each of these tools is implemented as an independent Python
9 module.
10
11 cli compute start dc1 my_name flavor_a
12 cli network create dc1 11.0.0.0/24
13"""
14
15import sys
16import compute
17import network
peustermd313dc12016-02-04 15:36:02 +010018import datacenter
peusterm58310762016-01-12 17:09:20 +010019
20
21def main():
22 if len(sys.argv) < 2:
23 print "Usage: son-emu-cli <toolname> <arguments>"
24 exit(0)
25 if sys.argv[1] == "compute":
26 compute.main(sys.argv[2:])
27 elif sys.argv[1] == "network":
28 network.main(sys.argv[2:])
peustermd313dc12016-02-04 15:36:02 +010029 elif sys.argv[1] == "datacenter":
30 datacenter.main(sys.argv[2:])
peusterm58310762016-01-12 17:09:20 +010031
32if __name__ == '__main__':
33 main()