common

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateFuncs = template.FuncMap{
	"clean_resource_name": templateCleanInstanceName,
}

Functions

func Port

func Port() func(multistep.StateBag) (int, error)

Port returns a function that can be given to the SSH communicator for determining the SSH Port

func SSHHost

func SSHHost() func(multistep.StateBag) (string, error)

SSHHost returns a function that can be given to the SSH communicator for determining the SSH address of the instance.

Types

type AccessConfig

type AccessConfig struct {
	// The api key used to communicate with IBM Cloud.
	APIKey string `mapstructure:"api_key" required:"true"`

	// Region of a Power VS.
	Region string `mapstructure:"region" required:"false"`

	// Zone of a Power VS.
	Zone string `mapstructure:"zone" required:"true"`

	// Account ID of a IBM Cloud account.
	AccountID string `mapstructure:"account_id" required:"false"`

	// Enable debug logging, Default `false`.
	Debug bool `mapstructure:"debug" required:"false"`

	// Power VS ServiceInstanceID
	ServiceInstanceID string `mapstructure:"service_instance_id" required:"true"`
	// contains filtered or unexported fields
}

func (*AccessConfig) DHCPClient added in v0.2.4

func (c *AccessConfig) DHCPClient(ctx context.Context, id string) (*instance.IBMPIDhcpClient, error)

func (*AccessConfig) ImageClient

func (c *AccessConfig) ImageClient(ctx context.Context, id string) (*instance.IBMPIImageClient, error)

func (*AccessConfig) InstanceClient

func (c *AccessConfig) InstanceClient(ctx context.Context, id string) (*instance.IBMPIInstanceClient, error)

func (*AccessConfig) JobClient

func (c *AccessConfig) JobClient(ctx context.Context, id string) (*instance.IBMPIJobClient, error)

func (*AccessConfig) NetworkClient

func (c *AccessConfig) NetworkClient(ctx context.Context, id string) (*instance.IBMPINetworkClient, error)

func (*AccessConfig) Session

func (c *AccessConfig) Session() (_ *ps.IBMPISession, err error)

type COS

type COS struct {
	Bucket string `mapstructure:"bucket" required:"true"`
	Object string `mapstructure:"object" required:"true"`
	Region string `mapstructure:"region" required:"true"`
}

func (*COS) FlatMapstructure

func (*COS) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatCOS. FlatCOS is an auto-generated flat version of COS. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type Capture

type Capture struct {
	Name string `mapstructure:"name" required:"true"`
	// The destination determines how the image is captured. Options: ('image-catalog', 'cloud-storage', 'both'). The default is 'cloud-storage'.
	// if image-catalog is specified then cos field content will be ignored
	Destination string      `mapstructure:"destination" required:"false"`
	COS         *CaptureCOS `mapstructure:"cos" required:"false"`
}

func (*Capture) FlatMapstructure

func (*Capture) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatCapture. FlatCapture is an auto-generated flat version of Capture. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type CaptureCOS

type CaptureCOS struct {
	Bucket    string `mapstructure:"bucket" required:"true"`
	Region    string `mapstructure:"region" required:"true"`
	AccessKey string `mapstructure:"access_key" required:"true"`
	SecretKey string `mapstructure:"secret_key" required:"true"`
}

func (*CaptureCOS) FlatMapstructure

func (*CaptureCOS) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatCaptureCOS. FlatCaptureCOS is an auto-generated flat version of CaptureCOS. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type FlatCOS

type FlatCOS struct {
	Bucket *string `mapstructure:"bucket" required:"true" cty:"bucket" hcl:"bucket"`
	Object *string `mapstructure:"object" required:"true" cty:"object" hcl:"object"`
	Region *string `mapstructure:"region" required:"true" cty:"region" hcl:"region"`
}

FlatCOS is an auto-generated flat version of COS. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatCOS) HCL2Spec

