X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fzerorpc%2Fcompute.py;h=7b6c1d45fe535b80d7f1e6bf3e4fe77ddcd61001;hb=e66ef121ed968d234bf984d01ee92ecdf6b21a72;hp=59b960c4af8779d22434864fe9831bb01f391b98;hpb=53337bc9b5cd5b6c613453b04c4f9cd703a61344;p=osm%2Fvim-emu.git diff --git a/src/emuvim/api/zerorpc/compute.py b/src/emuvim/api/zerorpc/compute.py index 59b960c..7b6c1d4 100644 --- a/src/emuvim/api/zerorpc/compute.py +++ b/src/emuvim/api/zerorpc/compute.py @@ -56,22 +56,24 @@ class MultiDatacenterApi(object): def __init__(self, dcs): self.dcs = dcs - def compute_action_start(self, dc_label, compute_name, image, command, network): + def compute_action_start(self, dc_label, compute_name, image, network=None, command=None): """ Start a new compute instance: A docker container :param dc_label: name of the DC :param compute_name: compute container name :param image: image name :param command: command to execute - :param network: - :return: networks list({"ip": "10.0.0.254/8"}, {"ip": "11.0.0.254/24"}) + :param network: list of all interface of the vnf, with their parameters (id=id1,ip=x.x.x.x/x),... + :return: networks list({"id":"input","ip": "10.0.0.254/8"}, {"id":"output","ip": "11.0.0.254/24"}) """ # TODO what to return UUID / given name / internal name ? logging.debug("RPC CALL: compute start") try: c = self.dcs.get(dc_label).startCompute( compute_name, image=image, command=command, network=network) - return str(c.name) + #return str(c.name) + # return docker inspect dict + return c.getStatus() except Exception as ex: logging.exception("RPC error.") return ex.message