modelupgrader

package
v0.0.0-...-51a0f74 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package modelupgrader defines an API endpoint for functions dealing with upgrading models.

Index

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 ConfigSource

type ConfigSource interface {
	Config() (*config.Config, error)
}

ConfigSource describes a type that is able to provide config. Abstracted primarily for testing.

type Model

type Model interface {
	IsControllerModel() bool
	AgentVersion() (version.Number, error)
	Owner() names.UserTag
	Name() string
	MigrationMode() state.MigrationMode
	Type() state.ModelType
	Life() state.Life
}

Model defines a point of use interface for the model from state.

type ModelUpgraderAPI

type ModelUpgraderAPI struct {
	// contains filtered or unexported fields
}

ModelUpgraderAPI implements the model upgrader interface and is the concrete implementation of the api end point.

func NewModelUpgraderAPI

func NewModelUpgraderAPI(
	controllerTag names.ControllerTag,
	stPool StatePool,
	toolsFinder common.ToolsFinder,
	newEnviron common.NewEnvironFunc,
	blockChecker common.BlockCheckerInterface,
	authorizer facade.Authorizer,
	callCtx context.ProviderCallContext,
	registryAPIFunc func(docker.ImageRepoDetails) (registry.Registry, error),
	environscloudspecGetter func(names.ModelTag) (environscloudspec.CloudSpec, error),
) (*ModelUpgraderAPI, error)

NewModelUpgraderAPI creates a new api server endpoint for managing models.

func (*ModelUpgraderAPI) AbortModelUpgrade

func (m *ModelUpgraderAPI) AbortModelUpgrade(arg params.ModelParam) error

AbortModelUpgrade aborts and archives the model upgrade synchronisation record, if any.

func (*ModelUpgraderAPI) UpgradeModel

func (m *ModelUpgraderAPI) UpgradeModel(arg params.UpgradeModelParams) (result params.UpgradeModelResult, err error)

UpgradeModel upgrades a model.

type State

type State interface {
	Model() (Model, error)
	HasUpgradeSeriesLocks() (bool, error)
	Release() bool
	AllModelUUIDs() ([]string, error)
	MachineCountForBase(base ...state.Base) (map[string]int, error)
	MongoCurrentStatus() (*replicaset.Status, error)
	SetModelAgentVersion(newVersion version.Number, stream *string, ignoreAgentVersions bool) error
	AbortCurrentUpgrade() error
	ControllerConfig() (controller.Config, error)
	AllCharmURLs() ([]*string, error)
}

State represents a point of use interface for modelling a current model.

type StatePool

type StatePool interface {
	Get(string) (State, error)
	ControllerModel() (Model, error)
	MongoVersion() (string, error)
}

StatePool represents a point of use interface for getting the state from the pool.

type SystemState

type SystemState interface {
	ControllerModel() (Model, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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