helpers

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OutputHandler

type OutputHandler func(string)

OutputHandler is a function which receives lines of piped output from an external tool as they become available.

type PluginConfig

type PluginConfig interface {
	// GetPackerConfig retrieves the common Packer configuration for the plugin.
	GetPackerConfig() *common.PackerConfig

	// GetCommunicatorConfig retrieves the Packer communicator configuration (if available) for the plugin.
	GetCommunicatorConfig() *communicator.Config

	// GetMCPUser retrieves the Cloud Control user name.
	GetMCPUser() string

	// GetMCPPassword retrieves the Cloud Control password.
	GetMCPPassword() string

	// Validate ensures that the configuration is valid.
	Validate() error
}

PluginConfig represents the basic configuration for a plugin.

type State

type State struct {
	// The state data.
	Data multistep.StateBag
}

State is the helper for working with `multistep` state data.

func ForStateBag

func ForStateBag(stateBag multistep.StateBag) State

ForStateBag creates a new `State` helper for the specified multistep.StateBag.

func (State) Get

func (state State) Get(key string) (value interface{})

Get retrieves the state data with the specified key.

func (State) GetBuilderID

func (state State) GetBuilderID() string

GetBuilderID gets the Id of the current builder plugin (if any) in the state data.

func (State) GetClient

func (state State) GetClient() *compute.Client

GetClient gets the CloudControl API client from the state data.

func (State) GetFirewallRule

func (state State) GetFirewallRule() *compute.FirewallRule

GetFirewallRule gets the firewall rule from the state data.

func (State) GetHook

func (state State) GetHook() packer.Hook

GetHook gets a reference to the Packer extensibility hook from the state data.

func (State) GetLastError

func (state State) GetLastError() error

GetLastError retrieves the last error (if any) from the state data.

func (State) GetNATRule

func (state State) GetNATRule() *compute.NATRule

GetNATRule gets the NAT rule from the state data.

func (State) GetNetworkDomain

func (state State) GetNetworkDomain() *compute.NetworkDomain

GetNetworkDomain gets the target network domain from the state data.

func (State) GetOk

func (state State) GetOk(key string) (value interface{}, exists bool)

GetOk retrieves the state data with the specified key, if it exists.

func (State) GetPackerConfig

func (state State) GetPackerConfig() *common.PackerConfig

GetPackerConfig gets the Packer configuration from the state data.

func (State) GetRemoteOVFPackageArtifact

func (state State) GetRemoteOVFPackageArtifact() *artifacts.RemoteOVFPackage

GetRemoteOVFPackageArtifact gets the remote OVF package artifact from the state data.

func (State) GetServer

func (state State) GetServer() *compute.Server

GetServer gets the target server from the state data.

func (State) GetSettings

func (state State) GetSettings() PluginConfig

GetSettings gets the plugin settings from the state data.

func (State) GetSourceArtifact

func (state State) GetSourceArtifact() packer.Artifact

GetSourceArtifact gets the source artifact from the state data.

func (State) GetSourceImage

func (state State) GetSourceImage() compute.Image

GetSourceImage gets the source image from the state data.

func (State) GetSourceImageArtifact

func (state State) GetSourceImageArtifact() *artifacts.Image

GetSourceImageArtifact gets the source image artifact from the state data.

func (State) GetTargetArtifact

func (state State) GetTargetArtifact() packer.Artifact

GetTargetArtifact gets the target artifact from the state data.

func (State) GetTargetDatacenter

func (state State) GetTargetDatacenter() *compute.Datacenter

GetTargetDatacenter gets the target datacenter from the state data.

func (State) GetTargetImage

func (state State) GetTargetImage() *compute.CustomerImage

GetTargetImage gets the target image from the state data.

func (State) GetTargetImageArtifact

func (state State) GetTargetImageArtifact() *artifacts.Image

GetTargetImageArtifact gets the target image artifact from the state data.

func (State) GetUI

func (state State) GetUI() packer.Ui

GetUI gets a reference to the Packer UI from the state data.

func (State) GetVLAN

func (state State) GetVLAN() *compute.VLAN

GetVLAN gets the target VLAN from the state data.

func (State) Set

func (state State) Set(key string, value interface{})

