Documentation
¶
Overview ¶
Code generated by "mapstructure-to-hcl2 -type ImageDestination"; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func CheckIntIn(val int, available []int) error
- func CheckStringIn(val string, available []string) error
- func Halt(state multistep.StateBag, err error, prefix string) multistep.StepAction
- func IsExpectedStateError(err error) bool
- func IsNotCompleteError(err error) bool
- func IsNotFoundError(err error) bool
- func IsStringIn(val string, available []string) bool
- func NewExpectedStateError(product, id string) error
- func NewNotCompletedError(product string) error
- func NewNotFoundError(product, id string) error
- func NewStringConverter(input map[string]string) stringConverter
- 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 ExpectedStateError
- type FlatImageDestination
- type ImageConfig
- type ImageDestination
- type ImageInfo
- type ImageInfoSet
- type InstanceType
- type NotCompletedError
- type NotFoundError
- type RunConfig
- type UCloudClient
- func (c *UCloudClient) DescribeFirewallById(sgId string) (*unet.FirewallDataSet, error)
- func (c *UCloudClient) DescribeImageById(imageId string) (*uhost.UHostImageSet, error)
- func (c *UCloudClient) DescribeImageByInfo(projectId, regionId, imageId string) (*uhost.UHostImageSet, error)
- func (c *UCloudClient) DescribeSubnetById(subnetId string) (*vpc.VPCSubnetInfoSet, error)
- func (c *UCloudClient) DescribeUHostById(uhostId string) (*uhost.UHostInstanceSet, error)
- func (c *UCloudClient) DescribeVPCById(vpcId string) (*vpc.VPCInfo, error)
Constants ¶
View Source
const ( // DefaultPasswordStr, DefaultPasswordNum and DefaultPasswordSpe are used to general default value of root password of UHost instance DefaultPasswordNum = "012346789" DefaultPasswordStr = "abcdefghijklmnopqrstuvwxyz" DefaultPasswordSpe = "-_" )
View Source
const ( InstanceStateRunning = "Running" InstanceStateStopped = "Stopped" ImageStateAvailable = "Available" BootDiskStateNormal = "Normal" OsTypeWindows = "Windows" SecurityGroupNonWeb = "recommend non web" IpTypePrivate = "Private" )
View Source
const (
DefaultCreateImageTimeout = 3600
)
Variables ¶
View Source
var BootDiskTypeMap = NewStringConverter(map[string]string{
"cloud_ssd": "CLOUD_SSD",
"local_normal": "LOCAL_NORMAL",
"local_ssd": "LOCAL_SSD",
})
View Source
var ImageNamePattern = regexp.MustCompile(`^[A-Za-z0-9\p{Han}-_\[\]:,.]{1,63}$`)
Functions ¶
func CheckIntIn ¶
func CheckStringIn ¶
func IsExpectedStateError ¶
func IsNotCompleteError ¶
func IsNotFoundError ¶
func IsStringIn ¶
func NewExpectedStateError ¶
func NewNotCompletedError ¶
func NewNotFoundError ¶
func NewStringConverter ¶
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"`
BaseUrl string `mapstructure:"base_url"`
// 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
// StateData should store data such as GeneratedData
// to be shared with post-processors
StateData map[string]interface{}
}
type ExpectedStateError ¶
type ExpectedStateError struct {
// contains filtered or unexported fields
}
func (*ExpectedStateError) Error ¶
func (e *ExpectedStateError) Error() string
type FlatImageDestination ¶
type FlatImageDestination struct {
ProjectId *string `mapstructure:"project_id" cty:"project_id"`
Region *string `mapstructure:"region" cty:"region"`
Name *string `mapstructure:"name" cty:"name"`
Description *string `mapstructure:"description" cty:"description"`
}
FlatImageDestination is an auto-generated flat version of ImageDestination. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatImageDestination) HCL2Spec ¶
func (*FlatImageDestination) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a ImageDestination. This spec is used by HCL to read the fields of ImageDestination. The decoded values from this spec will then be applied to a FlatImageDestination.
type ImageConfig ¶
type ImageConfig struct {
ImageName string `mapstructure:"image_name"`
ImageDescription string `mapstructure:"image_description"`
ImageDestinations []ImageDestination `mapstructure:"image_copy_to_mappings"`
WaitImageReadyTimeout int `mapstructure:"wait_image_ready_timeout"`
}
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"`
}
func (*ImageDestination) FlatMapstructure ¶
func (*ImageDestination) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatImageDestination. FlatImageDestination is an auto-generated flat version of ImageDestination. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type ImageInfoSet ¶
type ImageInfoSet struct {
// contains filtered or unexported fields
}
func NewImageInfoSet ¶
func NewImageInfoSet(vL []ImageInfo) *ImageInfoSet
func (*ImageInfoSet) Get ¶
func (i *ImageInfoSet) Get(projectId, region string) *ImageInfo
func (*ImageInfoSet) GetAll ¶
func (i *ImageInfoSet) GetAll() []ImageInfo
func (*ImageInfoSet) Remove ¶
func (i *ImageInfoSet) Remove(id string)
func (*ImageInfoSet) Set ¶
func (i *ImageInfoSet) Set(img ImageInfo)
type InstanceType ¶
func ParseInstanceType ¶
func ParseInstanceType(s string) (*InstanceType, error)
func (*InstanceType) Iscustomized ¶
func (i *InstanceType) Iscustomized() bool
func (*InstanceType) String ¶
func (i *InstanceType) String() string
type NotCompletedError ¶
type NotCompletedError struct {
// contains filtered or unexported fields
}
func (*NotCompletedError) Error ¶
func (e *NotCompletedError) 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 {
UHostConn *uhost.UHostClient
UNetConn *unet.UNetClient
VPCConn *vpc.VPCClient
UAccountConn *uaccount.UAccountClient
UFileConn *ufile.UFileClient
}
func (*UCloudClient) DescribeFirewallById ¶
func (c *UCloudClient) DescribeFirewallById(sgId string) (*unet.FirewallDataSet, error)
func (*UCloudClient) DescribeImageById ¶
func (c *UCloudClient) DescribeImageById(imageId string) (*uhost.UHostImageSet, error)
func (*UCloudClient) DescribeImageByInfo ¶
func (c *UCloudClient) DescribeImageByInfo(projectId, regionId, imageId string) (*uhost.UHostImageSet, error)
func (*UCloudClient) DescribeSubnetById ¶
func (c *UCloudClient) DescribeSubnetById(subnetId string) (*vpc.VPCSubnetInfoSet, error)
func (*UCloudClient) DescribeUHostById ¶
func (c *UCloudClient) DescribeUHostById(uhostId string) (*uhost.UHostInstanceSet, error)
func (*UCloudClient) DescribeVPCById ¶
func (c *UCloudClient) DescribeVPCById(vpcId string) (*vpc.VPCInfo, error)
Click to show internal directories.
Click to hide internal directories.