diff --git a/inventory_provider/config.py b/inventory_provider/config.py index 4311d91c9aaa6217001d01dea1cc5fd75b8931c6..59953f2eb9fb43b3f0b7b1b5b09e36b0be0e9baa 100644 --- a/inventory_provider/config.py +++ b/inventory_provider/config.py @@ -6,7 +6,7 @@ CONFIG_SCHEMA = { "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { - "database_credentials": { + "database-credentials": { "type": "object", "properties": { "hostname": {"type": "string"}, @@ -17,17 +17,7 @@ CONFIG_SCHEMA = { "required": ["hostname", "dbname", "username", "password"], "additionalProperties": False }, - "timeout": { - "type": "number", - "maximum": 10, # sanity - "exclusiveMinimum": 0 - } - }, - - "type": "object", - "properties": { - "ops-db": {"$ref": "#/definitions/database_credentials"}, - "ssh": { + "ssh-credentials": { "type": "object", "properties": { "username": {"type": "string"}, @@ -37,7 +27,7 @@ CONFIG_SCHEMA = { "required": ["private-key", "known-hosts"], "additionalProperties": False }, - "redis": { + "redis-credentials": { "type": "object", "properties": { "hostname": {"type": "string"}, @@ -47,7 +37,7 @@ CONFIG_SCHEMA = { "required": ["hostname", "port"], "additionalProperties": False }, - "sentinel": { + "redis-sentinel-config": { "type": "object", "properties": { "hostname": {"type": "string"}, @@ -59,16 +49,30 @@ CONFIG_SCHEMA = { "required": ["hostname", "port", "name"], "additionalProperties": False }, + "junosspace-credentials": { + "api": {"type": "string"}, + "username": {"type": "string"}, + "password": {"type": "string"} + }, + "timeout": { + "type": "number", + "maximum": 10, # sanity + "exclusiveMinimum": 0 + } + }, + + "type": "object", + "properties": { + "ops-db": {"$ref": "#/definitions/database-credentials"}, + "ssh": {"$ref": "#/definitions/ssh-credentials"}, + "redis": {"$ref": "#/definitions/redis-credentials"}, + "sentinel": {"$ref": "#/definitions/redis-sentinel-config"}, "redis-databases": { "type": "array", "minItems": 1, "items": {"type": "integer"} }, - "junosspace": { - "api": {"type": "string"}, - "username": {"type": "string"}, - "password": {"type": "string"} - } + "junosspace": {"$ref": "#/definitions/junosspace-credentials"}, }, "oneOf": [ {