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 ¶
- func Register(registry facade.FacadeRegistry)
- type ConfigSource
- type ModelManagerAPI
- func (m *ModelManagerAPI) ChangeModelCredential(args params.ChangeModelCredentialsParams) (params.ErrorResults, error)
- func (m *ModelManagerAPI) CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)
- func (m *ModelManagerAPI) DestroyModels(args params.DestroyModelsParams) (params.ErrorResults, error)
- func (m *ModelManagerAPI) DumpModels(args params.DumpModelRequest) params.StringResults
- func (m *ModelManagerAPI) DumpModelsDB(args params.Entities) params.MapResults
- func (m *ModelManagerAPI) ListModelSummaries(req params.ModelSummariesRequest) (params.ModelSummaryResults, error)
- func (m *ModelManagerAPI) ListModels(user params.Entity) (params.UserModelList, error)
- func (m *ModelManagerAPI) ModelDefaultsForClouds(args params.Entities) (params.ModelDefaultsResults, error)
- func (m *ModelManagerAPI) ModelInfo(args params.Entities) (params.ModelInfoResults, error)
- func (m *ModelManagerAPI) ModifyModelAccess(args params.ModifyModelAccessRequest) (result params.ErrorResults, _ error)
- func (m *ModelManagerAPI) SetModelDefaults(args params.SetModelDefaults) (params.ErrorResults, error)
- func (m *ModelManagerAPI) UnsetModelDefaults(args params.UnsetModelDefaults) (params.ErrorResults, error)
- type ModelManagerAPIV9
- func (m *ModelManagerAPIV9) CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)
- func (m *ModelManagerAPIV9) ListModelSummaries(req params.ModelSummariesRequest) (params.ModelSummaryResults, error)
- func (m *ModelManagerAPIV9) ModelInfo(args params.Entities) (params.ModelInfoResults, error)
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 ¶
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 ¶
func (m *ModelManagerAPI) DestroyModels(args params.DestroyModelsParams) (params.ErrorResults, error)
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 ¶
func (m *ModelManagerAPI) DumpModels(args params.DumpModelRequest) params.StringResults
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 ¶
func (m *ModelManagerAPI) ListModelSummaries(req params.ModelSummariesRequest) (params.ModelSummaryResults, error)
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 ¶
func (m *ModelManagerAPI) ModelInfo(args params.Entities) (params.ModelInfoResults, error)
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 ¶
func (m *ModelManagerAPIV9) CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)
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 ¶
func (m *ModelManagerAPIV9) ListModelSummaries(req params.ModelSummariesRequest) (params.ModelSummaryResults, error)
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 ¶
func (m *ModelManagerAPIV9) ModelInfo(args params.Entities) (params.ModelInfoResults, error)
ModelInfo returns information about the specified models. In V9 of the facade, we include DefaultSeries and DefaultBase within model info