Documentation ¶
Index ¶
- Constants
- func Copy(dst interface{}, src interface{}) error
- type CallbackCheckIPReady
- type Configuration
- func (conf *Configuration) Create(nodeIndex int, nodeGroup, name, instanceType string, diskType string, ...) (*Ec2Instance, error)
- func (conf *Configuration) GetInstanceID(name string) (*Ec2Instance, error)
- func (conf *Configuration) GetRoute53AccessKey() string
- func (conf *Configuration) GetRoute53AccessToken() string
- func (conf *Configuration) GetRoute53Profile() string
- func (conf *Configuration) GetRoute53Region() string
- func (conf *Configuration) GetRoute53SecretKey() string
- func (conf *Configuration) Log(args ...interface{})
- 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(...) error
- func (instance *Ec2Instance) ShutdownGuest() error
- func (instance *Ec2Instance) Status() (*Status, error)
- func (instance *Ec2Instance) UnRegisterDNS(...) error
- func (instance *Ec2Instance) WaitForIP(callback CallbackCheckIPReady) (*string, error)
- func (instance *Ec2Instance) WaitForPowered() error
- type Network
- type NetworkInterface
- type Status
- type Tag
- type UserDefinedNetworkInterface
- 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, desiredENI *UserDefinedNetworkInterface) (*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
func (*Configuration) GetRoute53AccessKey ¶ added in v1.22.14
func (conf *Configuration) GetRoute53AccessKey() string
GetRoute53AccessKey return route53 access key or default
func (*Configuration) GetRoute53AccessToken ¶ added in v1.22.14
func (conf *Configuration) GetRoute53AccessToken() string
GetRoute53AccessToken return route53 token or default
func (*Configuration) GetRoute53Profile ¶ added in v1.22.14
func (conf *Configuration) GetRoute53Profile() string
GetRoute53Profile return route53 profile or default
func (*Configuration) GetRoute53Region ¶ added in v1.22.14
func (conf *Configuration) GetRoute53Region() string
GetRoute53Profile return route53 region or default
func (*Configuration) GetRoute53SecretKey ¶ added in v1.22.14
func (conf *Configuration) GetRoute53SecretKey() string
GetRoute53SecretKey return route53 secret key or default
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, desiredENI *UserDefinedNetworkInterface) 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(accessKey, secretKey, accessToken, profile, region, 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(accessKey, secretKey, accessToken, profile, region, 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 Network ¶
type Network struct { ZoneID *string `json:"route53"` PrivateZoneName *string `json:"privateZoneName"` AccessKey *string `json:"accessKey"` SecretKey *string `json:"secretKey"` Token *string `json:"token"` Profile *string `json:"profile"` Region *string `json:"region"` ENI []NetworkInterface `json:"eni"` }
Network declare network configuration
type NetworkInterface ¶ added in v1.20.15
type NetworkInterface struct { SubnetsID interface{} `json:"subnets"` SecurityGroupID string `json:"securityGroup"` PublicIP bool `json:"publicIP"` }
NetworkInterface declare ENI interface
func (*NetworkInterface) GetRandomSubnetsID ¶ added in v1.20.15
func (eni *NetworkInterface) GetRandomSubnetsID() *string
type UserDefinedNetworkInterface ¶ added in v1.20.15
type UserDefinedNetworkInterface struct { NetworkInterfaceID string `json:"networkInterfaceId"` SubnetID string `json:"subnets"` SecurityGroupID string `json:"securityGroup"` PrivateAddress string `json:"privateAddress,omitempty"` PublicIP bool `json:"publicIP"` }
UserDefinedNetworkInterface declare a network interface interface overriding default Eni
type VirtualMachinePowerState ¶
type VirtualMachinePowerState string
VirtualMachinePowerState alias string