uhost

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Overview

The ucloud-uhost contains a packer.Builder implementation that builds uhost images for UCloud UHost instance.

Index

Constants

View Source
const BuilderId = "ucloud.uhost"

The unique ID for this builder

Variables

This section is empty.

Functions

func SSHHost

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

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

Types

type AccessConfig

type AccessConfig struct {
	PublicKey  string `mapstructure:"public_key"`
	PrivateKey string `mapstructure:"private_key"`
	Region     string `mapstructure:"region"`
	ProjectId  string `mapstructure:"project_id"`
	// contains filtered or unexported fields
}

func (*AccessConfig) Client

func (c *AccessConfig) Client() (*UCloudClient, error)

func (*AccessConfig) Config

func (c *AccessConfig) Config() error

func (*AccessConfig) Prepare

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

func (*AccessConfig) ValidateProjectId

func (c *AccessConfig) ValidateProjectId(projectId string) error

func (*AccessConfig) ValidateRegion

func (c *AccessConfig) ValidateRegion(region string) error

func (*AccessConfig) ValidateZone

func (c *AccessConfig) ValidateZone(region, zone string) error

type Artifact

type Artifact struct {
	UCloudImages *imageInfoSet

	BuilderIdValue string

	Client *UCloudClient
}

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"`
	AccessConfig        `mapstructure:",squash"`
	ImageConfig         `mapstructure:",squash"`
	RunConfig           `mapstructure:",squash"`
	// contains filtered or unexported fields
}

type ExpectedStateError

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

func (*ExpectedStateError) Error

func (e *ExpectedStateError) Error() string

type ImageConfig

type ImageConfig struct {
	ImageName         string             `mapstructure:"image_name"`
	ImageDescription  string             `mapstructure:"image_description"`
	ImageDestinations []ImageDestination `mapstructure:"image_copy_to_mappings"`
}

func (*ImageConfig) Prepare

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

type ImageDestination

type ImageDestination struct {
	ProjectId   string `mapstructure:"project_id"`
	Region      string `mapstructure:"region"`
	Name        string `mapstructure:"name"`
	Description string `mapstructure:"description"`
}

type NotCompleteError

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

func (*NotCompleteError) Error

func (e *NotCompleteError) Error() string

type NotFoundError

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type RunConfig

type RunConfig struct {
	Zone            string `mapstructure:"availability_zone"`
	SourceImageId   string `mapstructure:"source_image_id"`
	InstanceType    string `mapstructure:"instance_type"`
	InstanceName    string `mapstructure:"instance_name"`
	BootDiskType    string `mapstructure:"boot_disk_type"`
	VPCId           string `mapstructure:"vpc_id"`
	SubnetId        string `mapstructure:"subnet_id"`
	SecurityGroupId string `mapstructure:"security_group_id"`

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

func (*RunConfig) Prepare

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

type UCloudClient

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

func (*UCloudClient) DescribeImageById

func (c *UCloudClient) DescribeImageById(imageId string) (*uhost.UHostImageSet, error)

Jump to

Keyboard shortcuts

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