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 assocated.
Index ¶
- type ConfigSource
- type ModelManager
- type ModelManagerAPI
- func (m *ModelManagerAPI) CreateModel(args params.ModelCreateArgs) (params.ModelInfo, error)
- func (m *ModelManagerAPI) DestroyModels(args params.Entities) (params.ErrorResults, error)
- func (m *ModelManagerAPI) DumpModels(args params.Entities) params.MapResults
- func (m *ModelManagerAPI) DumpModelsDB(args params.Entities) params.MapResults
- func (m *ModelManagerAPI) ListModels(user params.Entity) (params.UserModelList, error)
- func (m *ModelManagerAPI) ModelDefaults() (params.ModelDefaultsResult, 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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigSource ¶
ConfigSource describes a type that is able to provide config. Abstracted primarily for testing.
type ModelManager ¶
type ModelManager 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) }
ModelManager defines the methods on the modelmanager API endpoint.
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 NewModelManagerAPI ¶
func NewModelManagerAPI( st common.ModelManagerBackend, configGetter environs.EnvironConfigGetter, authorizer facade.Authorizer, ) (*ModelManagerAPI, error)
NewModelManagerAPI creates a new api server endpoint for managing models.
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.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 (*ModelManagerAPI) DumpModels ¶
func (m *ModelManagerAPI) 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 (*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) 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. Only that controller owner can list models for any user (at this stage). Other users can only ask about their own models.
func (*ModelManagerAPI) ModelDefaults ¶
func (m *ModelManagerAPI) ModelDefaults() (params.ModelDefaultsResult, error)
ModelDefaults returns the default config values used when creating a new model.
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.