migrationmaster

package
v0.0.0-...-4bd6544 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

This package defines the API facade for use by the migration master worker when communicating to it's own controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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(
	backend Backend,
	precheckBackend migration.PrecheckBackend,
	resources facade.Resources,
	authorizer facade.Authorizer,
) (*API, error)

NewAPI creates a new API server endpoint for the model migration master worker.

func (*API) Export

func (api *API) Export() (params.SerializedModel, error)

Export serializes the model associated with the API connection.

func (*API) MigrationStatus

func (api *API) MigrationStatus() (params.MasterMigrationStatus, error)

MigrationStatus returns the details and progress of the latest model migration.

func (*API) MinionReports

func (api *API) MinionReports() (params.MinionReports, error)

MinionReports returns details of the reports made by migration minions to the controller for the current migration phase.

func (*API) ModelInfo

func (api *API) ModelInfo() (params.MigrationModelInfo, error)

ModelInfo returns essential information about the model to be migrated.

func (*API) Prechecks

func (api *API) Prechecks() error

Prechecks performs pre-migration checks on the model and (source) controller.

func (*API) Reap

func (api *API) Reap() error

Reap removes all documents for the model associated with the API connection.

func (*API) SetPhase

func (api *API) SetPhase(args params.SetMigrationPhaseArgs) error

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(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) Watch

func (api *API) Watch() 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() params.NotifyWatchResult

WatchMinionReports sets up a watcher which reports when a report for a migration minion has arrived.

type Backend

type Backend interface {
	WatchForMigration() state.NotifyWatcher
	LatestMigration() (state.ModelMigration, error)
	ModelUUID() string
	ModelName() (string, error)
	ModelOwner() (names.UserTag, error)
	AgentVersion() (version.Number, error)
	RemoveExportingModelDocs() error

	migration.StateExporter
}

Backend defines the state functionality required by the migrationmaster facade.

Jump to

Keyboard shortcuts

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