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:
@@ -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",
|
||||
)
|
||||
|
Reference in New Issue
Block a user