Documentation ¶
Index ¶
- Constants
- func IpForSsh(instance *Instance) (openIp string, e error)
- func WaitForInstances(instances []*Instance, timeout time.Duration) error
- type Address
- type Attachment
- type BlockDeviceMapping
- type Client
- func (client *Client) CreateImage(opts *CreateImageOptions) (rsp *CreateImageResponse, e error)
- func (client *Client) CreateTags(resourceIds []string, tags map[string]string) error
- func (client *Client) DescribeAddresses() (addresses []*Address, e error)
- func (client *Client) DescribeImages() (images []*Image, e error)
- func (client *Client) DescribeImagesWithFilter(filter *ImageFilter) (images ImageList, e error)
- func (client *Client) DescribeInstances() (instances []*Instance, e error)
- func (client *Client) DescribeInstancesWithOptions(options *DescribeInstancesOptions) (instances []*Instance, e error)
- func (client *Client) DescribeKeyPairs() (pairs []*KeyPair, e error)
- func (client *Client) DescribeSecurityGroups(params *DescribeSecurityGroupsParameters) (groups []*SecurityGroup, e error)
- func (client *Client) DescribeSpotPriceHistory(filter *SpotPriceFilter) (prices []*SpotPrice, e error)
- func (client *Client) DescribeSubnets(params *DescribeSubnetsParameters) (*DescribeSubnetsResponse, error)
- func (client *Client) DescribeTags() (tags TagList, e error)
- func (client *Client) Endpoint() string
- func (client *Client) RunInstances(config *RunInstancesConfig) (list InstanceList, e error)
- func (client *Client) TerminateInstances(ids []string) (*aws.Response, error)
- type CreateImageOptions
- type CreateImageResponse
- type CreateNetworkInterface
- type DeregisterImage
- type DescribeAddressesResponse
- type DescribeImages
- type DescribeImagesResponse
- type DescribeInstances
- type DescribeInstancesOptions
- type DescribeInstancesResponse
- type DescribeKeyPairsResponse
- type DescribeSecurityGroupsParameters
- type DescribeSecurityGroupsResponse
- type DescribeSpotPriceHistoryResponse
- type DescribeSubnetsOptions
- type DescribeSubnetsParameters
- type DescribeSubnetsResponse
- type DescribeTagsResponse
- type DescribeVolumes
- type DescribeVolumesResponse
- type Ebs
- type Error
- type ErrorResponse
- type Filter
- type IamInstanceProfile
- type Image
- type ImageFilter
- type ImageList
- type Instance
- type InstanceList
- type IpAddress
- type IpPermission
- type KeyPair
- type NetworkInterface
- type ProductCode
- type Reservation
- type RunInstances
- type RunInstancesConfig
- type RunInstancesResponse
- type SecurityGroup
- type SpotPrice
- type SpotPriceFilter
- type Subnet
- type Tag
- type TagList
- type Volume
Constants ¶
View Source
const ( API_VERSIONS_EC2 = "2013-08-15" CANONICAL_OWNER_ID = "099720109477" SELF_OWNER_ID = "self" UBUNTU_ALL = "ubuntu/images/*" UBUNTU_PREFIX = "ubuntu-*" UBUNTU_RARING_PREFIX = "ubuntu-raring*" UBUNTU_TRUSTY_PREFIX = "ubuntu-trusty*" UBUNTU_SAUCY_PREFIX = "ubuntu-saucy*" ImagePrefixRaringAmd64 = "ubuntu-raring-13.04-amd64*" )
View Source
const ( VolumeTypeGp = "gp2" VolumeTypeIo1 = "io1" VolumeTypeStandard = "standard" )
View Source
const DESC_LINUX_UNIX = "Linux/UNIX"
View Source
const TIME_FORMAT = "2006-01-02T15:04:05.999Z"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct { PublicIp string `xml:"publicIp"` // 203.0.113.41</publicIp> AllocationId string `xml:"allocationId"` // eipalloc-08229861</allocationId> Domain string `xml:"domain"` // vpc</domain> InstanceId string `xml:"instanceId"` // i-64600030</instanceId> AssociationId string `xml:"associationId"` // eipassoc-f0229899</associationId> NetworkInterfaceId string `xml:"networkInterfaceId"` // eni-ef229886</networkInterfaceId> NetworkInterfaceOwnerId string `xml:"networkInterfaceOwnerId"` // 053230519467</networkInterfaceOwnerId> PrivateIpAddress string `xml:"privateIpAddress"` // 10.0.0.228</privateIpAddress> }
type Attachment ¶
type Attachment struct { VolumeId string `xml:"volumeId"` // vol-1a2b3c4d</volumeId> InstanceId string `xml:"instanceId"` // i-1a2b3c4d</instanceId> Device string `xml:"device"` // /dev/sdh</device> Status string `xml:"status"` // attached</status> AttachTime string `xml:"attachTime"` // YYYY-MM-DDTHH:MM:SS.SSSZ</attachTime> DeleteOnTermination string `xml:"deleteOnTermination"` // false</deleteOnTermination> }
type BlockDeviceMapping ¶
type Client ¶
func NewFromEnv ¶
func NewFromEnv() *Client
func (*Client) CreateImage ¶
func (client *Client) CreateImage(opts *CreateImageOptions) (rsp *CreateImageResponse, e error)
func (*Client) CreateTags ¶
func (*Client) DescribeAddresses ¶
func (*Client) DescribeImages ¶
func (*Client) DescribeImagesWithFilter ¶
func (client *Client) DescribeImagesWithFilter(filter *ImageFilter) (images ImageList, e error)
func (*Client) DescribeInstances ¶
func (*Client) DescribeInstancesWithOptions ¶
func (client *Client) DescribeInstancesWithOptions(options *DescribeInstancesOptions) (instances []*Instance, e error)
func (*Client) DescribeKeyPairs ¶
func (*Client) DescribeSecurityGroups ¶
func (client *Client) DescribeSecurityGroups(params *DescribeSecurityGroupsParameters) (groups []*SecurityGroup, e error)
func (*Client) DescribeSpotPriceHistory ¶
func (client *Client) DescribeSpotPriceHistory(filter *SpotPriceFilter) (prices []*SpotPrice, e error)
func (*Client) DescribeSubnets ¶
func (client *Client) DescribeSubnets(params *DescribeSubnetsParameters) (*DescribeSubnetsResponse, error)
func (*Client) DescribeTags ¶
func (*Client) RunInstances ¶
func (client *Client) RunInstances(config *RunInstancesConfig) (list InstanceList, e error)
type CreateImageOptions ¶
type CreateImageResponse ¶
type CreateNetworkInterface ¶
type DeregisterImage ¶
type DeregisterImage struct {
ImageId string
}
func (*DeregisterImage) Execute ¶
func (d *DeregisterImage) Execute(client *Client) error
type DescribeAddressesResponse ¶
type DescribeAddressesResponse struct {
Addresses []*Address `xml:"addressesSet>item"`
}
type DescribeImages ¶
type DescribeImages struct { ExecutableBys []string ImageIds []string Owners []string Filters []*Filter }
func (*DescribeImages) Execute ¶
func (action *DescribeImages) Execute(client *Client) (*DescribeImagesResponse, error)
type DescribeImagesResponse ¶
type DescribeInstances ¶
func (*DescribeInstances) Execute ¶
func (action *DescribeInstances) Execute(client *Client) (*DescribeInstancesResponse, error)
type DescribeInstancesResponse ¶
type DescribeInstancesResponse struct { XMLName xml.Name `xml:"DescribeInstancesResponse"` RequestId string `xml:"requestId"` Reservations []*Reservation `xml:"reservationSet>item"` }
func (*DescribeInstancesResponse) Instances ¶
func (rsp *DescribeInstancesResponse) Instances() []*Instance
type DescribeKeyPairsResponse ¶
type DescribeKeyPairsResponse struct {
KeyPairs []*KeyPair `xml:"keySet>item"`
}
type DescribeSecurityGroupsResponse ¶
type DescribeSecurityGroupsResponse struct {
SecurityGroups []*SecurityGroup `xml:"securityGroupInfo>item"`
}
type DescribeSpotPriceHistoryResponse ¶
type DescribeSpotPriceHistoryResponse struct {
SpotPrices []*SpotPrice `xml:"spotPriceHistorySet>item"`
}
type DescribeSubnetsOptions ¶
type DescribeSubnetsParameters ¶
type DescribeSubnetsParameters struct {
Filters []*Filter
}
type DescribeSubnetsResponse ¶
type DescribeTagsResponse ¶
type DescribeTagsResponse struct {
Tags []*Tag `xml:"tagSet>item"`
}
type DescribeVolumes ¶
func (*DescribeVolumes) Execute ¶
func (action *DescribeVolumes) Execute(client *Client) (*DescribeVolumesResponse, error)
type DescribeVolumesResponse ¶
type Ebs ¶
type Ebs struct { SnapshotId string `xml:"snapshotId,omitempty" json:",omitempty"` VolumeId string `xml:"volumeId,omitempty"` VolumeSize int `xml:"volumeSize,omitempty" json:",omitempty"` DeleteOnTermination bool `xml:"deleteOnTermination,omitempty" json:",omitempty"` VolumeType string `xml:"volumeType,omitempty json:",omitempty""` // see VolumeType... (e.g. gp, io1, standard) Iops int `xml:"iops,omitempty" json:",omitempty"` Encrypted bool `xml:"encrypted,omitempty" json:",omitempty"` }
type ErrorResponse ¶
type ErrorResponse struct { XMLName xml.Name `xml:"Response"` RequestID string `xml:"RequestID"` Errors []*Error `xml:"Errors>Error"` }
func (*ErrorResponse) ErrorStrings ¶
func (er *ErrorResponse) ErrorStrings() string
type IamInstanceProfile ¶
type Image ¶
type Image struct { ImageId string `xml:"imageId"` ImageLocation string `xml:"imageLocation"` ImageState string `xml:"imageState"` ImageOwnerId string `xml:"imageOwnerId"` IsPublic bool `xml:"isPublic"` Architecture string `xml:"architecture"` ImageType string `xml:"imageType"` ImageOwnerAlias string `xml:"imageOwnerAlias"` Name string `xml:"name"` RootDeviceType string `xml:"rootDeviceType"` VirtualizationType string `xml:"virtualizationType"` Hypervisor string `xml:"hypervisor"` BlockDeviceMappings []*BlockDeviceMapping `xml:"blockDeviceMapping>item"` ProductCodes []*ProductCode `xml:"productCodes>item"` Tags []*Tag `xml:"tagSet>item"` }
type ImageFilter ¶
type Instance ¶
type Instance struct { InstanceId string `xml:"instanceId"` ImageId string `xml:"imageId"` InstanceStateCode int `xml:"instanceState>code"` InstanceStateName string `xml:"instanceState>name"` PrivateDnsName string `xml:"privateDnsName"` DnsName string `xml:"dnsName"` Reason string `xml:"reason"` KeyName string `xml:"keyName"` AmiLaunchIndex int `xml:"amiLaunchIndex"` InstanceType string `xml:"instanceType"` LaunchTime time.Time `xml:"launchTime"` PlacementAvailabilityZone string `xml:"placement>availabilityZone"` PlacementTenancy string `xml:"placement>tenancy"` KernelId string `xml:"kernelId"` MonitoringState string `xml:"monitoring>state"` SubnetId string `xml:"subnetId"` VpcId string `xml:"vpcId"` PrivateIpAddress string `xml:"privateIpAddress"` IpAddress string `xml:"ipAddress"` SourceDestCheck string `xml:"sourceDestCheck"` Architecture string `xml:"architecture"` RootDeviceType string `xml:"rootDeviceType"` RootDeviceName string `xml:"rootDeviceName"` VirtualizationType string `xml:"virtualizationType"` ClientToken string `xml:"clientToken"` Hypervisor string `xml:"hypervisor"` EbsOptimized string `xml:"ebsOptimized"` BlockDeviceMappings []*BlockDeviceMapping `xml:"blockDeviceMapping>item"` SecurityGroups []*SecurityGroup `xml:"groupSet>item"` Tags []*Tag `xml:"tagSet>item"` NetworkInterfaces []*NetworkInterface `xml:"networkInterfaceSet>item"` IamInstanceProfile *IamInstanceProfile `xml:"iamInstanceProfile"` }
type InstanceList ¶
type InstanceList []*Instance
type IpPermission ¶
type IpPermission struct { IpProtocol string `xml:"ipProtocol,omitempty"` // tcp</ipProtocol> FromPort int `xml:"fromPort,omitempty"` // 80</fromPort> ToPort int `xml:"toPort,omitempty"` // 80</toPort> Groups []*SecurityGroup `xml:"groups>item,omitempty"` // IpRanges []string `xml:"ipRanges>item>cidrIp"` }
type NetworkInterface ¶
type NetworkInterface struct { NetworkInterfaceId string `xml:"networkInterfaceId"` SubnetId string `xml:"subnetId"` VpcId string `xml:"vpcId"` Description string `xml:"description"` OwnerId string `xml:"ownerId"` Status string `xml:"status"` MacAddress string `xml:"macAddress"` PrivateIpAddress string `xml:"privateIpAddress"` PrivateDnsName string `xml:"privateDnsName"` SourceDestCheck bool `xml:"sourceDestCheck"` SecurityGroups []*SecurityGroup `xml:"groupSet>item"` AttachmentAttachmentId string `xml:"attachment>attachmentId"` AttachmentDeviceIndex int `xml:"attachment>deviceIndex"` AttachmentStatus string `xml:"attachment>status"` AttachmentAttachTime time.Time `xml:"attachment>attachTime"` AttachmentDeleteOnTermination bool `xml:"attachment>deleteOnTermination"` AssociationPublicIp string `xml:"association>publicIp"` AssociationPublicDnsName string `xml:"association>publicDnsName"` AssociationIpOwnerId string `xml:"association>ipOwnerId"` PrivateIpAddresses []*IpAddress `xml:"privateIpAddressesSet>item"` }
type ProductCode ¶
type Reservation ¶
type RunInstances ¶
type RunInstances struct { InstanceType string ImageId string MinCount int MaxCount int KeyName string SecurityGroupIds []string SubnetId string UserData string AvailabilityZone string InstanceInitiatedShutdownBehavior string IamInstanceProfileName string BlockDeviceMapings []*BlockDeviceMapping NetworkInterfaces []*CreateNetworkInterface }
func (*RunInstances) AddPublicIp ¶
func (config *RunInstances) AddPublicIp()
func (*RunInstances) Execute ¶
func (action *RunInstances) Execute(client *Client) (*RunInstancesResponse, error)
type RunInstancesConfig ¶
type RunInstancesConfig struct { ImageId string `json:",omitempty"` MinCount int `json:",omitempty"` MaxCount int `json:",omitempty"` InstanceType string `json:",omitempty"` AvailabilityZone string `json:",omitempty"` KeyName string `json:",omitempty"` SecurityGroups []string `json:",omitempty"` SubnetId string `json:",omitempty"` NetworkInterfaces []*CreateNetworkInterface `json:",omitempty"` BlockDeviceMappings []*BlockDeviceMapping `json:",omitempty"` UserData string `json:",omitempty"` IamInstanceProfileName string `json:",omitempty"` EbsOptimized bool `json:",omitempty"` }
func (*RunInstancesConfig) AddPublicIp ¶
func (config *RunInstancesConfig) AddPublicIp() error
type RunInstancesResponse ¶
type SecurityGroup ¶
type SecurityGroup struct { OwnerId string `xml:"ownerId,omitempty"` // 111122223333</ownerId> GroupId string `xml:"groupId,omitempty"` // sg-1a2b3c4d</groupId> GroupName string `xml:"groupName,omitempty"` // WebServers</groupName> GroupDescription string `xml:"groupDescription,omitempty"` // Web Servers</groupDescription> VpcId string `xml:"vpcId,omitempty"` // IpPermissions []*IpPermission `xml:"ipPermissions>item"` }
type SpotPrice ¶
type SpotPrice struct { InstanceType string `xml:"instanceType"` // m1.small</instanceType> ProductDescription string `xml:"productDescription"` // Linux/UNIX</productDescription> SpotPrice float64 `xml:"spotPrice"` // 0.287</spotPrice> Timestamp time.Time `xml:"timestamp"` // 2009-12-04T20:56:05.000Z</timestamp> AvailabilityZone string `xml:"availabilityZone"` // us-east-1a</availabilityZone> }
type SpotPriceFilter ¶
type Subnet ¶
type Subnet struct { SubnetId string `xml:"subnetId"` State string `xml:"state"` VpcId string `xml:"vpcId"` CidrBlock string `xml:"cidrBlock"` AvailableIpAddressCount int `xml:"availableIpAddressCount"` AvailabilityZone string `xml:"availabilityZone"` DefaultForAz bool `xml:"defaultForAz"` MapPublicIpOnLaunch bool `xml:"mapPublicIpOnLaunch"` }
type Tag ¶
type Volume ¶
type Volume struct { VolumeId string `xml:"volumeId"` // vol-1a2b3c4d</volumeId> Size string `xml:"size"` // 80</size> SnapshotId string `xml:"snapshotId/"` // AvailabilityZone string `xml:"availabilityZone"` // us-east-1a</availabilityZone> Status string `xml:"status"` // in-use</status> CreateTime time.Time `xml:"createTime"` // YYYY-MM-DDTHH:MM:SS.SSSZ</createTime> Attachments []*Attachment `xml:"attachmentSet>item"` }
Click to show internal directories.
Click to hide internal directories.