~james-page/ubuntu/wily/juju-core/mir-fixes

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/state/api/machiner/machiner.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-03-28 08:58:42 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20140328085842-cyzrgc120bdfxwj0
Tags: 1.17.7-0ubuntu1
* New upstream point release, including fixes for:
  - no debug log with all providers on Ubuntu 14.04 (LP: #1294776).
* d/control: Add cpu-checker dependency to juju-local (LP: #1297077).

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
        "launchpad.net/juju-core/state/api/params"
10
10
)
11
11
 
 
12
const machinerFacade = "Machiner"
 
13
 
12
14
// State provides access to the Machiner API facade.
13
15
type State struct {
14
16
        caller base.Caller
 
17
        *common.APIAddresser
 
18
}
 
19
 
 
20
func (st *State) call(method string, params, result interface{}) error {
 
21
        return st.caller.Call(machinerFacade, "", method, params, result)
15
22
}
16
23
 
17
24
// NewState creates a new client-side Machiner facade.
18
25
func NewState(caller base.Caller) *State {
19
 
        return &State{caller}
 
26
        return &State{
 
27
                caller:       caller,
 
28
                APIAddresser: common.NewAPIAddresser(machinerFacade, caller),
 
29
        }
 
30
 
20
31
}
21
32
 
22
33
// machineLife requests the lifecycle of the given machine from the server.
23
34
func (st *State) machineLife(tag string) (params.Life, error) {
24
 
        return common.Life(st.caller, "Machiner", tag)
 
35
        return common.Life(st.caller, machinerFacade, tag)
25
36
}
26
37
 
27
38
// Machine provides access to methods of a state.Machine through the facade.