Documentation ¶
Overview ¶
The controller package defines an API end point for functions dealing with controllers as a whole.
Index ¶
- type Controller
- type ControllerAPI
- func (s *ControllerAPI) AllModels() (params.UserModelList, error)
- func (s *ControllerAPI) DestroyController(args params.DestroyControllerArgs) error
- func (c *ControllerAPI) InitiateModelMigration(reqArgs params.InitiateModelMigrationArgs) (params.InitiateModelMigrationResults, error)
- func (s *ControllerAPI) ListBlockedModels() (params.ModelBlockInfoList, error)
- func (s *ControllerAPI) ModelConfig() (params.ModelConfigResults, error)
- func (c *ControllerAPI) ModelStatus(req params.Entities) (params.ModelStatusResults, error)
- func (s *ControllerAPI) RemoveBlocks(args params.RemoveBlocksArgs) error
- func (c *ControllerAPI) WatchAllModels() (params.AllWatcherId, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { AllModels() (params.UserModelList, error) DestroyController(args params.DestroyControllerArgs) error ModelConfig() (params.ModelConfigResults, error) ListBlockedModels() (params.ModelBlockInfoList, error) RemoveBlocks(args params.RemoveBlocksArgs) error WatchAllModels() (params.AllWatcherId, error) ModelStatus(req params.Entities) (params.ModelStatusResults, error) InitiateModelMigration(params.InitiateModelMigrationArgs) (params.InitiateModelMigrationResults, error) }
Controller defines the methods on the controller API end point.
type ControllerAPI ¶
type ControllerAPI struct {
// contains filtered or unexported fields
}
ControllerAPI implements the environment manager interface and is the concrete implementation of the api end point.
func NewControllerAPI ¶
func NewControllerAPI( st *state.State, resources *common.Resources, authorizer common.Authorizer, ) (*ControllerAPI, error)
NewControllerAPI creates a new api server endpoint for managing environments.
func (*ControllerAPI) AllModels ¶
func (s *ControllerAPI) AllModels() (params.UserModelList, error)
AllModels allows controller administrators to get the list of all the environments in the controller.
func (*ControllerAPI) DestroyController ¶
func (s *ControllerAPI) DestroyController(args params.DestroyControllerArgs) error
DestroyController will attempt to destroy the controller. If the args specify the removal of blocks or the destruction of the models, this method will attempt to do so.
If the controller has any non-Dead hosted models, then an error with the code params.CodeHasHostedModels will be transmitted, regardless of the value of the DestroyModels parameter. This is to inform the client that it should wait for hosted models to be completely cleaned up before proceeding.
func (*ControllerAPI) InitiateModelMigration ¶
func (c *ControllerAPI) InitiateModelMigration(reqArgs params.InitiateModelMigrationArgs) ( params.InitiateModelMigrationResults, error, )
InitiateModelMigration attempts to begin the migration of one or more models to other controllers.
func (*ControllerAPI) ListBlockedModels ¶
func (s *ControllerAPI) ListBlockedModels() (params.ModelBlockInfoList, error)
ListBlockedModels returns a list of all environments on the controller which have a block in place. The resulting slice is sorted by environment name, then owner. Callers must be controller administrators to retrieve the list.
func (*ControllerAPI) ModelConfig ¶
func (s *ControllerAPI) ModelConfig() (params.ModelConfigResults, error)
ModelConfig returns the environment config for the controller environment. For information on the current environment, use client.ModelGet
func (*ControllerAPI) ModelStatus ¶
func (c *ControllerAPI) ModelStatus(req params.Entities) (params.ModelStatusResults, error)
ModelStatus returns a summary of the environment.
func (*ControllerAPI) RemoveBlocks ¶
func (s *ControllerAPI) RemoveBlocks(args params.RemoveBlocksArgs) error
RemoveBlocks removes all the blocks in the controller.
func (*ControllerAPI) WatchAllModels ¶
func (c *ControllerAPI) WatchAllModels() (params.AllWatcherId, error)
WatchAllModels starts watching events for all models in the controller. The returned AllWatcherId should be used with Next on the AllModelWatcher endpoint to receive deltas.