diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2019-04-18 17:15:26 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2019-04-18 17:30:32 +0800 |
commit | f424e7777ea76929ed5d8d28ac67d872bf9a08e0 (patch) | |
tree | ef78409d86c3cdb235e210bedc77cfbc6540a628 /zte | |
parent | 336380c8decaeb14a3cf6e3a3e19f646437fd997 (diff) |
Add inputs json for inst vnf
Change-Id: I4b7a06b5f63d639d9269e3748cdc5f96e4072fc3
Issue-ID: VFC-1307
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'zte')
-rw-r--r-- | zte/vmanager/driver/interfaces/data/inputs.json | 16 | ||||
-rw-r--r-- | zte/vmanager/driver/interfaces/views.py | 6 |
2 files changed, 21 insertions, 1 deletions
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( |