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

package action

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


Package Files

action.go cancel.go common.go list.go listoperations.go run.go runaction.go show.go showoperation.go showoutput.go status.go waitflag.go

func ConvertActionOutput Uses

func ConvertActionOutput(output map[string]interface{}, compat, alwaysStdout bool) map[string]interface{}

ConvertActionOutput returns result data with stdout, stderr etc correctly formatted.

func FormatActionResult Uses

func FormatActionResult(id string, 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 NewCancelCommand Uses

func NewCancelCommand() cmd.Command

func NewListCommand Uses

func NewListCommand() cmd.Command

func NewListOperationsCommand Uses

func NewListOperationsCommand() cmd.Command

func NewRunActionCommand Uses

func NewRunActionCommand() cmd.Command

func NewRunCommand Uses

func NewRunCommand() cmd.Command

func NewShowActionOutputCommand Uses

func NewShowActionOutputCommand() cmd.Command

func NewShowCommand Uses

func NewShowCommand() cmd.Command

NewShowCommand returns a command to print action information.

func NewShowOperationCommand Uses

func NewShowOperationCommand() cmd.Command

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.
    // TODO(juju3) - remove.
    Enqueue(params.Actions) (params.ActionResults, error)

    // EnqueueOperation takes a list of Actions and queues them up to be executed as
    // an operation, each action running as a task on the the designated ActionReceiver.
    // We return the ID of the overall operation and each individual task.
    EnqueueOperation(params.Actions) (params.EnqueuedActions, 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)

    // ListOperations fetches the operation summaries for specified apps/units.
    ListOperations(params.OperationQueryArgs) (params.OperationResults, error)

    // Operation fetches the operation with the specified id.
    Operation(id string) (params.OperationResult, 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 30 packages (graph). Updated 2020-08-06. Refresh now. Tools for package owners.