undertaker

package
v0.0.0-...-2608902 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Machine

type Machine interface {
	// Watch returns a watcher for observing changes to a machine.
	Watch() state.NotifyWatcher
}

Machine defines the needed methods of state.Machine for the work of the undertaker API.

type Model

type Model interface {

	// Owner returns tag representing the owner of the model.
	// The owner is the user that created the model.
	Owner() names.UserTag

	// Life returns whether the model is Alive, Dying or Dead.
	Life() state.Life

	// Name returns the human friendly name of the model.
	Name() string

	// UUID returns the universally unique identifier of the model.
	UUID() string

	// Destroy sets the model's lifecycle to Dying, preventing
	// addition of services or machines to state.
	Destroy() error
}

Model defines the needed methods of state.Model for the work of the undertaker API.

type Service

type Service interface {
	// Watch returns a watcher for observing changes to a service.
	Watch() state.NotifyWatcher
}

Service defines the needed methods of state.Service for the work of the undertaker API.

type State

type State interface {
	state.EntityFinder

	// Model returns the model entity.
	Model() (Model, error)

	// IsController returns true if this state instance has the bootstrap
	// model UUID.
	IsController() bool

	// ProcessDyingModel checks if there are any machines or services left in
	// state. If there are none, the model's life is changed from dying to dead.
	ProcessDyingModel() (err error)

	// RemoveAllModelDocs removes all documents from multi-environment
	// collections.
	RemoveAllModelDocs() error

	// AllMachines returns all machines in the model ordered by id.
	AllMachines() ([]Machine, error)

	// AllServices returns all deployed services in the model.
	AllServices() ([]Service, error)

	// ModelConfig retrieves the model configuration.
	ModelConfig() (*config.Config, error)
}

State defines the needed methods of state.State for the work of the undertaker API.

type UndertakerAPI

type UndertakerAPI struct {
	*common.StatusSetter
	// contains filtered or unexported fields
}

UndertakerAPI implements the API used by the machine undertaker worker.

func NewUndertakerAPI

func NewUndertakerAPI(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*UndertakerAPI, error)

NewUndertakerAPI creates a new instance of the undertaker API.

func (*UndertakerAPI) ModelConfig

func (u *UndertakerAPI) ModelConfig() (params.ModelConfigResult, error)

ModelConfig returns the model's configuration.

func (*UndertakerAPI) ModelInfo

ModelInfo returns information on the model needed by the undertaker worker.

func (*UndertakerAPI) ProcessDyingModel

func (u *UndertakerAPI) ProcessDyingModel() error

ProcessDyingModel checks if a dying environment has any machines or services. If there are none, the environment's life is changed from dying to dead.

func (*UndertakerAPI) RemoveModel

func (u *UndertakerAPI) RemoveModel() error

RemoveModel removes any records of this model from Juju.

func (*UndertakerAPI) WatchModelResources

func (u *UndertakerAPI) WatchModelResources() params.NotifyWatchResults

WatchModelResources creates watchers for changes to the lifecycle of an model's machines and services.

Jump to

Keyboard shortcuts

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