Documentation ¶
Index ¶
- Constants
- func CheckFloatingIP(client *gophercloud.ServiceClient, id string) (*floatingips.FloatingIP, error)
- func CheckFloatingIPNetwork(client *gophercloud.ServiceClient, networkRef string) (string, error)
- func CommHost(client *gophercloud.ServiceClient, sshinterface string, sshipversion string) func(multistep.StateBag) (string, error)
- func FindFreeFloatingIP(client *gophercloud.ServiceClient) (*floatingips.FloatingIP, error)
- func GetFloatingIPNetworkIDByName(client *gophercloud.ServiceClient, networkName string) (string, error)
- func GetInstancePortID(client *gophercloud.ServiceClient, id string) (string, error)
- func GetVolumeSize(imageClient *gophercloud.ServiceClient, imageID string) (int, error)
- func WaitForImage(client *gophercloud.ServiceClient, imageId string) error
- func WaitForState(conf *StateChangeConf) (i interface{}, err error)
- func WaitForVolume(blockStorageClient *gophercloud.ServiceClient, volumeID string) error
- type AccessConfig
- type Artifact
- type Builder
- type Config
- type ExternalNetwork
- type ImageConfig
- type ImageFilter
- type ImageFilterOptions
- type RunConfig
- type StateChangeConf
- type StateRefreshFunc
- type StepAllocateIp
- type StepCreateVolume
- type StepDetachVolume
- type StepGetPassword
- type StepKeyPair
- type StepLoadFlavor
- type StepRunSourceServer
- type StepSourceImageInfo
- type StepStopServer
- type StepWaitForRackConnect
Constants ¶
const BuilderId = "mitchellh.openstack"
The unique ID for this builder
Variables ¶
This section is empty.
Functions ¶
func CheckFloatingIP ¶ added in v1.3.0
func CheckFloatingIP(client *gophercloud.ServiceClient, id string) (*floatingips.FloatingIP, error)
CheckFloatingIP gets a floating IP by its ID and checks if it is already associated with any internal interface. It returns floating IP if it can be used.
func CheckFloatingIPNetwork ¶ added in v1.3.0
func CheckFloatingIPNetwork(client *gophercloud.ServiceClient, networkRef string) (string, error)
CheckFloatingIPNetwork checks provided network reference and returns a valid Networking service ID.
func CommHost ¶
func CommHost( client *gophercloud.ServiceClient, sshinterface string, sshipversion string) func(multistep.StateBag) (string, error)
CommHost looks up the host for the communicator.
func FindFreeFloatingIP ¶ added in v1.3.0
func FindFreeFloatingIP(client *gophercloud.ServiceClient) (*floatingips.FloatingIP, error)
FindFreeFloatingIP returns free unassociated floating IP. It will return first floating IP if there are many.
func GetFloatingIPNetworkIDByName ¶ added in v1.3.0
func GetFloatingIPNetworkIDByName(client *gophercloud.ServiceClient, networkName string) (string, error)
GetFloatingIPNetworkIDByName searches for the external network ID by the provided name.
func GetInstancePortID ¶ added in v1.3.0
func GetInstancePortID(client *gophercloud.ServiceClient, id string) (string, error)
GetInstancePortID returns internal port of the instance that can be used for the association of a floating IP. It will return an ID of a first port if there are many.
func GetVolumeSize ¶ added in v1.3.0
func GetVolumeSize(imageClient *gophercloud.ServiceClient, imageID string) (int, error)
GetVolumeSize returns volume size in gigabytes based on the image min disk value if it's not empty. Or it calculates needed gigabytes size from the image bytes size.
func WaitForImage ¶
func WaitForImage(client *gophercloud.ServiceClient, imageId string) error
WaitForImage waits for the given Image ID to become ready.
func WaitForState ¶
func WaitForState(conf *StateChangeConf) (i interface{}, err error)
WaitForState watches an object and waits for it to achieve a certain state.
func WaitForVolume ¶ added in v1.3.0
func WaitForVolume(blockStorageClient *gophercloud.ServiceClient, volumeID string) error
WaitForVolume waits for the given volume to become available.
Types ¶
type AccessConfig ¶
type AccessConfig struct { Username string `mapstructure:"username"` UserID string `mapstructure:"user_id"` Password string `mapstructure:"password"` IdentityEndpoint string `mapstructure:"identity_endpoint"` TenantID string `mapstructure:"tenant_id"` TenantName string `mapstructure:"tenant_name"` DomainID string `mapstructure:"domain_id"` DomainName string `mapstructure:"domain_name"` Insecure bool `mapstructure:"insecure"` Region string `mapstructure:"region"` EndpointType string `mapstructure:"endpoint_type"` CACertFile string `mapstructure:"cacert"` ClientCertFile string `mapstructure:"cert"` ClientKeyFile string `mapstructure:"key"` Token string `mapstructure:"token"` Cloud string `mapstructure:"cloud"` // contains filtered or unexported fields }
AccessConfig is for common configuration related to openstack access
func (*AccessConfig) Prepare ¶
func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error
type Artifact ¶
type Artifact struct { // ImageId of built image ImageId string // BuilderId is the unique ID for the builder that created this image BuilderIdValue string // OpenStack connection for performing API stuff. Client *gophercloud.ServiceClient }
Artifact is an artifact implementation that contains built images.
type Config ¶
type Config struct { common.PackerConfig `mapstructure:",squash"` AccessConfig `mapstructure:",squash"` ImageConfig `mapstructure:",squash"` RunConfig `mapstructure:",squash"` // contains filtered or unexported fields }
type ExternalNetwork ¶ added in v1.3.0
type ExternalNetwork struct { networks.Network external.NetworkExternalExt }
ExternalNetwork is a network with external router.
type ImageConfig ¶
type ImageConfig struct { ImageName string `mapstructure:"image_name"` ImageMetadata map[string]string `mapstructure:"metadata"` ImageVisibility imageservice.ImageVisibility `mapstructure:"image_visibility"` ImageMembers []string `mapstructure:"image_members"` }
ImageConfig is for common configuration related to creating Images.
func (*ImageConfig) Prepare ¶
func (c *ImageConfig) Prepare(ctx *interpolate.Context) []error
type ImageFilter ¶ added in v1.3.0
type ImageFilter struct { Filters ImageFilterOptions `mapstructure:"filters"` MostRecent bool `mapstructure:"most_recent"` }
type ImageFilterOptions ¶ added in v1.3.0
type ImageFilterOptions struct { Name string `mapstructure:"name"` Owner string `mapstructure:"owner"` Tags []string `mapstructure:"tags"` Visibility string `mapstructure:"visibility"` }
func (*ImageFilterOptions) Build ¶ added in v1.3.0
func (f *ImageFilterOptions) Build() (*images.ListOpts, error)
func (*ImageFilterOptions) Empty ¶ added in v1.3.0
func (f *ImageFilterOptions) Empty() bool
type RunConfig ¶
type RunConfig struct { Comm communicator.Config `mapstructure:",squash"` SourceImage string `mapstructure:"source_image"` SourceImageName string `mapstructure:"source_image_name"` SourceImageFilters ImageFilter `mapstructure:"source_image_filter"` Flavor string `mapstructure:"flavor"` AvailabilityZone string `mapstructure:"availability_zone"` RackconnectWait bool `mapstructure:"rackconnect_wait"` FloatingIPNetwork string `mapstructure:"floating_ip_network"` FloatingIP string `mapstructure:"floating_ip"` ReuseIPs bool `mapstructure:"reuse_ips"` SecurityGroups []string `mapstructure:"security_groups"` Networks []string `mapstructure:"networks"` Ports []string `mapstructure:"ports"` UserData string `mapstructure:"user_data"` UserDataFile string `mapstructure:"user_data_file"` InstanceName string `mapstructure:"instance_name"` InstanceMetadata map[string]string `mapstructure:"instance_metadata"` ConfigDrive bool `mapstructure:"config_drive"` // Used for BC, value will be passed to the "floating_ip_network" FloatingIPPool string `mapstructure:"floating_ip_pool"` UseBlockStorageVolume bool `mapstructure:"use_blockstorage_volume"` VolumeName string `mapstructure:"volume_name"` VolumeType string `mapstructure:"volume_type"` VolumeAvailabilityZone string `mapstructure:"volume_availability_zone"` // Not really used, but here for BC OpenstackProvider string `mapstructure:"openstack_provider"` UseFloatingIp bool `mapstructure:"use_floating_ip"` // contains filtered or unexported fields }
RunConfig contains configuration for running an instance from a source image and details on how to access that launched image.
type StateChangeConf ¶
type StateChangeConf struct { Pending []string Refresh StateRefreshFunc StepState multistep.StateBag Target []string }
StateChangeConf is the configuration struct used for `WaitForState`.
type StateRefreshFunc ¶
StateRefreshFunc is a function type used for StateChangeConf that is responsible for refreshing the item being watched for a state change.
It returns three results. `result` is any object that will be returned as the final object after waiting for state change. This allows you to return the final updated object, for example an openstack instance after refreshing it.
`state` is the latest state of that object. And `err` is any error that may have happened while refreshing the state.
func ServerStateRefreshFunc ¶
func ServerStateRefreshFunc( client *gophercloud.ServiceClient, s *servers.Server) StateRefreshFunc
ServerStateRefreshFunc returns a StateRefreshFunc that is used to watch an openstack server.
type StepAllocateIp ¶
func (*StepAllocateIp) Cleanup ¶
func (s *StepAllocateIp) Cleanup(state multistep.StateBag)
func (*StepAllocateIp) Run ¶
func (s *StepAllocateIp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepCreateVolume ¶ added in v1.3.0
type StepCreateVolume struct { UseBlockStorageVolume bool SourceImage string VolumeName string VolumeType string VolumeAvailabilityZone string // contains filtered or unexported fields }
func (*StepCreateVolume) Cleanup ¶ added in v1.3.0
func (s *StepCreateVolume) Cleanup(state multistep.StateBag)
func (*StepCreateVolume) Run ¶ added in v1.3.0
func (s *StepCreateVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepDetachVolume ¶ added in v1.3.0
type StepDetachVolume struct {
UseBlockStorageVolume bool
}
func (*StepDetachVolume) Cleanup ¶ added in v1.3.0
func (s *StepDetachVolume) Cleanup(multistep.StateBag)
func (*StepDetachVolume) Run ¶ added in v1.3.0
func (s *StepDetachVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepGetPassword ¶
type StepGetPassword struct { Debug bool Comm *communicator.Config }
StepGetPassword reads the password from a booted OpenStack server and sets it on the WinRM config.
func (*StepGetPassword) Cleanup ¶
func (s *StepGetPassword) Cleanup(multistep.StateBag)
func (*StepGetPassword) Run ¶
func (s *StepGetPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepKeyPair ¶
type StepKeyPair struct { Debug bool Comm *communicator.Config DebugKeyPath string // contains filtered or unexported fields }
func (*StepKeyPair) Cleanup ¶
func (s *StepKeyPair) Cleanup(state multistep.StateBag)
func (*StepKeyPair) Run ¶
func (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepLoadFlavor ¶
type StepLoadFlavor struct {
Flavor string
}
StepLoadFlavor gets the FlavorRef from a Flavor. It first assumes that the Flavor is a ref and verifies it. Otherwise, it tries to find the flavor by name.
func (*StepLoadFlavor) Cleanup ¶
func (s *StepLoadFlavor) Cleanup(state multistep.StateBag)
func (*StepLoadFlavor) Run ¶
func (s *StepLoadFlavor) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepRunSourceServer ¶
type StepRunSourceServer struct { Name string SourceImage string SourceImageName string SecurityGroups []string Networks []string Ports []string AvailabilityZone string UserData string UserDataFile string ConfigDrive bool InstanceMetadata map[string]string UseBlockStorageVolume bool // contains filtered or unexported fields }
func (*StepRunSourceServer) Cleanup ¶
func (s *StepRunSourceServer) Cleanup(state multistep.StateBag)
func (*StepRunSourceServer) Run ¶
func (s *StepRunSourceServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepSourceImageInfo ¶ added in v1.3.0
type StepSourceImageInfo struct { SourceImage string SourceImageName string SourceImageOpts images.ListOpts SourceMostRecent bool }
func (*StepSourceImageInfo) Cleanup ¶ added in v1.3.0
func (s *StepSourceImageInfo) Cleanup(state multistep.StateBag)
func (*StepSourceImageInfo) Run ¶ added in v1.3.0
func (s *StepSourceImageInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepStopServer ¶
type StepStopServer struct{}
func (*StepStopServer) Cleanup ¶
func (s *StepStopServer) Cleanup(state multistep.StateBag)
func (*StepStopServer) Run ¶
func (s *StepStopServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepWaitForRackConnect ¶
type StepWaitForRackConnect struct {
Wait bool
}
func (*StepWaitForRackConnect) Cleanup ¶
func (s *StepWaitForRackConnect) Cleanup(state multistep.StateBag)
func (*StepWaitForRackConnect) Run ¶
func (s *StepWaitForRackConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Source Files ¶
- access_config.go
- artifact.go
- builder.go
- image_config.go
- networks.go
- run_config.go
- server.go
- ssh.go
- step_add_image_members.go
- step_allocate_ip.go
- step_create_image.go
- step_create_volume.go
- step_detach_volume.go
- step_get_password.go
- step_key_pair.go
- step_load_flavor.go
- step_run_source_server.go
- step_source_image_info.go
- step_stop_server.go
- step_update_image_visibility.go
- step_wait_for_rackconnect.go
- volume.go