projects
/
osm
/
vim-emu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #9 from mpeuster/master
[osm/vim-emu.git]
/
emuvim
/
api
/
zerorpcapi.py
diff --git
a/emuvim/api/zerorpcapi.py
b/emuvim/api/zerorpcapi.py
index
be44444
..
bbb95ca
100644
(file)
--- a/
emuvim/api/zerorpcapi.py
+++ b/
emuvim/api/zerorpcapi.py
@@
-28,9
+28,9
@@
class ZeroRpcApiEndpoint(object):
self.__class__.__name__, self.ip, self.port))
def connectDatacenter(self, dc):
self.__class__.__name__, self.ip, self.port))
def connectDatacenter(self, dc):
- self.dcs[dc.
name
] = dc
+ self.dcs[dc.
label
] = dc
logging.info("Connected DC(%s) to API endpoint %s(%s:%d)" % (
logging.info("Connected DC(%s) to API endpoint %s(%s:%d)" % (
- dc.
name
, self.__class__.__name__, self.ip, self.port))
+ dc.
label
, self.__class__.__name__, self.ip, self.port))
def start(self):
thread = threading.Thread(target=self._api_server_thread, args=())
def start(self):
thread = threading.Thread(target=self._api_server_thread, args=())
@@
-56,11
+56,13
@@
class MultiDatacenterApi(object):
def __init__(self, dcs):
self.dcs = dcs
def __init__(self, dcs):
self.dcs = dcs
- def compute_action_start(self, dc_name, compute_name, image):
+ def compute_action_start(self, dc_name, compute_name, image, network):
+ # network e.g. {"ip": "10.0.0.254/8"}
# TODO what to return UUID / given name / internal name ?
logging.debug("RPC CALL: compute start")
try:
# 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, image=image)
+ c = self.dcs.get(dc_name).startCompute(
+ compute_name, image=image, network=network)
return str(c.name)
except Exception as ex:
logging.exception("RPC error.")
return str(c.name)
except Exception as ex:
logging.exception("RPC error.")