-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver: digitalloggers_restapi: enable REST API #1512
base: master
Are you sure you want to change the base?
Conversation
3b6145d
to
b7e9452
Compare
Added to test_powerdriver.py in second push. |
Have you considered contributing this to pdudaemon? Please see our merge policy for network PDUs: #1031 |
There is no support for digitalloggers in pdudaemon but there was support in labgrid... I'm not currently using pdudaemon and the code will be significantly different so no sure when i will have time for that. I remember conversations about pdudaemon in the past, not opposed to the policy... I almost feel like we should drop network power support in labgrid though to avoid confusion. |
b7e9452
to
c1252d4
Compare
Rebased this on current master. |
c1252d4
to
01f82ae
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1512 +/- ##
========================================
- Coverage 56.6% 56.5% -0.2%
========================================
Files 168 169 +1
Lines 13033 13075 +42
========================================
+ Hits 7385 7392 +7
- Misses 5648 5683 +35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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. Add to test_powerdriver.py import test. Example usage in lg-env.yaml (default as-shipped settings): NetworkPowerPort: model: 'digitalloggers_restapi' host: 'http://admin:[email protected]' index: 0 Signed-off-by: Tim Orling <[email protected]> [[email protected]: removed unused and sorted imports] Signed-off-by: Rouven Czerwinski <[email protected]>
01f82ae
to
6579cf6
Compare
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