Documentation ¶
Index ¶
- Constants
- type AuthMode
- type Environ
- func (e *Environ) AllInstances() (insts []instance.Instance, err error)
- func (e *Environ) AvailabilityZones() ([]common.AvailabilityZone, error)
- func (e *Environ) Bootstrap(ctx environs.BootstrapContext, args environs.BootstrapParams) (*environs.BootstrapResult, error)
- func (e *Environ) ClosePorts(ports []network.PortRange) error
- func (e *Environ) Config() *config.Config
- func (e *Environ) ConstraintsValidator() (constraints.Validator, error)
- func (e *Environ) ControllerInstances() ([]instance.Id, error)
- func (e *Environ) Destroy() error
- func (e *Environ) DistributeInstances(candidates, distributionGroup []instance.Id) ([]instance.Id, error)
- func (e *Environ) InstanceAvailabilityZoneNames(ids []instance.Id) ([]string, error)
- func (e *Environ) Instances(ids []instance.Id) ([]instance.Instance, error)
- func (*Environ) MaintainInstance(args environs.StartInstanceParams) error
- func (e *Environ) MetadataLookupParams(region string) (*simplestreams.MetadataLookupParams, error)
- func (e *Environ) OpenPorts(ports []network.PortRange) error
- func (e *Environ) Ports() ([]network.PortRange, error)
- func (e *Environ) PrecheckInstance(series string, cons constraints.Value, placement string) error
- func (e *Environ) Provider() environs.EnvironProvider
- func (e *Environ) Region() (simplestreams.CloudSpec, error)
- func (e *Environ) RunUpgradeStepsFor(ver version.Number) error
- func (e *Environ) SetConfig(cfg *config.Config) error
- func (e *Environ) StartInstance(args environs.StartInstanceParams) (*environs.StartInstanceResult, error)
- func (e *Environ) StopInstances(ids ...instance.Id) error
- func (e *Environ) SupportedArchitectures() ([]string, error)
- func (e *Environ) TagInstance(id instance.Id, tags map[string]string) error
- type EnvironProvider
- func (p EnvironProvider) BootstrapConfig(args environs.BootstrapConfigParams) (*config.Config, error)
- func (EnvironProvider) DetectRegions() ([]cloud.Region, error)
- func (p EnvironProvider) MetadataLookupParams(region string) (*simplestreams.MetadataLookupParams, error)
- func (p EnvironProvider) Open(cfg *config.Config) (environs.Environ, error)
- func (p EnvironProvider) PrepareForBootstrap(ctx environs.BootstrapContext, cfg *config.Config) (environs.Environ, error)
- func (p EnvironProvider) PrepareForCreateEnvironment(cfg *config.Config) (*config.Config, error)
- func (p EnvironProvider) RestrictedConfigAttributes() []string
- func (EnvironProvider) Schema() environschema.Fields
- func (p EnvironProvider) SecretAttrs(cfg *config.Config) (map[string]string, error)
- func (p EnvironProvider) Validate(cfg, old *config.Config) (valid *config.Config, err error)
- type Firewaller
- type FirewallerFactory
- type OpenstackCredentials
- type OpenstackRenderer
- type ProviderConfigurator
Constants ¶
const (
CinderProviderType = storage.ProviderType("cinder")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environ ¶
type Environ struct { common.SupportsUnitPlacementPolicy // contains filtered or unexported fields }
func (*Environ) AllInstances ¶
func (*Environ) AvailabilityZones ¶
func (e *Environ) AvailabilityZones() ([]common.AvailabilityZone, error)
AvailabilityZones returns a slice of availability zones.
func (*Environ) Bootstrap ¶
func (e *Environ) Bootstrap(ctx environs.BootstrapContext, args environs.BootstrapParams) (*environs.BootstrapResult, error)
func (*Environ) ConstraintsValidator ¶
func (e *Environ) ConstraintsValidator() (constraints.Validator, error)
ConstraintsValidator is defined on the Environs interface.
func (*Environ) ControllerInstances ¶
func (*Environ) DistributeInstances ¶
func (e *Environ) DistributeInstances(candidates, distributionGroup []instance.Id) ([]instance.Id, error)
DistributeInstances implements the state.InstanceDistributor policy.
func (*Environ) InstanceAvailabilityZoneNames ¶
InstanceAvailabilityZoneNames returns the availability zone names for each of the specified instances.
func (*Environ) MaintainInstance ¶
func (*Environ) MaintainInstance(args environs.StartInstanceParams) error
MaintainInstance is specified in the InstanceBroker interface.
func (*Environ) MetadataLookupParams ¶
func (e *Environ) MetadataLookupParams(region string) (*simplestreams.MetadataLookupParams, error)
MetadataLookupParams returns parameters which are used to query simplestreams metadata.
func (*Environ) PrecheckInstance ¶
PrecheckInstance is defined on the state.Prechecker interface.
func (*Environ) Provider ¶
func (e *Environ) Provider() environs.EnvironProvider
func (*Environ) Region ¶
func (e *Environ) Region() (simplestreams.CloudSpec, error)
Region is specified in the HasRegion interface.
func (*Environ) RunUpgradeStepsFor ¶
RunUpgradeStepsFor implements provider.Upgradable
func (*Environ) StartInstance ¶
func (e *Environ) StartInstance(args environs.StartInstanceParams) (*environs.StartInstanceResult, error)
StartInstance is specified in the InstanceBroker interface.
func (*Environ) SupportedArchitectures ¶
SupportedArchitectures is specified on the EnvironCapability interface.
type EnvironProvider ¶
type EnvironProvider struct { environs.ProviderCredentials Configurator ProviderConfigurator FirewallerFactory FirewallerFactory }
func (EnvironProvider) BootstrapConfig ¶
func (p EnvironProvider) BootstrapConfig(args environs.BootstrapConfigParams) (*config.Config, error)
BootstrapConfig is specified in the EnvironProvider interface.
func (EnvironProvider) DetectRegions ¶
func (EnvironProvider) DetectRegions() ([]cloud.Region, error)
DetectRegions implements environs.CloudRegionDetector.
func (EnvironProvider) MetadataLookupParams ¶
func (p EnvironProvider) MetadataLookupParams(region string) (*simplestreams.MetadataLookupParams, error)
MetadataLookupParams returns parameters which are used to query image metadata to find matching image information.
func (EnvironProvider) PrepareForBootstrap ¶
func (p EnvironProvider) PrepareForBootstrap( ctx environs.BootstrapContext, cfg *config.Config, ) (environs.Environ, error)
PrepareForBootstrap is specified in the EnvironProvider interface.
func (EnvironProvider) PrepareForCreateEnvironment ¶
PrepareForCreateEnvironment is specified in the EnvironProvider interface.
func (EnvironProvider) RestrictedConfigAttributes ¶
func (p EnvironProvider) RestrictedConfigAttributes() []string
RestrictedConfigAttributes is specified in the EnvironProvider interface.
func (EnvironProvider) Schema ¶
func (EnvironProvider) Schema() environschema.Fields
Schema returns the configuration schema for an environment.
func (EnvironProvider) SecretAttrs ¶
type Firewaller ¶
type Firewaller interface { // OpenPorts opens the given port ranges for the whole environment. OpenPorts(ports []network.PortRange) error // ClosePorts closes the given port ranges for the whole environment. ClosePorts(ports []network.PortRange) error // Ports returns the port ranges opened for the whole environment. Ports() ([]network.PortRange, error) // Implementations shoud delete all global security groups. DeleteGlobalGroups() error // Implementations should return list of security groups, that belong to given instances. GetSecurityGroups(ids ...instance.Id) ([]string, error) // Implementations should set up initial security groups, if any. SetUpGroups(machineId string, apiPort int) ([]nova.SecurityGroup, error) // Set of initial networks, that should be added by default to all new instances. InitialNetworks() []nova.ServerNetworks // OpenInstancePorts opens the given port ranges for the specified instance. OpenInstancePorts(inst instance.Instance, machineId string, ports []network.PortRange) error // CloseInstancePorts closes the given port ranges for the specified instance. CloseInstancePorts(inst instance.Instance, machineId string, ports []network.PortRange) error // InstancePorts returns the port ranges opened for the specified instance. InstancePorts(inst instance.Instance, machineId string) ([]network.PortRange, error) }
Firewaller allows custom openstack provider behaviour. This is used in other providers that embed the openstack provider.
type FirewallerFactory ¶
type FirewallerFactory interface {
GetFirewaller(env environs.Environ) Firewaller
}
factory for obtaining firawaller object.
type OpenstackCredentials ¶
type OpenstackCredentials struct{}
func (OpenstackCredentials) CredentialSchemas ¶
func (OpenstackCredentials) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema
CredentialSchemas is part of the environs.ProviderCredentials interface.
func (OpenstackCredentials) DetectCredentials ¶
func (c OpenstackCredentials) DetectCredentials() (*cloud.CloudCredential, error)
DetectCredentials is part of the environs.ProviderCredentials interface.
type OpenstackRenderer ¶
type OpenstackRenderer struct{}
func (OpenstackRenderer) Render ¶
func (OpenstackRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error)
type ProviderConfigurator ¶
type ProviderConfigurator interface { // GetConfigDefaults sets some configuration default values, if any GetConfigDefaults() schema.Defaults // This method allows to adjust defult RunServerOptions, before new server is actually created. ModifyRunServerOptions(options *nova.RunServerOpts) // This method provides default cloud config. // This config can be different for different providers. GetCloudConfig(args environs.StartInstanceParams) (cloudinit.CloudConfig, error) }
This interface is added to allow to customize openstack provider behaviour. This is used in other providers, that embeds openstack provider.