Skip to main content

Control interface for the GL Hub

Project description

HubAxle - control interface for the GL Hub

Exposes an HTTP API for controlling the GL Hub.

There are several primary functions:

  • Update the configuration files which the GL Runtime is consuming
  • Monitor status of the GL Runtime
  • Discover and set up cameras that are accessible to the hub

Command-line tools

  • poetry run discover-cameras - discover cameras on the local network
  • poetry run launch-service - start the hubaxle service

Using it.

  1. Set up a user by setting the HUB_LOGINS env var to username:password Either do this through the balena dashboard, or by running
docker compose up -e HUB_LOGINS="username:password" hubaxle
  1. Open the port on the hubaxle container. (port 8000 inside the container, port 80 on the host)

  2. Open /admin/ page, and authenticate with your login

  3. Create a config entry called runtime.yaml

  4. Watch as the glruntime container does what you tell it to!

Testing

poetry run pytest

Development:

If it's awkward to set the HUB_LOGINS env var, you can also run

./src/manage.py createsuperuser

from the hubaxle container, and then you can log in with the credentials you set.

API Development

Using DRF-spectacular, we completely auto-generate the Open-api spec and then in turn use that to autogenerate a client library using Openapi-generator. We then provide a thin wrapper around the client library to make it easier to use.

To generate the api-spec and the client library, inside the src directory run:

make generate-api

A couple of notes:

  • This means that schema.yaml should NEVER be manually edited.
  • Inside the autogenerated client library, we generate classes with the exact same name as the the Django models, and, by default, the exact same fields. Note this if there are any fields that you want to keep private. However, this model provides increased clarity, the data that you send in as a request maps extremely directly onto the model that the backend deals with

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hubaxle-0.1.8.tar.gz (76.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hubaxle-0.1.8-py3-none-any.whl (121.4 kB view details)

Uploaded Python 3

File details

Details for the file hubaxle-0.1.8.tar.gz.

File metadata

  • Download URL: hubaxle-0.1.8.tar.gz
  • Upload date:
  • Size: 76.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/22.6.0

File hashes

Hashes for hubaxle-0.1.8.tar.gz
Algorithm Hash digest
SHA256 b17f20b60b9966cc4db0f0b5282fdbbbfe1d11544d48cd3928ad091f64558701
MD5 867187a7cc80b57c249c6a7439116f0f
BLAKE2b-256 f05bac44d71a629d170f4372860bf5eef01e5d33f05325229e3153429348f0d8

See more details on using hashes here.

File details

Details for the file hubaxle-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: hubaxle-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 121.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/22.6.0

File hashes

Hashes for hubaxle-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 edb558130c5e297d0bd57a8e3ce9c63035f952321eac87b162ce16299afeba77
MD5 1921f814a13b28a1fb10c7da2a6d29be
BLAKE2b-256 9186b0e09fb07723294731cb2a83ee8b2b71e8bb1a9ace4dc9b482bc88370492

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page