openstack

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2013 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "mitchellh.openstack"

The unique ID for this builder

Variables

This section is empty.

Functions

func SSHAddress

func SSHAddress(csp gophercloud.CloudServersProvider, port int) func(map[string]interface{}) (string, error)

SSHAddress returns a function that can be given to the SSH communicator for determining the SSH address based on the server AccessIPv4 setting..

func SSHConfig

func SSHConfig(username string) func(map[string]interface{}) (*gossh.ClientConfig, error)

SSHConfig returns a function that can be used for the SSH communicator config for connecting to the instance created over SSH using the generated private key.

func WaitForImage

func WaitForImage(csp gophercloud.CloudServersProvider, 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.

Types

type AccessConfig

type AccessConfig struct {
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Provider string `mapstructure:"provider"`
}

AccessConfig is for common configuration related to openstack access

func (*AccessConfig) Auth

Auth returns a valid Auth object for access to openstack services, or an error if the authentication couldn't be resolved.

func (*AccessConfig) Prepare

func (c *AccessConfig) Prepare(t *packer.ConfigTemplate) []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.
	Conn gophercloud.CloudServersProvider
}

Artifact is an artifact implementation that contains built images.

func (*Artifact) BuilderId

func (a *Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (*Artifact) Files() []string

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

func (*Builder) Cancel

func (b *Builder) Cancel()

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) error

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

type ImageConfig

type ImageConfig struct {
	ImageName string `mapstructure:"image_name"`
}

ImageConfig is for common configuration related to creating Images.

func (*ImageConfig) Prepare

func (c *ImageConfig) Prepare(t *packer.ConfigTemplate) []error

type RunConfig

type RunConfig struct {
	SourceImage   string `mapstructure:"source_image"`
	Flavor        string `mapstructure:"flavor"`
	RawSSHTimeout string `mapstructure:"ssh_timeout"`
	SSHUsername   string `mapstructure:"ssh_username"`
	SSHPort       int    `mapstructure:"ssh_port"`
	// 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.

func (*RunConfig) Prepare

func (c *RunConfig) Prepare(t *packer.ConfigTemplate) []error

func (*RunConfig) SSHTimeout

func (c *RunConfig) SSHTimeout() time.Duration

type StateChangeConf

type StateChangeConf struct {
	Pending   []string
	Refresh   StateRefreshFunc
	StepState map[string]interface{}
	Target    string
}

StateChangeConf is the configuration struct used for `WaitForState`.

type StateRefreshFunc

type StateRefreshFunc func() (result interface{}, state string, progress int, err error)

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(csp gophercloud.CloudServersProvider, s *gophercloud.Server) StateRefreshFunc

ServerStateRefreshFunc returns a StateRefreshFunc that is used to watch an openstacn server.

type StepKeyPair

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

func (*StepKeyPair) Cleanup

func (s *StepKeyPair) Cleanup(state map[string]interface{})

func (*StepKeyPair) Run

func (s *StepKeyPair) Run(state map[string]interface{}) multistep.StepAction

type StepRunSourceServer

type StepRunSourceServer struct {
	Flavor      string
	Name        string
	SourceImage string
	// contains filtered or unexported fields
}

func (*StepRunSourceServer) Cleanup

func (s *StepRunSourceServer) Cleanup(state map[string]interface{})

func (*StepRunSourceServer) Run

func (s *StepRunSourceServer) Run(state map[string]interface{}) multistep.StepAction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL