Documentation
¶
Overview ¶
Package controller defines an API endpoint for functions dealing with controllers as a whole.
Index ¶
- Variables
- func ChangeControllerAccess(accessor ControllerAccess, apiUser, targetUserTag names.UserTag, ...) error
- func Register(registry facade.FacadeRegistry)
- type Application
- type Backend
- type ControllerAPI
- func (c *ControllerAPI) AllModels() (params.UserModelList, error)
- func (c *ControllerAPI) ConfigSet(args params.ControllerConfigSet) error
- func (c *ControllerAPI) ControllerVersion() (params.ControllerVersionResults, error)
- func (c *ControllerAPI) DashboardConnectionInfo() (params.DashboardConnectionInfo, error)
- func (c *ControllerAPI) DestroyController(args params.DestroyControllerArgs) error
- func (c *ControllerAPI) GetControllerAccess(req params.Entities) (params.UserAccessResults, error)
- func (c *ControllerAPI) HostedModelConfigs() (params.HostedModelConfigsResults, error)
- func (c *ControllerAPI) IdentityProviderURL() (params.StringResult, error)
- func (c *ControllerAPI) InitiateMigration(reqArgs params.InitiateMigrationArgs) (params.InitiateMigrationResults, error)
- func (c *ControllerAPI) ListBlockedModels() (params.ModelBlockInfoList, error)
- func (c *ControllerAPI) ModifyControllerAccess(args params.ModifyControllerAccessRequest) (params.ErrorResults, error)
- func (c *ControllerAPI) MongoVersion() (params.StringResult, error)
- func (c *ControllerAPI) RemoveBlocks(args params.RemoveBlocksArgs) error
- func (c *ControllerAPI) WatchAllModelSummaries() (params.SummaryWatcherID, error)
- func (c *ControllerAPI) WatchAllModels() (params.AllWatcherId, error)
- func (c *ControllerAPI) WatchModelSummaries() (params.SummaryWatcherID, error)
- type ControllerAPIv11
- type ControllerAccess
- type Relation
Constants ¶
This section is empty.
Variables ¶
var LatestAPI = makeControllerAPI
LatestAPI is used for testing purposes to create the latest controller API.
var TestingAPI = LatestAPI
TestingAPI is an escape hatch for requesting a controller API that won't allow auth to correctly happen for ModelStatus. I'm not convicned this should exist at all.
Functions ¶
func ChangeControllerAccess ¶
func ChangeControllerAccess(accessor ControllerAccess, 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.
func Register ¶
func Register(registry facade.FacadeRegistry)
Register is called to expose a package of facades onto a given registry.
Types ¶
type Application ¶
type Backend ¶
type Backend interface { ControllerAccess Model() (*state.Model, error) Application(name string) (Application, error) MongoVersion() (string, error) ControllerModelUUID() string AllModelUUIDs() ([]string, error) AllBlocksForController() ([]state.Block, error) RemoveAllBlocksForController() error ModelExists(uuid string) (bool, error) ControllerConfig() (jujucontroller.Config, error) UpdateControllerConfig(updateAttrs map[string]interface{}, removeAttrs []string) error }
type ControllerAPI ¶
type ControllerAPI struct { *common.ControllerConfigAPI *common.ModelStatusAPI cloudspec.CloudSpecer // contains filtered or unexported fields }
ControllerAPI provides the Controller API.
func NewControllerAPI ¶
func NewControllerAPI( st *state.State, pool *state.StatePool, authorizer facade.Authorizer, resources facade.Resources, presence facade.Presence, hub facade.Hub, factory multiwatcher.Factory, controller *cache.Controller, leadership leadership.Reader, ) (*ControllerAPI, error)
NewControllerAPI creates a new api server endpoint for operations on a controller.
func (*ControllerAPI) AllModels ¶
func (c *ControllerAPI) AllModels() (params.UserModelList, error)
AllModels allows controller administrators to get the list of all the models in the controller.
func (*ControllerAPI) ConfigSet ¶
func (c *ControllerAPI) ConfigSet(args params.ControllerConfigSet) error
ConfigSet changes the value of specified controller configuration settings. Only some settings can be changed after bootstrap. Settings that aren't specified in the params are left unchanged.
func (*ControllerAPI) ControllerVersion ¶
func (c *ControllerAPI) ControllerVersion() (params.ControllerVersionResults, error)
ControllerVersion returns the version information associated with this controller binary.
NOTE: the implementation intentionally does not check for SuperuserAccess as the Version is known even to users with login access.
func (*ControllerAPI) DashboardConnectionInfo ¶
func (c *ControllerAPI) DashboardConnectionInfo() (params.DashboardConnectionInfo, error)
DashboardConnectionInfo returns the connection information for a client to connect to the Juju Dashboard including any proxying information.
func (*ControllerAPI) DestroyController ¶
func (c *ControllerAPI) DestroyController(args params.DestroyControllerArgs) error
DestroyController destroys the controller.
If the args specify the destruction of the models, this method will attempt to do so. Otherwise, if the controller has any non-empty, non-Dead hosted models, then an error with the code params.CodeHasHostedModels will be transmitted.
func (*ControllerAPI) GetControllerAccess ¶
func (c *ControllerAPI) GetControllerAccess(req params.Entities) (params.UserAccessResults, error)
GetControllerAccess returns the level of access the specified users have on the controller.
func (*ControllerAPI) HostedModelConfigs ¶
func (c *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) IdentityProviderURL ¶
func (c *ControllerAPI) IdentityProviderURL() (params.StringResult, error)
IdentityProviderURL returns the URL of the configured external identity provider for this controller or an empty string if no external identity provider has been configured when the controller was bootstrapped.
NOTE: the implementation intentionally does not check for SuperuserAccess as the URL is known even to users with login access.
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 (c *ControllerAPI) ListBlockedModels() (params.ModelBlockInfoList, error)
ListBlockedModels returns a list of all models on the controller which have a block in place. The resulting slice is sorted by model name, then owner. Callers must be controller administrators to retrieve the list.
func (*ControllerAPI) ModifyControllerAccess ¶
func (c *ControllerAPI) ModifyControllerAccess(args params.ModifyControllerAccessRequest) (params.ErrorResults, error)
ModifyControllerAccess changes the model access granted to users.
func (*ControllerAPI) MongoVersion ¶
func (c *ControllerAPI) MongoVersion() (params.StringResult, error)
MongoVersion allows the introspection of the mongo version per controller
func (*ControllerAPI) RemoveBlocks ¶
func (c *ControllerAPI) RemoveBlocks(args params.RemoveBlocksArgs) error
RemoveBlocks removes all the blocks in the controller.
func (*ControllerAPI) WatchAllModelSummaries ¶
func (c *ControllerAPI) WatchAllModelSummaries() (params.SummaryWatcherID, error)
WatchAllModelSummaries starts watching the summary updates from the cache. This method is superuser access only, and watches all models 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.
func (*ControllerAPI) WatchModelSummaries ¶
func (c *ControllerAPI) WatchModelSummaries() (params.SummaryWatcherID, error)
WatchModelSummaries starts watching the summary updates from the cache. Only models that the user has access to are returned.
type ControllerAPIv11 ¶
type ControllerAPIv11 struct {
*ControllerAPI
}
func (*ControllerAPIv11) ModelConfig
deprecated
func (c *ControllerAPIv11) ModelConfig() (params.ModelConfigResults, error)
ModelConfig returns the model config for the controller model.
Deprecated: this facade method will be removed in 4.0 when this facade is converted to a multi-model facade. Please use the ModelConfig facade's ModelGet method instead: github.com/juju/juju/apiserver/facades/client/modelconfig.ModelConfigAPI.ModelGet
type ControllerAccess ¶
type ControllerAccess interface { ControllerTag() names.ControllerTag AddControllerUser(spec state.UserAccessSpec) (permission.UserAccess, error) UserAccess(subject names.UserTag, target names.Tag) (permission.UserAccess, error) ControllerInfo() (*state.ControllerInfo, error) CreateCloudAccess(cloud string, user names.UserTag, access permission.Access) error GetCloudAccess(cloud string, user names.UserTag) (permission.Access, error) RemoveCloudAccess(cloud string, user names.UserTag) error UserPermission(subject names.UserTag, target names.Tag) (permission.Access, error) RemoveUserAccess(subject names.UserTag, target names.Tag) error SetUserAccess(subject names.UserTag, target names.Tag, access permission.Access) (permission.UserAccess, error) }