func (*FlatCOS) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a COS. This spec is used by HCL to read the fields of COS. The decoded values from this spec will then be applied to a FlatCOS.

type FlatCapture

type FlatCapture struct {
	Name        *string         `mapstructure:"name" required:"true" cty:"name" hcl:"name"`
	Destination *string         `mapstructure:"destination" required:"false" cty:"destination" hcl:"destination"`
	COS         *FlatCaptureCOS `mapstructure:"cos" required:"false" cty:"cos" hcl:"cos"`
}

FlatCapture is an auto-generated flat version of Capture. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatCapture) HCL2Spec

func (*FlatCapture) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Capture. This spec is used by HCL to read the fields of Capture. The decoded values from this spec will then be applied to a FlatCapture.

type FlatCaptureCOS

type FlatCaptureCOS struct {
	Bucket    *string `mapstructure:"bucket" required:"true" cty:"bucket" hcl:"bucket"`
	Region    *string `mapstructure:"region" required:"true" cty:"region" hcl:"region"`
	AccessKey *string `mapstructure:"access_key" required:"true" cty:"access_key" hcl:"access_key"`
	SecretKey *string `mapstructure:"secret_key" required:"true" cty:"secret_key" hcl:"secret_key"`
}

FlatCaptureCOS is an auto-generated flat version of CaptureCOS. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatCaptureCOS) HCL2Spec

func (*FlatCaptureCOS) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a CaptureCOS. This spec is used by HCL to read the fields of CaptureCOS. The decoded values from this spec will then be applied to a FlatCaptureCOS.

type FlatSource

type FlatSource struct {
	Name       *string         `mapstructure:"name" required:"false" cty:"name" hcl:"name"`
	COS        *FlatCOS        `mapstructure:"cos" required:"false" cty:"cos" hcl:"cos"`
	StockImage *FlatStockImage `mapstructure:"stock_image" required:"false" cty:"stock_image" hcl:"stock_image"`
}

FlatSource is an auto-generated flat version of Source. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatSource) HCL2Spec

func (*FlatSource) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Source. This spec is used by HCL to read the fields of Source. The decoded values from this spec will then be applied to a FlatSource.

type FlatStockImage

type FlatStockImage struct {
	Name *string `mapstructure:"name" required:"true" cty:"name" hcl:"name"`
}

FlatStockImage is an auto-generated flat version of StockImage. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatStockImage) HCL2Spec

func (*FlatStockImage) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a StockImage. This spec is used by HCL to read the fields of StockImage. The decoded values from this spec will then be applied to a FlatStockImage.

type ImageConfig

type ImageConfig struct {
}

type RunConfig

type RunConfig struct {
	InstanceName string   `mapstructure:"instance_name" required:"true"`
	KeyPairName  string   `mapstructure:"key_pair_name" required:"true"`
	SubnetIDs    []string `mapstructure:"subnet_ids" required:"false"`
	DHCPNetwork  bool     `mapstructure:"dhcp_network" required:"false"`
	Source       Source   `mapstructure:"source" required:"true"`
	Capture      Capture  `mapstructure:"capture" required:"true"`

	// Communicator settings
	Comm communicator.Config `mapstructure:",squash"`
}

func (*RunConfig) Prepare

func (c *RunConfig) Prepare(ctx *interpolate.Context) []error

type Source

type Source struct {
	Name       string      `mapstructure:"name" required:"false"`
	COS        *COS        `mapstructure:"cos" required:"false"`
	StockImage *StockImage `mapstructure:"stock_image" required:"false"`
}

func (*Source) FlatMapstructure

func (*Source) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatSource. FlatSource is an auto-generated flat version of Source. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type StockImage

type StockImage struct {
	Name string `mapstructure:"name" required:"true"`
}

func (*StockImage) FlatMapstructure

func (*StockImage) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatStockImage. FlatStockImage is an auto-generated flat version of StockImage. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

Jump to

Keyboard shortcuts

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