action

package
v0.0.0-...-298751d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type APIv7

type APIv7 struct {
	*ActionAPI
}

APIv7 provides the Action API facade for version 7.

type ActionAPI

type ActionAPI struct {
	// contains filtered or unexported fields
}

ActionAPI implements the client API for interacting with Actions

func (*ActionAPI) Actions

func (a *ActionAPI) Actions(arg params.Entities) (params.ActionResults, error)

Actions takes a list of ActionTags, and returns the full Action for each ID.

func (*ActionAPI) ApplicationsCharmsActions

func (a *ActionAPI) ApplicationsCharmsActions(args params.Entities) (params.ApplicationsCharmActionsResults, error)

ApplicationsCharmsActions returns a slice of charm Actions for a slice of services.

func (*ActionAPI) Cancel

func (a *ActionAPI) Cancel(arg params.Entities) (params.ActionResults, error)

Cancel attempts to cancel enqueued Actions from running.

func (*ActionAPI) EnqueueOperation

func (a *ActionAPI) EnqueueOperation(arg params.Actions) (params.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 designated ActionReceiver. We return the ID of the overall operation and each individual task.

func (*ActionAPI) ListOperations

func (a *ActionAPI) ListOperations(arg params.OperationQueryArgs) (params.OperationResults, error)

ListOperations fetches the called actions for specified apps/units.

func (*ActionAPI) Operations

func (a *ActionAPI) Operations(arg params.Entities) (params.OperationResults, error)

Operations fetches the specified operation ids.

func (*ActionAPI) Run

func (a *ActionAPI) Run(run params.RunParams) (results params.EnqueuedActions, err error)

Run the commands specified on the machines identified through the list of machines, units and services.

func (*ActionAPI) RunOnAllMachines

func (a *ActionAPI) RunOnAllMachines(run params.RunParams) (results params.EnqueuedActions, err error)

RunOnAllMachines attempts to run the specified command on all the machines.

func (*ActionAPI) WatchActionsProgress

func (api *ActionAPI) WatchActionsProgress(actions params.Entities) (params.StringsWatchResults, error)

WatchActionsProgress creates a watcher that reports on action log messages.

type Model

type Model interface {
	ActionByTag(tag names.ActionTag) (state.Action, error)
	AddAction(receiver state.ActionReceiver, operationID, name string, payload map[string]interface{}, parallel *bool, executionGroup *string) (state.Action, error)
	EnqueueOperation(summary string, count int) (string, error)
	FailOperationEnqueuing(operationID, failMessage string, count int) error
	FindActionsByName(name string) ([]state.Action, error)
	ListOperations(actionNames []string, actionReceivers []names.Tag, operationStatus []state.ActionStatus,
		offset, limit int,
	) ([]state.OperationInfo, bool, error)
	ModelTag() names.ModelTag
	OperationWithActions(id string) (*state.OperationInfo, error)
	Type() state.ModelType
}

Model describes model state used by the action facade.

type State

type State interface {
	AllApplications() ([]*state.Application, error)
	AllMachines() ([]*state.Machine, error)
	Application(name string) (*state.Application, error)
	FindEntity(tag names.Tag) (state.Entity, error)
	GetBlockForType(t state.BlockType) (state.Block, bool, error)
	Model() (Model, error)
	WatchActionLogs(actionId string) state.StringsWatcher
}

State provides the subset of global state required by the action facade.

type TagToActionReceiverFunc

type TagToActionReceiverFunc func(findEntity func(names.Tag) (state.Entity, error)) func(tag string) (state.ActionReceiver, error)

Jump to

Keyboard shortcuts

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