From f424e7777ea76929ed5d8d28ac67d872bf9a08e0 Mon Sep 17 00:00:00 2001 From: fujinhua Date: Thu, 18 Apr 2019 17:15:26 +0800 Subject: Add inputs json for inst vnf Change-Id: I4b7a06b5f63d639d9269e3748cdc5f96e4072fc3 Issue-ID: VFC-1307 Signed-off-by: fujinhua --- zte/vmanager/driver/interfaces/data/inputs.json | 16 ++++++++++++++++ zte/vmanager/driver/interfaces/views.py | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 zte/vmanager/driver/interfaces/data/inputs.json (limited to 'zte') diff --git a/zte/vmanager/driver/interfaces/data/inputs.json b/zte/vmanager/driver/interfaces/data/inputs.json new file mode 100644 index 00000000..640626c6 --- /dev/null +++ b/zte/vmanager/driver/interfaces/data/inputs.json @@ -0,0 +1,16 @@ +{ + "inputs": [ + { + "default": "", + "key_name": "Key1", + "type": "string", + "value": "Value1" + }, + { + "default": "", + "key_name": "Key2", + "type": "string", + "value": "Value2" + } + ] +} diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py index b981c9a1..3e62b068 100644 --- a/zte/vmanager/driver/interfaces/views.py +++ b/zte/vmanager/driver/interfaces/views.py @@ -138,10 +138,11 @@ class InstantiateVnf(APIView): logger.debug("[%s] packageInfo=%s", fun_name(), packageInfo) logger.debug("VNF_FTP=%s", VNF_FTP) data = { + "vnfinstancename": "default", "NFVOID": 1, "VNFMID": vnfmid, "vnfd_id": packageInfo.get("vnfdId"), - "deployflavorid": "TODO", + "deployflavorid": "default", "extension": {}, "inputs": [] } @@ -150,6 +151,9 @@ class InstantiateVnf(APIView): for name, value in ignorcase_get(additionalParam, "inputs").items(): data["inputs"].append({"key_name": name, "value": value, "type": "TODO"}) + inputs_json = load_json_file("inputs.json") + [data["inputs"].append(item) for item in inputs_json["inputs"]] + logger.debug("[%s] call_req data=%s", fun_name(), data) ret = restcall.call_req( -- cgit 1.2.3-korg