Documentation ¶
Index ¶
- Constants
- func Copy(dst interface{}, src interface{}) error
- type CallbackCheckIPReady
- type Configuration
- type Ec2Instance
- func (instance *Ec2Instance) Create(nodeIndex int, nodeGroup, instanceType string, userData *string, ...) error
- func (instance *Ec2Instance) Delete() error
- func (instance *Ec2Instance) NewContext() *context.Context
- func (instance *Ec2Instance) PowerOff() error
- func (instance *Ec2Instance) PowerOn() error
- func (instance *Ec2Instance) RegisterDNS(zoneID, name, address string, wait bool) error
- func (instance *Ec2Instance) ShutdownGuest() error
- func (instance *Ec2Instance) Status() (*Status, error)
- func (instance *Ec2Instance) UnRegisterDNS(zoneID, name, address string, wait bool) error
- func (instance *Ec2Instance) WaitForIP(callback CallbackCheckIPReady) (*string, error)
- func (instance *Ec2Instance) WaitForPowered() error
- type Eni
- type Network
- type Status
- type Tag
- type VirtualMachinePowerState
Constants ¶
const ( // VirtualMachinePowerStatePoweredOff state VirtualMachinePowerStatePoweredOff = VirtualMachinePowerState("poweredOff") // VirtualMachinePowerStatePoweredOn state VirtualMachinePowerStatePoweredOn = VirtualMachinePowerState("poweredOn") // VirtualMachinePowerStateSuspended state VirtualMachinePowerStateSuspended = VirtualMachinePowerState("suspended") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallbackCheckIPReady ¶
CallbackCheckIPReady callback to test if IP is up
type Configuration ¶
type Configuration struct { AccessKey string `json:"accessKey"` SecretKey string `json:"secretKey"` Token string `json:"token"` Profile string `json:"profile"` Region string `json:"region"` Timeout time.Duration `json:"timeout"` ImageID string `json:"ami"` IamRole string `json:"iam-role-arn"` KeyName string `json:"keyName"` Tags []Tag `json:"tags"` Network *Network `json:"network"` DiskType string `default:"standard" json:"diskType"` DiskSize int `default:"10" json:"diskSize"` }
Configuration declares aws connection info
func (*Configuration) Create ¶
func (conf *Configuration) Create(nodeIndex int, nodeGroup, name, instanceType string, diskType string, diskSize int, userData *string) (*Ec2Instance, error)
Create will create a named VM not powered memory and disk are in megabytes
func (*Configuration) GetInstanceID ¶
func (conf *Configuration) GetInstanceID(name string) (*Ec2Instance, error)
GetInstanceID return aws instance id from named ec2 instance
type Ec2Instance ¶
type Ec2Instance struct { InstanceName string InstanceID *string AddressIP *string // contains filtered or unexported fields }
Ec2Instance Running instance
func GetEc2Instance ¶
func GetEc2Instance(config *Configuration, instanceName string) (*Ec2Instance, error)
GetEc2Instance return an existing instance from name
func NewEc2Instance ¶
func NewEc2Instance(config *Configuration, instanceName string) (*Ec2Instance, error)
NewEc2Instance create a new instance
func (*Ec2Instance) Create ¶
func (instance *Ec2Instance) Create(nodeIndex int, nodeGroup, instanceType string, userData *string, diskType string, diskSize int) error
Create will create a named VM not powered memory and disk are in megabytes
func (*Ec2Instance) NewContext ¶
func (instance *Ec2Instance) NewContext() *context.Context
NewContext create instance context
func (*Ec2Instance) PowerOff ¶
func (instance *Ec2Instance) PowerOff() error
PowerOff power off a VM by name
func (*Ec2Instance) PowerOn ¶
func (instance *Ec2Instance) PowerOn() error
PowerOn power on a VM by name
func (*Ec2Instance) RegisterDNS ¶
func (instance *Ec2Instance) RegisterDNS(zoneID, name, address string, wait bool) error
RegisterDNS register EC2 instance in Route53
func (*Ec2Instance) ShutdownGuest ¶
func (instance *Ec2Instance) ShutdownGuest() error
ShutdownGuest power off a VM by name
func (*Ec2Instance) Status ¶
func (instance *Ec2Instance) Status() (*Status, error)
Status return the current status of VM by name
func (*Ec2Instance) UnRegisterDNS ¶
func (instance *Ec2Instance) UnRegisterDNS(zoneID, name, address string, wait bool) error
UnRegisterDNS unregister EC2 instance in Route53
func (*Ec2Instance) WaitForIP ¶
func (instance *Ec2Instance) WaitForIP(callback CallbackCheckIPReady) (*string, error)
WaitForIP wait ip a VM by name
func (*Ec2Instance) WaitForPowered ¶
func (instance *Ec2Instance) WaitForPowered() error
WaitForPowered wait ip a VM by name
type Eni ¶
type Eni struct { SubnetsID interface{} `json:"subnets"` SecurityGroupID string `json:"securityGroup"` PublicIP bool `json:"publicIP"` }
Eni decalre ENI interface
func (*Eni) GetRandomSubnetsID ¶ added in v1.20.14
type Network ¶
type Network struct { ZoneID *string `json:"route53"` PrivateZoneName *string `json:"privateZoneName"` ENI []Eni `json:"eni"` }
Network declare network configuration
type VirtualMachinePowerState ¶
type VirtualMachinePowerState string
VirtualMachinePowerState alias string