controller

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

The controller package defines an API end point for functions dealing with controllers as a whole.

Index

Constants

This section is empty.

Variables

LatestAPI is used for testing purposes to create the latest controller API.

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 ControllerAPI

type ControllerAPI struct {
	*common.ControllerConfigAPI
	*common.ModelStatusAPI
	cloudspec.CloudSpecAPI
	// 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,
) (*ControllerAPI, error)

NewControllerAPI creates a new api server endpoint for operations on a controller.

func NewControllerAPIv9

func NewControllerAPIv9(ctx facade.Context) (*ControllerAPI, error)

NewControllerAPIv9 creates a new ControllerAPIv9.

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

func (c *ControllerAPI) ModelConfig() (params.ModelConfigResults, error)

ModelConfig returns the model config for the controller model. For information on the current model, 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) 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 ControllerAPIv3

type ControllerAPIv3 struct {
	*ControllerAPIv4
}

ControllerAPIv3 provides the v3 Controller API.

func NewControllerAPIv3

func NewControllerAPIv3(ctx facade.Context) (*ControllerAPIv3, error)

NewControllerAPIv3 creates a new ControllerAPIv3.

func (*ControllerAPIv3) DestroyController

func (c *ControllerAPIv3) DestroyController(args params.DestroyControllerArgs) error

DestroyController destroys the controller.

The v3 implementation of DestroyController ignores the DestroyStorage field of the arguments, and unconditionally destroys all storage in the controller.

See ControllerAPIv4.DestroyController for more details.

func (*ControllerAPIv3) 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 ControllerAPIv4

type ControllerAPIv4 struct {
	*ControllerAPIv5
}

ControllerAPIv4 provides the v4 Controller API. The only difference between this and v5 is that v4 doesn't have the UpdateControllerConfig method.

func NewControllerAPIv4

func NewControllerAPIv4(ctx facade.Context) (*ControllerAPIv4, error)

NewControllerAPIv4 creates a new ControllerAPIv4.

func (*ControllerAPIv4) ConfigSet

func (c *ControllerAPIv4) ConfigSet(_, _ struct{})

ConfigSet isn't on the v4 API.

type ControllerAPIv5

type ControllerAPIv5 struct {
	*ControllerAPIv6
}

ControllerAPIv5 provides the v5 Controller API. The only difference between this and v6 is that v5 doesn't have the MongoVersion method.

func NewControllerAPIv5

func NewControllerAPIv5(ctx facade.Context) (*ControllerAPIv5, error)

NewControllerAPIv5 creates a new ControllerAPIv5.

func (*ControllerAPIv5) MongoVersion

func (c *ControllerAPIv5) MongoVersion()

MongoVersion isn't on the v5 API.

type ControllerAPIv6

type ControllerAPIv6 struct {
	*ControllerAPIv7
}

ControllerAPIv6 provides the v6 Controller API. The only difference between this and v7 is that v6 doesn't have the IdentityProviderURL method.

func NewControllerAPIv6

func NewControllerAPIv6(ctx facade.Context) (*ControllerAPIv6, error)

NewControllerAPIv6 creates a new ControllerAPIv6.

func (*ControllerAPIv6) IdentityProviderURL

func (c *ControllerAPIv6) IdentityProviderURL()

IdentityProviderURL isn't on the v6 API.

type ControllerAPIv7

type ControllerAPIv7 struct {
	*ControllerAPIv8
}

ControllerAPIv7 provides the v7 Controller API. The only difference between this and v8 is that v7 doesn't have the ControllerVersion method.

func NewControllerAPIv7

func NewControllerAPIv7(ctx facade.Context) (*ControllerAPIv7, error)

NewControllerAPIv7 creates a new ControllerAPIv7.

func (*ControllerAPIv7) ControllerVersion

func (c *ControllerAPIv7) ControllerVersion(_, _ struct{})

ControllerVersion isn't on the v7 API.

type ControllerAPIv8

type ControllerAPIv8 struct {
	*ControllerAPI
}

ControllerAPIv8 provides the v8 Controller API. The only difference between this and v9 is that v8 doesn't have the model summary watchers.

func NewControllerAPIv8

func NewControllerAPIv8(ctx facade.Context) (*ControllerAPIv8, error)

NewControllerAPIv8 creates a new ControllerAPIv8.

func (*ControllerAPIv8) WatchAllModelSummaries

func (c *ControllerAPIv8) WatchAllModelSummaries(_, _ struct{})

WatchAllModelSummaries isn't on the v8 API.

func (*ControllerAPIv8) WatchModelSummaries

func (c *ControllerAPIv8) WatchModelSummaries(_, _ struct{})

WatchModelSummaries isn't on the v8 API.

Jump to

Keyboard shortcuts

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