| peusterm | 5831076 | 2016-01-12 17:09:20 +0100 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | """ |
| 3 | Simple CLI client to interact with a running emulator. |
| 4 | |
| peusterm | 2ec74e1 | 2016-01-13 11:17:53 +0100 | [diff] [blame] | 5 | (c) 2016 by Manuel Peuster <manuel.peuster@upb.de> |
| 6 | |
| peusterm | 5831076 | 2016-01-12 17:09:20 +0100 | [diff] [blame] | 7 | 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 | |
| 15 | import sys |
| 16 | import compute |
| 17 | import network |
| 18 | |
| 19 | |
| 20 | def main(): |
| 21 | if len(sys.argv) < 2: |
| 22 | print "Usage: son-emu-cli <toolname> <arguments>" |
| 23 | exit(0) |
| 24 | if sys.argv[1] == "compute": |
| 25 | compute.main(sys.argv[2:]) |
| 26 | elif sys.argv[1] == "network": |
| 27 | network.main(sys.argv[2:]) |
| 28 | |
| 29 | if __name__ == '__main__': |
| 30 | main() |