Set updates the state data with the specified key and value.

func (State) SetBuilderID

func (state State) SetBuilderID(builderID string)

SetBuilderID updates the Id of the current builder plugin (if any) in the state data.

func (State) SetClient

func (state State) SetClient(client *compute.Client)

SetClient updates the CloudControl API client in the state data.

func (State) SetFirewallRule

func (state State) SetFirewallRule(firewallRule *compute.FirewallRule)

SetFirewallRule updates the firewall rule in the state data.

func (State) SetHook

func (state State) SetHook(hook packer.Hook)

SetHook updates the reference to the Packer extensibility hook in the state data.

func (State) SetLastError

func (state State) SetLastError(err error)

SetLastError updates the last error (if any) in the state data.

func (State) SetNATRule

func (state State) SetNATRule(natRule *compute.NATRule)

SetNATRule updates the NAT rule in the state data.

func (State) SetNetworkDomain

func (state State) SetNetworkDomain(networkDomain *compute.NetworkDomain)

SetNetworkDomain updates the target network domain in the state data.

func (State) SetPackerConfig

func (state State) SetPackerConfig(config *common.PackerConfig)

SetPackerConfig updates the Packer configuration in the state data.

func (State) SetRemoteOVFPackageArtifact

func (state State) SetRemoteOVFPackageArtifact(packageArtifact *artifacts.RemoteOVFPackage)

SetRemoteOVFPackageArtifact updates the remote OVF package artifact in the state data.

func (State) SetServer

func (state State) SetServer(server *compute.Server)

SetServer updates the target server in the state data.

func (State) SetSettings

func (state State) SetSettings(config PluginConfig)

SetSettings updates the plugin settings in the state data.

func (State) SetSourceArtifact

func (state State) SetSourceArtifact(sourceArtifact packer.Artifact)

SetSourceArtifact updates the source artifact in the state data.

func (State) SetSourceImage

func (state State) SetSourceImage(image compute.Image)

SetSourceImage updates the source image in the state data.

func (State) SetSourceImageArtifact

func (state State) SetSourceImageArtifact(sourceArtifact *artifacts.Image)

SetSourceImageArtifact updates the source image artifact in the state data.

func (State) SetTargetArtifact

func (state State) SetTargetArtifact(targetArtifact packer.Artifact)

SetTargetArtifact updates the target artifact in the state data.

func (State) SetTargetDatacenter

func (state State) SetTargetDatacenter(datacenter *compute.Datacenter)

SetTargetDatacenter updates the target datacenter in the state data.

func (State) SetTargetImage

func (state State) SetTargetImage(image *compute.CustomerImage)

SetTargetImage updates the target image in the state data.

func (State) SetTargetImageArtifact

func (state State) SetTargetImageArtifact(sourceArtifact *artifacts.Image)

SetTargetImageArtifact updates the target image artifact in the state data.

func (State) SetUI

func (state State) SetUI(ui packer.Ui)

SetUI updates the reference to the Packer UI in the state data.

func (State) SetVLAN

func (state State) SetVLAN(vlan *compute.VLAN)

SetVLAN updates the target VLAN in the state data.

func (State) ShowError

func (state State) ShowError(err error)

ShowError displays the specified error via the UI, and persists it using SetLastError.

func (State) ShowErrorMessage

func (state State) ShowErrorMessage(errorMessage string, formatArgs ...interface{})

ShowErrorMessage displays the specified error message via the UI, and persists it using SetLastError.

func (State) ShowMessage

func (state State) ShowMessage(message string, formatArgs ...interface{})

ShowMessage displays the specified message via the UI (if available, otherwise via log.Printf).

type Tool

type Tool struct {
	// The tool name.
	Name string

	// ExecutablePath is the path of the tool executable.
	ExecutablePath string

	// WorkDir is the working directory where tool will be run.
	WorkDir string
	// contains filtered or unexported fields
}

Tool represents an external tool.

func ForTool

func ForTool(toolExecutable string, workDir string, outputHandler OutputHandler) (tool *Tool, err error)

ForTool creates a new external tool helper.

func (*Tool) Run

func (tool *Tool) Run(args ...string) (success bool, err error)

Run invokes the tool.

Jump to

Keyboard shortcuts

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