Documentation ¶
Index ¶
- Constants
- func AcceptAllFlavors(nova.FlavorDetail) bool
- type AuthMode
- type Environ
- func (e *Environ) AdoptResources(controllerUUID string, fromVersion version.Number) error
- func (e *Environ) AllInstances() ([]instance.Instance, 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(rules []network.IngressRule) error
- func (e *Environ) Config() *config.Config
- func (e *Environ) ConstraintsValidator() (constraints.Validator, error)
- func (e *Environ) ControllerInstances(controllerUUID string) ([]instance.Id, error)
- func (e *Environ) Create(environs.CreateParams) error
- func (e *Environ) Destroy() error
- func (e *Environ) DestroyController(controllerUUID string) error
- func (e *Environ) DistributeInstances(candidates, distributionGroup []instance.Id) ([]instance.Id, error)
- func (e *Environ) IngressRules() ([]network.IngressRule, error)
- func (e *Environ) InstanceAvailabilityZoneNames(ids []instance.Id) ([]string, error)
- func (e *Environ) InstanceTypes(c constraints.Value) (instances.InstanceTypesWithCostMetadata, 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(rules []network.IngressRule) error
- func (e *Environ) PrecheckInstance(series string, cons constraints.Value, placement string) error
- func (e *Environ) PrepareForBootstrap(ctx environs.BootstrapContext) error
- func (e *Environ) Provider() environs.EnvironProvider
- func (e *Environ) Region() (simplestreams.CloudSpec, error)
- func (e *Environ) SetClock(clock clock.Clock)
- 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 (env *Environ) StorageProvider(t storage.ProviderType) (storage.Provider, error)
- func (env *Environ) StorageProviderTypes() ([]storage.ProviderType, error)
- func (e *Environ) TagInstance(id instance.Id, tags map[string]string) error
- type EnvironProvider
- func (p EnvironProvider) CloudSchema() *jsonschema.Schema
- func (p EnvironProvider) ConfigDefaults() schema.Defaults
- func (p EnvironProvider) ConfigSchema() schema.Fields
- func (EnvironProvider) DetectRegions() ([]cloud.Region, error)
- func (p EnvironProvider) MetadataLookupParams(region string) (*simplestreams.MetadataLookupParams, error)
- func (p EnvironProvider) Open(args environs.OpenParams) (environs.Environ, error)
- func (p EnvironProvider) Ping(endpoint string) error
- func (p EnvironProvider) PrepareConfig(args environs.PrepareConfigParams) (*config.Config, error)
- func (EnvironProvider) Schema() environschema.Fields
- func (p EnvironProvider) Validate(cfg, old *config.Config) (valid *config.Config, err error)
- type Firewaller
- type FirewallerFactory
- type FlavorFilter
- type FlavorFilterFunc
- type LegacyNovaNetworking
- type Networking
- type NetworkingDecorator
- type NeutronNetworking
- type OpenstackCredentials
- func (OpenstackCredentials) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema
- func (c OpenstackCredentials) DetectCredentials() (*cloud.CloudCredential, error)
- func (OpenstackCredentials) FinalizeCredential(_ environs.FinalizeCredentialContext, args environs.FinalizeCredentialParams) (*cloud.Credential, error)
- type OpenstackRenderer
- type OpenstackStorage
- type ProviderConfigurator
Constants ¶
const ( CredAttrTenantName = "tenant-name" CredAttrUserName = "username" CredAttrPassword = "password" CredAttrDomainName = "domain-name" CredAttrProjectDomainName = "project-domain-name" CredAttrUserDomainName = "user-domain-name" CredAttrAccessKey = "access-key" CredAttrSecretKey = "secret-key" )
const (
CinderProviderType = storage.ProviderType("cinder")
)
const (
GroupControllerPattern = `^(?P<prefix>juju-)(?P<controllerUUID>` + validUUID + `)(?P<suffix>-.*)$`
)
Variables ¶
This section is empty.
Functions ¶
func AcceptAllFlavors ¶
func AcceptAllFlavors(nova.FlavorDetail) bool
AcceptAllFlavors is a function that returns true for any input, and can be assigned to a value of type FlavorFilterFunc.
Types ¶
type Environ ¶
type Environ struct {
// contains filtered or unexported fields
}
func (*Environ) AdoptResources ¶
AdoptResources is part of the Environ interface.
func (*Environ) AllInstances ¶
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 (e *Environ) Bootstrap(ctx environs.BootstrapContext, args environs.BootstrapParams) (*environs.BootstrapResult, error)
func (*Environ) ClosePorts ¶
func (e *Environ) ClosePorts(rules []network.IngressRule) error
func (*Environ) ConstraintsValidator ¶
func (e *Environ) ConstraintsValidator() (constraints.Validator, error)
ConstraintsValidator is defined on the Environs interface.
func (*Environ) ControllerInstances ¶
func (*Environ) Create ¶
func (e *Environ) Create(environs.CreateParams) error
Create is part of the Environ interface.
func (*Environ) DestroyController ¶
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) IngressRules ¶
func (e *Environ) IngressRules() ([]network.IngressRule, error)
func (*Environ) InstanceAvailabilityZoneNames ¶
InstanceAvailabilityZoneNames returns the availability zone names for each of the specified instances.
func (*Environ) InstanceTypes ¶
func (e *Environ) InstanceTypes(c constraints.Value) (instances.InstanceTypesWithCostMetadata, 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) PrecheckInstance ¶
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) StartInstance ¶
func (e *Environ) StartInstance(args environs.StartInstanceParams) (*environs.StartInstanceResult, error)
StartInstance is specified in the InstanceBroker interface.
func (*Environ) StorageProvider ¶
StorageProvider implements storage.ProviderRegistry.
func (*Environ) StorageProviderTypes ¶
func (env *Environ) StorageProviderTypes() ([]storage.ProviderType, error)
StorageProviderTypes implements storage.ProviderRegistry.
type EnvironProvider ¶
type EnvironProvider struct { environs.ProviderCredentials Configurator ProviderConfigurator FirewallerFactory FirewallerFactory FlavorFilter FlavorFilter // NetworkingDecorator, if non-nil, will be used to // decorate the default networking implementation. // This can be used to override behaviour. NetworkingDecorator NetworkingDecorator // ClientFromEndpoint returns an Openstack client for the given endpoint. ClientFromEndpoint func(endpoint string) client.AuthenticatingClient }
func (EnvironProvider) CloudSchema ¶
func (p EnvironProvider) CloudSchema() *jsonschema.Schema
CloudSchema returns the schema for adding new clouds of this type.
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 (p EnvironProvider) Open(args environs.OpenParams) (environs.Environ, error)
func (EnvironProvider) Ping ¶
func (p EnvironProvider) Ping(endpoint string) error
Ping tests the connection to the cloud, to verify the endpoint is valid.
func (EnvironProvider) PrepareConfig ¶
func (p EnvironProvider) PrepareConfig(args environs.PrepareConfigParams) (*config.Config, error)
PrepareConfig is specified in the EnvironProvider interface.
func (EnvironProvider) Schema ¶
func (EnvironProvider) Schema() environschema.Fields
Schema returns the configuration schema for an environment.
type Firewaller ¶
type Firewaller interface { // OpenPorts opens the given port ranges for the whole environment. OpenPorts(rules []network.IngressRule) error // ClosePorts closes the given port ranges for the whole environment. ClosePorts(rules []network.IngressRule) error // IngressRules returns the ingress rules applied to the whole environment. // It is expected that there be only one ingress rule result for a given // port range - the rule's SourceCIDRs will contain all applicable source // address rules for that port range. IngressRules() ([]network.IngressRule, error) // DeleteAllModelGroups deletes all security groups for the // model. DeleteAllModelGroups() error // DeleteAllControllerGroups deletes all security groups for the // controller, ie those for all hosted models. DeleteAllControllerGroups(controllerUUID string) error // DeleteGroups deletes the security groups with the specified names. DeleteGroups(names ...string) error // UpdateGroupController updates all of the security groups for // this model to refer to the specified controller, such that // DeleteAllControllerGroups will remove them only when called // with the specified controller ID. UpdateGroupController(controllerUUID string) error // GetSecurityGroups returns a list of the security groups that // belong to given instances. GetSecurityGroups(ids ...instance.Id) ([]string, error) // SetUpGroups sets up initial security groups, if any, and returns // their names. SetUpGroups(controllerUUID, machineId string, apiPort int) ([]string, error) // OpenInstancePorts opens the given port ranges for the specified instance. OpenInstancePorts(inst instance.Instance, machineId string, rules []network.IngressRule) error // CloseInstancePorts closes the given port ranges for the specified instance. CloseInstancePorts(inst instance.Instance, machineId string, rules []network.IngressRule) error // InstanceIngressRules returns the ingress rules applied to the specified instance. InstanceIngressRules(inst instance.Instance, machineId string) ([]network.IngressRule, 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 FlavorFilter ¶
type FlavorFilter interface { // AcceptFlavor returns true iff the given flavor is acceptable. AcceptFlavor(nova.FlavorDetail) bool }
FlavorFilter is an interface that can control which server flavors are acceptable.
type FlavorFilterFunc ¶
type FlavorFilterFunc func(nova.FlavorDetail) bool
FlavorFilterFunc is a function type that implements FlavorFilter.
func (FlavorFilterFunc) AcceptFlavor ¶
func (f FlavorFilterFunc) AcceptFlavor(d nova.FlavorDetail) bool
AcceptFlavor is part of the FlavorFilter interface.
type LegacyNovaNetworking ¶
type LegacyNovaNetworking struct {
// contains filtered or unexported fields
}
LegacyNovaNetworking is an implementation of Networking that uses the legacy Nova network APIs.
NOTE(axw) this is provided on a best-effort basis, primarily for CI testing of Juju until we are no longer dependent on an old OpenStack installation. This should not be relied on in production, and should be removed as soon as possible.
func (*LegacyNovaNetworking) AllocatePublicIP ¶
func (n *LegacyNovaNetworking) AllocatePublicIP(instId instance.Id) (*string, error)
AllocatePublicIP is part of the Networking interface.
func (*LegacyNovaNetworking) DefaultNetworks ¶
func (*LegacyNovaNetworking) DefaultNetworks() ([]nova.ServerNetworks, error)
DefaultNetworks is part of the Networking interface.
func (*LegacyNovaNetworking) ResolveNetwork ¶
func (n *LegacyNovaNetworking) ResolveNetwork(name string) (string, error)
ResolveNetwork is part of the Networking interface.
type Networking ¶
type Networking interface { // AllocatePublicIP allocates a public (floating) IP // to the specified instance. AllocatePublicIP(instance.Id) (*string, error) // DefaultNetworks returns the set of networks that should be // added by default to all new instances. DefaultNetworks() ([]nova.ServerNetworks, error) // ResolveNetwork takes either a network ID or label // and returns the corresponding network ID. ResolveNetwork(string) (string, error) }
Networking is an interface providing networking-related operations for an OpenStack Environ.
type NetworkingDecorator ¶
type NetworkingDecorator interface { // DecorateNetworking can be used to return a new Networking // implementation that overrides the provided, default Networking // implementation. DecorateNetworking(Networking) (Networking, error) }
NetworkingDecorator is an interface that provides a means of overriding the default Networking implementation.
type NeutronNetworking ¶
type NeutronNetworking struct {
// contains filtered or unexported fields
}
NeutronNetworking is an implementation of Networking that uses the Neutron network APIs.
func (*NeutronNetworking) AllocatePublicIP ¶
func (n *NeutronNetworking) AllocatePublicIP(instId instance.Id) (*string, error)
AllocatePublicIP is part of the Networking interface.
func (*NeutronNetworking) DefaultNetworks ¶
func (n *NeutronNetworking) DefaultNetworks() ([]nova.ServerNetworks, error)
DefaultNetworks is part of the Networking interface.
func (*NeutronNetworking) ResolveNetwork ¶
func (n *NeutronNetworking) ResolveNetwork(name string) (string, error)
ResolveNetwork is part of the Networking interface.
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 ¶
func (OpenstackCredentials) FinalizeCredential(_ environs.FinalizeCredentialContext, args environs.FinalizeCredentialParams) (*cloud.Credential, error)
FinalizeCredential 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 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) SetVolumeMetadata(volumeId string, metadata map[string]string) (map[string]string, 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.