def compute_action_start(self, dc_name, compute_name):
# TODO return UUID / IP ?
- logging.info("compute start")
+ logging.debug("RPC CALL: compute start")
+ if dc_name in self.dcs:
+ self.dcs[dc_name].addCompute(compute_name)
def compute_action_stop(self, dc_name, compute_name):
logging.info("compute stop")
+ if dc_name in self.dcs:
+ self.dcs[dc_name].removeCompute(compute_name)
def compute_list(self):
pass
# do some API tests
print c.compute_action_start("dc2", "my_new_container1")
- time.sleep(5)
+ time.sleep(10)
print c.compute_action_stop("dc2", "my_new_container1")
def start(self):
pass
- def addCompute(self):
- pass
-
- def removeCompute(self):
- pass
+ def addCompute(self, name):
+ #TODO remove mnet shortcut to have a clean API
+ #TODO connect container to DC's swtich
+ self.net.mnet.addDocker("%s.%s" % (self.name, name), dimage="ubuntu")
+
+ def removeCompute(self, name):
+ #TODO remove mnet shortcut to have a clean API
+ #TODO disconnect container to DC's swtich
+ self.net.mnet.removeDocker("%s.%s" % (self.name, name))