amz

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorDuplicateGroup = "InvalidGroup.Duplicate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	AccessKey, SecretKey, SessionToken string
}

func GetAuth

func GetAuth(accessKey, secretKey, sessionToken string) Auth

type BlockDeviceMapping

type BlockDeviceMapping struct {
	DeviceName          string
	VirtualName         string
	VolumeSize          int64
	DeleteOnTermination bool
	VolumeType          string
}

type CreateKeyPairResponse

type CreateKeyPairResponse struct {
	KeyName        string `xml:"keyName"`
	KeyFingerprint string `xml:"keyFingerprint"`
	KeyMaterial    []byte `xml:"keyMaterial"`
}

type CreateSecurityGroupResponse

type CreateSecurityGroupResponse struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"`
	GroupId   string `xml:"groupId"`
}

type CreateTagsResponse

type CreateTagsResponse struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"`
}

type DeleteSecurityGroupResponse

type DeleteSecurityGroupResponse struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"`
}

type DescribeInstancesResponse

type DescribeInstancesResponse struct {
	RequestId      string `xml:"requestId"`
	ReservationSet []struct {
		InstancesSet []EC2Instance `xml:"instancesSet>item"`
	} `xml:"reservationSet>item"`
}

type DescribeKeyPairsResponse

type DescribeKeyPairsResponse struct {
	RequestId string    `xml:"requestId"`
	KeySet    []KeyPair `xml:"keySet>item"`
}

type DescribeSecurityGroupsResponse

type DescribeSecurityGroupsResponse struct {
	RequestId         string          `xml:"requestId"`
	SecurityGroupInfo []SecurityGroup `xml:"securityGroupInfo>item"`
}

type DescribeSpotInstanceRequestsResponse added in v0.3.0

type DescribeSpotInstanceRequestsResponse struct {
	RequestId              string `xml:"requestId"`
	SpotInstanceRequestSet []struct {
		Status struct {
			Code string `xml:"code"`
		} `xml:"status"`
		InstanceId string `xml:"instanceId"`
	} `xml:"spotInstanceRequestSet>item"`
}

type DescribeSubnetsResponse

type DescribeSubnetsResponse struct {
	RequestId string   `xml:"requestId"`
	SubnetSet []Subnet `xml:"subnetSet>item"`
}

type EC2

type EC2 struct {
	Endpoint string
	Auth     Auth
	Region   string
}

func NewEC2

func NewEC2(auth Auth, region string) *EC2

func (*EC2) AuthorizeSecurityGroup

func (e *EC2) AuthorizeSecurityGroup(groupId string, permissions []IpPermission) error

func (*EC2) CreateKeyPair

func (e *EC2) CreateKeyPair(name string) ([]byte, error)

func (*EC2) CreateSecurityGroup

func (e *EC2) CreateSecurityGroup(name string, description string, vpcId string) (*SecurityGroup, error)

func (*EC2) CreateTags

func (e *EC2) CreateTags(id string, tags map[string]string) error

func (*EC2) DeleteKeyPair

func (e *EC2) DeleteKeyPair(name string) error

func (*EC2) DeleteSecurityGroup

func (e *EC2) DeleteSecurityGroup(groupId string) error

func (*EC2) DescribeSpotInstanceRequests added in v0.3.0

func (e *EC2) DescribeSpotInstanceRequests(spotInstanceRequestId string) (string, string, error)

func (*EC2) GetInstance

func (e *EC2) GetInstance(instanceId string) (EC2Instance, error)

func (*EC2) GetKeyPair

func (e *EC2) GetKeyPair(name string) (*KeyPair, error)

func (*EC2) GetKeyPairs

func (e *EC2) GetKeyPairs() ([]KeyPair, error)

func (*EC2) GetSecurityGroupById

func (e *EC2) GetSecurityGroupById(id string) (*SecurityGroup, error)

func (*EC2) GetSecurityGroups

func (e *EC2) GetSecurityGroups() ([]SecurityGroup, error)

func (*EC2) GetSubnets

func (e *EC2) GetSubnets(filters []Filter) ([]Subnet, error)

func (*EC2) ImportKeyPair

func (e *EC2) ImportKeyPair(name, publicKey string) error

func (*EC2) RequestSpotInstances added in v0.3.0

func (e *EC2) RequestSpotInstances(amiId string, instanceType string, zone string, instanceCount int, securityGroup string, keyName string, subnetId string, bdm *BlockDeviceMapping, role string, spotPrice string, monitoring bool) (string, error)

func (*EC2) RestartInstance

func (e *EC2) RestartInstance(instanceId string) error

func (*EC2) RunInstance

func (e *EC2) RunInstance(amiId string, instanceType string, zone string, minCount int, maxCount int, securityGroup string, keyName string, subnetId string, bdm *BlockDeviceMapping, role string, privateIPOnly bool, monitoring bool) (EC2Instance, error)

func (*EC2) StartInstance

func (e *EC2) StartInstance(instanceId string) error

func (*EC2) StopInstance

func (e *EC2) StopInstance(instanceId string, force bool) error

func (*EC2) TerminateInstance

func (e *EC2) TerminateInstance(instanceId string) error

type EC2Instance

