~mfoord/juju-core/tests-replset

« back to all changes in this revision

Viewing changes to state/api/apiclient.go

  • Committer: Benji York
  • Date: 2013-03-15 15:20:42 UTC
  • mfrom: (993.3.9 1130151)
  • Revision ID: benji.york@canonical.com-20130315152042-kn87kj7tqtkqozuq
Add ServiceDestroyUnits to the API

R=fwereade, dimitern, rog
CC=
https://codereview.appspot.com/7554046

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
        return nil
123
123
}
124
124
 
125
 
// ServiceAddUnit adds a given number of units to a service.
126
 
func (c *Client) ServiceAddUnits(service string, numUnits int) error {
127
 
        params := params.ServiceAddUnits{
 
125
// AddServiceUnits adds a given number of units to a service.
 
126
func (c *Client) AddServiceUnits(service string, numUnits int) error {
 
127
        params := params.AddServiceUnits{
128
128
                ServiceName: service,
129
129
                NumUnits:    numUnits,
130
130
        }
131
 
        err := c.st.client.Call("Client", "", "ServiceAddUnits", params, nil)
132
 
        if err != nil {
133
 
                return clientError(err)
134
 
        }
135
 
        return nil
 
131
        err := c.st.client.Call("Client", "", "AddServiceUnits", params, nil)
 
132
        return clientError(err)
 
133
}
 
134
 
 
135
// DestroyServiceUnits decreases the number of units dedicated to a service.
 
136
func (c *Client) DestroyServiceUnits(unitNames []string) error {
 
137
        params := params.DestroyServiceUnits{unitNames}
 
138
        err := c.st.client.Call("Client", "", "DestroyServiceUnits", params, nil)
 
139
        return clientError(err)
136
140
}
137
141
 
138
142
// ServiceDestroy destroys a given service.