171
171
// See http://goo.gl/Mcm3b for more details.
172
172
type EC2RunInstancesResp struct {
176
SecGroups []string "GroupSet>Item>GroupId"
177
Instances []EC2Instance "InstancesSet>Item"
176
SecurityGroups []string "GroupSet>Item>GroupId"
177
Instances []EC2Instance "InstancesSet>Item"
180
180
// EC2Instance encapsulates a running instance in EC2.
216
216
params["MinCount"] = strconv.Itoa(min)
217
217
params["MaxCount"] = strconv.Itoa(max)
218
for i, name := range options.SecGroups {
218
for i, name := range options.SecurityGroups {
219
219
params["SecurityGroup."+strconv.Itoa(i+1)] = name
221
221
params["ClientToken"] = strconv.Itoa64(time.Nanoseconds()) // XXX Fix this.
314
314
// See http://goo.gl/0ItPT for more details.
315
315
type EC2Reservation struct {
319
SecGroups []string "GroupSet>Item>GroupId"
320
Instances []EC2Instance "InstancesSet>Item"
319
SecurityGroups []string "GroupSet>Item>GroupId"
320
Instances []EC2Instance "InstancesSet>Item"
323
323
// Instances returns details about instances in EC2. Both parameters
352
// CreateSecGroup run a CreateSecurityGroup request in EC2, with the provided
352
// CreateSecurityGroup run a CreateSecurityGroup request in EC2, with the provided
353
353
// name and description.
355
355
// See http://goo.gl/Eo7Yl for more details.
356
func (ec2 *EC2) CreateSecGroup(name, description string) (resp *EC2SimpleResp, err os.Error) {
356
func (ec2 *EC2) CreateSecurityGroup(name, description string) (resp *EC2SimpleResp, err os.Error) {
357
357
params := makeParams("CreateSecurityGroup")
358
358
params["GroupName"] = name
359
359
params["GroupDescription"] = description
369
// EC2SecGroupsResp represents a response to a DescribeSecurityGroups
369
// EC2SecurityGroupsResp represents a response to a DescribeSecurityGroups
370
370
// request in EC2.
372
372
// See http://goo.gl/k12Uy for more details.
373
type EC2SecGroupsResp struct {
375
SecGroups []EC2SecGroup "SecurityGroupInfo>Item"
373
type EC2SecurityGroupsResp struct {
375
SecurityGroups []EC2SecurityGroup "SecurityGroupInfo>Item"
378
// EC2SecGroup encapsulates details for a security group in EC2.
378
// EC2SecurityGroup encapsulates details for a security group in EC2.
380
380
// See http://goo.gl/CIdyP for more details.
381
type EC2SecGroup struct {
381
type EC2SecurityGroup struct {
383
383
GroupName string "GroupName>"
384
384
GroupDescr string "GroupDescription>"
392
392
Protocol string "IPProtocol>"
395
SourceIPs []string "IPRanges>Item>CIDRIP"
396
SourceGroups []EC2SecGroupId "Groups>Item"
395
SourceIPs []string "IPRanges>Item>CIDRIP"
396
SourceGroups []EC2SecurityGroupId "Groups>Item"
399
// EC2SecGroupId is a globally unique identification for an EC2 security group.
400
type EC2SecGroupId struct {
399
// EC2SecurityGroupId is a globally unique identification for an EC2 security group.
400
type EC2SecurityGroupId struct {
401
401
OwnerId string "UserId>"
405
// SecGroups returns details about security groups in EC2. Both parameters
405
// SecurityGroups returns details about security groups in EC2. Both parameters
406
406
// are optional, and if provied will limit the security groups returned to those
407
407
// matching the given names or filtering rules.
409
409
// See http://goo.gl/k12Uy for more details.
410
func (ec2 *EC2) SecGroups(names []string, filter *Filter) (resp *EC2SecGroupsResp, err os.Error) {
410
func (ec2 *EC2) SecurityGroups(names []string, filter *Filter) (resp *EC2SecurityGroupsResp, err os.Error) {
411
411
params := makeParams("DescribeSecurityGroups")
412
412
for i, name := range names {
413
413
params["GroupName."+strconv.Itoa(i+1)] = name
415
415
filter.addParams(params)
417
resp = &EC2SecGroupsResp{}
417
resp = &EC2SecurityGroupsResp{}
418
418
err = ec2.query(params, resp)
425
// DelSecGroup removes the security group with the provided name in EC2.
425
// DeleteSecurityGroup removes the security group with the provided name in EC2.
427
427
// See http://goo.gl/QJJDO for more details.
428
func (ec2 *EC2) DelSecGroup(name string) (resp *EC2SimpleResp, err os.Error) {
428
func (ec2 *EC2) DeleteSecurityGroup(name string) (resp *EC2SimpleResp, err os.Error) {
429
429
params := makeParams("DeleteSecurityGroup")
430
430
params["GroupName"] = name
440
// AuthorizeSecGroup creates an allowance for clients matching the provided
440
// AuthorizeSecurityGroup creates an allowance for clients matching the provided
441
441
// rules to access instances within the named security group.
443
443
// See http://goo.gl/u2sDJ for more details.
444
func (ec2 *EC2) AuthorizeSecGroup(groupName string, perms []EC2IPPerm) (resp *EC2SimpleResp, err os.Error) {
444
func (ec2 *EC2) AuthorizeSecurityGroup(groupName string, perms []EC2IPPerm) (resp *EC2SimpleResp, err os.Error) {
445
445
params := makeParams("AuthorizeSecurityGroupIngress")
446
446
params["GroupName"] = groupName