controller

package
v0.0.0-...-6cf1bc9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2016 License: AGPL-3.0 Imports: 46 Imported by: 0

Documentation

Overview

The controller package groups various commands that are based on talking directly to the controller, and not environments in the controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddModelCommand

func NewAddModelCommand() cmd.Command

NewAddModelCommand returns a command to add a model.

func NewDestroyCommand

func NewDestroyCommand() cmd.Command

NewDestroyCommand returns a command to destroy a controller.

func NewEnableDestroyControllerCommand

func NewEnableDestroyControllerCommand() cmd.Command

NewEnableDestroyControllerCommand returns a command that allows a controller admin to remove blocks from the controller.

func NewGetConfigCommand

func NewGetConfigCommand() cmd.Command

func NewKillCommand

func NewKillCommand() cmd.Command

NewKillCommand returns a command to kill a controller. Killing is a forceful destroy.

func NewListControllersCommand

func NewListControllersCommand() cmd.Command

NewListControllersCommand returns a command to list registered controllers.

func NewListModelsCommand

func NewListModelsCommand() cmd.Command

NewListModelsCommand returns a command to list models.

func NewRegisterCommand

func NewRegisterCommand() cmd.Command

NewRegisterCommand returns a command to allow the user to register a controller.

func NewShowControllerCommand

func NewShowControllerCommand() cmd.Command

NewShowControllerCommand returns a command to show details of the desired controllers.

func NewUnregisterCommand

func NewUnregisterCommand(store jujuclient.ClientStore) cmd.Command

NewUnregisterCommand returns a command to allow the user to unregister a controller.

Types

type AccountDetails

type AccountDetails struct {
	// User is the username for the account.
	User string `yaml:"user" json:"user"`

	// Access is the level of access the user has on the controller.
	Access string `yaml:"access,omitempty" json:"access,omitempty"`

	// Password is the password for the account.
	Password string `yaml:"password,omitempty" json:"password,omitempty"`
}

AccountDetails holds details of an account to show.

type AddModelAPI

type AddModelAPI interface {
	CreateModel(
		name, owner, cloudName, cloudRegion string,
		cloudCredential names.CloudCredentialTag,
		config map[string]interface{},
	) (base.ModelInfo, error)
}

type CloudAPI

type CloudAPI interface {
	DefaultCloud() (names.CloudTag, error)
	Clouds() (map[names.CloudTag]jujucloud.Cloud, error)
	Cloud(names.CloudTag) (jujucloud.Cloud, error)
	UserCredentials(names.UserTag, names.CloudTag) ([]names.CloudCredentialTag, error)
	UpdateCredential(names.CloudCredentialTag, jujucloud.Credential) error
}

type ControllerAccessAPI

type ControllerAccessAPI interface {
	GetControllerAccess(user string) (permission.Access, error)
	ModelConfig() (map[string]interface{}, error)
	ModelStatus(models ...names.ModelTag) ([]base.ModelStatus, error)
	AllModels() ([]base.UserModel, error)
	Close() error
}

ControllerAccessAPI defines a subset of the api/controller/Client API.

type ControllerDetails

type ControllerDetails struct {
	// ControllerUUID is the unique ID for the controller.
	ControllerUUID string `yaml:"uuid" json:"uuid"`

	// APIEndpoints is the collection of API endpoints running in this controller.
	APIEndpoints []string `yaml:"api-endpoints,flow" json:"api-endpoints"`

	// CACert is a security certificate for this controller.
	CACert string `yaml:"ca-cert" json:"ca-cert"`

	// Cloud is the name of the cloud that this controller runs in.
	Cloud string `yaml:"cloud" json:"cloud"`

	// CloudRegion is the name of the cloud region that this controller runs in.
	CloudRegion string `yaml:"region,omitempty" json:"region,omitempty"`

	// AgentVersion is the version of the agent running on this controller.
	// AgentVersion need not always exist so we omitempty here. This struct is
	// used in both list-controller and show-controller. show-controller
	// displays the agent version where list-controller does not.
	AgentVersion string `yaml:"agent-version,omitempty" json:"agent-version,omitempty"`
}

ControllerDetails holds details of a controller to show.

type ControllerItem

