+dhcp_schema = {
+ "title":"DHCP schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type":"object",
+ "properties":{
+ "enabled": {"type": "boolean"},
+ "start-address": ip_schema,
+ "count": integer1_schema
+ },
+ "required": ["enabled", "start-address", "count"],
+}
+
+ip_profile_schema = {
+ "title":"IP profile schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type":"object",
+ "properties":{
+ "ip-version": {"type":"string", "enum":["IPv4","IPv6"]},
+ "subnet-address": ip_prefix_schema,
+ "gateway-address": ip_schema,
+ "dns-address": ip_schema,
+ "dhcp": dhcp_schema
+ },
+}
+
+key_pair_schema = {
+ "title": "Key-pair schema for cloud-init configuration schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type":"object",
+ "properties":{
+ "name": name_schema,
+ "key": {"type":"string"}
+ },
+ "required": ["key"],
+ "additionalProperties": False
+}
+
+cloud_config_user_schema = {
+ "title": "User schema for cloud-init configuration schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type":"object",
+ "properties":{
+ "name": nameshort_schema,
+ "user-info": {"type":"string"},
+ #"key-pairs": {"type" : "array", "items": key_pair_schema}
+ "key-pairs": {"type" : "array", "items": {"type":"string"}}
+ },
+ "required": ["name"],
+ "additionalProperties": False
+}
+
+cloud_config_schema = {
+ "title": "Cloud-init configuration schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type":"object",
+ "properties":{
+ #"key-pairs": {"type" : "array", "items": key_pair_schema},
+ "key-pairs": {"type" : "array", "items": {"type":"string"}},
+ "users": {"type" : "array", "items": cloud_config_user_schema}
+ },
+ "additionalProperties": False
+}
+