juju: github.com/juju/juju/core/migration Index | Files

package migration

import "github.com/juju/juju/core/migration"


Package Files

migration.go minionreports.go phase.go targetinfo.go

type MigrationStatus Uses

type MigrationStatus struct {
    // MigrationId hold the unique id for the migration.
    MigrationId string

    // ModelUUID holds the UUID of the model being migrated.
    ModelUUID string

    // Phases indicates the current migration phase.
    Phase Phase

    // PhaseChangedTime indicates the time the phase was changed to
    // its current value.
    PhaseChangedTime time.Time

    // TargetInfo contains the details of how to connect to the target
    // controller.
    TargetInfo TargetInfo

MigrationStatus returns the details for a migration as needed by the migrationmaster worker.

type MinionReports Uses

type MinionReports struct {
    // ModelUUID holds the unique identifier for the model migration.
    MigrationId string

    // Phases indicates the migration phase the reports relate to.
    Phase Phase

    // SuccesCount indicates how many agents have successfully
    // completed the migration phase.
    SuccessCount int

    // UnknownCount indicates how many agents are yet to report
    // regarding the migration phase.
    UnknownCount int

    // SomeUnknownMachines holds the ids of some of the machines which
    // have not yet reported in.
    SomeUnknownMachines []string

    // SomeUnknownUnits holds the names of some of the units which
    // have not yet reported in.
    SomeUnknownUnits []string

    // SomeUnknownApplications holds the names of some of the applications which
    // have not yet reported in.
    SomeUnknownApplications []string

    // FailedMachines holds the ids of machines which have failed to
    // complete the migration phase.
    FailedMachines []string

    // FailedUnits holds the names of units which have failed to
    // complete the migration phase.
    FailedUnits []string

    // FailedApplications holds the names of applications which have failed to
    // complete the migration phase.
    FailedApplications []string

MinionReports returns information about the migration minion reports received so far for a given migration phase.

func (*MinionReports) IsZero Uses

func (r *MinionReports) IsZero() bool

IsZero returns true if the MinionReports instance hasn't been set.

type ModelInfo Uses

type ModelInfo struct {
    UUID                   string
    Owner                  names.UserTag
    Name                   string
    AgentVersion           version.Number
    ControllerAgentVersion version.Number

ModelInfo is used to report basic details about a model.

func (*ModelInfo) Validate Uses

func (i *ModelInfo) Validate() error

type Phase Uses

type Phase int

Phase values specify model migration phases.

const (
    UNKNOWN Phase = iota

Enumerate all possible migration phases.

func ParsePhase Uses

func ParsePhase(target string) (Phase, bool)

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

func SuccessfulMigrationPhases Uses

func SuccessfulMigrationPhases() []Phase

Those phases are only used to get a complete successful round for testing purposes.

func (Phase) CanTransitionTo Uses

func (p Phase) CanTransitionTo(targetPhase Phase) bool

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

func (Phase) IsRunning Uses

func (p Phase) IsRunning() bool

IsRunning returns true if the phase indicates the migration is active and up to or at the SUCCESS phase. It returns false if the phase is one of the final cleanup phases or indicates an failed migration.

func (Phase) IsTerminal Uses

func (p Phase) IsTerminal() bool

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

func (Phase) String Uses

func (p Phase) String() string

String returns the name of an model migration phase constant.

type SerializedModel Uses

type SerializedModel struct {
    // Bytes contains the serialized data for the model.
    Bytes []byte

    // Charms lists the charm URLs in use in the model.
    Charms []string

    // Tools lists the tools versions in use with the model along with
    // their URIs. The URIs can be used to download the tools from the
    // source controller.
    Tools map[version.Binary]string // version -> tools URI

    // Resources represents all the resources in use in the model.
    Resources []SerializedModelResource

SerializedModel wraps a buffer contain a serialised Juju model as well as containing metadata about the charms and tools used by the model.

type SerializedModelResource Uses

type SerializedModelResource struct {
    ApplicationRevision resource.Resource
    CharmStoreRevision  resource.Resource
    UnitRevisions       map[string]resource.Resource

SerializedModelResource defines the resource revisions for a specific application and its units.

type TargetInfo Uses

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

    // ControllerAlias holds an optional alias for the target controller.
    ControllerAlias string

    // 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

    // Macaroons holds macaroons to use with AuthTag. At least one of
    // Password or Macaroons must be set.
    Macaroons []macaroon.Slice

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 Uses

func (info *TargetInfo) Validate() error

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

Package migration imports 7 packages (graph) and is imported by 370 packages. Updated 2020-09-30. Refresh now. Tools for package owners.