Merge ~travisghansen/maas:master into maas:master
Status: | Merged |
---|---|
Merge reported by: | Lee Trager |
Merged at revision: | 13a6cadde0c989e676cc98f6d25264d1885b6509 |
Proposed branch: | ~travisghansen/maas:master |
Merge into: | maas:master |
Diff against target: |
147 lines (+123/-0) 2 files modified
src/provisioningserver/drivers/power/registry.py (+2/-0) src/provisioningserver/drivers/power/webhook.py (+121/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lee Trager (community) | Approve | ||
MAAS Lander | Needs Fixing | ||
Review via email: mp+395743@code.launchpad.net |
Commit message
Webhook Power Driver
Description of the change
This is a simple power driver that POSTs to an http(s) endpoint of the user's choosing. The endpoint receives a json payload which looks like:
{"action"
OR
{"action"
OR
{"action"
The "power_query" POST expects a response of the following:
{"power_state": "on|off|unknown"}
SSL validation can be disabled to work with self-signed certs.
Authentication can be done by either setting a username/password for basic auth OR bearer auth by setting a token. Preference if given to the token if both token and username/password are set.
Of note, the URL can include query params.
I've tested this out by hacking the files into a snap and prototyping. In my simple use-case I'm configuring the endpoint to point to a Node-RED instance I have and then I wire everything up to control some crude/cheap iot power plugs (gosund devices with tasmota firmware flashed).
I'm completely new to maas (and python is not my strength) so I could be missing something entirely here so any tips are appreciated :)
UNIT TESTS
-b master lp:~travisghansen/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: FAILED maas-ci. internal: 8080/job/ maas/job/ branch- tester/ 8968/console 038f2705826989b 41be66580d
LOG: http://
COMMIT: 64e77f06124644a