machineundertaker

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API implements the API facade used by the machine undertaker.

func NewAPI

func NewAPI(backend Backend, resources facade.Resources, authorizer facade.Authorizer) (*API, error)

NewAPI implements the API used by the machine undertaker worker to find out what provider-level resources need to be cleaned up when a machine goes away.

func NewFacade

func NewFacade(st *state.State, res facade.Resources, auth facade.Authorizer) (*API, error)

NewFacade provides the signature required for facade registration.

func (*API) AllMachineRemovals

func (m *API) AllMachineRemovals(models params.Entities) params.EntitiesResults

AllMachineRemovals returns tags for all of the machines that have been marked for removal in the requested model.

func (*API) CompleteMachineRemovals

func (m *API) CompleteMachineRemovals(machines params.Entities) error

CompleteMachineRemovals removes the specified machines from the model database. It should only be called once any provider-level cleanup has been done for those machines.

func (*API) GetMachineProviderInterfaceInfo

func (m *API) GetMachineProviderInterfaceInfo(machines params.Entities) params.ProviderInterfaceInfoResults

GetMachineProviderInterfaceInfo returns the provider details for all network interfaces attached to the machines requested.

func (*API) WatchMachineRemovals

func (m *API) WatchMachineRemovals(models params.Entities) params.NotifyWatchResults

WatchMachineRemovals returns a watcher that will signal each time a machine is marked for removal.

type Backend

type Backend interface {
	// AllRemovedMachines returns all of the machines which have been
	// marked for removal.
	AllMachineRemovals() ([]string, error)

	// CompleteMachineRemovals removes the machines (and the associated removal
	// requests) after the provider-level cleanup is done.
	CompleteMachineRemovals(machineIDs ...string) error

	// WatchMachineRemovals returns a NotifyWatcher that triggers
	// whenever machine removal requests are added or removed.
	WatchMachineRemovals() state.NotifyWatcher

	// Machine gets a specific machine, so we can collect details of
	// its network interfaces.
	Machine(id string) (Machine, error)
}

Backend defines the methods the machine undertaker needs from state.State.

type Machine

type Machine interface {
	// AllProviderInterfaceInfos returns the details needed to talk to
	// the provider about this machine's attached devices.
	AllProviderInterfaceInfos() ([]network.ProviderInterfaceInfo, error)
}

Machine defines the methods we need from state.Machine.

Jump to

Keyboard shortcuts

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