summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--zte/vmanager/driver/interfaces/views.py26
1 files changed, 5 insertions, 21 deletions
diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py
index 7376d4d2..11dd6a09 100644
--- a/zte/vmanager/driver/interfaces/views.py
+++ b/zte/vmanager/driver/interfaces/views.py
@@ -135,36 +135,20 @@ class InstantiateVnf(APIView):
vnf_package_info = json.JSONDecoder().decode(ret[1])
packageInfo = ignorcase_get(vnf_package_info, "packageInfo")
logger.debug("[%s] packageInfo=%s", fun_name(), packageInfo)
+ logger.debug("VNF_FTP=%s", VNF_FTP)
data = {
"NFVOID": 1,
"VNFMID": vnfmid,
+ "vnfd_id": packageInfo.get("vnfdId"),
+ "deployflavorid": "TODO",
"extension": {},
+ "inputs": []
}
- vnfdModel = json.loads(ignorcase_get(packageInfo, "vnfdModel"))
- metadata = ignorcase_get(vnfdModel, "metadata")
- vnfd_name = ignorcase_get(metadata, "name")
- # TODO convert sdc vnf package to vnf vender package
- inputs = []
- if "SPGW" in vnfd_name.upper():
- data["VNFD"] = VNF_FTP + "SPGW"
- inputs = load_json_file("SPGW" + "_inputs.json")
- elif "MME" in vnfd_name.upper():
- data["VNFD"] = VNF_FTP + "MME"
- inputs = load_json_file("MME" + "_inputs.json")
- else:
- data["VNFD"] = ignorcase_get(packageInfo, "downloadUri")
-
- data["VNFURL"] = data["VNFD"]
additionalParam = ignorcase_get(instantiateVnfRequestSerializer.data, "additionalParam")
for name, value in ignorcase_get(additionalParam, "inputs").items():
- inputs.append({"name": name, "value": value})
+ data["inputs"].append({"key_name": name, "value": value, "type": "TODO"})
- data["extension"]["inputs"] = json.dumps(inputs)
- data["extension"]["extVirtualLinks"] = ignorcase_get(additionalParam, "extVirtualLinks")
- data["extension"]["vnfinstancename"] = ignorcase_get(instantiateVnfRequestSerializer.data, "vnfInstanceName")
- data["extension"]["vnfid"] = data["VNFD"]
- data["extension"]["multivim"] = 0
logger.debug("[%s] call_req data=%s", fun_name(), data)
ret = restcall.call_req(