migration

package
v0.0.0-...-2608902 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Phase

type Phase int

Phase values specify model migration phases.

const (
	UNKNOWN Phase = iota
	NONE
	QUIESCE
	READONLY
	PRECHECK
	IMPORT
	VALIDATION
	SUCCESS
	LOGTRANSFER
	REAP
	REAPFAILED
	DONE
	ABORT
	ABORTDONE
)

Enumerate all possible migration phases.

func ParsePhase

func ParsePhase(target string) (Phase, bool)

ParsePhase converts a string model migration phase name to its constant value.

func (Phase) CanTransitionTo

func (p Phase) CanTransitionTo(targetPhase Phase) bool

CanTransitionTo returns true if the given phase is a valid next model migration phase.

func (Phase) IsTerminal

func (p Phase) IsTerminal() bool

IsTerminal returns true if the phase is one which signifies the end of a migration.

func (Phase) String

func (p Phase) String() string

String returns the name of an model migration phase constant.

type TargetInfo

type TargetInfo struct {
	// ControllerTag holds tag for the target controller.
	ControllerTag names.ModelTag

	// Addrs holds the addresses and ports of the target controller's
	// API servers.
	Addrs []string

	// CACert holds the CA certificate that will be used to validate
	// the target API server's certificate, in PEM format.
	CACert string

	// AuthTag holds the user tag to authenticate with to the target
	// controller.
	AuthTag names.UserTag

	// Password holds the password to use with AuthTag.
	Password string
}

TargetInfo holds the details required to connect to a migration's target controller.

TODO(mjs) - Note the similarity to api.Info. It would be nice to be able to use api.Info here but state can't import api and moving api.Info to live under the core package is too big a project to be done right now.

func (*TargetInfo) Validate

func (info *TargetInfo) Validate() error

Validate returns an error if the TargetInfo contains bad data. Nil is returned otherwise.

Jump to

Keyboard shortcuts

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