X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=emuvim%2Fcli%2Fcompute.py;h=15fea9194c180623e0b2128f68ea3bfd59175401;hb=d7cb443596657a5c0a54e9c8230e441ad36a0cca;hp=9f1030f6384091df55c4ee30db45d9925aa82961;hpb=7973f056b636b5eaef7d0d5b330bccecddda8588;p=osm%2Fvim-emu.git diff --git a/emuvim/cli/compute.py b/emuvim/cli/compute.py old mode 100644 new mode 100755 index 9f1030f..15fea91 --- a/emuvim/cli/compute.py +++ b/emuvim/cli/compute.py @@ -27,8 +27,15 @@ class ZeroRpcClient(object): print "Command not implemented." def start(self, args): + network = {} + if args.get("network") is not None: + network = {"ip": args.get("network")} r = self.c.compute_action_start( - args.get("datacenter"), args.get("name"), args.get("image")) + args.get("datacenter"), + args.get("name"), + args.get("image"), + args.get("docker_command"), + network) pp.pprint(r) def stop(self, args): @@ -72,14 +79,25 @@ class ZeroRpcClient(object): parser = argparse.ArgumentParser(description='son-emu compute') -parser.add_argument("command", help="Action to be executed.") parser.add_argument( - "--datacenter", "-d", dest="datacenter", help="Data center.") + "command", + choices=['start', 'stop', 'list', 'status'], + help="Action to be executed.") parser.add_argument( - "--name", "-n", dest="name", help="Compute name.") + "--datacenter", "-d", dest="datacenter", + help="Data center to in which the compute instance should be executed") parser.add_argument( - "--image", "-i", dest="image", help="Name of container image to be used.") -# TODO: IP, image, etc. pp. + "--name", "-n", dest="name", + help="Name of compute instance e.g. 'vnf1'") +parser.add_argument( + "--image","-i", dest="image", + help="Name of container image to be used e.g. 'ubuntu'") +parser.add_argument( + "--dcmd", "-c", dest="docker_command", + help="Startup command of the container e.g. './start.sh'") +parser.add_argument( + "--net", dest="network", + help="Network properties of compute instance e.g. '10.0.0.123/8'") def main(argv):