This repository has been archived by the owner on Jul 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
describe_launch_configurations.go
84 lines (74 loc) · 3.17 KB
/
describe_launch_configurations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package autoscaling
import (
"encoding/xml"
"strconv"
"time"
)
func (action *DescribeLaunchConfigurations) Execute(client *Client) (*DescribeLaunchConfigurationsResponse, error) {
rsp := &DescribeLaunchConfigurationsResponse{}
e := client.Load("GET", action.query(), rsp)
return rsp, e
}
func (action *DescribeLaunchConfigurations) query() string {
values := Values{
"NextToken": action.NextToken,
"Action": "DescribeLaunchConfigurations",
"Version": "2011-01-01",
}
if action.MaxRecords > 0 {
values["MaxRecords"] = strconv.Itoa(action.MaxRecords)
}
for i, name := range action.LaunchConfigurationNames {
values["LaunchConfigurationNames.member."+strconv.Itoa(i+1)] = name
}
return values.query()
}
type DescribeLaunchConfigurations struct {
LaunchConfigurationNames []string `xml:",omitempty"`
MaxRecords int `xml:",omitempty"`
NextToken string `xml:",omitempty"`
}
type DescribeLaunchConfigurationsResponse struct {
XMLName xml.Name `xml:"DescribeLaunchConfigurationsResponse"`
DescribeLaunchConfigurationsResult *DescribeLaunchConfigurationsResult `xml:"DescribeLaunchConfigurationsResult,omitempty"`
}
type DescribeLaunchConfigurationsResult struct {
XMLName xml.Name `xml:"DescribeLaunchConfigurationsResult"`
LaunchConfigurations []*LaunchConfiguration `xml:"LaunchConfigurations>member,omitempty"`
NextToken string `xml:",omitempty"`
}
type LaunchConfiguration struct {
AssociatePublicIpAddress bool `xml:",omitempty"`
BlockDeviceMappings []*BlockDeviceMapping `xml:",omitempty"`
CreatedTime time.Time `xml:",omitempty"`
EbsOptimized bool `xml:",omitempty"`
IamInstanceProfile string `xml:",omitempty"`
ImageId string `xml:",omitempty"`
InstanceMonitoring *InstanceMonitoring `xml:",omitempty"`
InstanceType string `xml:",omitempty"`
KernelId string `xml:",omitempty"`
KeyName string `xml:",omitempty"`
LaunchConfigurationARN string `xml:",omitempty"`
LaunchConfigurationName string `xml:",omitempty"`
PlacementTenancy string `xml:",omitempty"`
RamdiskId string `xml:",omitempty"`
SecurityGroups []string `xml:"SecurityGroups>member,omitempty"`
SpotPrice string `xml:",omitempty"`
UserData string `xml:",omitempty"`
}
type BlockDeviceMapping struct {
DeviceName string `xml:",omitempty"`
Ebs *Ebs `xml:",omitempty"`
NoDevice bool `xml:",omitempty"`
VirtualName string `xml:",omitempty"`
}
type Ebs struct {
DeleteOnTermination bool `xml:",omitempty"`
Iops int `xml:",omitempty"`
SnapshotId string `xml:",omitempty"`
VolumeSize int `xml:",omitempty"`
VolumeType string `xml:",omitempty"`
}
type InstanceMonitoring struct {
Enabled bool `xml:",omitempty"`
}