SOL003 API Align
[vfc/nfvo/lcm.git] / lcm / ns / biz / ns_instant.py
similarity index 97%
rename from lcm/ns/ns_instant.py
rename to lcm/ns/biz/ns_instant.py
index 698e77e..527a35e 100644 (file)
@@ -79,7 +79,7 @@ class InstantNSService(object):
             # start
             params_vnf = []
             plan_dict = json.JSONDecoder().decode(dst_plan)
-            for vnf in ignore_case_get(plan_dict, "vnfs"):
+            for vnf in ignore_case_get(plan_dict, "ns_vnfs"):
                 vnfd_id = vnf['properties']['id']
                 vnfm_type = vnf['properties'].get("nf_type", "undefined")
                 vimid = self.get_vnf_vim_id(vim_id, location_constraints, vnfd_id)
@@ -202,11 +202,11 @@ class InstantNSService(object):
 
     @staticmethod
     def set_vl_vim_id(vim_id, location_constraints, plan_dict):
-        if "vls" not in plan_dict:
+        if "ns_vls" not in plan_dict:
             logger.debug("No vl is found in nsd.")
             return
         vl_vnf = {}
-        for vnf in ignore_case_get(plan_dict, "vnfs"):
+        for vnf in ignore_case_get(plan_dict, "ns_vnfs"):
             if "dependencies" in vnf:
                 for depend in vnf["dependencies"]:
                     vl_vnf[depend["vl_id"]] = vnf['properties']['id']
@@ -215,7 +215,7 @@ class InstantNSService(object):
             if "vnfProfileId" in location:
                 vnfd_id = location["vnfProfileId"]
                 vnf_vim[vnfd_id] = location["locationConstraints"]["vimId"]
-        for vl in plan_dict["vls"]:
+        for vl in plan_dict["ns_vls"]:
             vnfdid = ignore_case_get(vl_vnf, vl["vl_id"])
             vimid = ignore_case_get(vnf_vim, vnfdid)
             if not vimid:
@@ -229,7 +229,7 @@ class InstantNSService(object):
     @staticmethod
     def get_model_count(context):
         data = json.JSONDecoder().decode(context)
-        vls = len(data.get('vls', []))
+        vls = len(data.get('ns_vls', []))
         sfcs = len(data.get('fps', []))
-        vnfs = len(data.get('vnfs', []))
+        vnfs = len(data.get('ns_vnfs', []))
         return {'vlCount': str(vls), 'sfcCount': str(sfcs), 'vnfCount': str(vnfs)}