Add timeout_ns_update to the NS update params in valdation.py
[osm/NBI.git] / osm_nbi / validation.py
index fc16f06..5c75522 100644 (file)
@@ -157,7 +157,7 @@ ns_instantiate_vdu = {
                 "type": "object",
                 "properties": {
                     "name": name_schema,
-                    "ip-address": ip_schema,
+                    "ip-address": {"oneOf": [ip_schema, ipv6_schema]},
                     "mac-address": mac_schema,
                     "floating-ip-required": bool_schema,
                 },
@@ -176,7 +176,7 @@ ip_profile_dns_schema = {
     "items": {
         "type": "object",
         "properties": {
-            "address": ip_schema,
+            "address": {"oneOf": [ip_schema, ipv6_schema]},
         },
         "required": ["address"],
         "additionalProperties": False,
@@ -246,7 +246,7 @@ provider_network_schema = {
 }
 
 ns_instantiate_internal_vld = {
-    "title": "ns action instantiate input schema for vdu",
+    "title": "ns action instantiate input schema for vld",
     "$schema": "http://json-schema.org/draft-04/schema#",
     "type": "object",
     "properties": {
@@ -316,6 +316,19 @@ additional_params_for_vnf = {
                     "additionalProperties": False,
                 },
             },
+            "affinity-or-anti-affinity-group": {
+                "type": "array",
+                "items": {
+                    "type": "object",
+                    "properties": {
+                        "id": name_schema,
+                        "vim-affinity-group-id": name_schema,
+                    },
+                    "required": ["id"],
+                    "minProperties": 2,
+                    "additionalProperties": False,
+                },
+            },
         },
         "required": ["member-vnf-index"],
         "minProperties": 2,
@@ -391,7 +404,7 @@ ns_instantiate = {
                             "properties": {
                                 "member-vnf-index-ref": name_schema,
                                 "vnfd-connection-point-ref": name_schema,
-                                "ip-address": ip_schema,
+                                "ip-address": {"oneOf": [ip_schema, ipv6_schema]},
                                 # "mac-address": mac_schema,
                             },
                             "required": [
@@ -427,6 +440,39 @@ ns_terminate = {
     "additionalProperties": False,
 }
 
+ns_update = {
+    "title": "ns update input schema",
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "type": "object",
+    "properties": {
+        "lcmOperationType": string_schema,
+        "nsInstanceId": id_schema,
+        "timeout_ns_update": integer1_schema,
+        "updateType": {
+            "enum": ["CHANGE_VNFPKG", "REMOVE_VNF", "MODIFY_VNF_INFORMATION"]
+        },
+        "modifyVnfInfoData": {
+            "type": "object",
+            "properties": {
+                "vnfInstanceId": id_schema,
+                "vnfdId": id_schema,
+            },
+            "required": ["vnfInstanceId", "vnfdId"],
+        },
+        "removeVnfInstanceId": id_schema,
+        "changeVnfPackageData": {
+            "type": "object",
+            "properties": {
+                "vnfInstanceId": id_schema,
+                "vnfdId": id_schema,
+            },
+            "required": ["vnfInstanceId", "vnfdId"],
+        },
+    },
+    "required": ["updateType"],
+    "additionalProperties": False,
+}
+
 ns_action = {  # TODO for the moment it is only contemplated the vnfd primitive execution
     "title": "ns action input schema",
     "$schema": "http://json-schema.org/draft-04/schema#",
@@ -503,6 +549,7 @@ vim_account_edit_schema = {
         "vim_password": passwd_schema,
         "vca": id_schema,
         "config": {"type": "object"},
+        "prometheus-config": {"type": "object"},
     },
     "additionalProperties": False,
 }
@@ -527,6 +574,7 @@ vim_account_new_schema = {
         "vim_password": passwd_schema,
         "vca": id_schema,
         "config": {"type": "object"},
+        "prometheus-config": {"type": "object"},
     },
     "required": [
         "name",
@@ -924,6 +972,7 @@ user_edit_schema = {
     "type": "object",
     "properties": {
         "password": passwd_schema,
+        "old_password": passwd_schema,
         "username": string_schema,  # To allow User Name modification
         "projects": {"oneOf": [nameshort_list_schema, array_edition_schema]},
         "project_role_mappings": project_role_mappings,
@@ -1032,6 +1081,7 @@ nbi_new_input_schemas = {
     "ns_instantiate": ns_instantiate,
     "ns_action": ns_action,
     "ns_scale": ns_scale,
+    "ns_update": ns_update,
     "pdus": pdu_new_schema,
 }