Use ip_profile_schema in validation.py 94/12994/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 22 Feb 2023 15:52:24 +0000 (16:52 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 22 Feb 2023 15:55:54 +0000 (16:55 +0100)
Change-Id: If5742f94acba919d5400fabc4c601e45b05c1bdb
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_nbi/validation.py

index 58ecaf7..33ede77 100644 (file)
@@ -194,19 +194,6 @@ ip_profile_dhcp_schema = {
 }
 
 ip_profile_schema = {
-    "title": "ip profile validation schema",
-    "$schema": "http://json-schema.org/draft-04/schema#",
-    "type": "object",
-    "properties": {
-        "ip-version": {"enum": ["ipv4", "ipv6"]},
-        "subnet-address": ip_prefix_schema,
-        "gateway-address": ip_schema,
-        "dns-server": ip_profile_dns_schema,
-        "dhcp-params": ip_profile_dhcp_schema,
-    },
-}
-
-ip_profile_update_schema = {
     "title": "ip profile validation schema",
     "$schema": "http://json-schema.org/draft-04/schema#",
     "type": "object",
@@ -253,7 +240,7 @@ ns_instantiate_internal_vld = {
         "name": name_schema,
         "vim-network-name": name_schema,
         "vim-network-id": name_schema,
-        "ip-profile": ip_profile_update_schema,
+        "ip-profile": ip_profile_schema,
         "provider-network": provider_network_schema,
         "internal-connection-point": {
             "type": "array",
@@ -394,7 +381,7 @@ ns_instantiate = {
                     "vim-network-id": {"oneOf": [string_schema, object_schema]},
                     "ns-net": object_schema,
                     "wimAccountId": {"oneOf": [id_schema, bool_schema, null_schema]},
-                    "ip-profile": object_schema,
+                    "ip-profile": ip_profile_schema,
                     "provider-network": provider_network_schema,
                     "vnfd-connection-point-ref": {
                         "type": "array",