juju: github.com/juju/juju/cmd/juju/action Index | Files

package action

import "github.com/juju/juju/cmd/juju/action"


Package Files

action.go call.go cancel.go common.go list.go listtasks.go runaction.go show.go showoutput.go status.go waitflag.go

func FormatActionResult Uses

func FormatActionResult(result params.ActionResult, utc, compat bool) map[string]interface{}

FormatActionResult removes empty values from the given ActionResult and inserts the remaining ones in a map[string]interface{} for cmd.Output to write in an easy-to-read format.

func GetActionResult Uses

func GetActionResult(api APIClient, requestedId string, wait *time.Timer, compat bool) (params.ActionResult, error)

GetActionResult tries to repeatedly fetch an action until it is in a completed state and then it returns it. It waits for a maximum of "wait" before returning with the latest action status.

func GetActionsByName Uses

func GetActionsByName(api APIClient, name string) ([]params.ActionResult, error)

GetActionsByName takes an action APIClient and a name and returns a list of ActionResults.

func NewCallCommand Uses

func NewCallCommand() cmd.Command

func NewCancelCommand Uses

func NewCancelCommand() cmd.Command

func NewListCommand Uses

func NewListCommand() cmd.Command

func NewListTasksCommand Uses

func NewListTasksCommand() cmd.Command

func NewRunActionCommand Uses

func NewRunActionCommand() cmd.Command

func NewShowActionOutputCommand Uses

func NewShowActionOutputCommand() cmd.Command

func NewShowCommand Uses

func NewShowCommand() cmd.Command

NewShowCommand returns a command to print function information.

func NewShowTaskCommand Uses

func NewShowTaskCommand() cmd.Command

func NewStatusCommand Uses

func NewStatusCommand() cmd.Command

type APIClient Uses

type APIClient interface {

    // BestAPIVersion returns the API version that we were able to
    // determine is supported by both the client and the API Server
    BestAPIVersion() int

    // Enqueue takes a list of Actions and queues them up to be executed by
    // the designated ActionReceiver, returning the params.Action for each
    // queued Action, or an error if there was a problem queueing up the
    // Action.
    Enqueue(params.Actions) (params.ActionResults, error)

    // ListAll takes a list of Tags representing ActionReceivers and returns
    // all of the Actions that have been queued or run by each of those
    // Entities.
    ListAll(params.Entities) (params.ActionsByReceivers, error)

    // ListPending takes a list of Tags representing ActionReceivers
    // and returns all of the Actions that are queued for each of those
    // Entities.
    ListPending(params.Entities) (params.ActionsByReceivers, error)

    // ListCompleted takes a list of Tags representing ActionReceivers
    // and returns all of the Actions that have been run on each of those
    // Entities.
    ListCompleted(params.Entities) (params.ActionsByReceivers, error)

    // Cancel attempts to cancel a queued up Action from running.
    Cancel(params.Entities) (params.ActionResults, error)

    // ApplicationCharmActions is a single query which uses ApplicationsCharmsActions to
    // get the charm.Actions for a single application by tag.
    ApplicationCharmActions(params.Entity) (map[string]params.ActionSpec, error)

    // Actions fetches actions by tag.  These Actions can be used to get
    // the ActionReceiver if necessary.
    Actions(params.Entities) (params.ActionResults, error)

    // Tasks fetches the called functions (actions) for specified apps/units.
    Tasks(params.TaskQueryArgs) (params.ActionResults, error)

    // FindActionTagsByPrefix takes a list of string prefixes and finds
    // corresponding ActionTags that match that prefix.
    FindActionTagsByPrefix(params.FindTags) (params.FindTagsResults, error)

    // FindActionsByNames takes a list of names and finds a corresponding list of
    // Actions for every name.
    FindActionsByNames(params.FindActionsByNames) (params.ActionsByNames, error)

    // WatchActionProgress reports on logged action progress messages.
    WatchActionProgress(actionId string) (watcher.StringsWatcher, error)

type APIClient represents the action API functionality.

type ActionCommandBase Uses

type ActionCommandBase struct {

ActionCommandBase is the base type for action sub-commands.

func (*ActionCommandBase) NewActionAPIClient Uses

func (c *ActionCommandBase) NewActionAPIClient() (APIClient, error)

NewActionAPIClient returns a client for the action api endpoint.

Package action imports 26 packages (graph) and is imported by 57 packages. Updated 2019-11-16. Refresh now. Tools for package owners.