Documentation
¶
Overview ¶
Package migrationmaster defines the API facade for use by the migration master worker when communicating with its own controller.
Index ¶
- func Register(registry facade.FacadeRegistry)
- type API
- func (api *API) Export(ctx context.Context) (params.SerializedModel, error)
- func (api *API) MigrationStatus(ctx context.Context) (params.MasterMigrationStatus, error)
- func (api *API) MinionReportTimeout(ctx context.Context) (params.StringResult, error)
- func (api *API) MinionReports(ctx context.Context) (params.MinionReports, error)
- func (api *API) ModelInfo(ctx context.Context) (params.MigrationModelInfo, error)
- func (api *API) Prechecks(ctx context.Context, arg params.PrechecksArgs) error
- func (api *API) ProcessRelations(ctx context.Context, args params.ProcessRelations) error
- func (api *API) Reap(ctx context.Context) error
- func (api *API) SetPhase(ctx context.Context, args params.SetMigrationPhaseArgs) error
- func (api *API) SetStatusMessage(ctx context.Context, args params.SetMigrationStatusMessageArgs) error
- func (api *API) SourceControllerInfo(ctx context.Context) (params.MigrationSourceInfo, error)
- func (api *API) Watch(ctx context.Context) params.NotifyWatchResult
- func (api *API) WatchMinionReports(ctx context.Context) params.NotifyWatchResult
- type ApplicationService
- type Backend
- type ControllerConfigService
- type ControllerState
- type CredentialService
- type ModelAgentService
- type ModelConfigService
- type ModelExporter
- type ModelInfoService
- type ModelService
- type UpgradeService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(registry facade.FacadeRegistry)
Register is called to expose a package of facades onto a given registry.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API implements the API required for the model migration master worker.
func NewAPI ¶
func NewAPI( controllerState ControllerState, backend Backend, modelExporter ModelExporter, store objectstore.ObjectStore, precheckBackend migration.PrecheckBackend, pool migration.Pool, resources facade.Resources, authorizer facade.Authorizer, presence facade.Presence, environscloudspecGetter func(context.Context, names.ModelTag) (environscloudspec.CloudSpec, error), leadership leadership.Reader, credentialService CredentialService, controllerConfigService ControllerConfigService, modelConfigService ModelConfigService, modelInfoService ModelInfoService, modelService ModelService, applicationService ApplicationService, upgradeService UpgradeService, modelAgentService ModelAgentService, ) (*API, error)
NewAPI creates a new API server endpoint for the model migration master worker.
func (*API) MigrationStatus ¶
MigrationStatus returns the details and progress of the latest model migration.
func (*API) MinionReportTimeout ¶
MinionReportTimeout returns the configuration value for this controller that indicates how long the migration master worker should wait for minions to reported on phases of a migration.
func (*API) MinionReports ¶
MinionReports returns details of the reports made by migration minions to the controller for the current migration phase.
func (*API) Prechecks ¶
Prechecks performs pre-migration checks on the model and (source) controller.
func (*API) ProcessRelations ¶
ProcessRelations processes any relations that need updating after an export. This should help fix any remoteApplications that have been migrated.
func (*API) SetPhase ¶
SetPhase sets the phase of the active model migration. The provided phase must be a valid phase value, for example QUIESCE" or "ABORT". See the core/migration package for the complete list.
func (*API) SetStatusMessage ¶
func (api *API) SetStatusMessage(ctx context.Context, args params.SetMigrationStatusMessageArgs) error
SetStatusMessage sets a human readable status message containing information about the migration's progress. This will be shown in status output shown to the end user.
func (*API) SourceControllerInfo ¶
SourceControllerInfo returns the details required to connect to the source controller for model migration.
func (*API) Watch ¶
func (api *API) Watch(ctx context.Context) params.NotifyWatchResult
Watch starts watching for an active migration for the model associated with the API connection. The returned id should be used with the NotifyWatcher facade to receive events.
func (*API) WatchMinionReports ¶
func (api *API) WatchMinionReports(ctx context.Context) params.NotifyWatchResult
WatchMinionReports sets up a watcher which reports when a report for a migration minion has arrived.
type ApplicationService ¶
type ApplicationService interface {
GetApplicationLife(context.Context, string) (life.Value, error)
}
ApplicationService provides access to the application service.
type Backend ¶
type Backend interface { migration.LegacyStateExporter WatchForMigration() state.NotifyWatcher LatestMigration() (state.ModelMigration, error) RemoveExportingModelDocs() error AllLocalRelatedModels() ([]string, error) }
Backend defines the state functionality required by the migrationmaster facade.
type ControllerConfigService ¶
type ControllerConfigService interface { // ControllerConfig returns the config values for the controller. ControllerConfig(context.Context) (controller.Config, error) }
ControllerConfigService provides access to the controller configuration.
type ControllerState ¶
type ControllerState interface {
APIHostPortsForClients(controller.Config) ([]network.SpaceHostPorts, error)
}
ControllerState defines the state functionality for controller model.
type CredentialService ¶
type CredentialService interface { // CloudCredential returns the cloud credential for the given tag. CloudCredential(ctx context.Context, key credential.Key) (cloud.Credential, error) }
CredentialService provides access to credentials.
type ModelAgentService ¶
type ModelAgentService interface { // GetModelTargetAgentVersion returns the target agent version for the // entire model. The following errors can be returned: // - [github.com/juju/juju/domain/model/errors.NotFound] - When the model does // not exist. GetModelTargetAgentVersion(context.Context) (version.Number, error) }
ModelAgentService provides access to the Juju agent version for the model.
type ModelConfigService ¶
type ModelConfigService interface { // ModelConfig returns the current config for the model. ModelConfig(context.Context) (*config.Config, error) }
ModelConfigService provides access to the model configuration.
type ModelExporter ¶
type ModelExporter interface { // ExportModel exports a model to a description.Model. // It requires a known set of leaders to be passed in, so that applications // can have their leader set correctly once imported. // The objectstore is used to retrieve charms and resources for export. ExportModel(context.Context, map[string]string, objectstore.ObjectStore) (description.Model, error) }
ModelExporter exports a model to a description.Model.
type ModelInfoService ¶
type ModelInfoService interface { // GetModelInfo returns the readonly model information for the model in // question. GetModelInfo(context.Context) (model.ModelInfo, error) }
ModelInfoService provides access to information about the model.