tencloud

package
v0.0.0-...-95250d3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderID = "epicgames.tencloud"

Variables

This section is empty.

Functions

func SSHConfig

func SSHConfig(username, password string) func(multistep.StateBag) (*ssh.ClientConfig, error)

func SSHHost

func SSHHost(tc *tcapi.Client, sshInterface string) func(multistep.StateBag) (string, error)

func SleepSeconds

func SleepSeconds() (seconds int)

func TimeoutSeconds

func TimeoutSeconds() (seconds int)

func WaitForDoesNotExist

func WaitForDoesNotExist(conf *StateChangeConf) (i interface{}, err error)

func WaitForExists

func WaitForExists(conf *StateChangeConf) (i interface{}, err error)

func WaitForState

func WaitForState(conf *StateChangeConf) (i interface{}, err error)

Types

type Artifact

type Artifact struct {
	Images         map[string]string
	BuilderIdValue string
	Session        *tcapi.Client
}

func (Artifact) BuilderId

func (a Artifact) BuilderId() string

func (Artifact) Destroy

func (a Artifact) Destroy() error

func (Artifact) Files

func (a Artifact) Files() []string

func (Artifact) Id

func (a Artifact) Id() string

func (Artifact) State

func (a Artifact) State(name string) interface{}

func (Artifact) String

func (a Artifact) String() string

type AuthConfig

type AuthConfig struct {
	KeyID   string `mapstructure:"key_id"`
	Key     string `mapstructure:"key"`
	Region  string `mapstructure:"region"`
	Project int    `mapstructure:"project"`
	// contains filtered or unexported fields
}

authentication configuration

func (*AuthConfig) Client

func (c *AuthConfig) Client() (*tcapi.Client, error)

func (*AuthConfig) Prepare

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

type Builder

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

func (*Builder) Cancel

func (b *Builder) Cancel()

func (*Builder) Prepare

func (b *Builder) Prepare(rawVars ...interface{}) ([]string, error)

