REST API
The hyperglass API is based on the powerful FastAPI framework, which includes automatic API documentation using the OpenAPI specification. If you plan to provide your users with API access to your hyperglass instance, it is highly recommended to leave this enabled.
FastAPI provides built in support for both Swagger UI and Redoc, which are open source projects that create a pretty web UI from an OpenAPI specification.
#
SettingsParameter | Type | Default | Description |
---|---|---|---|
enable | Boolean | true | Enable or disable the API documentation. |
title | String | '{site_title} API Documentation' | API documentation title. {site_title} will be replaced with the site_title parameter. |
description | String | API documentation description appearing below the title. | |
base_url | String | 'https://lg.example.net' | The base URL for your hyperglass site. Used by OpenAPI for dynamically creating hyperlinks. |
mode | String | 'redoc' | OpenAPI UI library to use for the hyperglass API docs. Must be redoc or swagger |
uri | String | '/api/docs' | HTTP URI/path where API documentation can be accessed. |
openapi_uri | String | '/openapi.json' | Path to the automatically generated openapi.json file. |
queries | /queries endpoint settings ➡️ | ||
query | /query endpoint settings ➡️ | ||
devices | /devices endpoint settings ➡️ |
queries
#
Parameter | Type | Default | Description |
---|---|---|---|
title | String | 'Supported Queries' | Displayed as the header text above the API endpoint section. |
description | String | 'List of supported query types.' | Displayed inside each API endpoint section. |
summary | String | 'Query Types' | Displayed beside the API endpoint URI. |
query
#
Parameter | Type | Default | Description |
---|---|---|---|
title | String | 'Submit Query' | Displayed as the header text above the API endpoint section. |
description | String | 'Request a query response per-location.' | Displayed inside each API endpoint section. |
summary | String | 'Query the Looking Glass' | Displayed beside the API endpoint URI. |
devices
#
Parameter | Type | Default | Description |
---|---|---|---|
title | String | 'Devices' | Displayed as the header text above the API endpoint section. |
description | String | 'List of all devices/locations with associated identifiers, display names, networks, & VRFs.' | Displayed inside each API endpoint section. |
summary | String | 'Devices List' | Displayed beside the API endpoint URI. |
#
Examplehyperglass.yaml
From the developer
I'm partial to Redoc, partially because I find it to be more aesthetically pleasing, and partially because it's written in ReactJS, just like the hyperglass UI. At some point, I plan to migrate away from the built-in Redoc page and integrate Redoc directly with hyperglass.