modelmanager

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package modelmanager defines an API end point for functions dealing with models. Creating, listing and sharing models. This facade is available at the root of the controller API, and as such, there is no implicit Model associated.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
}

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

type ModelManagerAPI

type ModelManagerAPI struct {
	*common.ModelStatusAPI
	// contains filtered or unexported fields
}

ModelManagerAPI implements the model manager interface and is the concrete implementation of the api end point.

func NewFacadeV9

func NewFacadeV9(ctx facade.Context) (*ModelManagerAPI, error)

NewFacadeV9 is used for API registration.

func NewModelManagerAPI

func NewModelManagerAPI(
	st common.ModelManagerBackend,
	ctlrSt common.ModelManagerBackend,
	stPool StatePool,
	configGetter environs.EnvironConfigGetter,
	getBroker newCaasBrokerFunc,
	authorizer facade.Authorizer,
	m common.Model,
	callCtx context.ProviderCallContext,
) (*ModelManagerAPI, error)

NewModelManagerAPI creates a new api server endpoint for managing models.

func (*ModelManagerAPI) ChangeModelCredential

func (m *ModelManagerAPI) ChangeModelCredential(args params.ChangeModelCredentialsParams) (params.ErrorResults, error)

ChangeModelCredential changes cloud credential reference for models. These new cloud credentials must already exist on the controller.

func (*ModelManagerAPI) CreateModel

func (m *ModelManagerAPI) CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)

CreateModel creates a new model using the account and model config specified in the args.

func (*ModelManagerAPI) DestroyModels

DestroyModels will try to destroy the specified models. If there is a block on destruction, this method will return an error. From ModelManager v7 onwards, DestroyModels gains 'force' and 'max-wait' parameters.

func (*ModelManagerAPI) DumpModels

DumpModels will export the models into the database agnostic representation. The user needs to either be a controller admin, or have admin privileges on the model itself.

func (*ModelManagerAPI) DumpModelsDB

func (m *ModelManagerAPI) DumpModelsDB(args params.Entities) params.MapResults

DumpModelsDB will gather all documents from all model collections for the specified model. The map result contains a map of collection names to lists of documents represented as maps.

func (*ModelManagerAPI) ListModelSummaries

ListModelSummaries returns models that the specified user has access to in the current server. Controller admins (superuser) can list models for any user. Other users can only ask about their own models.

func (*ModelManagerAPI) ListModels

func (m *ModelManagerAPI) ListModels(user params.Entity) (params.UserModelList, error)

ListModels returns the models that the specified user has access to in the current server. Controller admins (superuser) can list models for any user. Other users can only ask about their own models.

func (*ModelManagerAPI) ModelDefaultsForClouds

func (m *ModelManagerAPI) ModelDefaultsForClouds(args params.Entities) (params.ModelDefaultsResults, error)

ModelDefaultsForClouds returns the default config values for the specified clouds.

func (*ModelManagerAPI) ModelInfo

ModelInfo returns information about the specified models.

func (*ModelManagerAPI) ModifyModelAccess

func (m *ModelManagerAPI) ModifyModelAccess(args params.ModifyModelAccessRequest) (result params.ErrorResults, _ error)

ModifyModelAccess changes the model access granted to users.

func (*ModelManagerAPI) SetModelDefaults

func (m *ModelManagerAPI) SetModelDefaults(args params.SetModelDefaults) (params.ErrorResults, error)

SetModelDefaults writes new values for the specified default model settings.

func (*ModelManagerAPI) UnsetModelDefaults

func (m *ModelManagerAPI) UnsetModelDefaults(args params.UnsetModelDefaults) (params.ErrorResults, error)

UnsetModelDefaults removes the specified default model settings.

func (*ModelManagerAPI) ValidateModelUpgrades

func (m *ModelManagerAPI) ValidateModelUpgrades(args params.ValidateModelUpgradeParams) (params.ErrorResults, error)

ValidateModelUpgrades validates if a model is allowed to perform an upgrade. Examples of why you would want to block a model upgrade, would be situations like upgrade-series. If performing an upgrade-series we don't know the current status of the machine, so performing an upgrade-model can lead to bad unintended errors down the line.

