5
"launchpad.net/juju-core/cmd"
6
"launchpad.net/juju-core/juju"
7
"launchpad.net/juju-core/state/api/params"
8
"launchpad.net/juju-core/state/statecmd"
11
// DestroyRelationCommand causes an existing service relation to be shut down.
12
type DestroyRelationCommand struct {
17
func (c *DestroyRelationCommand) Info() *cmd.Info {
19
Name: "destroy-relation",
20
Args: "<service1>[:<relation name1>] <service2>[:<relation name2>]",
21
Purpose: "destroy a relation between two services",
22
Aliases: []string{"remove-relation"},
26
func (c *DestroyRelationCommand) Init(args []string) error {
28
return fmt.Errorf("a relation must involve two services")
34
func (c *DestroyRelationCommand) Run(_ *cmd.Context) error {
35
conn, err := juju.NewConnFromName(c.EnvName)
41
params := params.DestroyRelation{
42
Endpoints: c.Endpoints,
44
return statecmd.DestroyRelation(conn.State, params)