Skip to content
Snippets Groups Projects
Commit f69358a6 authored by Erik Reid's avatar Erik Reid
Browse files

refactored config schema for readability

parent 9e1f9fb7
No related branches found
No related tags found
No related merge requests found
......@@ -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": [
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment