cvm

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: MPL-2.0 Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Bangkok       = Region("ap-bangkok")
	Beijing       = Region("ap-beijing")
	Chengdu       = Region("ap-chengdu")
	Chongqing     = Region("ap-chongqing")
	Guangzhou     = Region("ap-guangzhou")
	GuangzhouOpen = Region("ap-guangzhou-open")
	Hongkong      = Region("ap-hongkong")
	Mumbai        = Region("ap-mumbai")
	Seoul         = Region("ap-seoul")
	Shanghai      = Region("ap-shanghai")
	ShanghaiFsi   = Region("ap-shanghai-fsi")
	ShenzhenFsi   = Region("ap-shenzhen-fsi")
	Singapore     = Region("ap-singapore")
	Tokyo         = Region("ap-tokyo")
	Frankfurt     = Region("eu-frankfurt")
	Moscow        = Region("eu-moscow")
	Ashburn       = Region("na-ashburn")
	Siliconvalley = Region("na-siliconvalley")
	Toronto       = Region("na-toronto")
)

below would be moved to tencentcloud sdk git repo

View Source
const BuilderId = "tencent.cloud"
View Source
const DefaultWaitForInterval = 5

Variables

View Source
var ValidCBSType = []string{
	"LOCAL_BASIC", "LOCAL_SSD", "CLOUD_BASIC", "CLOUD_SSD", "CLOUD_PREMIUM",
}

Functions

func CheckResourceIdFormat

func CheckResourceIdFormat(resource string, id string) bool

func MessageClean

func MessageClean(state multistep.StateBag, module string)

func SSHHost

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

SSHHost returns a function that can be given to the SSH communicator

func WaitForImageReady

func WaitForImageReady(client *cvm.Client, imageName string, status string, timeout int) error

func WaitForInstance

func WaitForInstance(client *cvm.Client, instanceId string, status string, timeout int) error

Types

type Artifact

type Artifact struct {
	TencentCloudImages map[string]string
	BuilderIdValue     string
	Client             *cvm.Client
}

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) State

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

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

func (*Builder) Prepare

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

func (*Builder) Run

func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error)

type Config

type Config struct {
	common.PackerConfig      `mapstructure:",squash"`
	TencentCloudAccessConfig `mapstructure:",squash"`
	TencentCloudImageConfig  `mapstructure:",squash"`
	TencentCloudRunConfig    `mapstructure:",squash"`
	// contains filtered or unexported fields
}

type Region

type Region string

type TencentCloudAccessConfig

type TencentCloudAccessConfig struct {
	SecretId       string `mapstructure:"secret_id"`
	SecretKey      string `mapstructure:"secret_key"`
	Region         string `mapstructure:"region"`
	Zone           string `mapstructure:"zone"`
	SkipValidation bool   `mapstructure:"skip_region_validation"`
}

func (*TencentCloudAccessConfig) Client

func (cf *TencentCloudAccessConfig) Client() (*cvm.Client, *vpc.Client, error)

func (*TencentCloudAccessConfig) Config

func (cf *TencentCloudAccessConfig) Config() error

func (*TencentCloudAccessConfig) Prepare

func (cf *TencentCloudAccessConfig) Prepare(ctx *interpolate.Context) []error

type TencentCloudImageConfig

type TencentCloudImageConfig struct {
	ImageName          string   `mapstructure:"image_name"`
	ImageDescription   string   `mapstructure:"image_description"`
	Reboot             bool     `mapstructure:"reboot"`
	ForcePoweroff      bool     `mapstructure:"force_poweroff"`
	Sysprep            bool     `mapstructure:"sysprep"`
	ImageForceDelete   bool     `mapstructure:"image_force_delete"`
	ImageCopyRegions   []string `mapstructure:"image_copy_regions"`
	ImageShareAccounts []string `mapstructure:"image_share_accounts"`
	SkipValidation     bool     `mapstructure:"skip_region_validation"`
}

func (*TencentCloudImageConfig) Prepare

func (cf *TencentCloudImageConfig) Prepare(ctx *interpolate.Context) []error

type TencentCloudRunConfig

type TencentCloudRunConfig struct {
	AssociatePublicIpAddress bool   `mapstructure:"associate_public_ip_address"`
	SourceImageId            string `mapstructure:"source_image_id"`
	InstanceType             string `mapstructure:"instance_type"`
	InstanceName             string `mapstructure:"instance_name"`
	DiskType                 string `mapstructure:"disk_type"`
	DiskSize                 int64  `mapstructure:"disk_size"`
	VpcId                    string `mapstructure:"vpc_id"`
	VpcName                  string `mapstructure:"vpc_name"`
	VpcIp                    string `mapstructure:"vpc_ip"`
	SubnetId                 string `mapstructure:"subnet_id"`
	SubnetName               string `mapstructure:"subnet_name"`
	CidrBlock                string `mapstructure:"cidr_block"` // 10.0.0.0/16(default), 172.16.0.0/12, 192.168.0.0/16
	SubnectCidrBlock         string `mapstructure:"subnect_cidr_block"`
	InternetChargeType       string `mapstructure:"internet_charge_type"`
	InternetMaxBandwidthOut  int64  `mapstructure:"internet_max_bandwidth_out"`
	SecurityGroupId          string `mapstructure:"security_group_id"`
	SecurityGroupName        string `mapstructure:"security_group_name"`
	UserData                 string `mapstructure:"user_data"`
	UserDataFile             string `mapstructure:"user_data_file"`
	HostName                 string `mapstructure:"host_name"`

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

func (*TencentCloudRunConfig) Prepare

func (cf *TencentCloudRunConfig) Prepare(ctx *interpolate.Context) []error

Jump to

Keyboard shortcuts

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