added more documentation comments
[osm/vim-emu.git] / emuvim / cli / __main__.py
1 """
2 For now only a dummy client. Connects to the zerorpc interface of the
3 emulator and performs some actions (start/stop/list).
4
5 We will provide a full CLI here later on which looks like:
6
7 cli compute start dc1 my_name flavor_a
8 cli network create dc1 11.0.0.0/24
9 """
10 import time
11 import zerorpc
12
13
14 def main():
15 print "Example CLI client"
16 # create connection to remote Mininet instance
17 c = zerorpc.Client()
18 c.connect("tcp://127.0.0.1:4242")
19
20 # do some API tests
21 print c.compute_action_start("dc2", "my_new_container1")
22
23 time.sleep(10)
24
25 print c.compute_action_stop("dc2", "my_new_container1")
26
27
28 if __name__ == '__main__':
29 main()