2
0
Эх сурвалжийг харах

Fixes OpenStack and VMware providers schema

Alessandro Pilotti 9 жил өмнө
parent
commit
7714299025

+ 48 - 40
coriolis/providers/openstack/schemas/connection_info_schema.json

@@ -1,56 +1,64 @@
 {
   "$schema": "http://cloudbase.it/coriolis/schemas/openstack_connection#",
-  "type": "object",
-  "properties": {
-    "secret_ref": {
-      "type": "string"
-    },
-    "identity_api_version": {
-      "type": "integer"
-    },
-    "username": {
-      "type": "string"
-    },
-    "password": {
-      "type": "string"
-    },
-    "project_name": {
-      "type": "string"
-    },
-    "user_domain_name": {
-      "type": "string"
-    },
-    "project_domain_name": {
-      "type": "string"
-    },
-    "auth_url": {
-      "type": "string"
-    },
-    "allow_untrusted": {
-      "type": "boolean",
-      "default": false
-    }
-  },
   "oneOf": [
     {
-      "required": ["secret_ref"]
-    },
-    {
+      "type": "object",
+      "properties": {
+        "identity_api_version": {
+          "type": "integer",
+          "minimum": 2,
+          "maximum": 3
+        },
+        "username": {
+          "type": "string"
+        },
+        "password": {
+          "type": "string"
+        },
+        "project_name": {
+          "type": "string"
+        },
+        "user_domain_name": {
+          "type": "string"
+        },
+        "project_domain_name": {
+          "type": "string"
+        },
+        "auth_url": {
+          "type": "string"
+        },
+        "allow_untrusted": {
+          "type": "boolean",
+          "default": false
+        }
+      },
       "required": [
-        "identity_api_version",
         "username",
         "password",
         "project_name",
-        "user_domain_name",
-        "project_domain_name",
         "auth_url"
-      ]
+      ],
+      "additionalProperties": false
     },
     {
       "type": "object",
-      "additionalProperties": false,
       "properties": {
-      }
+        "secret_ref": {
+          "type": "string",
+          "format": "uri"
+        }
+      },
+      "required": ["secret_ref"],
+      "additionalProperties": false
+    },
+    {
+      "type": "object",
+      "properties": {
+      },
+      "additionalProperties": false
+    },
+    {
+      "type": "null"
     }
   ]
 }

+ 36 - 32
coriolis/providers/openstack/schemas/target_environment_schema.json

@@ -1,47 +1,51 @@
 {
   "$schema": "http://cloudbase.it/coriolis/schemas/openstack_target_environment#",
-  "type": "object",
-  "properties": {
-    "secret_ref": {
-      "type": "string"
-    },
-    "network_map": {
+  "oneOf": [
+    {
       "type": "object",
       "properties": {
-        "VM Network Local": {
+        "network_map": {
+          "type": "object"
+        },
+        "glance_upload": {
+          "type": "boolean"
+        },
+        "disk_format": {
+          "type": "string"
+        },
+        "container_format": {
+          "type": "string"
+        },
+        "hypervisor_type": {
+          "type": "string"
+        },
+        "migr_image_name": {
+          "type": "string"
+        },
+        "migr_image_name_map": {
+          "type": "object"
+        },
+        "migr_flavor_name": {
+          "type": "string"
+        },
+        "flavor_name": {
+          "type": "string"
+        },
+        "fip_pool_name": {
+          "type": "string"
+        },
+        "migr_fip_pool_name": {
           "type": "string"
         },
-        "VM Network": {
+        "keypair_name": {
           "type": "string"
         }
       },
-      "required": [
-        "VM Network Local",
-        "VM Network"
-      ]
-    },
-    "flavor_name": {
-      "type": "string"
-    },
-    "fip_pool_name": {
-      "type": "string"
-    },
-    "migr_fip_pool_name": {
-      "type": "string"
-    },
-    "keypair_name": {
-      "type": "string"
-    }
-  },
-  "oneOf": [
-    {
-      "required": ["secret_ref"]
-    },
-    {
       "required": [
         "network_map",
         "flavor_name"
-      ]
+      ],
+      "additionalProperties": false
     }
   ]
 }

+ 30 - 26
coriolis/providers/vmware_vsphere/schemas/connection_info_schema.json

@@ -1,38 +1,42 @@
 {
   "$schema": "http://cloudbase.it/coriolis/schemas/vmware_vsphere_connection#",
-  "type": "object",
-  "properties": {
-    "secret_ref": {
-      "type": "string"
-    },
-    "host": {
-      "type": "string"
-    },
-    "port": {
-      "type": "integer"
-    },
-    "username": {
-      "type": "string"
-    },
-    "password": {
-      "type": "string"
-    },
-    "allow_untrusted": {
-      "type": "boolean",
-      "default": false
-    }
-  },
   "oneOf": [
     {
-      "required": ["secret_ref"]
-    },
-    {
+      "type": "object",
+      "properties": {
+        "host": {
+          "type": "string"
+        },
+        "port": {
+          "type": "integer"
+        },
+        "username": {
+          "type": "string"
+        },
+        "password": {
+          "type": "string"
+        },
+        "allow_untrusted": {
+          "type": "boolean"
+        }
+      },
       "required": [
         "host",
         "port",
         "username",
         "password"
-      ]
+      ],
+      "additionalProperties": false
+    },
+    {
+      "type": "object",
+      "properties": {
+        "secret_ref": {
+          "type": "string"
+        }
+      },
+      "required": ["secret_ref"],
+      "additionalProperties": false
     }
   ]
 }