Documentation

Index

Constants

View Source
const (
	CredAttrTenantName = "tenant-name"
	CredAttrUserName   = "username"
	CredAttrPassword   = "password"
	CredAttrDomainName = "domain-name"
	CredAttrAccessKey  = "access-key"
	CredAttrSecretKey  = "secret-key"
)
View Source
const (
	CinderProviderType = storage.ProviderType("cinder")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMode

type AuthMode string
const (
	AuthKeyPair  AuthMode = "keypair"
	AuthLegacy   AuthMode = "legacy"
	AuthUserPass AuthMode = "userpass"
)

type Environ

type Environ struct {
	// contains filtered or unexported fields
}

func (*Environ) AllInstances

func (e *Environ) AllInstances() ([]instance.Instance, error)

    AllInstances returns all instances in this environment.

    func (*Environ) AvailabilityZones

    func (e *Environ) AvailabilityZones() ([]common.AvailabilityZone, error)

      AvailabilityZones returns a slice of availability zones.

      func (*Environ) Bootstrap

      func (*Environ) ClosePorts

      func (e *Environ) ClosePorts(ports []network.PortRange) error

      func (*Environ) Config

      func (e *Environ) Config() *config.Config

      func (*Environ) ConstraintsValidator

      func (e *Environ) ConstraintsValidator() (constraints.Validator, error)

        ConstraintsValidator is defined on the Environs interface.

        func (*Environ) ControllerInstances

        func (e *Environ) ControllerInstances(controllerUUID string) ([]instance.Id, error)

        func (*Environ) Create

        func (e *Environ) Create(environs.CreateParams) error

          Create is part of the Environ interface.

          func (*Environ) Destroy

          func (e *Environ) Destroy() error

          func (*Environ) DestroyController

          func (e *Environ) DestroyController(controllerUUID string) error

            DestroyController implements the Environ interface.

            func (*Environ) DistributeInstances

            func (e *Environ) DistributeInstances(candidates, distributionGroup []instance.Id) ([]instance.Id, error)

              DistributeInstances implements the state.InstanceDistributor policy.

              func (*Environ) InstanceAvailabilityZoneNames

              func (e *Environ) InstanceAvailabilityZoneNames(ids []instance.Id) ([]string, error)

                InstanceAvailabilityZoneNames returns the availability zone names for each of the specified instances.

                func (*Environ) Instances

                func (e *Environ) Instances(ids []instance.Id) ([]instance.Instance, error)

                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) OpenPorts

                    func (e *Environ) OpenPorts(ports []network.PortRange) error

                    func (*Environ) Ports

                    func (e *Environ) Ports() ([]network.PortRange, error)

                    func (*Environ) PrecheckInstance

                    func (e *Environ) PrecheckInstance(series string, cons constraints.Value, placement string) error

                      PrecheckInstance is defined on the state.Prechecker interface.

                      func (*Environ) PrepareForBootstrap

                      func (e *Environ) PrepareForBootstrap(ctx environs.BootstrapContext) error

                        PrepareForBootstrap is part of the Environ 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

                          func (e *Environ) RunUpgradeStepsFor(ver version.Number) error

                            RunUpgradeStepsFor implements provider.Upgradable

                            func (*Environ) SetConfig

                            func (e *Environ) SetConfig(cfg *config.Config) error

                            func (*Environ) StartInstance

                              StartInstance is specified in the InstanceBroker interface.

                              func (*Environ) StopInstances

                              func (e *Environ) StopInstances(ids ...instance.Id) error

                              func (*Environ) StorageProvider

                              func (env *Environ) StorageProvider(t storage.ProviderType) (storage.Provider, error)

                                StorageProvider implements storage.ProviderRegistry.

                                func (*Environ) StorageProviderTypes

                                func (env *Environ) StorageProviderTypes() ([]storage.ProviderType, error)

                                  StorageProviderTypes implements storage.ProviderRegistry.

                                  func (*Environ) TagInstance

                                  func (e *Environ) TagInstance(id instance.Id, tags map[string]string) error

                                    TagInstance implements environs.InstanceTagger.

                                    type EnvironProvider

                                    type EnvironProvider struct {
                                    	environs.ProviderCredentials
                                    	Configurator      ProviderConfigurator
                                    	FirewallerFactory FirewallerFactory
                                    }

                                    func (EnvironProvider) ConfigDefaults

                                    func (p EnvironProvider) ConfigDefaults() schema.Defaults

                                      ConfigDefaults returns the default values for the provider specific config attributes.

                                      func (EnvironProvider) ConfigSchema

                                      func (p EnvironProvider) ConfigSchema() schema.Fields

                                        ConfigSchema returns extra config attributes specific to this provider only.

                                        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) Open

                                            func (EnvironProvider) PrepareConfig

                                            func (p EnvironProvider) PrepareConfig(args environs.PrepareConfigParams) (*config.Config, error)

                                              PrepareConfig is specified in the EnvironProvider interface.

                                              func (EnvironProvider) Schema

                                                Schema returns the configuration schema for an environment.

                                                func (EnvironProvider) Validate

                                                func (p EnvironProvider) Validate(cfg, old *config.Config) (valid *config.Config, err error)

                                                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 are expected to delete all security groups for the
                                                	// environment.
                                                	DeleteAllModelGroups() error
                                                
                                                	// Implementations are expected to delete all security groups for the
                                                	// controller, ie those for all hosted models.
                                                	DeleteAllControllerGroups(controllerUUID string) 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(controllerUUID, 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.

                                                        func (OpenstackCredentials) FinalizeCredential

                                                          FinalizeCredential is part of the environs.ProviderCredentials interface.

                                                          type OpenstackRenderer

                                                          type OpenstackRenderer struct{}

                                                          func (OpenstackRenderer) Render

                                                          type OpenstackStorage

                                                          type OpenstackStorage interface {
                                                          	GetVolume(volumeId string) (*cinder.Volume, error)
                                                          	GetVolumesDetail() ([]cinder.Volume, error)
                                                          	DeleteVolume(volumeId string) error
                                                          	CreateVolume(cinder.CreateVolumeVolumeParams) (*cinder.Volume, error)
                                                          	AttachVolume(serverId, volumeId, mountPoint string) (*nova.VolumeAttachment, error)
                                                          	DetachVolume(serverId, attachmentId string) error
                                                          	ListVolumeAttachments(serverId string) ([]nova.VolumeAttachment, 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.