controller

package
v0.0.0-...-2608902 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: AGPL-3.0 Imports: 36 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 NewCreateModelCommand

func NewCreateModelCommand() cmd.Command

NewCreateModelCommand returns a command to create an model.

func NewDestroyCommand

func NewDestroyCommand() cmd.Command

NewDestroyCommand returns a command to destroy a controller.

func NewKillCommand

func NewKillCommand() cmd.Command

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

func NewListBlocksCommand

func NewListBlocksCommand() cmd.Command

NewListBlocksCommand returns a command to list the blocks in a controller.

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 NewRemoveBlocksCommand

func NewRemoveBlocksCommand() cmd.Command

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

func NewShowControllerCommand

func NewShowControllerCommand() cmd.Command

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

Types

type AccountDetails

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

	// Password is the password for the account.
	Password string `yaml:"password,omitempty" json:"password,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"`
}

AccountDetails holds details of an account to show.

type BootstrapConfig

type BootstrapConfig struct {
	Config               map[string]interface{} `yaml:"config,omitempty" json:"config,omitempty"`
	Cloud                string                 `yaml:"cloud" json:"cloud"`
	CloudType            string                 `yaml:"cloud-type" json:"cloud-type"`
	CloudRegion          string                 `yaml:"region,omitempty" json:"region,omitempty"`
	CloudEndpoint        string                 `yaml:"endpoint,omitempty" json:"endpoint,omitempty"`
	CloudStorageEndpoint string                 `yaml:"storage-endpoint,omitempty" json:"storage-endpoint,omitempty"`
	Credential           string                 `yaml:"credential,omitempty" json:"credential,omitempty"`
}

BootstrapConfig holds the configuration used to bootstrap a controller.

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"`
}

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"`
	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"`
}

ControllerItem defines the serialization behaviour of controller information.

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 CreateModelAPI

type CreateModelAPI interface {
	Close() error
	ConfigSkeleton(provider, region string) (params.ModelConfig, error)
	CreateModel(owner string, account, config map[string]interface{}) (params.Model, error)
}

type ModelDetails

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

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 string             `yaml:"current-model,omitempty" json:"current-model,omitempty"`
}

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"`

	// Accounts is a collection of accounts for this controller.
	Accounts map[string]*AccountDetails `yaml:"accounts,omitempty" json:"accounts,omitempty"`

	// CurrentAccount is the name of the current account for this controller.
	CurrentAccount string `yaml:"current-account,omitempty" json:"current-account,omitempty"`

	// BootstrapConfig contains the bootstrap configuration for this controller.
	// This is only available on the client that bootstrapped the controller.
	BootstrapConfig *BootstrapConfig `yaml:"bootstrap-config,omitempty" json:"bootstrap-config,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