modelmanager

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 26 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 assocated.

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 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 NewFacadeV5

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

NewFacadeV5 is used for API registration.

func NewModelManagerAPI

func NewModelManagerAPI(
	st common.ModelManagerBackend,
	ctlrSt common.ModelManagerBackend,
	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)

ChangeModelCredentials 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.

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) ModelDefaults

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

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

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 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)

NewFacade 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 {
	*ModelManagerAPI
}

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{})

Mask out new methods from the old API versions. The API reflection code in rpc/rpcreflect/type.go:newMethod skips 2-argument methods, so this removes the method as far as the RPC machinery is concerned.

ChangeModelCredential did not exist prior to v5.

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.

Jump to

Keyboard shortcuts

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