From: gcalvino Date: Mon, 17 Dec 2018 15:24:08 +0000 (+0100) Subject: Adding vim-network-id parameter to instantiation X-Git-Tag: v5.0.3~10 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=0d7ac8da3021aab4d859d4de869c51422ecc08d3;p=osm%2FLCM.git Adding vim-network-id parameter to instantiation Change-Id: Ie2a9d0def321ca734a0e8141cb7f7491b488115e Signed-off-by: gcalvino --- diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 2f806f4..badef36 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -345,6 +345,10 @@ class NsLcm(LcmBase): populate_dict(RO_ns_params, ("vnfs", vnf_params["member-vnf-index"], "networks", internal_vld_params["name"], "vim-network-name"), internal_vld_params["vim-network-name"]) + if internal_vld_params.get("vim-network-id"): + populate_dict(RO_ns_params, ("vnfs", vnf_params["member-vnf-index"], "networks", + internal_vld_params["name"], "vim-network-id"), + internal_vld_params["vim-network-id"]) if internal_vld_params.get("ip-profile"): populate_dict(RO_ns_params, ("vnfs", vnf_params["member-vnf-index"], "networks", internal_vld_params["name"], "ip-profile"), @@ -393,6 +397,18 @@ class NsLcm(LcmBase): RO_vld_sites.append({"netmap-use": vld_params["vim-network-name"]}) if RO_vld_sites: populate_dict(RO_ns_params, ("networks", vld_params["name"], "sites"), RO_vld_sites) + if vld_params.get("vim-network-id"): + RO_vld_sites = [] + if isinstance(vld_params["vim-network-id"], dict): + for vim_account, vim_net in vld_params["vim-network-id"].items(): + RO_vld_sites.append({ + "netmap-use": vim_net, + "datacenter": vim_account_2_RO(vim_account) + }) + else: # isinstance str + RO_vld_sites.append({"netmap-use": vld_params["vim-network-id"]}) + if RO_vld_sites: + populate_dict(RO_ns_params, ("networks", vld_params["name"], "sites"), RO_vld_sites) if "vnfd-connection-point-ref" in vld_params: for cp_params in vld_params["vnfd-connection-point-ref"]: # look for interface