type ModelManagerAPIV2

type ModelManagerAPIV2 struct {
	*ModelManagerAPIV3
}

ModelManagerAPIV2 provides a way to wrap the different calls between version 2 and version 3 of the model manager API

func NewFacadeV2

func NewFacadeV2(ctx facade.Context) (*ModelManagerAPIV2, error)

NewFacadeV2 is used for API registration.

func (*ModelManagerAPIV2) DumpModels

func (m *ModelManagerAPIV2) DumpModels(args params.Entities) params.MapResults

DumpModels will export the models into the database agnostic representation. The user needs to either be a controller admin, or have admin privileges on the model itself.

func (*ModelManagerAPIV2) ModelStatus

ModelStatus is a legacy method call to ensure that we preserve backward compatibility. TODO (anastasiamac 2017-10-26) This should be made obsolete/removed.

type ModelManagerAPIV3

type ModelManagerAPIV3 struct {
	*ModelManagerAPIV4
}

ModelManagerAPIV3 provides a way to wrap the different calls between version 3 and version 4 of the model manager API

func NewFacadeV3

func NewFacadeV3(ctx facade.Context) (*ModelManagerAPIV3, error)

NewFacadeV3 is used for API registration.

func (*ModelManagerAPIV3) DestroyModels

func (m *ModelManagerAPIV3) DestroyModels(args params.Entities) (params.ErrorResults, error)

DestroyModels will try to destroy the specified models. If there is a block on destruction, this method will return an error.

func (*ModelManagerAPIV3) ModelStatus

ModelStatus is a legacy method call to ensure that we preserve backward compatibility. TODO (anastasiamac 2017-10-26) This should be made obsolete/removed.

type ModelManagerAPIV4

type ModelManagerAPIV4 struct {
	*ModelManagerAPIV5
}

ModelManagerAPIV4 provides a way to wrap the different calls between version 4 and version 5 of the model manager API

func NewFacadeV4

func NewFacadeV4(ctx facade.Context) (*ModelManagerAPIV4, error)

NewFacadeV4 is used for API registration.

func (*ModelManagerAPIV4) ChangeModelCredential

func (*ModelManagerAPIV4) ChangeModelCredential(_, _ struct{})

ChangeModelCredential did not exist prior to v5.

type ModelManagerAPIV5

type ModelManagerAPIV5 struct {
	*ModelManagerAPIV6
}

ModelManagerAPIV5 provides a way to wrap the different calls between version 5 and version 6 of the model manager API

func NewFacadeV5

func NewFacadeV5(ctx facade.Context) (*ModelManagerAPIV5, error)

NewFacadeV5 is used for API registration.

func (*ModelManagerAPIV5) ModelDefaults

func (m *ModelManagerAPIV5) ModelDefaults() (params.ModelDefaultsResult, error)

ModelDefaults returns the default config values used when creating a new model.

func (*ModelManagerAPIV5) ModelDefaultsForClouds

func (*ModelManagerAPIV5) ModelDefaultsForClouds(_, _ struct{})

ModelDefaultsForClouds did not exist prior to v6.

type ModelManagerAPIV6

type ModelManagerAPIV6 struct {
	*ModelManagerAPIV7
}

ModelManagerAPIV6 provides a way to wrap the different calls between version 7 and version 6 of the model manager API

func NewFacadeV6

func NewFacadeV6(ctx facade.Context) (*ModelManagerAPIV6, error)

NewFacadeV6 is used for API registration.

type ModelManagerAPIV7

type ModelManagerAPIV7 struct {
	*ModelManagerAPIV8
}

ModelManagerAPIV7 provides a way to wrap the different calls between version 8 and version 7 of the model manager API

func NewFacadeV7

func NewFacadeV7(ctx facade.Context) (*ModelManagerAPIV7, error)

NewFacadeV7 is used for API registration.

func (*ModelManagerAPIV7) ModelInfo

ModelInfo returns information about the specified models.

type ModelManagerAPIV8

type ModelManagerAPIV8 struct {
	*ModelManagerAPI
}

