From 14b1680ff4b3ea79c9fd01b09ca78db1b9561156 Mon Sep 17 00:00:00 2001 From: Erik Reid <erik.reid@geant.org> Date: Fri, 17 Apr 2020 10:55:27 +0200 Subject: [PATCH] added unmanaged-interfaces to config schema --- inventory_provider/config.py | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/inventory_provider/config.py b/inventory_provider/config.py index 59953f2e..9000efbd 100644 --- a/inventory_provider/config.py +++ b/inventory_provider/config.py @@ -6,6 +6,11 @@ CONFIG_SCHEMA = { "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { + "timeout": { + "type": "number", + "maximum": 10, # sanity + "exclusiveMinimum": 0 + }, "database-credentials": { "type": "object", "properties": { @@ -50,14 +55,25 @@ CONFIG_SCHEMA = { "additionalProperties": False }, "junosspace-credentials": { - "api": {"type": "string"}, - "username": {"type": "string"}, - "password": {"type": "string"} + "type": "object", + "properties": { + "api": {"type": "string"}, + "username": {"type": "string"}, + "password": {"type": "string"} + }, + "required": ["api", "username", "password"], + "additionalProperties": False }, - "timeout": { - "type": "number", - "maximum": 10, # sanity - "exclusiveMinimum": 0 + "interface-address": { + "type": "object", + "properties": { + "address": {"type": "string"}, + "network": {"type": "string"}, + "interface": {"type": "string"}, + "router": {"type": "string"} + }, + "required": ["address", "network", "interface", "router"], + "additionalProperties": False } }, @@ -73,6 +89,10 @@ CONFIG_SCHEMA = { "items": {"type": "integer"} }, "junosspace": {"$ref": "#/definitions/junosspace-credentials"}, + "unmanaged-interfaces": { + "type": "array", + "items": {"$ref": "#/definitions/interface-address"} + } }, "oneOf": [ { -- GitLab