github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/api/action/run.go (about)

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