From 446cf624b8186937e5d38ef1e2e150609792285f Mon Sep 17 00:00:00 2001 From: checktheroads Date: Tue, 21 Jan 2020 17:32:31 -0700 Subject: [PATCH] centralize static-y definitions --- hyperglass/configuration/__init__.py | 9 +++++++++ hyperglass/configuration/models/docs.py | 1 + hyperglass/constants.py | 2 ++ 3 files changed, 12 insertions(+) diff --git a/hyperglass/configuration/__init__.py b/hyperglass/configuration/__init__.py index 11c0023..bd901d8 100644 --- a/hyperglass/configuration/__init__.py +++ b/hyperglass/configuration/__init__.py @@ -421,3 +421,12 @@ _frontend_params.update( } ) frontend_params = _frontend_params + +URL_DEV = f"http://localhost:{str(params.general.listen_port)}/api/" +URL_PROD = "/api/" + +REDIS_CONFIG = { + "host": str(params.general.redis_host), + "port": params.general.redis_port, + "decode_responses": True, +} diff --git a/hyperglass/configuration/models/docs.py b/hyperglass/configuration/models/docs.py index 4511b53..566789c 100644 --- a/hyperglass/configuration/models/docs.py +++ b/hyperglass/configuration/models/docs.py @@ -18,3 +18,4 @@ class Docs(HyperglassModel): endpoint_summary: StrictStr = "Query Endpoint" endpoint_description: StrictStr = "Request a query response per-location." group_title: StrictStr = "Queries" + openapi_url: AnyUri = "/openapi.json" diff --git a/hyperglass/constants.py b/hyperglass/constants.py index 48ecade..bfaf89b 100644 --- a/hyperglass/constants.py +++ b/hyperglass/constants.py @@ -34,6 +34,8 @@ LOG_HANDLER = {"sink": sys.stdout, "format": LOG_FMT, "level": "INFO"} LOG_HANDLER_FILE = {"format": LOG_FMT, "level": "INFO"} +STATUS_CODE_MAP = {"warning": 400, "error": 400, "danger": 500} + CREDIT = """ Powered by [**hyperglass**](https://github.com/checktheroads/hyperglass). Source code \ licensed \