Documentation ¶
Index ¶
- type Machine
- type Model
- type Service
- type State
- type UndertakerAPI
- func (u *UndertakerAPI) ModelConfig() (params.ModelConfigResult, error)
- func (u *UndertakerAPI) ModelInfo() (params.UndertakerModelInfoResult, error)
- func (u *UndertakerAPI) ProcessDyingModel() error
- func (u *UndertakerAPI) RemoveModel() error
- func (u *UndertakerAPI) WatchModelResources() params.NotifyWatchResults
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) // AllApplications returns all deployed services in the model. AllApplications() ([]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 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 ¶
func (u *UndertakerAPI) ModelInfo() (params.UndertakerModelInfoResult, error)
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.