Manifest schema now validates partition definition

S3 partitioning is disallowed for now
This commit is contained in:
Anders Ingemann 2013-10-29 22:41:29 +01:00
parent cf3c861a27
commit 71adb3d04e
4 changed files with 85 additions and 33 deletions

View file

@ -9,8 +9,8 @@
"bootstrapper": {
"type": "object",
"properties": {
"workspace": { "type": "string" },
"mirror": { "type": "string" },
"workspace": { "$ref": "#/definitions/path" },
"mirror": { "type": "string", "format": "uri" },
"tarball": { "type": "boolean" }
},
"required": ["workspace"]
@ -18,14 +18,8 @@
"system": {
"type": "object",
"properties": {
"release": {
"type": "string",
"enum": ["wheezy"]
},
"architecture": {
"type": "string",
"enum": ["i386", "amd64"]
},
"release": { "enum": ["wheezy"] },
"architecture": { "enum": ["i386", "amd64"] },
"timezone": { "type": "string" },
"locale": { "type": "string" },
"charmap": { "type": "string" }
@ -33,13 +27,18 @@
"required": ["release", "architecture", "timezone", "locale", "charmap"]
},
"volume": {
"type": "object"
// "properties": {
// "backing": {
// "type": "string"
// }
// },
// "required": ["backing"]
"type": "object",
"properties": {
"backing": { "type": "string" },
"partitions": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/no_partitions" },
{ "$ref": "#/definitions/partition_table" }
]
}
},
"required": ["partitions"]
},
"plugins": {
"type": "object",
@ -57,5 +56,44 @@
"additionalProperties": false
}
},
"required": ["provider", "bootstrapper", "volume", "system"]
"required": ["provider", "bootstrapper", "volume", "system"],
"definitions": {
"path": {
"type": "string",
"pattern": "^[^\\0]+$"
},
"no_partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none"] },
"root": { "$ref": "#/definitions/partition" }
},
"required": ["root"],
"additionalProperties": false
},
"partition_table": {
"type": "object",
"properties": {
"type": { "enum": ["mbr", "gpt"] },
"boot": { "$ref": "#/definitions/partition" },
"root": { "$ref": "#/definitions/partition" },
"swap": {
"type": "object",
"properties": { "size": { "type": "integer", "minimum": 1 } },
"required": ["size"]
}
},
"required": ["root"],
"additionalProperties": false
},
"partition": {
"type": "object",
"properties": {
"size": { "type": "integer", "minimum": 1 },
"filesystem": { "enum": ["ext2", "ext3", "ext4", "xfs"] }
},
"required": ["size", "filesystem"]
}
},
"required": ["provider", "bootstrapper", "system", "volume"]
}

View file

@ -25,6 +25,17 @@
}
},
"required": ["bucket"]
},
"volume": {
"type": "object",
"properties": {
"partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none"] }
}
}
}
}
},
"required": ["image"]

View file

@ -3,6 +3,17 @@
"title": "EC2 manifest",
"type": "object",
"properties": {
"image": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"credentials": {
"type": "object",
"properties": {
@ -17,13 +28,10 @@
"volume": {
"type": "object",
"properties": {
"backing": {
"type": "string",
"enum": ["ebs", "s3"]
}
"backing": { "enum": ["ebs", "s3"] }
},
"required": ["backing"]
}
},
"required": ["volume"]
"required": ["image"]
}

View file

@ -10,13 +10,8 @@
"type": "string",
"enum": ["raw", "vdi", "qcow2"]
}
// "filesystem": {
// "type": "string",
// "enum": ["ext2", "ext3", "ext4", "xfs"]
// }
},
"required": ["backing"]
}
},
"required": ["volume"]
}
}