Feature 10909: Heal operation for VDU
[osm/NBI.git] / osm_nbi / validation.py
index ae9644c..7e50aa9 100644 (file)
@@ -492,6 +492,7 @@ ns_action = {  # TODO for the moment it is only contemplated the vnfd primitive
     "required": ["primitive", "primitive_params"],  # TODO add member_vnf_index
     "additionalProperties": False,
 }
+
 ns_scale = {  # TODO for the moment it is only VDU-scaling
     "title": "ns scale input schema",
     "$schema": "http://json-schema.org/draft-04/schema#",
@@ -549,6 +550,51 @@ ns_migrate = {
     "additionalProperties": False
 }
 
+ns_heal = {
+    "title": "ns heal input schema",
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "type": "object",
+    "properties": {
+        "lcmOperationType": string_schema,
+        "nsInstanceId": id_schema,
+        "timeout_ns_heal": integer1_schema,
+        "healVnfData": {
+            "type": "array",
+            "items": {
+                "type": "object",
+                "properties": {
+                    "vnfInstanceId": id_schema,
+                    "cause": description_schema,
+                    "additionalParams": {
+                        "type": "object",
+                        "properties": {
+                            "run-day1": bool_schema,
+                            "vdu": {
+                                "type": "array",
+                                "items": {
+                                    "type": "object",
+                                    "properties": {
+                                        "run-day1": bool_schema,
+                                        "vdu-id": name_schema,
+                                        "count-index": integer0_schema,
+                                    },
+                                    "required": ["vdu-id"],
+                                    "additionalProperties": False,
+                                },
+                            },
+                        },
+                        "additionalProperties": False,
+                    },
+                },
+                "required": ["vnfInstanceId"],
+                "additionalProperties": False,
+            },
+        },
+    },
+    "required": ["healVnfData"],
+    "additionalProperties": False,
+}
+
 schema_version = {"type": "string", "enum": ["1.0"]}
 schema_type = {"type": "string"}
 vim_type = shortname_schema  # {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]}
@@ -1117,6 +1163,7 @@ nbi_new_input_schemas = {
     "ns_action": ns_action,
     "ns_scale": ns_scale,
     "ns_update": ns_update,
+    "ns_heal": ns_heal,
     "pdus": pdu_new_schema,
 }