Documentation
¶
Overview ¶
The controller package defines an API end point for functions dealing with controllers as a whole.
Index ¶
- func ChangeControllerAccess(accessor *state.State, apiUser, targetUserTag names.UserTag, ...) error
- type Controller
- type ControllerAPI
- func (s *ControllerAPI) AllModels() (params.UserModelList, error)
- func (s *ControllerAPI) DestroyController(args params.DestroyControllerArgs) error
- func (c *ControllerAPI) GetControllerAccess(req params.Entities) (params.UserAccessResults, error)
- func (s *ControllerAPI) HostedModelConfigs() (params.HostedModelConfigsResults, error)
- func (c *ControllerAPI) InitiateMigration(reqArgs params.InitiateMigrationArgs) (params.InitiateMigrationResults, error)
- func (s *ControllerAPI) ListBlockedModels() (params.ModelBlockInfoList, error)
- func (s *ControllerAPI) ModelConfig() (params.ModelConfigResults, error)
- func (c *ControllerAPI) ModifyControllerAccess(args params.ModifyControllerAccessRequest) (params.ErrorResults, 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 ¶
func ChangeControllerAccess ¶
func ChangeControllerAccess(accessor *state.State, apiUser, targetUserTag names.UserTag, action params.ControllerAction, access permission.Access) error
ChangeControllerAccess performs the requested access grant or revoke action for the specified user on the controller.
Types ¶
type Controller ¶
type Controller interface { AllModels() (params.UserModelList, error) DestroyController(args params.DestroyControllerArgs) error ModelConfig() (params.ModelConfigResults, error) HostedModelConfigs() (params.HostedModelConfigsResults, error) GetControllerAccess(params.Entities) (params.UserAccessResults, error) ControllerConfig() (params.ControllerConfigResult, error) ListBlockedModels() (params.ModelBlockInfoList, error) RemoveBlocks(args params.RemoveBlocksArgs) error WatchAllModels() (params.AllWatcherId, error) ModelStatus(params.Entities) (params.ModelStatusResults, error) InitiateMigration(params.InitiateMigrationArgs) (params.InitiateMigrationResults, error) ModifyControllerAccess(params.ModifyControllerAccessRequest) (params.ErrorResults, error) }
Controller defines the methods on the controller API end point.
type ControllerAPI ¶
type ControllerAPI struct { *common.ControllerConfigAPI *common.ModelStatusAPI cloudspec.CloudSpecAPI // 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(ctx facade.Context) (*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) GetControllerAccess ¶
func (c *ControllerAPI) GetControllerAccess(req params.Entities) (params.UserAccessResults, error)
GetControllerAccess returns the level of access the specifed users have on the controller.
func (*ControllerAPI) HostedModelConfigs ¶
func (s *ControllerAPI) HostedModelConfigs() (params.HostedModelConfigsResults, error)
HostedModelConfigs returns all the information that the client needs in order to connect directly with the host model's provider and destroy it directly.
func (*ControllerAPI) InitiateMigration ¶
func (c *ControllerAPI) InitiateMigration(reqArgs params.InitiateMigrationArgs) ( params.InitiateMigrationResults, error, )
InitiateMigration 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) ModifyControllerAccess ¶
func (c *ControllerAPI) ModifyControllerAccess(args params.ModifyControllerAccessRequest) (params.ErrorResults, error)
ModifyControllerAccess changes the model access granted to users.
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.