action

package
v0.0.0-...-bfa9622 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 36 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetActionResult

func GetActionResult(api APIClient, requestedId string, tick, wait clock.Timer) (actionapi.ActionResult, error)

GetActionResult tries to repeatedly fetch a task 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 NewCancelCommand

func NewCancelCommand() cmd.Command

func NewExecCommand

func NewExecCommand(store jujuclient.ClientStore) cmd.Command

NewExecCommand returns an exec command.

func NewListCommand

func NewListCommand() cmd.Command

func NewListOperationsCommand

func NewListOperationsCommand() cmd.Command

NewListOperationsCommand returns a ListOperations command.

func NewRunCommand

func NewRunCommand() cmd.Command

func NewShowCommand

func NewShowCommand() cmd.Command

NewShowCommand returns a command to print action information.

func NewShowOperationCommand

func NewShowOperationCommand() cmd.Command

func NewShowTaskCommand

func NewShowTaskCommand() cmd.Command

Types

type APIClient

type APIClient interface {
	io.Closer

	// RunOnAllMachines runs the command on all the machines with the specified
	// timeout.
	RunOnAllMachines(commands string, timeout time.Duration) (action.EnqueuedActions, error)

	// Run the Commands specified on the machines identified through the ids
	// provided in the machines, applications and units slices.
	Run(action.RunParams) (action.EnqueuedActions, 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([]action.Action) (action.EnqueuedActions, error)

	// Cancel attempts to cancel a queued up Action from running.
	Cancel([]string) ([]action.ActionResult, error)

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

	// Actions fetches actions by tag.  These Actions can be used to get
	// the ActionReceiver if necessary.
	Actions([]string) ([]action.ActionResult, error)

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

	// Operation fetches the operation with the specified id.
	Operation(id string) (action.Operation, error)

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

APIClient represents the action API functionality.

type ActionCommandBase

type ActionCommandBase struct {
	modelcmd.ModelCommandBase
}

ActionCommandBase is the base type for action sub-commands.

func (*ActionCommandBase) NewActionAPIClient

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

NewActionAPIClient returns a client for the action api endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL