{"modulePath":"github.com/HashDataInc/packer","version":"v1.3.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package openstack\n\n## Constants\n\n```go\nconst BuilderId = \"mitchellh.openstack\"\n```\nThe unique ID for this builder\n\n## Functions\n\n```go\nfunc CheckFloatingIP(client *gophercloud.ServiceClient, id string) (*floatingips.FloatingIP, error)\n```\nCheckFloatingIP 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.\n\n```go\nfunc CheckFloatingIPNetwork(client *gophercloud.ServiceClient, networkRef string) (string, error)\n```\nCheckFloatingIPNetwork checks provided network reference and returns a valid Networking service ID.\n\n```go\nfunc CommHost(\n\tclient *gophercloud.ServiceClient,\n\tsshinterface string,\n\tsshipversion string) func(multistep.StateBag) (string, error)\n```\nCommHost looks up the host for the communicator.\n\n```go\nfunc FindFreeFloatingIP(client *gophercloud.ServiceClient) (*floatingips.FloatingIP, error)\n```\nFindFreeFloatingIP returns free unassociated floating IP. It will return first floating IP if there are many.\n\n```go\nfunc GetFloatingIPNetworkIDByName(client *gophercloud.ServiceClient, networkName string) (string, error)\n```\nGetFloatingIPNetworkIDByName searches for the external network ID by the provided name.\n\n```go\nfunc GetInstancePortID(client *gophercloud.ServiceClient, id string) (string, error)\n```\nGetInstancePortID 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.\n\n```go\nfunc GetVolumeSize(imageClient *gophercloud.ServiceClient, imageID string) (int, error)\n```\nGetVolumeSize 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.\n\n```go\nfunc GetVolumeStatus(blockStorageClient *gophercloud.ServiceClient, volumeID string) (string, error)\n```\n\n```go\nfunc WaitForImage(client *gophercloud.ServiceClient, imageId string) error\n```\nWaitForImage waits for the given Image ID to become ready.\n\n```go\nfunc WaitForState(conf *StateChangeConf) (i interface{}, err error)\n```\nWaitForState watches an object and waits for it to achieve a certain state.\n\n```go\nfunc WaitForVolume(blockStorageClient *gophercloud.ServiceClient, volumeID string) error\n```\nWaitForVolume waits for the given volume to become available.\n\n## Types\n\n```go\ntype AccessConfig struct {\n\tUsername         string `mapstructure:\"username\"`\n\tUserID           string `mapstructure:\"user_id\"`\n\tPassword         string `mapstructure:\"password\"`\n\tIdentityEndpoint string `mapstructure:\"identity_endpoint\"`\n\tTenantID         string `mapstructure:\"tenant_id\"`\n\tTenantName       string `mapstructure:\"tenant_name\"`\n\tDomainID         string `mapstructure:\"domain_id\"`\n\tDomainName       string `mapstructure:\"domain_name\"`\n\tInsecure         bool   `mapstructure:\"insecure\"`\n\tRegion           string `mapstructure:\"region\"`\n\tEndpointType     string `mapstructure:\"endpoint_type\"`\n\tCACertFile       string `mapstructure:\"cacert\"`\n\tClientCertFile   string `mapstructure:\"cert\"`\n\tClientKeyFile    string `mapstructure:\"key\"`\n\tToken            string `mapstructure:\"token\"`\n\tCloud            string `mapstructure:\"cloud\"`\n\t// contains filtered or unexported fields\n}\n```\nAccessConfig is for common configuration related to openstack access\n\n```go\nfunc (c *AccessConfig) Prepare(ctx *interpolate.Context) []error\n```\n\n```go\ntype Artifact struct {\n\t// ImageId of built image\n\tImageId string\n\n\t// BuilderId is the unique ID for the builder that created this image\n\tBuilderIdValue string\n\n\t// OpenStack connection for performing API stuff.\n\tClient *gophercloud.ServiceClient\n}\n```\nArtifact is an artifact implementation that contains built images.\n\n```go\nfunc (a *Artifact) BuilderId() string\n```\n\n```go\nfunc (a *Artifact) Destroy() error\n```\n\n```go\nfunc (*Artifact) Files() []string\n```\n\n```go\nfunc (a *Artifact) Id() string\n```\n\n```go\nfunc (a *Artifact) State(name string) interface{}\n```\n\n```go\nfunc (a *Artifact) String() string\n```\n\n```go\ntype Builder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (b *Builder) Cancel()\n```\n\n```go\nfunc (b *Builder) Prepare(raws ...interface{}) ([]string, error)\n```\n\n```go\nfunc (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)\n```\n\n```go\ntype Config struct {\n\tcommon.PackerConfig `mapstructure:\",squash\"`\n\n\tAccessConfig `mapstructure:\",squash\"`\n\tImageConfig  `mapstructure:\",squash\"`\n\tRunConfig    `mapstructure:\",squash\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype ExternalNetwork struct {\n\tnetworks.Network\n\texternal.NetworkExternalExt\n}\n```\nExternalNetwork is a network with external router.\n\n```go\ntype ImageConfig struct {\n\tImageName       string                       `mapstructure:\"image_name\"`\n\tImageMetadata   map[string]string            `mapstructure:\"metadata\"`\n\tImageVisibility imageservice.ImageVisibility `mapstructure:\"image_visibility\"`\n\tImageMembers    []string                     `mapstructure:\"image_members\"`\n\tImageDiskFormat string                       `mapstructure:\"image_disk_format\"`\n}\n```\nImageConfig is for common configuration related to creating Images.\n\n```go\nfunc (c *ImageConfig) Prepare(ctx *interpolate.Context) []error\n```\n\n```go\ntype ImageFilter struct {\n\tFilters    ImageFilterOptions `mapstructure:\"filters\"`\n\tMostRecent bool               `mapstructure:\"most_recent\"`\n}\n```\n\n```go\ntype ImageFilterOptions struct {\n\tName       string   `mapstructure:\"name\"`\n\tOwner      string   `mapstructure:\"owner\"`\n\tTags       []string `mapstructure:\"tags\"`\n\tVisibility string   `mapstructure:\"visibility\"`\n}\n```\n\n```go\nfunc (f *ImageFilterOptions) Build() (*images.ListOpts, error)\n```\n\n```go\nfunc (f *ImageFilterOptions) Empty() bool\n```\n\n```go\ntype RunConfig struct {\n\tComm communicator.Config `mapstructure:\",squash\"`\n\n\tSourceImage        string            `mapstructure:\"source_image\"`\n\tSourceImageName    string            `mapstructure:\"source_image_name\"`\n\tSourceImageFilters ImageFilter       `mapstructure:\"source_image_filter\"`\n\tFlavor             string            `mapstructure:\"flavor\"`\n\tAvailabilityZone   string            `mapstructure:\"availability_zone\"`\n\tRackconnectWait    bool              `mapstructure:\"rackconnect_wait\"`\n\tFloatingIPNetwork  string            `mapstructure:\"floating_ip_network\"`\n\tFloatingIP         string            `mapstructure:\"floating_ip\"`\n\tReuseIPs           bool              `mapstructure:\"reuse_ips\"`\n\tSecurityGroups     []string          `mapstructure:\"security_groups\"`\n\tNetworks           []string          `mapstructure:\"networks\"`\n\tPorts              []string          `mapstructure:\"ports\"`\n\tUserData           string            `mapstructure:\"user_data\"`\n\tUserDataFile       string            `mapstructure:\"user_data_file\"`\n\tInstanceName       string            `mapstructure:\"instance_name\"`\n\tInstanceMetadata   map[string]string `mapstructure:\"instance_metadata\"`\n\n\tConfigDrive bool `mapstructure:\"config_drive\"`\n\n\t// Used for BC, value will be passed to the \"floating_ip_network\"\n\tFloatingIPPool string `mapstructure:\"floating_ip_pool\"`\n\n\tUseBlockStorageVolume  bool   `mapstructure:\"use_blockstorage_volume\"`\n\tVolumeName             string `mapstructure:\"volume_name\"`\n\tVolumeType             string `mapstructure:\"volume_type\"`\n\tVolumeAvailabilityZone string `mapstructure:\"volume_availability_zone\"`\n\n\t// Not really used, but here for BC\n\tOpenstackProvider string `mapstructure:\"openstack_provider\"`\n\tUseFloatingIp     bool   `mapstructure:\"use_floating_ip\"`\n\t// contains filtered or unexported fields\n}\n```\nRunConfig contains configuration for running an instance from a source image and details on how to access that launched image.\n\n```go\nfunc (c *RunConfig) Prepare(ctx *interpolate.Context) []error\n```\n\n```go\ntype StateChangeConf struct {\n\tPending   []string\n\tRefresh   StateRefreshFunc\n\tStepState multistep.StateBag\n\tTarget    []string\n}\n```\nStateChangeConf is the configuration struct used for \\`WaitForState\\`.\n\n```go\ntype StateRefreshFunc func() (result interface{}, state string, progress int, err error)\n```\nStateRefreshFunc is a function type used for StateChangeConf that is responsible for refreshing the item being watched for a state change.\n\nIt 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.\n\n\\`state\\` is the latest state of that object. And \\`err\\` is any error that may have happened while refreshing the state.\n\n```go\nfunc ServerStateRefreshFunc(\n\tclient *gophercloud.ServiceClient, s *servers.Server) StateRefreshFunc\n```\nServerStateRefreshFunc returns a StateRefreshFunc that is used to watch an openstack server.\n\n```go\ntype StepAllocateIp struct {\n\tFloatingIPNetwork string\n\tFloatingIP        string\n\tReuseIPs          bool\n}\n```\n\n```go\nfunc (s *StepAllocateIp) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepAllocateIp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepCreateVolume struct {\n\tUseBlockStorageVolume  bool\n\tVolumeName             string\n\tVolumeType             string\n\tVolumeAvailabilityZone string\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *StepCreateVolume) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepCreateVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepDetachVolume struct {\n\tUseBlockStorageVolume bool\n}\n```\n\n```go\nfunc (s *StepDetachVolume) Cleanup(multistep.StateBag)\n```\n\n```go\nfunc (s *StepDetachVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepGetPassword struct {\n\tDebug bool\n\tComm  *communicator.Config\n}\n```\nStepGetPassword reads the password from a booted OpenStack server and sets it on the WinRM config.\n\n```go\nfunc (s *StepGetPassword) Cleanup(multistep.StateBag)\n```\n\n```go\nfunc (s *StepGetPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepKeyPair struct {\n\tDebug        bool\n\tComm         *communicator.Config\n\tDebugKeyPath string\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *StepKeyPair) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepLoadFlavor struct {\n\tFlavor string\n}\n```\nStepLoadFlavor 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.\n\n```go\nfunc (s *StepLoadFlavor) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepLoadFlavor) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepRunSourceServer struct {\n\tName                  string\n\tSecurityGroups        []string\n\tNetworks              []string\n\tPorts                 []string\n\tAvailabilityZone      string\n\tUserData              string\n\tUserDataFile          string\n\tConfigDrive           bool\n\tInstanceMetadata      map[string]string\n\tUseBlockStorageVolume bool\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *StepRunSourceServer) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepRunSourceServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepSourceImageInfo struct {\n\tSourceImage      string\n\tSourceImageName  string\n\tSourceImageOpts  images.ListOpts\n\tSourceMostRecent bool\n}\n```\n\n```go\nfunc (s *StepSourceImageInfo) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepSourceImageInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepStopServer struct{}\n```\n\n```go\nfunc (s *StepStopServer) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepStopServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n```go\ntype StepWaitForRackConnect struct {\n\tWait bool\n}\n```\n\n```go\nfunc (s *StepWaitForRackConnect) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepWaitForRackConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction\n```\n\n","path":"github.com/HashDataInc/packer/builder/openstack","name":"openstack","synopsis":"","isRedistributable":true}
