forked from juju/juju
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.go
27 lines (22 loc) · 885 Bytes
/
run.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package action
import (
"time"
"github.com/juju/juju/apiserver/params"
)
// RunOnAllMachines runs the command on all the machines with the specified
// timeout.
func (c *Client) RunOnAllMachines(commands string, timeout time.Duration) ([]params.ActionResult, error) {
var results params.ActionResults
args := params.RunParams{Commands: commands, Timeout: timeout}
err := c.facade.FacadeCall("RunOnAllMachines", args, &results)
return results.Results, err
}
// Run the Commands specified on the machines identified through the ids
// provided in the machines, applications and units slices.
func (c *Client) Run(run params.RunParams) ([]params.ActionResult, error) {
var results params.ActionResults
err := c.facade.FacadeCall("Run", run, &results)
return results.Results, err
}