undertaker

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

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

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

	// ModelConfig retrieves the model configuration.
	ModelConfig() (*config.Config, 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
	// contains filtered or unexported fields
}

UndertakerAPI implements the API used by the model undertaker worker.

func NewUndertakerAPI

func NewUndertakerAPI(st *state.State, resources facade.Resources, authorizer facade.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 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) 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