~mfoord/juju-core/tests-replset

« back to all changes in this revision

Viewing changes to state/statecmd/destroyunit.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:
 
1
// Code shared by the CLI and API for the DestroyServiceUnits function.
 
2
 
 
3
package statecmd
 
4
 
 
5
import (
 
6
        "launchpad.net/juju-core/juju"
 
7
        "launchpad.net/juju-core/state"
 
8
        "launchpad.net/juju-core/state/api/params"
 
9
)
 
10
 
 
11
// DestroyServiceUnits removes the specified units.
 
12
func DestroyServiceUnits(state *state.State, args params.DestroyServiceUnits) error {
 
13
        conn, err := juju.NewConnFromState(state)
 
14
        if err != nil {
 
15
                return err
 
16
        }
 
17
        return conn.DestroyUnits(args.UnitNames...)
 
18
}