diff --git a/README.md b/README.md index ec524e2c6e351f14c97ace885e062fdbce6f3f1e..dc2faf5ca4906236aefe16643c9361a7479baf18 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,12 @@ must be formatted according to the following json schema: "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { - "database_credentials": { + "timeout": { + "type": "number", + "maximum": 10, # sanity + "exclusiveMinimum": 0 + }, + "database-credentials": { "type": "object", "properties": { "hostname": {"type": "string"}, @@ -64,16 +69,8 @@ must be formatted according to the following json schema: }, "required": ["hostname", "dbname", "username", "password"], "additionalProperties": False - - } - }, - - "type": "object", - "properties": { - "alarms-db": {"$ref": "#/definitions/database_credentials"}, - "ops-db": {"$ref": "#/definitions/database_credentials"}, - "oid_list.conf": {"type": "string"}, - "ssh": { + }, + "ssh-credentials": { "type": "object", "properties": { "username": {"type": "string"}, @@ -83,54 +80,76 @@ must be formatted according to the following json schema: "required": ["private-key", "known-hosts"], "additionalProperties": False }, - "redis": { + "redis-credentials": { "type": "object", "properties": { "hostname": {"type": "string"}, - "port": {"type": "integer"} + "port": {"type": "integer"}, + "socket_timeout": {"$ref": "#/definitions/timeout"} }, "required": ["hostname", "port"], "additionalProperties": False }, - "junosspace": { - "api": {"type": "string"}, - "username": {"type": "string"}, - "password": {"type": "string"} + "redis-sentinel-config": { + "type": "object", + "properties": { + "hostname": {"type": "string"}, + "port": {"type": "integer"}, + "name": {"type": "string"}, + "redis_socket_timeout": {"$ref": "#/definitions/timeout"}, + "sentinel_socket_timeout": {"$ref": "#/definitions/timeout"} + }, + "required": ["hostname", "port", "name"], + "additionalProperties": False }, - "infinera-dna": { + "interface-address": { + "type": "object", + "properties": { + "address": {"type": "string"}, + "network": {"type": "string"}, + "interface": {"type": "string"}, + "router": {"type": "string"} + }, + "required": ["address", "network", "interface", "router"], + "additionalProperties": False + } + }, + + "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", - "items": { - "type": "object", - "properties": { - "name": {"type": "string"}, - "address": {"type": "string"} - }, - "required": ["name", "address"], - "additionalProperties": False - } + "minItems": 1, + "items": {"type": "integer"} }, - "coriant-tnms": { + "managed-routers": {"type": "string"}, + "unmanaged-interfaces": { "type": "array", - "items": { - "type": "object", - "properties": { - "name": {"type": "string"}, - "address": {"type": "string"} - }, - "required": ["name", "address"], - "additionalProperties": False - } + "items": {"$ref": "#/definitions/interface-address"} } }, - "required": [ - "alarms-db", - "ops-db", - "oid_list.conf", - "ssh", - "redis", - "junosspace", - "infinera-dna", - "coriant-tnms"], + "oneOf": [ + { + "required": [ + "ops-db", + "ssh", + "redis", + "redis-databases", + "managed-routers"] + }, + { + "required": [ + "ops-db", + "ssh", + "sentinel", + "redis-databases", + "managed-routers"] + } + ], "additionalProperties": False } ```