1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-17 08:48:05 +00:00
thatmattlove-hyperglass/hyperglass/configuration/models/docs.py
2020-02-01 12:50:12 -10:00

41 lines
1.3 KiB
Python

"""Configuration for API docs feature."""
# Third Party Imports
from pydantic import StrictBool
from pydantic import StrictStr
from pydantic import constr
# Project Imports
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"
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",
)