controller

package
v0.0.0-...-298751d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 36 Imported by: 1

Documentation

Overview

Package controller defines an API endpoint for functions dealing with controllers as a whole.

Index

Constants

This section is empty.

Variables

View Source
var LatestAPI = newControllerAPIv11

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

View Source
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 Application interface {
	Name() string
	Relations() ([]Relation, error)
	CharmConfig(branchName string) (charm.Settings, error)
}

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,
) (*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) 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 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)
}

type Relation

type Relation interface {
	Endpoint(applicationname string) (state.Endpoint, error)
	RelatedEndpoints(applicationname string) ([]state.Endpoint, error)
	ApplicationSettings(appName string) (map[string]interface{}, error)
	ModelUUID() string
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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