juju: github.com/juju/juju/worker/machineactions Index | Files

package machineactions

import "github.com/juju/juju/worker/machineactions"

Index

Package Files

handleactions.go manifold.go shim.go worker.go

Variables

var RunAsUser = "ubuntu"

RunAsUser is the user that the machine juju-run action is executed as.

func HandleAction Uses

func HandleAction(name string, params map[string]interface{}) (results map[string]interface{}, err error)

HandleAction receives a name and a map of parameters for a given machine action. It will handle that action in a specific way and return a results map suitable for ActionFinish.

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold as configured.

func NewMachineActionsWorker Uses

func NewMachineActionsWorker(config WorkerConfig) (worker.Worker, error)

NewMachineActionsWorker returns a worker.Worker that watches for actions enqueued on this machine and tries to execute them.

type Facade Uses

type Facade interface {
    WatchActionNotifications(agent names.MachineTag) (watcher.StringsWatcher, error)
    RunningActions(agent names.MachineTag) ([]params.ActionResult, error)

    Action(names.ActionTag) (*machineactions.Action, error)
    ActionBegin(names.ActionTag) error
    ActionFinish(tag names.ActionTag, status string, results map[string]interface{}, message string) error
}

Facade defines the capabilities required by the worker from the API.

func NewFacade Uses

func NewFacade(apiCaller base.APICaller) Facade

NewFacade creates a Facade from a base.APICaller. It's a sensible value for ManifoldConfig.NewFacade.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName     string
    APICallerName string

    NewFacade func(base.APICaller) Facade
    NewWorker func(WorkerConfig) (worker.Worker, error)
}

ManifoldConfig describes the dependencies of a machine action runner.

type WorkerConfig Uses

type WorkerConfig struct {
    Facade       Facade
    MachineTag   names.MachineTag
    HandleAction func(name string, params map[string]interface{}) (results map[string]interface{}, err error)
}

WorkerConfig defines the worker's dependencies.

func (WorkerConfig) Validate Uses

func (c WorkerConfig) Validate() error

Validate returns an error if the configuration is not complete.

Package machineactions imports 19 packages (graph) and is imported by 21 packages. Updated 2019-09-06. Refresh now. Tools for package owners.