undertaker

package
v0.0.0-...-e653fdf Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetProvider = provider.Provider
)

For testing.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type Model

type Model interface {
	state.ModelAccessor

	// 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

	// ForceDestroyed returns whether the dying/dead model was
	// destroyed with --force. Always false for alive models.
	ForceDestroyed() bool

	// DestroyTimeout returns the timeout passed in when the
	// model was destroyed.
	DestroyTimeout() *time.Duration

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

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

	// Watch returns a watcher watching the model.
	Watch() state.NotifyWatcher
}

Model defines the needed methods of state.Model 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)

	// RemoveDyingModel sets current model to dead then removes all documents from
	// multi-model collections.
	RemoveDyingModel() error

	// WatchModelEntityReferences gets a watcher capable of monitoring
	// model entity references changes.
	WatchModelEntityReferences(mUUID string) state.NotifyWatcher

	// ModelUUID returns the model UUID for the model controlled
	// by this state instance.
	ModelUUID() string
}

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

type UndertakerAPI

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

UndertakerAPI implements the API used by the model undertaker worker.

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 model has any machines or applications. If there are none, the model'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) WatchModel

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

WatchModel creates a watcher for the current model.

func (*UndertakerAPI) WatchModelResources

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

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

Jump to

Keyboard shortcuts

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