Commit 42083eea authored by Rafael Monnerat's avatar Rafael Monnerat

kvm/theia: Dont use allOf on resilient to extend properties

  allOf implies that all (both) schemas should be valid, but
    additionalProperties false wont allow it, since it become multually
    invalid. (You can validate only one or None)

  Just use $ref to expand the list, it end up with the expected outcome
   reducing complexity.

  Note: kvm wasn't using additionalProperties false but it was changed
   because it makes it future proof, in case we set it (we should set).
parent 5b2556a1
Pipeline #36141 failed with stage
in 0 seconds
{ {
"type": "object", "type": "object",
"$schema": "http://json-schema.org/draft-06/schema", "$schema": "http://json-schema.org/draft-06/schema",
"allOf": [ "description": "Parameters to instantiate resilient KVM",
{ "additionalProperties": false,
"$ref": "./instance-kvm-input-schema.json#" "properties": {
"$ref": "./instance-kvm-input-schema.json#/properties",
"resilient-clone-number": {
"title": "Amount of backup(s) to create",
"description": "Amount of backup(s) to create. Each backup consists of a Pull Backup Server and a clone.",
"type": "integer",
"default": 1,
"optional": true
}, },
{ "-sla-0-computer_guid": {
"properties": { "title": "Target computer for main instance",
"resilient-clone-number": { "description": "Target computer GUID for main instance.",
"title": "Amount of backup(s) to create", "type": "string",
"description": "Amount of backup(s) to create. Each backup consists of a Pull Backup Server and a clone.", "optional": true
"type": "integer", },
"default": 1, "-sla-1-computer_guid": {
"optional": true "title": "Target computer for first clone",
}, "description": "Target computer for first clone and PBS.",
"-sla-0-computer_guid": { "type": "string",
"title": "Target computer for main instance", "optional": true
"description": "Target computer GUID for main instance.", },
"type": "string", "-sla-pbs1-computer_guid": {
"optional": true "title": "Target computer for first PBS",
}, "description": "Target computer for first PBS instance.",
"-sla-1-computer_guid": { "type": "string",
"title": "Target computer for first clone", "optional": true
"description": "Target computer for first clone and PBS.", },
"type": "string", "-sla-2-computer_guid": {
"optional": true "title": "Target computer for second clone",
}, "description": "Target computer for second clone and PBS.",
"-sla-pbs1-computer_guid": { "type": "string",
"title": "Target computer for first PBS", "optional": true
"description": "Target computer for first PBS instance.", },
"type": "string", "-sla-pbs2-computer_guid": {
"optional": true "title": "Target computer for second PBS",
}, "description": "Target computer for second PBS instance.",
"-sla-2-computer_guid": { "type": "string",
"title": "Target computer for second clone", "optional": true
"description": "Target computer for second clone and PBS.", },
"type": "string", "resiliency-backup-periodicity": {
"optional": true "title": "Periodicity of backup",
}, "description": "Periodicity of backup, in cron format.",
"-sla-pbs2-computer_guid": { "type": "string",
"title": "Target computer for second PBS", "optional": true
"description": "Target computer for second PBS instance.", },
"type": "string", "remove-backup-older-than": {
"optional": true "title": "Remove backups older than...",
}, "description": "Remove all the backups in PBS that are older than specified value. It should be rdiff-backup-compatible.",
"resiliency-backup-periodicity": { "type": "string",
"title": "Periodicity of backup", "default": "2W",
"description": "Periodicity of backup, in cron format.", "optional": true
"type": "string",
"optional": true
},
"remove-backup-older-than": {
"title": "Remove backups older than...",
"description": "Remove all the backups in PBS that are older than specified value. It should be rdiff-backup-compatible.",
"type": "string",
"default": "2W",
"optional": true
}
}
} }
] }
} }
...@@ -2,65 +2,60 @@ ...@@ -2,65 +2,60 @@
"$schema": "http://json-schema.org/draft-06/schema", "$schema": "http://json-schema.org/draft-06/schema",
"type": "object", "type": "object",
"description": "Parameters to instantiate resilient Theia", "description": "Parameters to instantiate resilient Theia",
"allOf": [ "additionalProperties": false,
{ "properties": {
"$ref": "./instance-input-schema.json#" "resilient-clone-number": {
"title": "Amount of backup(s) to create",
"description": "Amount of backup(s) to create. Each backup consists of a Pull Backup Server and a clone.",
"type": "integer",
"default": 1,
"minimum": 0,
"maximum": 2,
"optional": true
}, },
{ "-sla-theia0-computer_guid": {
"properties": { "title": "Target computer for main instance",
"resilient-clone-number": { "description": "Target computer GUID for main instance.",
"title": "Amount of backup(s) to create", "type": "string",
"description": "Amount of backup(s) to create. Each backup consists of a Pull Backup Server and a clone.", "optional": true
"type": "integer", },
"default": 1, "-sla-theia1-computer_guid": {
"minimum": 0, "title": "Target computer for first clone",
"maximum": 2, "description": "Target computer for first clone instance.",
"optional": true "type": "string",
}, "optional": true
"-sla-theia0-computer_guid": { },
"title": "Target computer for main instance", "-sla-pbs1-computer_guid": {
"description": "Target computer GUID for main instance.", "title": "Target computer for first PBS",
"type": "string", "description": "Target computer for first PBS instance.",
"optional": true "type": "string",
}, "optional": true
"-sla-theia1-computer_guid": { },
"title": "Target computer for first clone", "-sla-theia2-computer_guid": {
"description": "Target computer for first clone instance.", "title": "Target computer for second clone",
"type": "string", "description": "Target computer for second clone instance.",
"optional": true "type": "string",
}, "optional": true
"-sla-pbs1-computer_guid": { },
"title": "Target computer for first PBS", "-sla-pbs2-computer_guid": {
"description": "Target computer for first PBS instance.", "title": "Target computer for second PBS",
"type": "string", "description": "Target computer for second PBS instance.",
"optional": true "type": "string",
}, "optional": true
"-sla-theia2-computer_guid": { },
"title": "Target computer for second clone", "resiliency-backup-periodicity": {
"description": "Target computer for second clone instance.", "title": "Periodicity of backup",
"type": "string", "description": "Periodicity of backup, in cron format.",
"optional": true "type": "string",
}, "optional": true
"-sla-pbs2-computer_guid": { },
"title": "Target computer for second PBS", "remove-backup-older-than": {
"description": "Target computer for second PBS instance.", "title": "Remove backups older than...",
"type": "string", "description": "Remove all the backups in PBS that are older than specified value. It should be rdiff-backup-compatible.",
"optional": true "type": "string",
}, "default": "2W",
"resiliency-backup-periodicity": { "optional": true
"title": "Periodicity of backup", },
"description": "Periodicity of backup, in cron format.", "$ref": "./instance-input-schema.json#/properties"
"type": "string", }
"optional": true
},
"remove-backup-older-than": {
"title": "Remove backups older than...",
"description": "Remove all the backups in PBS that are older than specified value. It should be rdiff-backup-compatible.",
"type": "string",
"default": "2W",
"optional": true
}
}
}
]
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment