action

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatActionResult

func FormatActionResult(result params.ActionResult) 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

func GetActionResult(api APIClient, requestedId string, wait *time.Timer) (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

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

func NewCancelCommand() cmd.Command

func NewListCommand

func NewListCommand() cmd.Command

func NewRunCommand

func NewRunCommand() cmd.Command

func NewShowOutputCommand

func NewShowOutputCommand() cmd.Command

func NewStatusCommand

func NewStatusCommand() cmd.Command

Types

type APIClient

type APIClient interface {
	io.Closer

	// 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)

	// 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)
}

type APIClient represents the action API functionality.

type ActionCommandBase

type ActionCommandBase struct {
	modelcmd.ModelCommandBase
	modelcmd.IAASOnlyCommand
}

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