Merge lp://staging/~julian-edwards/maas/api-for-power-query into lp://staging/~maas-committers/maas/trunk
Proposed by
Julian Edwards
Status: | Merged |
---|---|
Approved by: | Julian Edwards |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3045 |
Proposed branch: | lp://staging/~julian-edwards/maas/api-for-power-query |
Merge into: | lp://staging/~maas-committers/maas/trunk |
Diff against target: |
297 lines (+160/-5) 6 files modified
src/maasserver/api/nodes.py (+61/-0) src/maasserver/api/tests/test_doc.py (+1/-0) src/maasserver/api/tests/test_nodes.py (+84/-0) src/maasserver/exceptions.py (+11/-0) src/maasserver/models/node.py (+1/-4) src/maasserver/models/tests/test_node.py (+2/-1) |
To merge this branch: | bzr merge lp://staging/~julian-edwards/maas/api-for-power-query |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | Approve | ||
Review via email: mp+235422@code.staging.launchpad.net |
Commit message
Add an API call Node.power_state() which asks the cluster controller to query the state of the Node's power and returns the result. This is mainly intended for use in the web UI as a "test power parameters" button. It will hold up the appserver thread for up to 30 seconds waiting for the power query to finish, so use sparingly.
Description of the change
I also removed a duplicate UnknownPowerAction exception...
To post a comment you must log in.
Thorough work. I do have a few questions:
.
Half a minute seems generous... Are we really likely to need that long? It's an awfully long time to hold up an app server thread.
And if calling this method is likely to have a noticeable impact on the system, I wouldn't name it as if it were just a getter. Why not call it query_power_state to make it clear that it's “doing things” and not just “returning data”?
.
Not sure it matters but it looks to me as if 503: Service Unavailable was meant to signify that the web service as such is down, not just the resource that's being accessed.
.
What does “Power state is not queryable” mean? Is there anything more that can be said about that kind of error?