While trying to use this I discovered a few things could be clarified in the " Power management reference" doc, by reading and testing:
“The “power_query” POST expects a response of the following:
Which was mostly true, I had to return JSON with the power_state. However, MAAS uses a GET not a POST method for this query.
The HTTP response codes expected weren’t specified, but I used 200 which seemed to work for power on, power off, and power status URIs.