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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIPort is the port used for api connections.
	APIPort = "api-port"

	// AuditingEnabled determines whether the controller will record
	// auditing information.
	AuditingEnabled = "auditing-enabled"

	// StatePort is the port used for mongo connections.
	StatePort = "state-port"

	// CACertKey is the key for the controller's CA certificate attribute.
	CACertKey = "ca-cert"

	// ControllerUUIDKey is the key for the controller UUID attribute.
	ControllerUUIDKey = "controller-uuid"

	// IdentityURL sets the url of the identity manager.
	IdentityURL = "identity-url"

	// IdentityPublicKey sets the public key of the identity manager.
	IdentityPublicKey = "identity-public-key"

	// NUMAControlPolicyKey stores the value for this setting
	SetNUMAControlPolicyKey = "set-numa-control-policy"

	// AutocertDNSNameKey sets the DNS name of the controller. If a
	// client connects to this name, an official certificate will be
	// automatically requested. Connecting to any other host name
	// will use the usual self-generated certificate.
	AutocertDNSNameKey = "autocert-dns-name"

	// AutocertURLKey sets the URL used to obtain official TLS
	// certificates when a client connects to the API. By default,
	// certficates are obtains from LetsEncrypt. A good value for
	// testing is
	// "https://acme-staging.api.letsencrypt.org/directory".
	AutocertURLKey = "autocert-url"

	// AllowModelAccessKey sets whether the controller will allow users to
	// connect to models they have been authorized for even when
	// they don't have any access rights to the controller itself.
	AllowModelAccessKey = "allow-model-access"

	// DefaultAuditingEnabled contains the default value for the
	// AuditingEnabled config value.
	DefaultAuditingEnabled = false

	// DefaultNUMAControlPolicy should not be used by default.
	// Only use numactl if user specifically requests it
	DefaultNUMAControlPolicy = false

	// DefaultStatePort is the default port the controller is listening on.
	DefaultStatePort int = 37017

	// DefaultAPIPort is the default port the API server is listening on.
	DefaultAPIPort int = 17070
)

Variables

ControllerOnlyConfigAttributes are attributes which are only relevant for a controller, never a model.

Functions

func ControllerOnlyAttribute

func ControllerOnlyAttribute(attr string) bool

ControllerOnlyAttribute returns true if the specified attribute name is only relevant for a controller.

func GenerateControllerCertAndKey

func GenerateControllerCertAndKey(caCert, caKey string, hostAddresses []string) (string, string, error)

GenerateControllerCertAndKey makes sure that the config has a CACert and CAPrivateKey, generates and returns new certificate and key.

func Validate

func Validate(c Config) error

Validate ensures that config is a valid configuration.

Types

type Config

type Config map[string]interface{}

func NewConfig

func NewConfig(controllerUUID, caCert string, attrs map[string]interface{}) (Config, error)

NewConfig creates a new Config from the supplied attributes. Default values will be used where defaults are available.

The controller UUID and CA certificate must be passed in. The UUID is typically generated by the immediate caller, and the CA certificate generated by environs/bootstrap.NewConfig.

func (Config) APIPort

func (c Config) APIPort() int

APIPort returns the API server port for the environment.

func (Config) AllowModelAccess

func (c Config) AllowModelAccess() bool

AllowModelAccess reports whether users are allowed to access models they have been granted permission for even when they can't access the controller.

func (Config) AuditingEnabled

func (c Config) AuditingEnabled() bool

AuditingEnabled returns whether or not auditing has been enabled for the environment. The default is false.

func (Config) AutocertDNSName

func (c Config) AutocertDNSName() string

AutocertDNSName returns the DNS name of the controller. See AutocertDNSNameKey for more details.

func (Config) AutocertURL

func (c Config) AutocertURL() string

AutocertURL returns the URL used to obtain official TLS certificates when a client connects to the API. See AutocertURLKey for more details.

func (Config) CACert

func (c Config) CACert() (string, bool)

CACert returns the certificate of the CA that signed the controller certificate, in PEM format, and whether the setting is available.

func (Config) ControllerUUID

func (c Config) ControllerUUID() string

ControllerUUID returns the uuid for the model's controller.

func (Config) IdentityPublicKey

func (c Config) IdentityPublicKey() *bakery.PublicKey

IdentityPublicKey returns the public key of the identity manager.

func (Config) IdentityURL

func (c Config) IdentityURL() string

IdentityURL returns the url of the identity manager.

func (Config) NUMACtlPreference

func (c Config) NUMACtlPreference() bool

NUMACtlPreference returns if numactl is preferred.

func (Config) StatePort

func (c Config) StatePort() int

StatePort returns the controller port for the environment.

func (Config) Validate

func (c Config) Validate() error

Validate validates the controller configuration.

Directories

Path Synopsis
Package modelmanager provides the business logic for model management operations in the controller.
Package modelmanager provides the business logic for model management operations in the controller.

Jump to

Keyboard shortcuts

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