1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

add API endpoint docs

This commit is contained in:
checktheroads
2020-02-01 12:50:12 -10:00
parent 0d91c79af9
commit af4a0b0ea7
4 changed files with 235 additions and 10 deletions

View File

@@ -9,13 +9,33 @@ from hyperglass.configuration.models._utils import AnyUri
from hyperglass.configuration.models._utils import HyperglassModel
class EndpointConfig(HyperglassModel):
"""Validation model for per API endpoint documentation."""
title: StrictStr
description: StrictStr
summary: StrictStr
class Docs(HyperglassModel):
"""Validation model for params.docs."""
enable: StrictBool = True
mode: constr(regex=r"(swagger|redoc)") = "swagger"
uri: AnyUri = "/docs"
endpoint_summary: StrictStr = "Query Endpoint"
endpoint_description: StrictStr = "Request a query response per-location."
group_title: StrictStr = "Queries"
openapi_url: AnyUri = "/openapi.json"
query: EndpointConfig = {
"title": "Submit Query",
"description": "Request a query response per-location.",
"summary": "Query the Looking Glass",
}
devices: EndpointConfig = EndpointConfig(
title="Devices",
description="List of all devices/locations with associated identifiers, display names, networks, & VRFs.",
summary="Devices List",
)
queries: EndpointConfig = EndpointConfig(
title="Supported Queries",
description="List of supported query types.",
summary="Query Types",
)