Documentation
¶
Overview ¶
The ucloud-uhost contains a packer.Builder implementation that builds uhost images for UCloud UHost instance.
Index ¶
- Constants
- func SSHHost(usePrivateIp bool) func(multistep.StateBag) (string, error)
- type AccessConfig
- func (c *AccessConfig) Client() (*UCloudClient, error)
- func (c *AccessConfig) Config() error
- func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error
- func (c *AccessConfig) ValidateProjectId(projectId string) error
- func (c *AccessConfig) ValidateRegion(region string) error
- func (c *AccessConfig) ValidateZone(region, zone string) error
- type Artifact
- type Builder
- type Config
- type ExpectedStateError
- type ImageConfig
- type ImageDestination
- type NotCompleteError
- type NotFoundError
- type RunConfig
- type UCloudClient
Constants ¶
View Source
const BuilderId = "ucloud.uhost"
The unique ID for this builder
Variables ¶
This section is empty.
Functions ¶
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
}
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 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"`
}
type UCloudClient ¶
type UCloudClient struct {
// contains filtered or unexported fields
}
func (*UCloudClient) DescribeImageById ¶
func (c *UCloudClient) DescribeImageById(imageId string) (*uhost.UHostImageSet, error)
Source Files
¶
- access_config.go
- artifact.go
- builder.go
- client.go
- consts.go
- errors.go
- image_config.go
- run_config.go
- step_check_source_image.go
- step_config_security_group.go
- step_config_subnet.go
- step_config_vpc.go
- step_copy_image.go
- step_create_image.go
- step_create_instance.go
- step_pre_validate.go
- step_stop_instance.go
- types.go
- utils.go
Click to show internal directories.
Click to hide internal directories.