machineactions

package
v0.0.0-...-12adbad Latest Latest
Warning

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

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

Documentation

Overview

Package machineactions implements the API server side of running actions on machines.

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 Backend

type Backend interface {
	ActionByTag(tag names.ActionTag) (state.Action, error)
	FindEntity(tag names.Tag) (state.Entity, error)
	TagToActionReceiverFn(findEntity func(names.Tag) (state.Entity, error)) func(string) (state.ActionReceiver, error)
	ConvertActions(ar state.ActionReceiver, fn common.GetActionsFn) ([]params.ActionResult, error)
}

type Facade

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

Facade implements the machineactions interface and is the concrete implementation of the api end point.

func NewFacade

func NewFacade(
	backend Backend,
	resources facade.Resources,
	authorizer facade.Authorizer,
) (*Facade, error)

NewFacade creates a new server-side machineactions API end point.

func (*Facade) Actions

func (f *Facade) Actions(args params.Entities) params.ActionResults

Actions returns the Actions by Tags passed and ensures that the machine asking for them is the machine that has the actions

func (*Facade) BeginActions

func (f *Facade) BeginActions(args params.Entities) params.ErrorResults

BeginActions marks the actions represented by the passed in Tags as running.

func (*Facade) FinishActions

func (f *Facade) FinishActions(args params.ActionExecutionResults) params.ErrorResults

FinishActions saves the result of a completed Action

func (*Facade) RunningActions

func (f *Facade) RunningActions(args params.Entities) params.ActionsByReceivers

RunningActions lists the actions running for the entities passed in. If we end up needing more than ListRunning at some point we could follow/abstract what's done in the client actions package.

func (*Facade) WatchActionNotifications

func (f *Facade) WatchActionNotifications(args params.Entities) params.StringsWatchResults

WatchActionNotifications returns a StringsWatcher for observing incoming action calls to a machine.

Jump to

Keyboard shortcuts

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