type ControllerItem struct {
	ModelName          string              `yaml:"current-model,omitempty" json:"current-model,omitempty"`
	User               string              `yaml:"user,omitempty" json:"user,omitempty"`
	Access             string              `yaml:"access,omitempty" json:"access,omitempty"`
	Server             string              `yaml:"recent-server,omitempty" json:"recent-server,omitempty"`
	ControllerUUID     string              `yaml:"uuid" json:"uuid"`
	APIEndpoints       []string            `yaml:"api-endpoints,flow" json:"api-endpoints"`
	CACert             string              `yaml:"ca-cert" json:"ca-cert"`
	Cloud              string              `yaml:"cloud" json:"cloud"`
	CloudRegion        string              `yaml:"region,omitempty" json:"region,omitempty"`
	AgentVersion       string              `yaml:"agent-version,omitempty" json:"agent-version,omitempty"`
	ModelCount         *int                `yaml:"model-count,omitempty" json:"model-count,omitempty"`
	MachineCount       *int                `yaml:"machine-count,omitempty" json:"machine-count,omitempty"`
	ControllerMachines *ControllerMachines `yaml:"controller-machines,omitempty" json:"controller-machins,omitempty"`
}

ControllerItem defines the serialization behaviour of controller information.

type ControllerMachines

type ControllerMachines struct {
	Active int `yaml:"active"`
	Total  int `yaml:"total"`
}

ControllerMachines holds the total number of controller machines and the number of active ones.

type ControllerSet

type ControllerSet struct {
	Controllers       map[string]ControllerItem `yaml:"controllers" json:"controllers"`
	CurrentController string                    `yaml:"current-controller" json:"current-controller"`
}

ControllerSet contains the set of controllers known to the client, and name of the current controller.

type MachineDetails

type MachineDetails struct {
	// ID holds the id of the machine.
	ID string `yaml:"id,omitempty" json:"id,omitempty"`

	// InstanceID holds the cloud instance id of the machine.
	InstanceID string `yaml:"instance-id,omitempty" json:"instance-id,omitempty"`

	// HAStatus holds information informing of the HA status of the machine.
	HAStatus string `yaml:"ha-status,omitempty" json:"ha-status,omitempty"`
}

ModelDetails holds details of a model to show.

type ModelDetails

type ModelDetails struct {
	// ModelUUID holds the details of a model.
	ModelUUID string `yaml:"uuid" json:"uuid"`

	// MachineCount holds the number of machines in the model.
	MachineCount *int `yaml:"machine-count,omitempty" json:"machine-count,omitempty"`

	// CoreCount holds the number of cores across the machines in the model.
	CoreCount *int `yaml:"core-count,omitempty" json:"core-count,omitempty"`
}

ModelDetails holds details of a model to show.

type ModelManagerAPI

type ModelManagerAPI interface {
	Close() error
	ListModels(user string) ([]base.UserModel, error)
	ModelInfo([]names.ModelTag) ([]params.ModelInfoResult, error)
}

ModelManagerAPI defines the methods on the model manager API that the models command calls.

type ModelSet

type ModelSet struct {
	Models []common.ModelInfo `yaml:"models" json:"models"`

	// CurrentModel is the name of the current model, qualified for the
	// user for which we're listing models. i.e. for the user admin,
	// and the model admin/foo, this field will contain "foo"; for
	// bob and the same model, the field will contain "admin/foo".
	CurrentModel string `yaml:"current-model,omitempty" json:"current-model,omitempty"`

	// CurrentModelQualified is the fully qualified name for the current
	// model, i.e. having the format $owner/$model.
	CurrentModelQualified string `yaml:"-" json:"-"`
}

ModelSet contains the set of models known to the client, and UUID of the current model.

type ModelsSysAPI

type ModelsSysAPI interface {
	Close() error
	AllModels() ([]base.UserModel, error)
}

ModelsSysAPI defines the methods on the controller manager API that the list models command calls.

type ShowControllerDetails

type ShowControllerDetails struct {
	// Details contains the same details that client store caches for this controller.
	Details ControllerDetails `yaml:"details,omitempty" json:"details,omitempty"`

	// Machines is a collection of all machines forming the controller cluster.
	Machines map[string]MachineDetails `yaml:"controller-machines,omitempty" json:"controller-machines,omitempty"`

	// Models is a collection of all models for this controller.
	Models map[string]ModelDetails `yaml:"models,omitempty" json:"models,omitempty"`

	// CurrentModel is the name of the current model for this controller
	CurrentModel string `yaml:"current-model,omitempty" json:"current-model,omitempty"`

	// Account is the account details for the user logged into this controller.
	Account *AccountDetails `yaml:"account,omitempty" json:"account,omitempty"`

	// Errors is a collection of errors related to accessing this controller details.
	Errors []string `yaml:"errors,omitempty" json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

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