X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=emuvim%2Fapi%2Fzerorpcapi.py;h=be44444ee57a993b67c4dbee633454defbc49c2b;hb=7973f056b636b5eaef7d0d5b330bccecddda8588;hp=ecf822cd1b3f87432ac8e4d75a79a63dc8a4119c;hpb=2ec74e1b51575358297374272edd2b9562210ee5;p=osm%2Fvim-emu.git diff --git a/emuvim/api/zerorpcapi.py b/emuvim/api/zerorpcapi.py index ecf822c..be44444 100644 --- a/emuvim/api/zerorpcapi.py +++ b/emuvim/api/zerorpcapi.py @@ -7,7 +7,7 @@ import logging import threading import zerorpc -logging.basicConfig(level=logging.DEBUG) +logging.basicConfig(level=logging.INFO) class ZeroRpcApiEndpoint(object): @@ -56,17 +56,18 @@ class MultiDatacenterApi(object): 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: - return 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.") return ex.message def compute_action_stop(self, dc_name, compute_name): - logging.info("RPC CALL: compute stop") + logging.debug("RPC CALL: compute stop") try: return self.dcs.get(dc_name).stopCompute(compute_name) except Exception as ex: @@ -74,7 +75,7 @@ class MultiDatacenterApi(object): return ex.message def compute_list(self, dc_name): - logging.info("RPC CALL: compute list") + logging.debug("RPC CALL: compute list") try: if dc_name is None: # return list with all compute nodes in all DCs @@ -92,7 +93,7 @@ class MultiDatacenterApi(object): return ex.message def compute_status(self, dc_name, compute_name): - logging.info("RPC CALL: compute status") + logging.debug("RPC CALL: compute status") try: return self.dcs.get( dc_name).containers.get(compute_name).getStatus()