Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInactive is returned when the migration is no longer active // (probably aborted). In this case the migrationmaster should be // restarted so that it can wait for the next migration attempt. ErrInactive = errors.New("migration is no longer active") // ErrMigrated is returned when the model has migrated to another // server. The migrationmaster should not be restarted again in // this case. ErrMigrated = errors.New("model has migrated") )
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold packages a Worker for use in a dependency.Engine.
Types ¶
type Config ¶
type Config struct {
ModelUUID string
Facade Facade
Guard fortress.Guard
APIOpen func(*api.Info, api.DialOpts) (api.Connection, error)
UploadBinaries func(migration.UploadBinariesConfig) error
CharmDownloader migration.CharmDownloader
ToolsDownloader migration.ToolsDownloader
Clock clock.Clock
}
Config defines the operation of a Worker.
type Facade ¶
type Facade interface {
// Watch returns a watcher which reports when a migration is
// active for the model associated with the API connection.
Watch() (watcher.NotifyWatcher, error)
// MigrationStatus returns the details and progress of the latest
// model migration.
MigrationStatus() (coremigration.MigrationStatus, error)
// SetPhase updates the phase of the currently active model
// migration.
SetPhase(coremigration.Phase) error
// SetStatusMessage sets a human readable message regarding the
// progress of a migration.
SetStatusMessage(string) error
// Prechecks performs pre-migration checks on the model and
// (source) controller.
Prechecks() error
// ModelInfo return basic information about the model to migrated.
ModelInfo() (coremigration.ModelInfo, error)
// Export returns a serialized representation of the model
// associated with the API connection.
Export() (coremigration.SerializedModel, error)
// ProcessRelations runs a series of processes to ensure that the relations
// of a given model are correct after a migrated model.
ProcessRelations(string) error
// OpenResource downloads a single resource for an application.
OpenResource(string, string) (io.ReadCloser, error)
// Reap removes all documents of the model associated with the API
// connection.
Reap() error
// WatchMinionReports returns a watcher which reports when a migration
// minion has made a report for the current migration phase.
WatchMinionReports() (watcher.NotifyWatcher, error)
// MinionReports returns details of the reports made by migration
// minions to the controller for the current migration phase.
MinionReports() (coremigration.MinionReports, error)
// MinionReportTimeout returns the maximum time to wait for minion workers
// to report on a migration phase.
MinionReportTimeout() (time.Duration, error)
// StreamModelLog takes a starting time and returns a channel that
// will yield the logs on or after that time - these are the logs
// that need to be transferred to the target after the migration
// is successful.
StreamModelLog(context.Context, time.Time) (<-chan common.LogMessage, error)
}
Facade exposes controller functionality to a Worker.
type ManifoldConfig ¶
type ManifoldConfig struct {
AgentName string
APICallerName string
FortressName string
Clock clock.Clock
NewFacade func(base.APICaller) (Facade, error)
NewWorker func(Config) (worker.Worker, error)
}
ManifoldConfig defines the names of the manifolds on which a Worker manifold will depend.
func (ManifoldConfig) Validate ¶
func (config ManifoldConfig) Validate() error
Validate is called by start to check for bad configuration.
Click to show internal directories.
Click to hide internal directories.