added image argument to CLI
diff --git a/README.md b/README.md
index 7d75760..a9d48b3 100644
--- a/README.md
+++ b/README.md
@@ -76,7 +76,7 @@
* list active compute resources
* Cloud-like reference API with CLI for demonstrations
* Write CLI client
- * Start compute
+ * Start compute (name, DC, image)
* Stop compute
* Create an Ansible-based automatic installation routine
* Unit tests
diff --git a/emuvim/api/zerorpcapi.py b/emuvim/api/zerorpcapi.py
index 8a08131..be44444 100644
--- a/emuvim/api/zerorpcapi.py
+++ b/emuvim/api/zerorpcapi.py
@@ -56,11 +56,11 @@
def __init__(self, dcs):
self.dcs = dcs
- def compute_action_start(self, dc_name, compute_name):
+ def compute_action_start(self, dc_name, compute_name, image):
# TODO what to return UUID / given name / internal name ?
logging.debug("RPC CALL: compute start")
try:
- c = self.dcs.get(dc_name).startCompute(compute_name)
+ c = self.dcs.get(dc_name).startCompute(compute_name, image=image)
return str(c.name)
except Exception as ex:
logging.exception("RPC error.")
diff --git a/emuvim/cli/compute.py b/emuvim/cli/compute.py
index c5f2231..9f1030f 100644
--- a/emuvim/cli/compute.py
+++ b/emuvim/cli/compute.py
@@ -28,7 +28,7 @@
def start(self, args):
r = self.c.compute_action_start(
- args.get("datacenter"), args.get("name"))
+ args.get("datacenter"), args.get("name"), args.get("image"))
pp.pprint(r)
def stop(self, args):
@@ -77,6 +77,8 @@
"--datacenter", "-d", dest="datacenter", help="Data center.")
parser.add_argument(
"--name", "-n", dest="name", help="Compute name.")
+parser.add_argument(
+ "--image", "-i", dest="image", help="Name of container image to be used.")
# TODO: IP, image, etc. pp.