Documentation ¶
Overview ¶
Copyright 2012, 2013 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.
Copyright 2015 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NewMachiner = func(cfg Config) (worker.Worker, error) { if err := cfg.Validate(); err != nil { return nil, errors.Annotate(err, "validating config") } handler := &Machiner{config: cfg} w, err := watcher.NewNotifyWorker(watcher.NotifyConfig{ Handler: handler, }) if err != nil { return nil, errors.Trace(err) } return w, nil }
NewMachiner returns a Worker that will wait for the identified machine to become Dying and make it Dead; or until the machine becomes Dead by other means.
The machineDead function will be called immediately after the machine's lifecycle is updated to Dead.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency manifold that runs a machiner worker, using the resource names defined in the supplied config.
Types ¶
type APIMachineAccessor ¶
func (APIMachineAccessor) Machine ¶
func (a APIMachineAccessor) Machine(tag names.MachineTag) (Machine, error)
type Config ¶
type Config struct { // MachineAccessor provides a means of observing and updating the // machine's state. MachineAccessor MachineAccessor // Tag is the machine's tag. Tag names.MachineTag // ClearMachineAddressesOnStart indicates whether or not to clear // the machine's machine addresses when the worker starts. ClearMachineAddressesOnStart bool // NotifyMachineDead will, if non-nil, be called after the machine // is transitioned to the Dead lifecycle state. NotifyMachineDead func() error }
Config defines the configuration for a machiner worker.
type Machine ¶
type Machine interface { Refresh() error Life() params.Life EnsureDead() error SetMachineAddresses(addresses []network.Address) error SetStatus(machineStatus status.Status, info string, data map[string]interface{}) error Watch() (watcher.NotifyWatcher, error) SetObservedNetworkConfig(netConfig []params.NetworkConfig) error }
type MachineAccessor ¶
type Machiner ¶
type Machiner struct {
// contains filtered or unexported fields
}
Machiner is responsible for a machine agent's lifecycle.
type ManifoldConfig ¶
type ManifoldConfig engine.AgentAPIManifoldConfig
ManifoldConfig defines the names of the manifolds on which a Manifold will depend.