func (*Builder) Run

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

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`
	AuthConfig          `mapstructure:",squash"`
	ImageConfig         `mapstructure:",squash"`
	RunConfig           `mapstructure:",squash"`
	// contains filtered or unexported fields
}

type ImageConfig

type ImageConfig struct {
	ImageName          string   `mapstructure:"image_name"`
	ImageDescription   string   `mapstructure:"image_description"`
	ImageDescTags      TagMap   `mapstructure:"tags"`
	ImageDescTagsDelim string   `mapstructure:"tag_delimiter"`
	ImageRegions       []string `mapstructure:"image_regions"`
	ForceDeregister    bool     `mapstructure:"force_deregister"`
	CleanImageName     bool     `mapstructure:"clean_image_name"`
}

image configuration

func (*ImageConfig) Prepare

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

type RunConfig

type RunConfig struct {
	AvailabilityZone        string           `mapstructure:"availability_zone"`
	SourceImageId           string           `mapstructure:"source_image_id"`
	SourceImageFilter       TagFilterOptions `mapstructure:"source_image_filters"`
	InstanceType            string           `mapstructure:"instance_type"`
	InstanceChargeType      string           `mapstructure:"instance_charge_type"`
	SystemDiskType          string           `mapstructure:"system_disk_type"`
	SystemDiskSize          string           `mapstructure:"system_disk_size"`
	VpcId                   string           `mapstructure:"vpc_id"`
	SubnetId                string           `mapstructure:"subnet_id"`
	InternetChargeType      string           `mapstructure:"internet_charge_type"`
	InternetMaxBandwidthOut string           `mapstructure:"internet_max_bandwidth_out"`
	PublicIpAssigned        bool             `mapstructure:"public_ip_assigned"`
	SecurityGroupIds        []string         `mapstructure:"security_group_ids"`
	UserData                string           `mapstructure:"user_data"`
	UserDataFile            string           `mapstructure:"user_data_file"`
	TemporaryKeyPairName    string           `mapstructure:"temporary_key_pair_name"`
	DisableStopInstance     bool             `mapstructure:"disable_stop_instance"`
	SSHKeyPairName          string           `mapstructure:"ssh_keypair_name"`
	SSHInterface            string           `mapstructure:"ssh_interface"`

	Comm communicator.Config `mapstructure:",squash"`
}

instance run configuration

func (*RunConfig) Prepare

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

type StateChangeConf

type StateChangeConf struct {
	Pending   []string
	Refresh   StateRefreshFunc
	StepState multistep.StateBag
	Target    string
}

type StateRefreshFunc

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

func ImageExistsRefreshFunc

func ImageExistsRefreshFunc(tc *tcapi.Client, imageName string) StateRefreshFunc

func ImageStateRefreshFunc

func ImageStateRefreshFunc(tc *tcapi.Client, imageId string) StateRefreshFunc

func InstanceStateRefreshFunc

func InstanceStateRefreshFunc(tc *tcapi.Client, instanceId string) StateRefreshFunc

type StepCreateImage

type StepCreateImage struct {
	Image tcapi.Image
}

func (*StepCreateImage) Cleanup

func (step *StepCreateImage) Cleanup(state multistep.StateBag)

func (*StepCreateImage) Run

type StepDeregisterImage

type StepDeregisterImage struct {
	ForceDeregister bool
	ImageName       string
	Regions         []string
}

func (*StepDeregisterImage) Cleanup

func (step *StepDeregisterImage) Cleanup(_ multistep.StateBag)

func (*StepDeregisterImage) Run

type StepImageRegionCopy

type StepImageRegionCopy struct {
	Regions []string
	Name    string
}

func (*StepImageRegionCopy) Cleanup

func (step *StepImageRegionCopy) Cleanup(_ multistep.StateBag)

func (*StepImageRegionCopy) Run

type StepKeyPair

type StepKeyPair struct {
	Debug                bool
	DebugKeyPath         string
	TemporaryKeyPairName string
	KeyPairName          string
	PrivateKeyFile       string
	// contains filtered or unexported fields
}

func (*StepKeyPair) Cleanup

func (step *StepKeyPair) Cleanup(state multistep.StateBag)

func (*StepKeyPair) Run

type StepPreValidate

type StepPreValidate struct {
	DestImageName   string
	ForceDeregister bool
}

func (*StepPreValidate) Cleanup

func (step *StepPreValidate) Cleanup(_ multistep.StateBag)

func (*StepPreValidate) Run

type StepRunInstance

type StepRunInstance struct {
	AvailabilityZone        string           `mapstructure:"availability_zone"`
	SourceImageId           string           `mapstructure:"source_image_id"`
	SourceImageFilter       TagFilterOptions `mapstructure:"source_image_filter"`
	InstanceType            string           `mapstructure:"instance_type"`
	InstanceChargeType      string           `mapstructure:"instance_charge_type"`
	SystemDiskType          string           `mapstructure:"system_disk_type"`
	SystemDiskSize          string           `mapstructure:"system_disk_size"`
	VpcId                   string           `mapstructure:"vpc_id"`
	SubnetId                string           `mapstructure:"subnet_id"`
	InternetChargeType      string           `mapstructure:"internet_charge_type"`
	InternetMaxBandwidthOut string           `mapstructure:"internet_max_bandwidth_out"`
	PublicIpAssigned        bool             `mapstructure:"public_ip_assigned"`
	SecurityGroupIds        []string         `mapstructure:"security_group_ids"`
	UserData                string           `mapstructure:"user_data"`
	UserDataFile            string           `mapstructure:"user_data_file"`
	// contains filtered or unexported fields
}

func (*StepRunInstance) Cleanup

func (step *StepRunInstance) Cleanup(state multistep.StateBag)

func (*StepRunInstance) Run

type StepSourceImageInfo

type StepSourceImageInfo struct {
	SourceImage       string
	SourceImageFilter TagFilterOptions
}

func (*StepSourceImageInfo) Cleanup

func (step *StepSourceImageInfo) Cleanup(_ multistep.StateBag)

func (*StepSourceImageInfo) Run

type StepStopInstance

type StepStopInstance struct {
	Skip                bool
	DisableStopInstance bool
}

func (*StepStopInstance) Cleanup

func (step *StepStopInstance) Cleanup(_ multistep.StateBag)

func (*StepStopInstance) Run

type TagFilterOptions

type TagFilterOptions struct {
	Filters        map[string]string `mapstructure:"filters"`
	TagFilters     map[string]string `mapstructure:"tag_filters"`
	TagFilterDelim string            `mapstructure:"tag_filter_delimiter"`
	MostRecent     bool              `mapstructure:"most_recent"`
}

TagFilterOptions holds all of the potential filters for describing a tc image

func (TagFilterOptions) Empty

func (t TagFilterOptions) Empty() bool

Empty determines if the TagFilterOptions is set or not

func (TagFilterOptions) FindImage

func (t TagFilterOptions) FindImage(client *tcapi.Client) (*tcapi.Image, error)

FindImage finds a source image id given the provided filters

func (TagFilterOptions) IsDelimSet

func (t TagFilterOptions) IsDelimSet() bool

IsDelimSet checks if there is a delimeter set for tag filters or not

type TagMap

type TagMap map[string]string

TagMap is a helper type for a string=>string map

func (TagMap) Flatten

func (t TagMap) Flatten(delim string) string

Flatten well... flattens the tag map with the supplied delimiter

func (TagMap) IsSet

func (t TagMap) IsSet() bool

IsSet determines if the TagMap is set or not

Jump to

Keyboard shortcuts

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