summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--zte/vmanager/driver/interfaces/data/MME_inputs.json246
-rw-r--r--zte/vmanager/driver/interfaces/data/SPGW_inputs.json10
-rw-r--r--zte/vmanager/driver/interfaces/views.py14
3 files changed, 269 insertions, 1 deletions
diff --git a/zte/vmanager/driver/interfaces/data/MME_inputs.json b/zte/vmanager/driver/interfaces/data/MME_inputs.json
new file mode 100644
index 00000000..557c4862
--- /dev/null
+++ b/zte/vmanager/driver/interfaces/data/MME_inputs.json
@@ -0,0 +1,246 @@
+[
+ {
+ "name": "vnf.availabilityzone.cdb_zone",
+ "value": ""
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_7",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.networkadvancedConfig.MAC_MODE",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.networkadvancedConfig.SRIOV_BOND_MODE",
+ "value": "0"
+ },
+ {
+ "name": "vnf.appvmcap.PreemptiveCDBNumber",
+ "value": "2"
+ },
+ {
+ "name": "vnf.availabilityzone.omp_zone",
+ "value": ""
+ },
+ {
+ "name": "vnf.networkadvancedConfig.VIM_TYPE",
+ "value": "OPENSTACK"
+ },
+ {
+ "name": "vnf.availabilityzone.cmp_zone",
+ "value": ""
+ },
+ {
+ "name": "vnf.umacinfo.BureauType",
+ "value": "2"
+ },
+ {
+ "name": "vnf.appvmcap.IPBMaxNumber",
+ "value": "0"
+ },
+ {
+ "name": "vnf.networkSGConfig.PortSecurityEnable",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_inner_base",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.ommmasterip.MstOMMOMPIP",
+ "value": "129.128.50.133"
+ },
+ {
+ "name": "vnf.ommmasterip.MstBigNetGateWay",
+ "value": "172.30.23.1"
+ },
+ {
+ "name": "vnf.loadsharevmservergroup.SMP_SG_Num",
+ "value": "2"
+ },
+ {
+ "name": "vnf.specialconfig.AutoFormatDisk",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_inner_fabric",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.deploy.VMBVersionFile",
+ "value": "VMB_X86_64_64_R_CE_V5.17.10_NFV.pkg"
+ },
+ {
+ "name": "vnf.networkadvancedConfig.SAME_MAC_BOND",
+ "value": "YES"
+ },
+ {
+ "name": "vnf.loadsharevmservergroup.IPB_SG_Num",
+ "value": "2"
+ },
+ {
+ "name": "vnf.appvmcap.PreemptiveCMPNumber",
+ "value": "1"
+ },
+ {
+ "name": "vnf.networkCommConfig.AllocIPFromPool",
+ "value": "YES"
+ },
+ {
+ "name": "vnf.loadsharevmservergroup.USUP_SG_Num",
+ "value": "2"
+ },
+ {
+ "name": "vnf.ommmasterip.MstBigNetIP",
+ "value": "172.30.23.51"
+ },
+ {
+ "name": "vnf.loadsharevmservergroup.UP_LP_SG_Switch",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.appother.RACKNO",
+ "value": "1"
+ },
+ {
+ "name": "vnf.appvmcap.PreemptiveIPBNumber",
+ "value": "1"
+ },
+ {
+ "name": "vnf.networkCommConfig.VNFMNetworkCommFalg",
+ "value": ""
+ },
+ {
+ "name": "vnf.ommbasic.HAlic",
+ "value": "newstartha.lic"
+ },
+ {
+ "name": "vnf.availabilityzone.smp_zone",
+ "value": ""
+ },
+ {
+ "name": "vnf.globalconfig.VMNamePrefix",
+ "value": ""
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_6",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_5",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_4",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_3",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_2",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_1",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.availabilityzone.usup_zone",
+ "value": ""
+ },
+ {
+ "name": "vnf.networkCommConfig.OmpCtlNetMask",
+ "value": "255.0.0.0"
+ },
+ {
+ "name": "vnf.umacinfo.NEName",
+ "value": ""
+ },
+ {
+ "name": "vnf.appreliability.OMPOnePlusOneBK",
+ "value": "YES"
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_8",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.ommbasic.DualOMM",
+ "value": "NO"
+ },
+ {
+ "name": "vnf.ommbasic.Clustertype",
+ "value": "HA"
+ },
+ {
+ "name": "vnf.loadsharevmservergroup.CMP_SG_Num",
+ "value": "2"
+ },
+ {
+ "name": "vnf.availabilityzone.ipb_zone",
+ "value": ""
+ },
+ {
+ "name": "vnf.ommbasic.HAkey",
+ "value": "newstartha.key"
+ },
+ {
+ "name": "vnf.appvmcap.PreemptiveSMPNumber",
+ "value": "1"
+ },
+ {
+ "name": "vnf.appvmcap.PreemptiveUSUPNumber",
+ "value": "1"
+ },
+ {
+ "name": "vnf.networkCommConfig.VNFNetworkCommFalg",
+ "value": ""
+ },
+ {
+ "name": "vnf.ommmasterip.BigNetMask",
+ "value": "255.255.255.0"
+ },
+ {
+ "name": "vnf.networkCommConfig.RightOmpCtrlIp",
+ "value": "128.129.17.162"
+ },
+ {
+ "name": "vnf.umacinfo.NEID",
+ "value": "50"
+ },
+ {
+ "name": "vnf.ommmasterip.OMP2OMMFloatIP",
+ "value": "129.128.50.1"
+ },
+ {
+ "name": "vnf.ommbasic.TimeZone",
+ "value": "Asia/Shanghai"
+ },
+ {
+ "name": "vnf.availabilityzone.omm_zone",
+ "value": ""
+ },
+ {
+ "name": "vnf.ommmasterip.OMMOMPMask",
+ "value": "255.255.255.0"
+ },
+ {
+ "name": "vnf.networkCommConfig.LeftOmpCtrlIp",
+ "value": "128.129.17.161"
+ },
+ {
+ "name": "vnf.loadsharevmservergroup.OMP_LP_SG_Switch",
+ "value": "NO"
+ },
+ {
+ "name": "NSInstanceID",
+ "value": ""
+ },
+ {
+ "name": "NSInstanceName",
+ "value": ""
+ }
+] \ No newline at end of file
diff --git a/zte/vmanager/driver/interfaces/data/SPGW_inputs.json b/zte/vmanager/driver/interfaces/data/SPGW_inputs.json
new file mode 100644
index 00000000..3a221168
--- /dev/null
+++ b/zte/vmanager/driver/interfaces/data/SPGW_inputs.json
@@ -0,0 +1,10 @@
+[
+ {
+ "name": "vnf.availabilityzone.cdb_zone",
+ "value": ""
+ },
+ {
+ "name": "vnf.supportsriovConfig.isSriov_external_7",
+ "value": "NO"
+ }
+] \ No newline at end of file
diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py
index 183b4c52..93b8d922 100644
--- a/zte/vmanager/driver/interfaces/views.py
+++ b/zte/vmanager/driver/interfaces/views.py
@@ -16,6 +16,7 @@ import inspect
import json
import logging
import traceback
+import os
from rest_framework.decorators import api_view
from rest_framework.response import Response
@@ -26,6 +27,14 @@ from driver.pub.utils.restcall import req_by_msb, call_aai
logger = logging.getLogger(__name__)
+def load_json_file(file_name):
+ json_file = os.path.join(os.path.dirname(__file__), "data/" + file_name)
+ f = open(json_file)
+ json_data = json.JSONDecoder().decode(f.read())
+ f.close()
+ return json_data
+
+
def fun_name():
return "=================%s==================" % inspect.stack()[1][3]
@@ -132,18 +141,21 @@ def instantiate_vnf(request, *args, **kwargs):
# TODO convert sdc vnf package to vnf vender package
from urlparse import urlparse
vnfm_ip = urlparse(ignorcase_get(vnfm_info, "url")).netloc.split(':')[0]
+
+ inputs = []
if "SPGW" in vnfd_name.upper():
data["VNFD"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + "SPGW"
data["VNFURL"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + "SPGW"
+ inputs = load_json_file("SPGW" + "_inputs.json")
elif "MME" in vnfd_name.upper():
data["VNFD"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + "MME"
data["VNFURL"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + "MME"
+ inputs = load_json_file("MME" + "_inputs.json")
else:
data["VNFD"] = ignorcase_get(packageInfo, "downloadUri")
data["VNFURL"] = ignorcase_get(packageInfo, "downloadUri")
data["extension"] = {}
- inputs = []
for name, value in ignorcase_get(ignorcase_get(request.data, "additionalParam"), "inputs").items():
inputs.append({"name": name, "value": value})