Add vnfm register for vfc 63/87863/1
authorHaibin Huang <haibin.huang@intel.com>
Thu, 16 May 2019 11:51:20 +0000 (11:51 +0000)
committerHaibin Huang <haibin.huang@intel.com>
Thu, 16 May 2019 11:53:47 +0000 (11:53 +0000)
Change-Id: I942c5740b30c7ca9fdd9af2c8cfa7f38af258cbf
Issue-ID: INT-795
Signed-off-by: Haibin Huang <haibin.huang@intel.com>
test/hpa_automation/tosca/hpa_automation.py
test/hpa_automation/tosca/vcpe_config.json

index ff53303..c9ff593 100755 (executable)
@@ -77,6 +77,22 @@ def register_all_clouds(parameters):
     for cloud_region, cloud_region_values in cloud_dictionary.iteritems():
         register_cloud_helper(cloud_region, cloud_region_values, parameters)
 
+def register_vnfm_helper(vnfm_key, values, parameters):
+    #Create vnfm
+    vnfm_create_string = 'oclip vnfm-create -b {} -c {} -e {} -v {} -g {} -x {} -i {} -j {} -q {} \
+    -m {} -u {} -p {}'.format(vnfm_key, values.get("type"), values.get("vendor"), \
+      values.get("version"), values.get("url"), values.get("vim-id"), \
+      values.get("user-name"), values.get("user-password"), values.get("vnfm-version"), \
+      parameters["aai_url"], parameters["aai_username"], parameters["aai_password"])
+
+    os.system(vnfm_create_string)
+
+def register_vnfm(parameters):
+    vnfm_params = parameters["vnfm_params"]
+    for vnfm_key, vnfm_values in vnfm_params.iteritems():
+        register_vnfm_helper(vnfm_key, vnfm_values, parameters)
+
+
 #VNF Deployment Section
 def add_policies(parameters):
     resource_string = (os.popen("oclip get-resource-module-name  -u {} -p {} -m {} |grep {}".format(\
@@ -162,17 +178,20 @@ set_open_cli_env(parameters)
 # 2.Create cloud complex
 create_complex(parameters)
 
-# 3.FIXME:Because SDC internal API will change without notice, so I will maually design VNF and Service.
+# 3.Register all clouds
+register_all_clouds(parameters)
+
+# 4.Register vnfm
+register_vnfm(parameters)
+
+# 5.FIXME:Because SDC internal API will change without notice, so I will maually design VNF and Service.
 # SDC output data model is not align with VFC, we use an workaround method
 # We just do run time automation 
 
-# 4.Register all clouds
-register_all_clouds(parameters)
-
-# 5.add_policies function not currently working, using curl commands
+# 6.add_policies function not currently working, using curl commands
 # add_policies(parameters)
 
-# 6. VFC part
+# 7. VFC part
 vnf_onboard_output = onboard_vnf(parameters)
 print vnf_onboard_output
 ns_onboard_out = onboard_ns(parameters)
index bfdbb0d..1277461 100755 (executable)
@@ -1,14 +1,14 @@
 {
     "open_cli_product" : "onap-dublin",
     "open_cli_home" : "/root/cli/deployment/zip/target/deployunzip",
-    "aai_url" : "https://10.12.6.235:30233",
+    "aai_url" : "https://10.12.5.224:30233",
     "aai_username" : "AAI",
     "aai_password" : "AAI",
     "sdc_catalog_url" : "http://10.12.6.235:30205",
     "sdc_password" : "demo123456!",
     "sdc_creator" : "cs0008",
 
-    "multicloud_url" : "http://10.12.6.235:30280",
+    "multicloud_url" : "http://10.12.5.224:30280",
     "policy_url" : "https://10.12.6.235:30240",
     "policy_username" : "testpdp",
     "policy_password" : "alpha123",
             }
         }
     ],
+    "vnfm_params":{
+        "GVNFMDRIVER":{
+           "type": "gvnfmdriver",
+           "vendor": "vfc",
+           "version": "v1.0",
+            "url": "http://msb-iag:80/",
+           "vim-id": "CloudOwner_ONAP-POD-01-Rail-07",
+            "user-name": "admin",
+           "user-password": "admin",
+           "vnfm-version": "v1.0"
+       }
+    },
     "sdc-controller-id": "2"
 }