modelmigration

package
v0.0.0-...-56cb166 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterExport

func RegisterExport(coordinator Coordinator, logger logger.Logger)

RegisterExport registers the export operations with the given coordinator.

func RegisterImport

func RegisterImport(coordinator Coordinator, logger logger.Logger)

RegisterImport register's a new model migration importer into the supplied coordinator.

Types

type ControllerConfigService

type ControllerConfigService interface {
	// ControllerConfig returns the config values for the controller.
	ControllerConfig(context.Context) (controller.Config, error)
}

ControllerConfigService defines the controller config service used for model migration.

type Coordinator

type Coordinator interface {
	// Add adds the given operation to the migration.
	Add(modelmigration.Operation)
}

Coordinator is the interface that is used to add operations to a migration.

type ExportService

type ExportService interface {
	// GetEnvironVersion retrieves the version of the environment provider
	// associated with the model.
	GetEnvironVersion(context.Context) (int, error)

	// GetModelConstraints returns the currently set constraints for the model.
	// The following error types can be expected:
	// - [modelerrors.NotFound]: when no model exists to set constraints for.
	GetModelConstraints(context.Context) (coreconstraints.Value, error)
}

ExportService provides a subset of the model domain service methods needed for model export.

type ModelDetailService

type ModelDetailService interface {
	// CreateModel is responsible for creating a new read only model
	// that is being imported.
	CreateModel(context.Context, uuid.UUID) error

	// DeleteModel is responsible for removing a read only model from the system.
	DeleteModel(context.Context) error

	// SetModelConstraints sets the model constraints to the new values removing
	// any previously set constraints.
	//
	// The following error types can be expected:
	// - [github.com/juju/juju/domain/network/errors.SpaceNotFound]: when the space
	// being set in the model constraint doesn't exist.
	// - [github.com/juju/juju/domain/machine/errors.InvalidContainerType]: when
	// the container type being set in the model constraint isn't valid.
	SetModelConstraints(context.Context, coreconstraints.Value) error
}

ModelDetailService defines a service for interacting with the model information found in a model database.

type ModelDetailServiceFunc

type ModelDetailServiceFunc = func(coremodel.UUID) ModelDetailService

ModelDetailServiceFunc is responsible for creating and returning a ModelDetailService for the specified model id. We use this func so that we can late bind the service during the import operation.

type ModelImportService

type ModelImportService interface {
	// ImportModel is responsible for creating a new model that is being
	// imported.
	ImportModel(context.Context, domainmodel.ModelImportArgs) (func(context.Context) error, error)

	// DeleteModel is responsible for removing a model from the system.
	DeleteModel(context.Context, coremodel.UUID, ...domainmodel.DeleteModelOption) error
}

ModelImportService defines the model service used to import models from another controller to this one.

type UserService

type UserService interface {
	// GetUserByName will find active users specified by the user name and
	// return the associated user object.
	GetUserByName(context.Context, coreuser.Name) (coreuser.User, error)
}

UserService defines the user service used for model migration.

Jump to

Keyboard shortcuts

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