ModelManagerAPIV8 provides a way to wrap the different calls between version 8 and version 8 of the model manager API

func NewFacadeV8

func NewFacadeV8(ctx facade.Context) (*ModelManagerAPIV8, error)

NewFacadeV8 is used for API registration.

func (*ModelManagerAPIV8) ValidateModelUpgrade

func (*ModelManagerAPIV8) ValidateModelUpgrade(_, _ struct{})

ValidateModelUpgrade did not exist prior to v9.

type ModelManagerV2

type ModelManagerV2 interface {
	CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)
	DumpModels(args params.Entities) params.MapResults
	DumpModelsDB(args params.Entities) params.MapResults
	ListModels(user params.Entity) (params.UserModelList, error)
	DestroyModels(args params.Entities) (params.ErrorResults, error)
	ModelStatus(req params.Entities) (params.ModelStatusResults, error)
}

ModelManagerV2 defines the methods on the version 2 facade for the modelmanager API endpoint.

type ModelManagerV3

type ModelManagerV3 interface {
	CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)
	DumpModels(args params.DumpModelRequest) params.StringResults
	DumpModelsDB(args params.Entities) params.MapResults
	ListModels(user params.Entity) (params.UserModelList, error)
	DestroyModels(args params.Entities) (params.ErrorResults, error)
	ModelInfo(args params.Entities) (params.ModelInfoResults, error)
	ModelStatus(req params.Entities) (params.ModelStatusResults, error)
}

ModelManagerV3 defines the methods on the version 3 facade for the modelmanager API endpoint.

type ModelManagerV4

type ModelManagerV4 interface {
	CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)
	DumpModels(args params.DumpModelRequest) params.StringResults
	DumpModelsDB(args params.Entities) params.MapResults
	ListModelSummaries(request params.ModelSummariesRequest) (params.ModelSummaryResults, error)
	ListModels(user params.Entity) (params.UserModelList, error)
	DestroyModels(args params.DestroyModelsParams) (params.ErrorResults, error)
	ModelInfo(args params.Entities) (params.ModelInfoResults, error)
	ModelStatus(req params.Entities) (params.ModelStatusResults, error)
}

ModelManagerV4 defines the methods on the version 4 facade for the modelmanager API endpoint.

type ModelManagerV5

type ModelManagerV5 interface {
	CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)
	DumpModels(args params.DumpModelRequest) params.StringResults
	DumpModelsDB(args params.Entities) params.MapResults
	ListModelSummaries(request params.ModelSummariesRequest) (params.ModelSummaryResults, error)
	ListModels(user params.Entity) (params.UserModelList, error)
	DestroyModels(args params.DestroyModelsParams) (params.ErrorResults, error)
	ModelInfo(args params.Entities) (params.ModelInfoResults, error)
	ModelStatus(req params.Entities) (params.ModelStatusResults, error)
	ChangeModelCredential(args params.ChangeModelCredentialsParams) (params.ErrorResults, error)
}

ModelManagerV5 defines the methods on the version 5 facade for the modelmanager API endpoint.

type ModelManagerV6

type ModelManagerV6 interface {
	ModelManagerV5
	ModelDefaultsForClouds(args params.Entities) (params.ModelDefaultsResults, error)
}

ModelManagerV6 defines the methods on the version 6 facade for the modelmanager API endpoint.

type ModelManagerV7

type ModelManagerV7 interface {
	ModelManagerV6
}

ModelManagerV7 defines the methods on the version 7 facade for the modelmanager API endpoint.

type ModelManagerV8

type ModelManagerV8 interface {
	ModelManagerV7
}

ModelManagerV8 defines the methods on the version 8 facade for the modelmanager API endpoint.

type ModelManagerV9

type ModelManagerV9 interface {
	ModelManagerV8
	ValidateModelUpgrades(args params.ValidateModelUpgradeParams) (params.ErrorResults, error)
}

ModelManagerV9 defines the methods on the version 9 facade for the modelmanager API endpoint.

type State

type State interface {
	Model() (Model, error)
	HasUpgradeSeriesLocks() (bool, error)
	Release() bool
}

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

type StatePool

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

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

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