modelmanager

package
v0.0.0-...-004e4dd Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 33 Imported by: 1

Documentation

Overview

Package modelmanager defines an API endpoint 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

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 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. V10 of the facade does not return default-series or default-base in model info

func NewModelManagerAPI

func NewModelManagerAPI(
	st common.ModelManagerBackend,
	ctlrSt common.ModelManagerBackend,
	toolsFinder common.ToolsFinder,
	getBroker newCaasBrokerFunc,
	blockChecker common.BlockCheckerInterface,
	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.

type ModelManagerAPIV9

type ModelManagerAPIV9 struct {
	*ModelManagerAPI
}

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

func (*ModelManagerAPIV9) CreateModel

CreateModel creates a new model using the account and model config specified in the args. V9 of the facade includes the model default-series and default-base in it's output

func (*ModelManagerAPIV9) 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. V9 of the facade includes the model default-series and default-base in it's output

func (*ModelManagerAPIV9) ModelInfo

ModelInfo returns information about the specified models. In V9 of the facade, we include DefaultSeries and DefaultBase within model info

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