Unify ssh_command. Allow remote ssh with paramiko and localhost with subprocess
[osm/openvim.git] / osm_openvim / vim_schema.py
index 1925f05..9440872 100644 (file)
@@ -298,7 +298,9 @@ host_data_schema={
                             "properties": {
                                 "core_id": integer0_schema,
                                 "thread_id": integer0_schema,
-                                "status": {"type": "string", "enum": ["noteligible"]}
+                                "status": {"type": "string", "enum": ["noteligible"]},
+                                "instance_id": {"type": "string"},   # ignored, just for compatibility with host-list
+                                "v_thread_id": {"type": "integer"}   # ignored, just for compatibility with host-list
                             },
                             "additionalProperties": False,
                             "required": ["core_id", "thread_id"]
@@ -344,7 +346,7 @@ host_data_schema={
         }
     },
     "additionalProperties": False,
-    "required": ["name", "ip_name"]
+    "required": ["name", "user", "ip_name"]
 }
 
 host_edit_schema={
@@ -603,10 +605,26 @@ network_new_schema = {
                 "enable_dhcp": {"type": "boolean"},
                 "dhcp_first_ip": ip_schema,
                 "dhcp_last_ip": ip_schema,
+                "dns": {"type": "array", "items": [ip_schema]},
+                "links":    {"type": "array", "items": {"type": "object", "properties": {
+                                "nat": cidr_schema,
+                                "iface": name_schema,
+                                "vlan": vlan_schema},
+                                "required": ["iface"],
+                                "additionalProperties": False
+                                },
+
+                             },
+                "routes":   {"type": "object", "properties":  {"default": ip_schema}, "patternProperties": {
+                                                            "^([0-9]{1,3}.){3}[0-9]{1,3}/[0-9]{1,2}$": ip_schema,
+                                                            },
+                                                            "additionalProperties": False
+                             },
+
                 "bind_net": name_schema,   # can be name, or uuid
                 "bind_type": {"oneOf": [{"type": "null"}, {"type": "string", "pattern": "^vlan:[0-9]{1,4}$"}]}
             },
-            "required": ["name"]
+        "required": ["name"]
         }
     },
     "required": ["network"],