stages/cloud-init: add support for configuring reporting handlers

It's possible the keys "logging" and "telemetry" can be arbitrary names.
If that's the case, we can change the schema without breaking backwards
compatibility, so defining known keys is safer.
This commit is contained in:
Achilleas Koutsou 2021-11-03 14:43:57 +01:00 committed by Christian Kellner
parent 3ee19645a3
commit 4ac004e178

View file

@ -24,6 +24,12 @@ import osbuild.api
SCHEMA = r"""
"definitions": {
"reporting_handlers": {
"type": "string",
"enum": ["log", "print", "webhook", "hyperv"]
}
},
"additionalProperties": false,
"required": ["config", "filename"],
"properties": {
@ -58,6 +64,32 @@ SCHEMA = r"""
}
}
},
"reporting": {
"type": "object",
"additionalProperties": false,
"description": "Define reporting endpoints.",
"minProperties": 1,
"properties": {
"logging": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"$ref": "#/definitions/reporting_handlers"
}
}
},
"telemetry": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"$ref": "#/definitions/reporting_handlers"
}
}
}
}
},
"datasource_list": {
"type": "array",
"items": {