Documentation ¶
Index ¶
- Constants
- Variables
- func ControllerOnlyAttribute(attr string) bool
- func GenerateControllerCertAndKey(caCert, caKey string, hostAddresses []string) (string, string, error)
- func Validate(c Config) error
- type Config
- func (c Config) APIPort() int
- func (c Config) AllowModelAccess() bool
- func (c Config) AuditingEnabled() bool
- func (c Config) AutocertDNSName() string
- func (c Config) AutocertURL() string
- func (c Config) CACert() (string, bool)
- func (c Config) ControllerUUID() string
- func (c Config) IdentityPublicKey() *bakery.PublicKey
- func (c Config) IdentityURL() string
- func (c Config) MongoMemoryProfile() string
- func (c Config) NUMACtlPreference() bool
- func (c Config) StatePort() int
- func (c Config) Validate() error
Constants ¶
const ( // MongoProfLow represents the most conservative mongo memory profile. MongoProfLow = "low" // MongoProfDefault represents the mongo memory profile shipped by default. MongoProfDefault = "default" )
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" // MongoMemoryProfile sets whether mongo uses the least possible memory or the // detault MongoMemoryProfile = "mongo-memory-profile" // 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 // DefaultMongoMemoryProfile is the default profile used by mongo. DefaultMongoMemoryProfile = MongoProfLow )
Variables ¶
var ControllerOnlyConfigAttributes = []string{ AllowModelAccessKey, APIPort, AutocertDNSNameKey, AutocertURLKey, CACertKey, ControllerUUIDKey, IdentityPublicKey, IdentityURL, SetNUMAControlPolicyKey, StatePort, MongoMemoryProfile, }
ControllerOnlyConfigAttributes are attributes which are only relevant for a controller, never a model.
Functions ¶
func ControllerOnlyAttribute ¶
ControllerOnlyAttribute returns true if the specified attribute name is only relevant for a controller.
Types ¶
type Config ¶
type Config map[string]interface{}
func NewConfig ¶
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) AllowModelAccess ¶
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 ¶
AuditingEnabled returns whether or not auditing has been enabled for the environment. The default is false.
func (Config) AutocertDNSName ¶
AutocertDNSName returns the DNS name of the controller. See AutocertDNSNameKey for more details.
func (Config) AutocertURL ¶
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 ¶
CACert returns the certificate of the CA that signed the controller certificate, in PEM format, and whether the setting is available.
func (Config) ControllerUUID ¶
ControllerUUID returns the uuid for the model's controller.
func (Config) IdentityPublicKey ¶
IdentityPublicKey returns the public key of the identity manager.
func (Config) IdentityURL ¶
IdentityURL returns the url of the identity manager.
func (Config) MongoMemoryProfile ¶
MongoMemoryProfile returns the selected profile or low.
func (Config) NUMACtlPreference ¶
NUMACtlPreference returns if numactl is preferred.
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. |