type EC2Instance struct {
	InstanceId    string `xml:"instanceId"`
	ImageId       string `xml:"imageId"`
	InstanceState struct {
		Code int    `xml:"code"`
		Name string `xml:"name"`
	} `xml:"instanceState"`
	PrivateDnsName string `xml:"privateDnsName"`
	DnsName        string `xml:"dnsName"`
	Reason         string `xml:"reason"`
	AmiLaunchIndex string `xml:"amiLaunchIndex"`
	ProductCodes   string `xml:"productCodes"`
	InstanceType   string `xml:"instanceType"`
	LaunchTime     string `xml:"launchTime"`
	Placement      struct {
		AvailabilityZone string `xml:"availabilityZone"`
		GroupName        string `xml:"groupName"`
		Tenancy          string `xml:"tenancy"`
	} `xml:"placement"`
	KernelId   string `xml:"kernelId"`
	Monitoring struct {
		State string `xml:"state"`
	} `xml:"monitoring"`
	SubnetId         string `xml:"subnetId"`
	VpcId            string `xml:"vpcId"`
	IpAddress        string `xml:"ipAddress"`
	PrivateIpAddress string `xml:"privateIpAddress"`
	SourceDestCheck  bool   `xml:"sourceDestCheck"`
	GroupSet         []struct {
		GroupId   string `xml:"groupId"`
		GroupName string `xml:"groupName"`
	} `xml:"groupSet"`
	StateReason struct {
		Code    string `xml:"code"`
		Message string `xml:"message"`
	} `xml:"stateReason"`
	Architecture        string `xml:"architecture"`
	RootDeviceType      string `xml:"rootDeviceType"`
	RootDeviceName      string `xml:"rootDeviceName"`
	BlockDeviceMapping  string `xml:"blockDeviceMapping"`
	VirtualizationType  string `xml:"virtualizationType"`
	ClientToken         string `xml:"clientToken"`
	Hypervisor          string `xml:"hypervisor"`
	NetworkInterfaceSet []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    string `xml:"sourceDestCheck"`
		GroupSet           []struct {
			GroupId   string `xml:"groupId"`
			GroupName string `xml:"groupName"`
		} `xml:"groupSet>item"`
		Attachment struct {
			AttachmentId        string `xml:"attachmentId"`
			DeviceIndex         string `xml:"deviceIndex"`
			Status              string `xml:"status"`
			AttachTime          string `xml:"attachTime"`
			DeleteOnTermination bool   `xml:"deleteOnTermination"`
		} `xml:"attachment"`
		PrivateIpAddressesSet []struct {
			PrivateIpAddress string `xml:"privateIpAddress"`
			PrivateDnsName   string `xml:"privateDnsName"`
			Primary          bool   `xml:"primary"`
		} `xml:"privateIpAddressesSet>item"`
	} `xml:"networkInterfaceSet>item"`
	EbsOptimized bool `xml:"ebsOptimized"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []struct {
		Code    string
		Message string
	} `xml:"Errors>Error"`
	RequestID string
}

type Filter added in v0.2.0

type Filter struct {
	Name  string
	Value string
}

type ImportKeyPairResponse

type ImportKeyPairResponse struct {
	KeyName        string `xml:"keyName"`
	KeyFingerprint string `xml:"keyFingerprint"`
	KeyMaterial    []byte `xml:"keyMaterial"`
}

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

type IpPermission

type IpPermission struct {
	IpProtocol string `xml:"ipProtocol"`
	FromPort   int    `xml:"fromPort"`
	ToPort     int    `xml:"toPort"`
	IpRange    string `xml:"ipRanges"`
}

type KeyPair

type KeyPair struct {
	KeyFingerprint string `xml:"keyFingerprint"`
	KeyName        string `xml:"keyName"`
}

type RequestSpotInstancesResponse added in v0.3.0

type RequestSpotInstancesResponse struct {
	RequestId              string `xml:"requestId"`
	SpotInstanceRequestSet []struct {
		SpotInstanceRequestId string `xml:"spotInstanceRequestId"`
		State                 string `xml:"state"`
	} `xml:"spotInstanceRequestSet>item"`
}

type RunInstancesResponse

type RunInstancesResponse struct {
	RequestId     string        `xml:"requestId"`
	ReservationId string        `xml:"reservationId"`
	OwnerId       string        `xml:"ownerId"`
	Instances     []EC2Instance `xml:"instancesSet>item"`
}

type SecurityGroup

type SecurityGroup struct {
	GroupName           string         `xml:"groupName"`
	GroupId             string         `xml:"groupId"`
	VpcId               string         `xml:"vpcId"`
	OwnerId             string         `xml:"ownerId"`
	IpPermissions       []IpPermission `xml:"ipPermissions>item,omitempty"`
	IpPermissionsEgress []IpPermission `xml:"ipPermissionsEgress>item,omitempty"`
}

type Subnet

type Subnet struct {
	SubnetId         string `xml:"subnetId"`
	State            string `xml:"state"`
	VpcId            string `xml:"vpcId"`
	CidrBlock        string `xml:"cidrBlock"`
	AvailabilityZone string `xml:"availabilityZone"`
	DefaultForAz     bool   `xml:"defaultForAz"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL