Code review comment for lp://staging/~dimitern/juju-core/040-machine-api-calls-needed-by-machiner

Revision history for this message
Dimiter Naydenov (dimitern) wrote :

Reviewers: mp+164920_code.launchpad.net,

Message:
Please take a look.

Description:
state/api: Machine API needed by machiner

This introduces several new API calls, needed by the
worker/machiner to handle machines through the API:
* Life
* EnsureDead
* SetAgentAlive
* SetStatus

In the course of this some refactoring of the API
server was in order:
* Introduced presence.Pinger support
* Watchers and pingers are now both handled as resources
   which have a Stop() method
* Added a couple of root-level permission checking calls:
- authOwner(), taking an entity with a Tag() method and returning
   true if the authenticated user's tag matches the entity's tag
- authEnvironManager() returning true if the authenticated user
   matches the environment manager (machine with JobManageEnviron)

Permission checks are performed to ensure only agents (or managers)
can access the new machine API calls.

https://code.launchpad.net/~dimitern/juju-core/040-machine-api-calls-needed-by-machiner/+merge/164920

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/9614043/

Affected files:
   A [revision details]
   M state/api/apiclient.go
   M state/api/params/params.go
   M state/apiserver/api_test.go
   M state/apiserver/apiserver.go
   M state/apiserver/error.go

« Back to merge proposal