labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

driver: digitalloggers_restapi: enable REST API

Open moto-timo opened this issue 4 months ago • 5 comments

The legacy HTTP API does not work on newer units without manually changing the configuration in Setup.

This driver is based on https://www.digital-loggers.com/restapi.pdf

Curl examples that were used for development are included as comments so that users can test their access outside of labgrid.

The REST API seems to only allow authenticated users, so the host: parameter is parsed to pass user and password to HTTPDigestAuth. CSRF is also required, so a valid (simple) header is provided. Non-authenticated URLs are supported, but most likely will not work.

HTTPS is recommended, but the units ship with self-signed certificates so SSL certificate verification warnings are intentionally ignored.

Example usage in lg-env.yaml (default as-shipped settings):

NetworkPowerPort: model: 'digitalloggers_restapi' host: 'http://admin:[email protected]' index: 0

Description

Checklist

  • [x] Documentation for the feature
  • [x] Tests for the feature
  • [x] The arguments and description in doc/configuration.rst have been updated
  • [ ] Add a section on how to use the feature to doc/usage.rst
  • [ ] Add a section on how to use the feature to doc/development.rst
  • [x] PR has been tested
  • [ ] Man pages have been regenerated

moto-timo avatar Sep 30 '24 22:09 moto-timo