fix additionalParamsNs/Vnf for the slice 56/7356/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 22 Mar 2019 13:27:12 +0000 (13:27 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 22 Mar 2019 13:27:12 +0000 (13:27 +0000)
Change-Id: I54906fc74ed798099815cc7a9165839039ea8eca
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_nbi/instance_topics.py
osm_nbi/nbi.py
osm_nbi/validation.py

index 7ad252f..8b18f0f 100644 (file)
@@ -1015,13 +1015,6 @@ class NsiTopic(BaseTopic):
                 indata_ns["vimAccountId"] = slice_request.get("vimAccountId")
                 indata_ns["nsDescription"] = service["description"]
                 indata_ns["key-pair-ref"] = None
-                for additional_params_subnet in get_iterable(slice_request.get("additionalParamsForSubnet")):
-                    if additional_params_subnet["id"] == service["id"]:
-                        if additional_params_subnet.get("additionalParamsForNs"):
-                            indata_ns["additionalParamsForNs"] = additional_params_subnet["additionalParamsForNs"]
-                        if additional_params_subnet.get("additionalParamsForVnf"):
-                            indata_ns["additionalParamsForVnf"] = additional_params_subnet["additionalParamsForVnf"]
-                        break
 
                 # NsrTopic(rollback, session, indata_ns, kwargs, headers, force)
                 # Overwriting ns_params filtering by nsName == netslice-subnet.id
@@ -1032,7 +1025,8 @@ class NsiTopic(BaseTopic):
                             copy_ns_param = deepcopy(ns_param)
                             del copy_ns_param["id"]
                             indata_ns.update(copy_ns_param)
-                # TODO: Improve network selection via networkID
+                            break
+                
                 # Override the instantiation parameters for netslice-vld provided by user
                 if nsi_vlds:
                     indata_ns_list = []
index 0417c9e..a9e2b24 100644 (file)
@@ -94,7 +94,7 @@ URL: /osm                                                       GET     POST
                 /<subscriptionId>                               5                       X
 
         /pdu/v1
-            /pdu_descriptor                                     O       O
+            /pdu_descriptors                                    O       O
                 /<id>                                           O               O       O       O
 
         /admin/v1
index 1dd70dc..7707a75 100644 (file)
@@ -638,26 +638,10 @@ nbi_edit_input_schemas = {
 }
 
 # NETSLICE SCHEMAS
-nsi_slice_instantiate = deepcopy(ns_instantiate)
-nsi_slice_instantiate["title"] = "netslice subnet instantiation params input schema"
-nsi_slice_instantiate["properties"]["id"] = name_schema
-nsi_slice_instantiate["properties"]["additionalParamsForNsi"] = object_schema
-nsi_slice_instantiate["properties"]["additionalParamsForSubnet"] = {
-    "type": "array",
-    "items": {
-        "type": "object",
-        "properties": {
-            "id": name_schema,
-            "additionalParamsForNs": object_schema,
-            "additionalParamsForVnf": additional_params_for_vnf
-        },
-        "required": ["id"],
-        "additionalProperties": False
-    }
-}
-del nsi_slice_instantiate["required"]
-del nsi_slice_instantiate["properties"]["additionalParamsForNs"]
-del nsi_slice_instantiate["properties"]["additionalParamsForVnf"]
+nsi_subnet_instantiate = deepcopy(ns_instantiate)
+nsi_subnet_instantiate["title"] = "netslice subnet instantiation params input schema"
+nsi_subnet_instantiate["properties"]["id"] = name_schema
+del nsi_subnet_instantiate["required"]
 
 nsi_vld_instantiate = {
     "title": "netslice vld instantiation params input schema",
@@ -686,10 +670,11 @@ nsi_instantiate = {
         "vimAccountId": id_schema,
         "ssh_keys": {"type": "string"},
         "nsi_id": id_schema,
+        "additionalParamsForNsi": object_schema,
         "netslice-subnet": {
             "type": "array",
             "minItems": 1,
-            "items": nsi_slice_instantiate
+            "items": nsi_subnet_instantiate
         },
         "netslice-vld": {
             "type": "array",