diff options
Diffstat (limited to 'vendor/github.com/goamz/goamz/autoscaling')
3 files changed, 0 insertions, 3575 deletions
diff --git a/vendor/github.com/goamz/goamz/autoscaling/autoscaling.go b/vendor/github.com/goamz/goamz/autoscaling/autoscaling.go deleted file mode 100644 index 8e9f8ab02..000000000 --- a/vendor/github.com/goamz/goamz/autoscaling/autoscaling.go +++ /dev/null @@ -1,1768 +0,0 @@ -// -// autoscaling: This package provides types and functions to interact with the AWS Auto Scale API -// -// Depends on https://wiki.ubuntu.com/goamz -// - -package autoscaling - -import ( - "encoding/base64" - "encoding/xml" - "fmt" - "log" - "net/http" - "net/http/httputil" - "net/url" - "sort" - "strconv" - "strings" - "time" - - "github.com/goamz/goamz/aws" -) - -const debug = false - -var timeNow = time.Now - -// AutoScaling contains the details of the AWS region to perform operations against. -type AutoScaling struct { - aws.Auth - aws.Region -} - -// New creates a new AutoScaling Client. -func New(auth aws.Auth, region aws.Region) *AutoScaling { - return &AutoScaling{auth, region} -} - -// ---------------------------------------------------------------------------- -// Request dispatching logic. - -// Error encapsulates an error returned by the AWS Auto Scaling API. -// -// See http://goo.gl/VZGuC for more details. -type Error struct { - // HTTP status code (200, 403, ...) - StatusCode int - // AutoScaling error code ("UnsupportedOperation", ...) - Code string - // The error type - Type string - // The human-oriented error message - Message string - RequestId string `xml:"RequestID"` -} - -func (err *Error) Error() string { - if err.Code == "" { - return err.Message - } - - return fmt.Sprintf("%s (%s)", err.Message, err.Code) -} - -type xmlErrors struct { - RequestId string `xml:"RequestId"` - Errors []Error `xml:"Error"` -} - -func (as *AutoScaling) query(params map[string]string, resp interface{}) error { - params["Version"] = "2011-01-01" - data := strings.NewReader(multimap(params).Encode()) - - hreq, err := http.NewRequest("POST", as.Region.AutoScalingEndpoint+"/", data) - if err != nil { - return err - } - - hreq.Header.Set("Content-Type", "application/x-www-form-urlencoded; param=value") - - token := as.Auth.Token() - if token != "" { - hreq.Header.Set("X-Amz-Security-Token", token) - } - - signer := aws.NewV4Signer(as.Auth, "autoscaling", as.Region) - signer.Sign(hreq) - - if debug { - log.Printf("%v -> {\n", hreq) - } - r, err := http.DefaultClient.Do(hreq) - - if err != nil { - log.Printf("Error calling Amazon %v", err) - return err - } - - defer r.Body.Close() - - if debug { - dump, _ := httputil.DumpResponse(r, true) - log.Printf("response:\n") - log.Printf("%v\n}\n", string(dump)) - } - if r.StatusCode != 200 { - return buildError(r) - } - err = xml.NewDecoder(r.Body).Decode(resp) - return err -} - -func buildError(r *http.Response) error { - var ( - err Error - errors xmlErrors - ) - xml.NewDecoder(r.Body).Decode(&errors) - if len(errors.Errors) > 0 { - err = errors.Errors[0] - } - - err.RequestId = errors.RequestId - err.StatusCode = r.StatusCode - if err.Message == "" { - err.Message = r.Status - } - return &err -} - -func multimap(p map[string]string) url.Values { - q := make(url.Values, len(p)) - for k, v := range p { - q[k] = []string{v} - } - return q -} - -func makeParams(action string) map[string]string { - params := make(map[string]string) - params["Action"] = action - return params -} - -func addParamsList(params map[string]string, label string, ids []string) { - for i, id := range ids { - params[label+"."+strconv.Itoa(i+1)] = id - } -} - -// ---------------------------------------------------------------------------- -// Filtering helper. - -// Filter builds filtering parameters to be used in an autoscaling query which supports -// filtering. For example: -// -// filter := NewFilter() -// filter.Add("architecture", "i386") -// filter.Add("launch-index", "0") -// resp, err := as.DescribeTags(filter,nil,nil) -// -type Filter struct { - m map[string][]string -} - -// NewFilter creates a new Filter. -func NewFilter() *Filter { - return &Filter{make(map[string][]string)} -} - -// Add appends a filtering parameter with the given name and value(s). -func (f *Filter) Add(name string, value ...string) { - f.m[name] = append(f.m[name], value...) -} - -func (f *Filter) addParams(params map[string]string) { - if f != nil { - a := make([]string, len(f.m)) - i := 0 - for k := range f.m { - a[i] = k - i++ - } - sort.StringSlice(a).Sort() - for i, k := range a { - prefix := "Filters.member." + strconv.Itoa(i+1) - params[prefix+".Name"] = k - for j, v := range f.m[k] { - params[prefix+".Values.member."+strconv.Itoa(j+1)] = v - } - } - } -} - -// ---------------------------------------------------------------------------- -// Auto Scaling base types and related functions. - -// SimpleResp is the basic response from most actions. -type SimpleResp struct { - XMLName xml.Name - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// EnabledMetric encapsulates a metric associated with an Auto Scaling Group -// -// See http://goo.gl/hXiH17 for more details -type EnabledMetric struct { - Granularity string `xml:"Granularity"` // The granularity of the enabled metric. - Metric string `xml:"Metric"` // The name of the enabled metric. -} - -// Instance encapsulates an instance type as returned by the Auto Scaling API -// -// See http://goo.gl/NwBxGh and http://goo.gl/OuoqhS for more details. -type Instance struct { - // General instance information - AutoScalingGroupName string `xml:"AutoScalingGroupName"` - AvailabilityZone string `xml:"AvailabilityZone"` - HealthStatus string `xml:"HealthStatus"` - InstanceId string `xml:"InstanceId"` - LaunchConfigurationName string `xml:"LaunchConfigurationName"` - LifecycleState string `xml:"LifecycleState"` -} - -// SuspenedProcess encapsulates an Auto Scaling process that has been suspended -// -// See http://goo.gl/iObPgF for more details -type SuspendedProcess struct { - ProcessName string `xml:"ProcessName"` - SuspensionReason string `xml:"SuspensionReason"` -} - -// Tag encapsulates tag applied to an Auto Scaling group. -// -// See http://goo.gl/MG1hqs for more details -type Tag struct { - Key string `xml:"Key"` - PropagateAtLaunch bool `xml:"PropagateAtLaunch"` // Specifies whether the new tag will be applied to instances launched after the tag is created - ResourceId string `xml:"ResourceId"` // the name of the Auto Scaling group - not required if creating ASG - ResourceType string `xml:"ResourceType"` // currently only auto-scaling-group is supported - not required if creating ASG - Value string `xml:"Value"` -} - -// AutoScalingGroup encapsulates an Auto Scaling Group object -// -// See http://goo.gl/fJdYhg for more details. -type AutoScalingGroup struct { - AutoScalingGroupARN string `xml:"AutoScalingGroupARN"` - AutoScalingGroupName string `xml:"AutoScalingGroupName"` - AvailabilityZones []string `xml:"AvailabilityZones>member"` - CreatedTime time.Time `xml:"CreatedTime"` - DefaultCooldown int `xml:"DefaultCooldown"` - DesiredCapacity int `xml:"DesiredCapacity"` - EnabledMetrics []EnabledMetric `xml:"EnabledMetric>member"` - HealthCheckGracePeriod int `xml:"HealthCheckGracePeriod"` - HealthCheckType string `xml:"HealthCheckType"` - Instances []Instance `xml:"Instances>member"` - LaunchConfigurationName string `xml:"LaunchConfigurationName"` - LoadBalancerNames []string `xml:"LoadBalancerNames>member"` - MaxSize int `xml:"MaxSize"` - MinSize int `xml:"MinSize"` - PlacementGroup string `xml:"PlacementGroup"` - Status string `xml:"Status"` - SuspendedProcesses []SuspendedProcess `xml:"SuspendedProcesses>member"` - Tags []Tag `xml:"Tags>member"` - TerminationPolicies []string `xml:"TerminationPolicies>member"` - VPCZoneIdentifier string `xml:"VPCZoneIdentifier"` -} - -// CreateAutoScalingGroupParams type encapsulates options for the respective request. -// -// See http://goo.gl/3S13Bv for more details. -type CreateAutoScalingGroupParams struct { - AutoScalingGroupName string - AvailabilityZones []string - DefaultCooldown int - DesiredCapacity int - HealthCheckGracePeriod int - HealthCheckType string - InstanceId string - LaunchConfigurationName string - LoadBalancerNames []string - MaxSize int - MinSize int - PlacementGroup string - Tags []Tag - TerminationPolicies []string - VPCZoneIdentifier string -} - -// AttachInstances Attach running instances to an autoscaling group -// -// See http://goo.gl/zDZbuQ for more details. -func (as *AutoScaling) AttachInstances(name string, instanceIds []string) (resp *SimpleResp, err error) { - params := makeParams("AttachInstances") - params["AutoScalingGroupName"] = name - - for i, id := range instanceIds { - key := fmt.Sprintf("InstanceIds.member.%d", i+1) - params[key] = id - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// CreateAutoScalingGroup creates an Auto Scaling Group on AWS -// -// Required params: AutoScalingGroupName, MinSize, MaxSize -// -// See http://goo.gl/3S13Bv for more details. -func (as *AutoScaling) CreateAutoScalingGroup(options *CreateAutoScalingGroupParams) ( - resp *SimpleResp, err error) { - params := makeParams("CreateAutoScalingGroup") - - params["AutoScalingGroupName"] = options.AutoScalingGroupName - params["MaxSize"] = strconv.Itoa(options.MaxSize) - params["MinSize"] = strconv.Itoa(options.MinSize) - params["DesiredCapacity"] = strconv.Itoa(options.DesiredCapacity) - - if options.DefaultCooldown > 0 { - params["DefaultCooldown"] = strconv.Itoa(options.DefaultCooldown) - } - if options.HealthCheckGracePeriod > 0 { - params["HealthCheckGracePeriod"] = strconv.Itoa(options.HealthCheckGracePeriod) - } - if options.HealthCheckType != "" { - params["HealthCheckType"] = options.HealthCheckType - } - if options.InstanceId != "" { - params["InstanceId"] = options.InstanceId - } - if options.LaunchConfigurationName != "" { - params["LaunchConfigurationName"] = options.LaunchConfigurationName - } - if options.PlacementGroup != "" { - params["PlacementGroup"] = options.PlacementGroup - } - if options.VPCZoneIdentifier != "" { - params["VPCZoneIdentifier"] = options.VPCZoneIdentifier - } - if len(options.LoadBalancerNames) > 0 { - addParamsList(params, "LoadBalancerNames.member", options.LoadBalancerNames) - } - if len(options.AvailabilityZones) > 0 { - addParamsList(params, "AvailabilityZones.member", options.AvailabilityZones) - } - if len(options.TerminationPolicies) > 0 { - addParamsList(params, "TerminationPolicies.member", options.TerminationPolicies) - } - for i, t := range options.Tags { - key := "Tags.member.%d.%s" - index := i + 1 - params[fmt.Sprintf(key, index, "Key")] = t.Key - params[fmt.Sprintf(key, index, "Value")] = t.Value - params[fmt.Sprintf(key, index, "PropagateAtLaunch")] = strconv.FormatBool(t.PropagateAtLaunch) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// EBS represents the AWS EBS volume data type -// -// See http://goo.gl/nDUL2h for more details -type EBS struct { - DeleteOnTermination bool `xml:"DeleteOnTermination"` - Iops int `xml:"Iops"` - SnapshotId string `xml:"SnapshotId"` - VolumeSize int `xml:"VolumeSize"` - VolumeType string `xml:"VolumeType"` -} - -// BlockDeviceMapping represents the association of a block device with ebs volume. -// -// See http://goo.gl/wEGwkU for more details. -type BlockDeviceMapping struct { - DeviceName string `xml:"DeviceName"` - Ebs EBS `xml:"Ebs"` - NoDevice bool `xml:"NoDevice"` - VirtualName string `xml:"VirtualName"` -} - -// InstanceMonitoring data type -// -// See http://goo.gl/TfaPwz for more details -type InstanceMonitoring struct { - Enabled bool `xml:"Enabled"` -} - -// LaunchConfiguration encapsulates the LaunchConfiguration Data Type -// -// See http://goo.gl/TOJunp -type LaunchConfiguration struct { - AssociatePublicIpAddress bool `xml:"AssociatePublicIpAddress"` - BlockDeviceMappings []BlockDeviceMapping `xml:"BlockDeviceMappings>member"` - CreatedTime time.Time `xml:"CreatedTime"` - EbsOptimized bool `xml:"EbsOptimized"` - IamInstanceProfile string `xml:"IamInstanceProfile"` - ImageId string `xml:"ImageId"` - InstanceId string `xml:"InstanceId"` - InstanceMonitoring InstanceMonitoring `xml:"InstanceMonitoring"` - InstanceType string `xml:"InstanceType"` - KernelId string `xml:"KernelId"` - KeyName string `xml:"KeyName"` - LaunchConfigurationARN string `xml:"LaunchConfigurationARN"` - LaunchConfigurationName string `xml:"LaunchConfigurationName"` - RamdiskId string `xml:"RamdiskId"` - SecurityGroups []string `xml:"SecurityGroups>member"` - SpotPrice string `xml:"SpotPrice"` - UserData string `xml:"UserData"` -} - -// CreateLaunchConfiguration creates a launch configuration -// -// Required params: AutoScalingGroupName, MinSize, MaxSize -// -// See http://goo.gl/8e0BSF for more details. -func (as *AutoScaling) CreateLaunchConfiguration(lc *LaunchConfiguration) ( - resp *SimpleResp, err error) { - - var b64 = base64.StdEncoding - - params := makeParams("CreateLaunchConfiguration") - params["LaunchConfigurationName"] = lc.LaunchConfigurationName - - if lc.AssociatePublicIpAddress { - params["AssociatePublicIpAddress"] = strconv.FormatBool(lc.AssociatePublicIpAddress) - } - if lc.EbsOptimized { - params["EbsOptimized"] = strconv.FormatBool(lc.EbsOptimized) - } - if lc.IamInstanceProfile != "" { - params["IamInstanceProfile"] = lc.IamInstanceProfile - } - if lc.ImageId != "" { - params["ImageId"] = lc.ImageId - } - if lc.InstanceId != "" { - params["InstanceId"] = lc.InstanceId - } - if lc.InstanceMonitoring != (InstanceMonitoring{}) { - params["InstanceMonitoring.Enabled"] = strconv.FormatBool(lc.InstanceMonitoring.Enabled) - } - if lc.InstanceType != "" { - params["InstanceType"] = lc.InstanceType - } - if lc.KernelId != "" { - params["KernelId"] = lc.KernelId - } - if lc.KeyName != "" { - params["KeyName"] = lc.KeyName - } - if lc.RamdiskId != "" { - params["RamdiskId"] = lc.RamdiskId - } - if lc.SpotPrice != "" { - params["SpotPrice"] = lc.SpotPrice - } - if lc.UserData != "" { - params["UserData"] = b64.EncodeToString([]byte(lc.UserData)) - } - - // Add our block device mappings - for i, bdm := range lc.BlockDeviceMappings { - key := "BlockDeviceMappings.member.%d.%s" - index := i + 1 - params[fmt.Sprintf(key, index, "DeviceName")] = bdm.DeviceName - params[fmt.Sprintf(key, index, "VirtualName")] = bdm.VirtualName - - if bdm.NoDevice { - params[fmt.Sprintf(key, index, "NoDevice")] = "true" - } - - if bdm.Ebs != (EBS{}) { - key := "BlockDeviceMappings.member.%d.Ebs.%s" - - // Defaults to true - params[fmt.Sprintf(key, index, "DeleteOnTermination")] = strconv.FormatBool(bdm.Ebs.DeleteOnTermination) - - if bdm.Ebs.Iops > 0 { - params[fmt.Sprintf(key, index, "Iops")] = strconv.Itoa(bdm.Ebs.Iops) - } - if bdm.Ebs.SnapshotId != "" { - params[fmt.Sprintf(key, index, "SnapshotId")] = bdm.Ebs.SnapshotId - } - if bdm.Ebs.VolumeSize > 0 { - params[fmt.Sprintf(key, index, "VolumeSize")] = strconv.Itoa(bdm.Ebs.VolumeSize) - } - if bdm.Ebs.VolumeType != "" { - params[fmt.Sprintf(key, index, "VolumeType")] = bdm.Ebs.VolumeType - } - } - } - - if len(lc.SecurityGroups) > 0 { - addParamsList(params, "SecurityGroups.member", lc.SecurityGroups) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// CreateOrUpdateTags creates or updates Auto Scaling Group Tags -// -// See http://goo.gl/e1UIXb for more details. -func (as *AutoScaling) CreateOrUpdateTags(tags []Tag) (resp *SimpleResp, err error) { - params := makeParams("CreateOrUpdateTags") - - for i, t := range tags { - key := "Tags.member.%d.%s" - index := i + 1 - params[fmt.Sprintf(key, index, "Key")] = t.Key - params[fmt.Sprintf(key, index, "Value")] = t.Value - params[fmt.Sprintf(key, index, "PropagateAtLaunch")] = strconv.FormatBool(t.PropagateAtLaunch) - params[fmt.Sprintf(key, index, "ResourceId")] = t.ResourceId - if t.ResourceType != "" { - params[fmt.Sprintf(key, index, "ResourceType")] = t.ResourceType - } else { - params[fmt.Sprintf(key, index, "ResourceType")] = "auto-scaling-group" - } - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -type CompleteLifecycleActionParams struct { - AutoScalingGroupName string - LifecycleActionResult string - LifecycleActionToken string - LifecycleHookName string -} - -// CompleteLifecycleAction completes the lifecycle action for the associated token initiated under the given lifecycle hook with the specified result. -// -// Part of the basic sequence for adding a lifecycle hook to an Auto Scaling group: -// 1) Create a notification target (SQS queue || SNS Topic) -// 2) Create an IAM role to allow the ASG topublish lifecycle notifications to the designated SQS queue or SNS topic -// 3) Create the lifecycle hook. You can create a hook that acts when instances launch or when instances terminate -// 4) If necessary, record the lifecycle action heartbeat to keep the instance in a pending state -// 5) ***Complete the lifecycle action*** -// -// See http://goo.gl/k4fl0p for more details -func (as *AutoScaling) CompleteLifecycleAction(options *CompleteLifecycleActionParams) ( - resp *SimpleResp, err error) { - params := makeParams("CompleteLifecycleAction") - - params["AutoScalingGroupName"] = options.AutoScalingGroupName - params["LifecycleActionResult"] = options.LifecycleActionResult - params["LifecycleActionToken"] = options.LifecycleActionToken - params["LifecycleHookName"] = options.LifecycleHookName - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DeleteAutoScalingGroup deletes an Auto Scaling Group -// -// See http://goo.gl/us7VSffor for more details. -func (as *AutoScaling) DeleteAutoScalingGroup(asgName string, forceDelete bool) ( - resp *SimpleResp, err error) { - params := makeParams("DeleteAutoScalingGroup") - params["AutoScalingGroupName"] = asgName - - if forceDelete { - params["ForceDelete"] = "true" - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DeleteLaunchConfiguration deletes a Launch Configuration -// -// See http://goo.gl/xksfyR for more details. -func (as *AutoScaling) DeleteLaunchConfiguration(name string) (resp *SimpleResp, err error) { - params := makeParams("DeleteLaunchConfiguration") - params["LaunchConfigurationName"] = name - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DeleteLifecycleHook eletes the specified lifecycle hook. -// If there are any outstanding lifecycle actions, they are completed first -// -// See http://goo.gl/MwX1vG for more details. -func (as *AutoScaling) DeleteLifecycleHook(asgName, lifecycleHookName string) (resp *SimpleResp, err error) { - params := makeParams("DeleteLifecycleHook") - params["AutoScalingGroupName"] = asgName - params["LifecycleHookName"] = lifecycleHookName - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DeleteNotificationConfiguration deletes notifications created by PutNotificationConfiguration. -// -// See http://goo.gl/jTqoYz for more details -func (as *AutoScaling) DeleteNotificationConfiguration(asgName string, topicARN string) ( - resp *SimpleResp, err error) { - params := makeParams("DeleteNotificationConfiguration") - params["AutoScalingGroupName"] = asgName - params["TopicARN"] = topicARN - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DeletePolicy deletes a policy created by PutScalingPolicy. -// -// policyName might be the policy name or ARN -// -// See http://goo.gl/aOQPH2 for more details -func (as *AutoScaling) DeletePolicy(asgName string, policyName string) (resp *SimpleResp, err error) { - params := makeParams("DeletePolicy") - params["AutoScalingGroupName"] = asgName - params["PolicyName"] = policyName - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DeleteScheduledAction deletes a scheduled action previously created using the PutScheduledUpdateGroupAction. -// -// See http://goo.gl/Zss9CH for more details -func (as *AutoScaling) DeleteScheduledAction(asgName string, scheduledActionName string) (resp *SimpleResp, err error) { - params := makeParams("DeleteScheduledAction") - params["AutoScalingGroupName"] = asgName - params["ScheduledActionName"] = scheduledActionName - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DeleteTags deletes autoscaling group tags -// -// See http://goo.gl/o8HzAk for more details. -func (as *AutoScaling) DeleteTags(tags []Tag) (resp *SimpleResp, err error) { - params := makeParams("DeleteTags") - - for i, t := range tags { - key := "Tags.member.%d.%s" - index := i + 1 - params[fmt.Sprintf(key, index, "Key")] = t.Key - params[fmt.Sprintf(key, index, "Value")] = t.Value - params[fmt.Sprintf(key, index, "PropagateAtLaunch")] = strconv.FormatBool(t.PropagateAtLaunch) - params[fmt.Sprintf(key, index, "ResourceId")] = t.ResourceId - params[fmt.Sprintf(key, index, "ResourceType")] = "auto-scaling-group" - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -//DescribeAccountLimits response wrapper -// -// See http://goo.gl/tKsMN0 for more details. -type DescribeAccountLimitsResp struct { - MaxNumberOfAutoScalingGroups int `xml:"DescribeAccountLimitsResult>MaxNumberOfAutoScalingGroups"` - MaxNumberOfLaunchConfigurations int `xml:"DescribeAccountLimitsResult>MaxNumberOfLaunchConfigurations"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeAccountLimits - Returns the limits for the Auto Scaling resources currently allowed for your AWS account. -// -// See http://goo.gl/tKsMN0 for more details. -func (as *AutoScaling) DescribeAccountLimits() (resp *DescribeAccountLimitsResp, err error) { - params := makeParams("DescribeAccountLimits") - - resp = new(DescribeAccountLimitsResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// AdjustmentType specifies whether the PutScalingPolicy ScalingAdjustment parameter is an absolute number or a percentage of the current capacity. -// -// See http://goo.gl/tCFqeL for more details -type AdjustmentType struct { - AdjustmentType string //Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity. -} - -//DescribeAdjustmentTypes response wrapper -// -// See http://goo.gl/hGx3Pc for more details. -type DescribeAdjustmentTypesResp struct { - AdjustmentTypes []AdjustmentType `xml:"DescribeAdjustmentTypesResult>AdjustmentTypes>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeAdjustmentTypes returns policy adjustment types for use in the PutScalingPolicy action. -// -// See http://goo.gl/hGx3Pc for more details. -func (as *AutoScaling) DescribeAdjustmentTypes() (resp *DescribeAdjustmentTypesResp, err error) { - params := makeParams("DescribeAdjustmentTypes") - - resp = new(DescribeAdjustmentTypesResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DescribeAutoScalingGroups response wrapper -// -// See http://goo.gl/nW74Ut for more details. -type DescribeAutoScalingGroupsResp struct { - AutoScalingGroups []AutoScalingGroup `xml:"DescribeAutoScalingGroupsResult>AutoScalingGroups>member"` - NextToken string `xml:"DescribeAutoScalingGroupsResult>NextToken"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeAutoScalingGroups returns a full description of each Auto Scaling group in the given list -// If no autoscaling groups are provided, returns the details of all autoscaling groups -// Supports pagination by using the returned "NextToken" parameter for subsequent calls -// -// See http://goo.gl/nW74Ut for more details. -func (as *AutoScaling) DescribeAutoScalingGroups(names []string, maxRecords int, nextToken string) ( - resp *DescribeAutoScalingGroupsResp, err error) { - params := makeParams("DescribeAutoScalingGroups") - - if maxRecords != 0 { - params["MaxRecords"] = strconv.Itoa(maxRecords) - } - if nextToken != "" { - params["NextToken"] = nextToken - } - if len(names) > 0 { - addParamsList(params, "AutoScalingGroupNames.member", names) - } - - resp = new(DescribeAutoScalingGroupsResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DescribeAutoScalingInstances response wrapper -// -// See http://goo.gl/ckzORt for more details. -type DescribeAutoScalingInstancesResp struct { - AutoScalingInstances []Instance `xml:"DescribeAutoScalingInstancesResult>AutoScalingInstances>member"` - NextToken string `xml:"DescribeAutoScalingInstancesResult>NextToken"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeAutoScalingInstances returns a description of each Auto Scaling instance in the InstanceIds list. -// If a list is not provided, the service returns the full details of all instances up to a maximum of 50 -// By default, the service returns a list of 20 items. -// Supports pagination by using the returned "NextToken" parameter for subsequent calls -// -// See http://goo.gl/ckzORt for more details. -func (as *AutoScaling) DescribeAutoScalingInstances(ids []string, maxRecords int, nextToken string) ( - resp *DescribeAutoScalingInstancesResp, err error) { - params := makeParams("DescribeAutoScalingInstances") - - if maxRecords != 0 { - params["MaxRecords"] = strconv.Itoa(maxRecords) - } - if nextToken != "" { - params["NextToken"] = nextToken - } - if len(ids) > 0 { - addParamsList(params, "InstanceIds.member", ids) - } - - resp = new(DescribeAutoScalingInstancesResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DescribeAutoScalingNotificationTypes response wrapper -// -// See http://goo.gl/pmLIoE for more details. -type DescribeAutoScalingNotificationTypesResp struct { - AutoScalingNotificationTypes []string `xml:"DescribeAutoScalingNotificationTypesResult>AutoScalingNotificationTypes>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeAutoScalingNotificationTypes returns a list of all notification types that are supported by Auto Scaling -// -// See http://goo.gl/pmLIoE for more details. -func (as *AutoScaling) DescribeAutoScalingNotificationTypes() (resp *DescribeAutoScalingNotificationTypesResp, err error) { - params := makeParams("DescribeAutoScalingNotificationTypes") - - resp = new(DescribeAutoScalingNotificationTypesResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DescribeLaunchConfigurationResp defines the basic response structure for launch configuration -// requests -// -// See http://goo.gl/y31YYE for more details. -type DescribeLaunchConfigurationsResp struct { - LaunchConfigurations []LaunchConfiguration `xml:"DescribeLaunchConfigurationsResult>LaunchConfigurations>member"` - NextToken string `xml:"DescribeLaunchConfigurationsResult>NextToken"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeLaunchConfigurations returns details about the launch configurations supplied in -// the list. If the list is nil, information is returned about all launch configurations in the -// region. -// -// See http://goo.gl/y31YYE for more details. -func (as *AutoScaling) DescribeLaunchConfigurations(names []string, maxRecords int, nextToken string) ( - resp *DescribeLaunchConfigurationsResp, err error) { - params := makeParams("DescribeLaunchConfigurations") - - if maxRecords != 0 { - params["MaxRecords"] = strconv.Itoa(maxRecords) - } - if nextToken != "" { - params["NextToken"] = nextToken - } - if len(names) > 0 { - addParamsList(params, "LaunchConfigurationNames.member", names) - } - - resp = new(DescribeLaunchConfigurationsResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - - return resp, nil -} - -// DescribeLifecycleHookTypesResult wraps a DescribeLifecycleHookTypes response -// -// See http://goo.gl/qiAH31 for more details. -type DescribeLifecycleHookTypesResult struct { - LifecycleHookTypes []string `xml:"DescribeLifecycleHookTypesResult>LifecycleHookTypes>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeLifecycleHookTypes describes the available types of lifecycle hooks -// -// See http://goo.gl/E9IBtY for more information -func (as *AutoScaling) DescribeLifecycleHookTypes() ( - resp *DescribeLifecycleHookTypesResult, err error) { - params := makeParams("DescribeLifecycleHookTypes") - - resp = new(DescribeLifecycleHookTypesResult) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// LifecycleHook represents a lifecyclehook object -// -// See http://goo.gl/j62Iqu for more information -type LifecycleHook struct { - AutoScalingGroupName string `xml:"AutoScalingGroupName"` - DefaultResult string `xml:"DefaultResult"` - GlobalTimeout int `xml:"GlobalTimeout"` - HeartbeatTimeout int `xml:"HeartbeatTimeout"` - LifecycleHookName string `xml:"LifecycleHookName"` - LifecycleTransition string `xml:"LifecycleTransition"` - NotificationMetadata string `xml:"NotificationMetadata"` - NotificationTargetARN string `xml:"NotificationTargetARN"` - RoleARN string `xml:"RoleARN"` -} - -// DescribeLifecycleHooks wraps a DescribeLifecycleHooks response -// -// See http://goo.gl/wQkWiz for more details. -type DescribeLifecycleHooksResult struct { - LifecycleHooks []string `xml:"DescribeLifecycleHooksResult>LifecycleHooks>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeLifecycleHooks describes the lifecycle hooks that currently belong to the specified Auto Scaling group -// -// See http://goo.gl/wQkWiz for more information -func (as *AutoScaling) DescribeLifecycleHooks(asgName string, hookNames []string) ( - resp *DescribeLifecycleHooksResult, err error) { - params := makeParams("DescribeLifecycleHooks") - params["AutoScalingGroupName"] = asgName - - if len(hookNames) > 0 { - addParamsList(params, "LifecycleHookNames.member", hookNames) - } - - resp = new(DescribeLifecycleHooksResult) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// MetricGranularity encapsulates the MetricGranularityType -// -// See http://goo.gl/WJ82AA for more details -type MetricGranularity struct { - Granularity string `xml:"Granularity"` -} - -//MetricCollection encapsulates the MetricCollectionType -// -// See http://goo.gl/YrEG6h for more details -type MetricCollection struct { - Metric string `xml:"Metric"` -} - -// DescribeMetricCollectionTypesResp response wrapper -// -// See http://goo.gl/UyYc3i for more details. -type DescribeMetricCollectionTypesResp struct { - Granularities []MetricGranularity `xml:"DescribeMetricCollectionTypesResult>Granularities>member"` - Metrics []MetricCollection `xml:"DescribeMetricCollectionTypesResult>Metrics>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeMetricCollectionTypes returns a list of metrics and a corresponding list of granularities for each metric -// -// See http://goo.gl/UyYc3i for more details. -func (as *AutoScaling) DescribeMetricCollectionTypes() (resp *DescribeMetricCollectionTypesResp, err error) { - params := makeParams("DescribeMetricCollectionTypes") - - resp = new(DescribeMetricCollectionTypesResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// NotificationConfiguration encapsulates the NotificationConfigurationType -// -// See http://goo.gl/M8xYOQ for more details -type NotificationConfiguration struct { - AutoScalingGroupName string `xml:"AutoScalingGroupName"` - NotificationType string `xml:"NotificationType"` - TopicARN string `xml:"TopicARN"` -} - -// DescribeNotificationConfigurations response wrapper -// -// See http://goo.gl/qiAH31 for more details. -type DescribeNotificationConfigurationsResp struct { - NotificationConfigurations []NotificationConfiguration `xml:"DescribeNotificationConfigurationsResult>NotificationConfigurations>member"` - NextToken string `xml:"DescribeNotificationConfigurationsResult>NextToken"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeNotificationConfigurations returns a list of notification actions associated with Auto Scaling groups for specified events. -// Supports pagination by using the returned "NextToken" parameter for subsequent calls -// -// http://goo.gl/qiAH31 for more details. -func (as *AutoScaling) DescribeNotificationConfigurations(asgNames []string, maxRecords int, nextToken string) ( - resp *DescribeNotificationConfigurationsResp, err error) { - params := makeParams("DescribeNotificationConfigurations") - - if maxRecords != 0 { - params["MaxRecords"] = strconv.Itoa(maxRecords) - } - if nextToken != "" { - params["NextToken"] = nextToken - } - if len(asgNames) > 0 { - addParamsList(params, "AutoScalingGroupNames.member", asgNames) - } - - resp = new(DescribeNotificationConfigurationsResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// Alarm encapsulates the Alarm data type. -// -// See http://goo.gl/Q0uPAB for more details -type Alarm struct { - AlarmARN string `xml:"AlarmARN"` - AlarmName string `xml:"AlarmName"` -} - -// ScalingPolicy encapsulates the ScalingPolicyType -// -// See http://goo.gl/BYAT18 for more details -type ScalingPolicy struct { - AdjustmentType string `xml:"AdjustmentType"` // ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity - Alarms []Alarm `xml:"Alarms>member"` // A list of CloudWatch Alarms related to the policy - AutoScalingGroupName string `xml:"AutoScalingGroupName"` - Cooldown int `xml:"Cooldown"` - MinAdjustmentStep int `xml:"MinAdjustmentStep"` // Changes the DesiredCapacity of ASG by at least the specified number of instances. - PolicyARN string `xml:"PolicyARN"` - PolicyName string `xml:"PolicyName"` - ScalingAdjustment int `xml:"ScalingAdjustment"` -} - -// DescribePolicies response wrapper -// -// http://goo.gl/bN7A9T for more details. -type DescribePoliciesResp struct { - ScalingPolicies []ScalingPolicy `xml:"DescribePoliciesResult>ScalingPolicies>member"` - NextToken string `xml:"DescribePoliciesResult>NextToken"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribePolicies returns descriptions of what each policy does. -// Supports pagination by using the returned "NextToken" parameter for subsequent calls -// -// http://goo.gl/bN7A9Tfor more details. -func (as *AutoScaling) DescribePolicies(asgName string, policyNames []string, maxRecords int, nextToken string) ( - resp *DescribePoliciesResp, err error) { - params := makeParams("DescribePolicies") - - if asgName != "" { - params["AutoScalingGroupName"] = asgName - } - if maxRecords != 0 { - params["MaxRecords"] = strconv.Itoa(maxRecords) - } - if nextToken != "" { - params["NextToken"] = nextToken - } - if len(policyNames) > 0 { - addParamsList(params, "PolicyNames.member", policyNames) - } - - resp = new(DescribePoliciesResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// Activity encapsulates the Activity data type -// -// See http://goo.gl/fRaVi1 for more details -type Activity struct { - ActivityId string `xml:"ActivityId"` - AutoScalingGroupName string `xml:"AutoScalingGroupName"` - Cause string `xml:"Cause"` - Description string `xml:"Description"` - Details string `xml:"Details"` - EndTime time.Time `xml:"EndTime"` - Progress int `xml:"Progress"` - StartTime time.Time `xml:"StartTime"` - StatusCode string `xml:"StatusCode"` - StatusMessage string `xml:"StatusMessage"` -} - -// DescribeScalingActivities response wrapper -// -// http://goo.gl/noOXIC for more details. -type DescribeScalingActivitiesResp struct { - Activities []Activity `xml:"DescribeScalingActivitiesResult>Activities>member"` - NextToken string `xml:"DescribeScalingActivitiesResult>NextToken"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeScalingActivities returns the scaling activities for the specified Auto Scaling group. -// Supports pagination by using the returned "NextToken" parameter for subsequent calls -// -// http://goo.gl/noOXIC more details. -func (as *AutoScaling) DescribeScalingActivities(asgName string, activityIds []string, maxRecords int, nextToken string) ( - resp *DescribeScalingActivitiesResp, err error) { - params := makeParams("DescribeScalingActivities") - - if asgName != "" { - params["AutoScalingGroupName"] = asgName - } - if maxRecords != 0 { - params["MaxRecords"] = strconv.Itoa(maxRecords) - } - if nextToken != "" { - params["NextToken"] = nextToken - } - if len(activityIds) > 0 { - addParamsList(params, "ActivityIds.member", activityIds) - } - - resp = new(DescribeScalingActivitiesResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// ProcessType encapsulates the Auto Scaling process data type -// -// See http://goo.gl/9BvNik for more details. -type ProcessType struct { - ProcessName string `xml:"ProcessName"` -} - -// DescribeScalingProcessTypes response wrapper -// -// See http://goo.gl/rkp2tw for more details. -type DescribeScalingProcessTypesResp struct { - Processes []ProcessType `xml:"DescribeScalingProcessTypesResult>Processes>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeScalingProcessTypes returns scaling process types for use in the ResumeProcesses and SuspendProcesses actions. -// -// See http://goo.gl/rkp2tw for more details. -func (as *AutoScaling) DescribeScalingProcessTypes() (resp *DescribeScalingProcessTypesResp, err error) { - params := makeParams("DescribeScalingProcessTypes") - - resp = new(DescribeScalingProcessTypesResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// ScheduledUpdateGroupAction contains the information to be used in a scheduled update to an -// AutoScalingGroup -// -// See http://goo.gl/z2Kfxe for more details -type ScheduledUpdateGroupAction struct { - AutoScalingGroupName string `xml:"AutoScalingGroupName"` - DesiredCapacity int `xml:"DesiredCapacity"` - EndTime time.Time `xml:"EndTime"` - MaxSize int `xml:"MaxSize"` - MinSize int `xml:"MinSize"` - Recurrence string `xml:"Recurrence"` - ScheduledActionARN string `xml:"ScheduledActionARN"` - ScheduledActionName string `xml:"ScheduledActionName"` - StartTime time.Time `xml:"StartTime"` - Time time.Time `xml:"Time"` -} - -// DescribeScheduledActionsResult contains the response from a DescribeScheduledActions. -// -// See http://goo.gl/zqrJLx for more details. -type DescribeScheduledActionsResult struct { - ScheduledUpdateGroupActions []ScheduledUpdateGroupAction `xml:"DescribeScheduledActionsResult>ScheduledUpdateGroupActions>member"` - NextToken string `xml:"DescribeScheduledActionsResult>NextToken"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// ScheduledActionsRequestParams contains the items that can be specified when making -// a ScheduledActions request -type DescribeScheduledActionsParams struct { - AutoScalingGroupName string - EndTime time.Time - MaxRecords int - ScheduledActionNames []string - StartTime time.Time - NextToken string -} - -// DescribeScheduledActions returns a list of the current scheduled actions. If the -// AutoScalingGroup name is provided it will list all the scheduled actions for that group. -// -// See http://goo.gl/zqrJLx for more details. -func (as *AutoScaling) DescribeScheduledActions(options *DescribeScheduledActionsParams) ( - resp *DescribeScheduledActionsResult, err error) { - params := makeParams("DescribeScheduledActions") - - if options.AutoScalingGroupName != "" { - params["AutoScalingGroupName"] = options.AutoScalingGroupName - } - if !options.StartTime.IsZero() { - params["StartTime"] = options.StartTime.Format(time.RFC3339) - } - if !options.EndTime.IsZero() { - params["EndTime"] = options.EndTime.Format(time.RFC3339) - } - if options.MaxRecords > 0 { - params["MaxRecords"] = strconv.Itoa(options.MaxRecords) - } - if options.NextToken != "" { - params["NextToken"] = options.NextToken - } - if len(options.ScheduledActionNames) > 0 { - addParamsList(params, "ScheduledActionNames.member", options.ScheduledActionNames) - } - - resp = new(DescribeScheduledActionsResult) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DescribeTags response wrapper -// -// See http://goo.gl/ZTEU3G for more details. -type DescribeTagsResp struct { - Tags []Tag `xml:"DescribeTagsResult>Tags>member"` - NextToken string `xml:"DescribeTagsResult>NextToken"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeTags lists the Auto Scaling group tags. -// Supports pagination by using the returned "NextToken" parameter for subsequent calls -// -// See http://goo.gl/ZTEU3G for more details. -func (as *AutoScaling) DescribeTags(filter *Filter, maxRecords int, nextToken string) ( - resp *DescribeTagsResp, err error) { - params := makeParams("DescribeTags") - - if maxRecords != 0 { - params["MaxRecords"] = strconv.Itoa(maxRecords) - } - if nextToken != "" { - params["NextToken"] = nextToken - } - - filter.addParams(params) - - resp = new(DescribeTagsResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DescribeTerminationPolicyTypes response wrapper -// -// See http://goo.gl/ZTEU3G for more details. -type DescribeTerminationPolicyTypesResp struct { - TerminationPolicyTypes []string `xml:"DescribeTerminationPolicyTypesResult>TerminationPolicyTypes>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DescribeTerminationPolicyTypes returns a list of all termination policies supported by Auto Scaling -// -// See http://goo.gl/ZTEU3G for more details. -func (as *AutoScaling) DescribeTerminationPolicyTypes() (resp *DescribeTerminationPolicyTypesResp, err error) { - params := makeParams("DescribeTerminationPolicyTypes") - - resp = new(DescribeTerminationPolicyTypesResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DetachInstancesResult wraps a DetachInstances response -type DetachInstancesResult struct { - Activities []Activity `xml:"DetachInstancesResult>Activities>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// DetachInstances removes an instance from an Auto Scaling group -// -// See http://goo.gl/cNwrqF for more details -func (as *AutoScaling) DetachInstances(asgName string, instanceIds []string, decrementCapacity bool) ( - resp *DetachInstancesResult, err error) { - params := makeParams("DetachInstances") - params["AutoScalingGroupName"] = asgName - params["ShouldDecrementDesiredCapacity"] = strconv.FormatBool(decrementCapacity) - - if len(instanceIds) > 0 { - addParamsList(params, "InstanceIds.member", instanceIds) - } - - resp = new(DetachInstancesResult) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// DisableMetricsCollection disables monitoring of group metrics for the Auto Scaling group specified in asgName. -// You can specify the list of affected metrics with the metrics parameter. If no metrics are specified, all metrics are disabled -// -// See http://goo.gl/kAvzQw for more details. -func (as *AutoScaling) DisableMetricsCollection(asgName string, metrics []string) ( - resp *SimpleResp, err error) { - params := makeParams("DisableMetricsCollection") - params["AutoScalingGroupName"] = asgName - - if len(metrics) > 0 { - addParamsList(params, "Metrics.member", metrics) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// EnableMetricsCollection enables monitoring of group metrics for the Auto Scaling group specified in asNmae. -// You can specify the list of affected metrics with the metrics parameter. -// Auto Scaling metrics collection can be turned on only if the InstanceMonitoring flag is set to true. -// Currently, the only legal granularity is "1Minute". -// -// See http://goo.gl/UcVDWn for more details. -func (as *AutoScaling) EnableMetricsCollection(asgName string, metrics []string, granularity string) ( - resp *SimpleResp, err error) { - params := makeParams("EnableMetricsCollection") - params["AutoScalingGroupName"] = asgName - params["Granularity"] = granularity - - if len(metrics) > 0 { - addParamsList(params, "Metrics.member", metrics) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// EnterStandbyResult wraps an EnterStandby response -type EnterStandbyResult struct { - Activities []Activity `xml:"EnterStandbyResult>Activities>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// EnterStandby moves instances in an Auto Scaling group into a Standby mode. -// -// See http://goo.gl/BJ3lXs for more information -func (as *AutoScaling) EnterStandby(asgName string, instanceIds []string, decrementCapacity bool) ( - resp *EnterStandbyResult, err error) { - params := makeParams("EnterStandby") - params["AutoScalingGroupName"] = asgName - params["ShouldDecrementDesiredCapacity"] = strconv.FormatBool(decrementCapacity) - - if len(instanceIds) > 0 { - addParamsList(params, "InstanceIds.member", instanceIds) - } - - resp = new(EnterStandbyResult) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// ExecutePolicy executes the specified policy. -// -// See http://goo.gl/BxHpFc for more details. -func (as *AutoScaling) ExecutePolicy(policyName string, asgName string, honorCooldown bool) ( - resp *SimpleResp, err error) { - params := makeParams("ExecutePolicy") - params["PolicyName"] = policyName - - if asgName != "" { - params["AutoScalingGroupName"] = asgName - } - if honorCooldown { - params["HonorCooldown"] = strconv.FormatBool(honorCooldown) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// ExitStandbyResult wraps an ExitStandby response -type ExitStandbyResult struct { - Activities []Activity `xml:"ExitStandbyResult>Activities>member"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// ExitStandby moves an instance out of Standby mode. -// -// See http://goo.gl/9zQV4G for more information -func (as *AutoScaling) ExitStandby(asgName string, instanceIds []string) ( - resp *ExitStandbyResult, err error) { - params := makeParams("ExitStandby") - params["AutoScalingGroupName"] = asgName - - if len(instanceIds) > 0 { - addParamsList(params, "InstanceIds.member", instanceIds) - } - - resp = new(ExitStandbyResult) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// PutLifecycleHookParams wraps a PutLifecycleHook request -// -// See http://goo.gl/zsNqp5 for more details -type PutLifecycleHookParams struct { - AutoScalingGroupName string - DefaultResult string - HeartbeatTimeout int - LifecycleHookName string - LifecycleTransition string - NotificationMetadata string - NotificationTargetARN string - RoleARN string -} - -// PutLifecycleHook Creates or updates a lifecycle hook for an Auto Scaling Group. -// -// Part of the basic sequence for adding a lifecycle hook to an Auto Scaling group: -// 1) Create a notification target (SQS queue || SNS Topic) -// 2) Create an IAM role to allow the ASG topublish lifecycle notifications to the designated SQS queue or SNS topic -// 3) *** Create the lifecycle hook. You can create a hook that acts when instances launch or when instances terminate*** -// 4) If necessary, record the lifecycle action heartbeat to keep the instance in a pending state -// 5) Complete the lifecycle action -// -// See http://goo.gl/9XrROq for more details. -func (as *AutoScaling) PutLifecycleHook(options *PutLifecycleHookParams) ( - resp *SimpleResp, err error) { - params := makeParams("PutLifecycleHook") - params["AutoScalingGroupName"] = options.AutoScalingGroupName - params["LifecycleHookName"] = options.LifecycleHookName - - if options.DefaultResult != "" { - params["DefaultResult"] = options.DefaultResult - } - if options.HeartbeatTimeout != 0 { - params["HeartbeatTimeout"] = strconv.Itoa(options.HeartbeatTimeout) - } - if options.LifecycleTransition != "" { - params["LifecycleTransition"] = options.LifecycleTransition - } - if options.NotificationMetadata != "" { - params["NotificationMetadata"] = options.NotificationMetadata - } - if options.NotificationTargetARN != "" { - params["NotificationTargetARN"] = options.NotificationTargetARN - } - if options.RoleARN != "" { - params["RoleARN"] = options.RoleARN - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// PutNotificationConfiguration configures an Auto Scaling group to send notifications when specified events take place. -// -// See http://goo.gl/9XrROq for more details. -func (as *AutoScaling) PutNotificationConfiguration(asgName string, notificationTypes []string, topicARN string) ( - resp *SimpleResp, err error) { - params := makeParams("PutNotificationConfiguration") - params["AutoScalingGroupName"] = asgName - params["TopicARN"] = topicARN - - if len(notificationTypes) > 0 { - addParamsList(params, "NotificationTypes.member", notificationTypes) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// PutScalingPolicyParams wraps a PutScalingPolicyParams request -// -// See http://goo.gl/o0E8hl for more details. -type PutScalingPolicyParams struct { - AutoScalingGroupName string - PolicyName string - ScalingAdjustment int - AdjustmentType string - Cooldown int - MinAdjustmentStep int -} - -// PutScalingPolicy response wrapper -// -// See http://goo.gl/o0E8hl for more details. -type PutScalingPolicyResp struct { - PolicyARN string `xml:"PutScalingPolicyResult>PolicyARN"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// PutScalingPolicy creates or updates a policy for an Auto Scaling group -// -// See http://goo.gl/o0E8hl for more details. -func (as *AutoScaling) PutScalingPolicy(options *PutScalingPolicyParams) ( - resp *PutScalingPolicyResp, err error) { - params := makeParams("PutScalingPolicy") - params["AutoScalingGroupName"] = options.AutoScalingGroupName - params["PolicyName"] = options.PolicyName - params["ScalingAdjustment"] = strconv.Itoa(options.ScalingAdjustment) - params["AdjustmentType"] = options.AdjustmentType - - if options.Cooldown != 0 { - params["Cooldown"] = strconv.Itoa(options.Cooldown) - } - if options.MinAdjustmentStep != 0 { - params["MinAdjustmentStep"] = strconv.Itoa(options.MinAdjustmentStep) - } - - resp = new(PutScalingPolicyResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// PutScheduledUpdateGroupActionParams contains the details of the ScheduledAction to be added. -// -// See http://goo.gl/sLPi0d for more details -type PutScheduledUpdateGroupActionParams struct { - AutoScalingGroupName string - DesiredCapacity int - EndTime time.Time - MaxSize int - MinSize int - Recurrence string - ScheduledActionName string - StartTime time.Time -} - -// PutScheduledUpdateGroupAction creates or updates a scheduled scaling action for an -// AutoScaling group. Scheduled actions can be made up to thirty days in advance. When updating -// a scheduled scaling action, if you leave a parameter unspecified, the corresponding value -// remains unchanged in the affected AutoScaling group. -// -// Auto Scaling supports the date and time expressed in "YYYY-MM-DDThh:mm:ssZ" format in UTC/GMT -// only. -// -// See http://goo.gl/sLPi0d for more details. -func (as *AutoScaling) PutScheduledUpdateGroupAction(options *PutScheduledUpdateGroupActionParams) ( - resp *SimpleResp, err error) { - params := makeParams("PutScheduledUpdateGroupAction") - params["AutoScalingGroupName"] = options.AutoScalingGroupName - params["ScheduledActionName"] = options.ScheduledActionName - params["MinSize"] = strconv.Itoa(options.MinSize) - params["MaxSize"] = strconv.Itoa(options.MaxSize) - params["DesiredCapacity"] = strconv.Itoa(options.DesiredCapacity) - - if !options.StartTime.IsZero() { - params["StartTime"] = options.StartTime.Format(time.RFC3339) - } - if !options.EndTime.IsZero() { - params["EndTime"] = options.EndTime.Format(time.RFC3339) - } - if options.Recurrence != "" { - params["Recurrence"] = options.Recurrence - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// RecordLifecycleActionHeartbeat ecords a heartbeat for the lifecycle action associated with a specific token. -// This extends the timeout by the length of time defined by the HeartbeatTimeout parameter of the -// PutLifecycleHook operation. -// -// Part of the basic sequence for adding a lifecycle hook to an Auto Scaling group: -// 1) Create a notification target (SQS queue || SNS Topic) -// 2) Create an IAM role to allow the ASG topublish lifecycle notifications to the designated SQS queue or SNS topic -// 3) Create the lifecycle hook. You can create a hook that acts when instances launch or when instances terminate -// 4) ***If necessary, record the lifecycle action heartbeat to keep the instance in a pending state*** -// 5) Complete the lifecycle action -// -// See http://goo.gl/jc70xp for more details. -func (as *AutoScaling) RecordLifecycleActionHeartbeat(asgName, lifecycleActionToken, hookName string) ( - resp *SimpleResp, err error) { - params := makeParams("RecordLifecycleActionHeartbeat") - params["AutoScalingGroupName"] = asgName - params["LifecycleActionToken"] = lifecycleActionToken - params["LifecycleHookName"] = hookName - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// ResumeProcesses resumes the scaling processes for the scaling group. If no processes are -// provided, all processes are resumed. -// -// See http://goo.gl/XWIIg1 for more details. -func (as *AutoScaling) ResumeProcesses(asgName string, processes []string) ( - resp *SimpleResp, err error) { - params := makeParams("ResumeProcesses") - params["AutoScalingGroupName"] = asgName - - if len(processes) > 0 { - addParamsList(params, "ScalingProcesses.member", processes) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// SetDesiredCapacity changes the DesiredCapacity of an AutoScaling group. -// -// See http://goo.gl/3WGZbI for more details. -func (as *AutoScaling) SetDesiredCapacity(asgName string, desiredCapacity int, honorCooldown bool) ( - resp *SimpleResp, err error) { - params := makeParams("SetDesiredCapacity") - params["AutoScalingGroupName"] = asgName - params["DesiredCapacity"] = strconv.Itoa(desiredCapacity) - params["HonorCooldown"] = strconv.FormatBool(honorCooldown) - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// SetInstanceHealth sets the health status of a specified instance that belongs to any of your Auto Scaling groups. -// -// See http://goo.gl/j4ZRxh for more details. -func (as *AutoScaling) SetInstanceHealth(id string, healthStatus string, respectGracePeriod bool) ( - resp *SimpleResp, err error) { - params := makeParams("SetInstanceHealth") - params["HealthStatus"] = healthStatus - params["InstanceId"] = id - // Default is true - params["ShouldRespectGracePeriod"] = strconv.FormatBool(respectGracePeriod) - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// SuspendProcesses suspends the processes for the autoscaling group. If no processes are -// provided, all processes are suspended. -// -// If you suspend either of the two primary processes (Launch or Terminate), this can prevent other -// process types from functioning properly. -// -// See http://goo.gl/DUJpQy for more details. -func (as *AutoScaling) SuspendProcesses(asgName string, processes []string) ( - resp *SimpleResp, err error) { - params := makeParams("SuspendProcesses") - params["AutoScalingGroupName"] = asgName - - if len(processes) > 0 { - addParamsList(params, "ScalingProcesses.member", processes) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// TerminateInstanceInAutoScalingGroupResp response wrapper -// -// See http://goo.gl/ki5hMh for more details. -type TerminateInstanceInAutoScalingGroupResp struct { - Activity Activity `xml:"TerminateInstanceInAutoScalingGroupResult>Activity"` - RequestId string `xml:"ResponseMetadata>RequestId"` -} - -// TerminateInstanceInAutoScalingGroup terminates the specified instance. -// Optionally, the desired group size can be adjusted by setting decrCap to true -// -// See http://goo.gl/ki5hMh for more details. -func (as *AutoScaling) TerminateInstanceInAutoScalingGroup(id string, decrCap bool) ( - resp *TerminateInstanceInAutoScalingGroupResp, err error) { - params := makeParams("TerminateInstanceInAutoScalingGroup") - params["InstanceId"] = id - params["ShouldDecrementDesiredCapacity"] = strconv.FormatBool(decrCap) - - resp = new(TerminateInstanceInAutoScalingGroupResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} - -// UpdateAutoScalingGroup updates the scaling group. -// -// To update an auto scaling group with a launch configuration that has the InstanceMonitoring -// flag set to False, you must first ensure that collection of group metrics is disabled. -// Otherwise calls to UpdateAutoScalingGroup will fail. -// -// See http://goo.gl/rqrmxy for more details. -func (as *AutoScaling) UpdateAutoScalingGroup(asg *AutoScalingGroup) (resp *SimpleResp, err error) { - params := makeParams("UpdateAutoScalingGroup") - - params["AutoScalingGroupName"] = asg.AutoScalingGroupName - params["MaxSize"] = strconv.Itoa(asg.MaxSize) - params["MinSize"] = strconv.Itoa(asg.MinSize) - params["DesiredCapacity"] = strconv.Itoa(asg.DesiredCapacity) - - if asg.DefaultCooldown > 0 { - params["DefaultCooldown"] = strconv.Itoa(asg.DefaultCooldown) - } - if asg.HealthCheckGracePeriod > 0 { - params["HealthCheckGracePeriod"] = strconv.Itoa(asg.HealthCheckGracePeriod) - } - if asg.HealthCheckType != "" { - params["HealthCheckType"] = asg.HealthCheckType - } - if asg.LaunchConfigurationName != "" { - params["LaunchConfigurationName"] = asg.LaunchConfigurationName - } - if asg.PlacementGroup != "" { - params["PlacementGroup"] = asg.PlacementGroup - } - if asg.VPCZoneIdentifier != "" { - params["VPCZoneIdentifier"] = asg.VPCZoneIdentifier - } - - if len(asg.AvailabilityZones) > 0 { - addParamsList(params, "AvailabilityZones.member", asg.AvailabilityZones) - } - if len(asg.TerminationPolicies) > 0 { - addParamsList(params, "TerminationPolicies.member", asg.TerminationPolicies) - } - - resp = new(SimpleResp) - if err := as.query(params, resp); err != nil { - return nil, err - } - return resp, nil -} diff --git a/vendor/github.com/goamz/goamz/autoscaling/autoscaling_test.go b/vendor/github.com/goamz/goamz/autoscaling/autoscaling_test.go deleted file mode 100644 index b728a1cf4..000000000 --- a/vendor/github.com/goamz/goamz/autoscaling/autoscaling_test.go +++ /dev/null @@ -1,1180 +0,0 @@ -package autoscaling - -import ( - "testing" - "time" - - . "gopkg.in/check.v1" - - "github.com/goamz/goamz/aws" - "github.com/goamz/goamz/testutil" -) - -func Test(t *testing.T) { - TestingT(t) -} - -var _ = Suite(&S{}) - -type S struct { - as *AutoScaling -} - -var testServer = testutil.NewHTTPServer() - -var mockTest bool - -func (s *S) SetUpSuite(c *C) { - testServer.Start() - auth := aws.Auth{AccessKey: "abc", SecretKey: "123"} - s.as = New(auth, aws.Region{AutoScalingEndpoint: testServer.URL}) -} - -func (s *S) TearDownTest(c *C) { - testServer.Flush() -} - -func TestBasicGroupRequest(t *testing.T) { - var as *AutoScaling - awsAuth, err := aws.EnvAuth() - if err != nil { - mockTest = true - t.Log("Running mock tests as AWS environment variables are not set") - awsAuth := aws.Auth{AccessKey: "abc", SecretKey: "123"} - as = New(awsAuth, aws.Region{AutoScalingEndpoint: testServer.URL}) - testServer.Start() - go testServer.WaitRequest() - testServer.Response(200, nil, BasicGroupResponse) - } else { - as = New(awsAuth, aws.USWest2) - } - - groupResp, err := as.DescribeAutoScalingGroups(nil, 10, "") - - if err != nil { - t.Fatal(err) - } - if len(groupResp.AutoScalingGroups) > 0 { - firstGroup := groupResp.AutoScalingGroups[0] - if len(firstGroup.AutoScalingGroupName) > 0 { - t.Logf("Found AutoScaling group %s\n", - firstGroup.AutoScalingGroupName) - } - } - testServer.Flush() -} - -func TestAutoScalingGroup(t *testing.T) { - var as *AutoScaling - // Launch configuration test config - lc := new(LaunchConfiguration) - lc.LaunchConfigurationName = "LConf1" - lc.ImageId = "ami-03e47533" // Octave debian ami - lc.KernelId = "aki-98e26fa8" - lc.KeyName = "testAWS" // Replace with valid key for your account - lc.InstanceType = "m1.small" - - // CreateAutoScalingGroup params test config - asgReq := new(CreateAutoScalingGroupParams) - asgReq.AutoScalingGroupName = "ASGTest1" - asgReq.LaunchConfigurationName = lc.LaunchConfigurationName - asgReq.DefaultCooldown = 300 - asgReq.HealthCheckGracePeriod = 300 - asgReq.DesiredCapacity = 1 - asgReq.MinSize = 1 - asgReq.MaxSize = 5 - asgReq.AvailabilityZones = []string{"us-west-2a"} - - asg := new(AutoScalingGroup) - asg.AutoScalingGroupName = "ASGTest1" - asg.LaunchConfigurationName = lc.LaunchConfigurationName - asg.DefaultCooldown = 300 - asg.HealthCheckGracePeriod = 300 - asg.DesiredCapacity = 1 - asg.MinSize = 1 - asg.MaxSize = 5 - asg.AvailabilityZones = []string{"us-west-2a"} - - awsAuth, err := aws.EnvAuth() - if err != nil { - mockTest = true - t.Log("Running mock tests as AWS environment variables are not set") - awsAuth := aws.Auth{AccessKey: "abc", SecretKey: "123"} - as = New(awsAuth, aws.Region{AutoScalingEndpoint: testServer.URL}) - } else { - as = New(awsAuth, aws.USWest2) - } - - // Create the launch configuration - if mockTest { - testServer.Response(200, nil, CreateLaunchConfigurationResponse) - } - _, err = as.CreateLaunchConfiguration(lc) - if err != nil { - t.Fatal(err) - } - - // Check that we can get the launch configuration details - if mockTest { - testServer.Response(200, nil, DescribeLaunchConfigurationsResponse) - } - _, err = as.DescribeLaunchConfigurations([]string{lc.LaunchConfigurationName}, 10, "") - if err != nil { - t.Fatal(err) - } - - // Create the AutoScalingGroup - if mockTest { - testServer.Response(200, nil, CreateAutoScalingGroupResponse) - } - _, err = as.CreateAutoScalingGroup(asgReq) - if err != nil { - t.Fatal(err) - } - - // Check that we can get the autoscaling group details - if mockTest { - testServer.Response(200, nil, DescribeAutoScalingGroupsResponse) - } - _, err = as.DescribeAutoScalingGroups(nil, 10, "") - if err != nil { - t.Fatal(err) - } - - // Suspend the scaling processes for the test AutoScalingGroup - if mockTest { - testServer.Response(200, nil, SuspendProcessesResponse) - } - _, err = as.SuspendProcesses(asg.AutoScalingGroupName, nil) - if err != nil { - t.Fatal(err) - } - - // Resume scaling processes for the test AutoScalingGroup - if mockTest { - testServer.Response(200, nil, ResumeProcessesResponse) - } - _, err = as.ResumeProcesses(asg.AutoScalingGroupName, nil) - if err != nil { - t.Fatal(err) - } - - // Change the desired capacity from 1 to 2. This will launch a second instance - if mockTest { - testServer.Response(200, nil, SetDesiredCapacityResponse) - } - _, err = as.SetDesiredCapacity(asg.AutoScalingGroupName, 2, false) - if err != nil { - t.Fatal(err) - } - - // Change the desired capacity from 2 to 1. This will terminate one of the instances - if mockTest { - testServer.Response(200, nil, SetDesiredCapacityResponse) - } - - _, err = as.SetDesiredCapacity(asg.AutoScalingGroupName, 1, false) - if err != nil { - t.Fatal(err) - } - - // Update the max capacity for the scaling group - if mockTest { - testServer.Response(200, nil, UpdateAutoScalingGroupResponse) - } - asg.MinSize = 1 - asg.MaxSize = 6 - asg.DesiredCapacity = 1 - _, err = as.UpdateAutoScalingGroup(asg) - if err != nil { - t.Fatal(err) - } - - // Add a scheduled action to the group - psar := new(PutScheduledUpdateGroupActionParams) - psar.AutoScalingGroupName = asg.AutoScalingGroupName - psar.MaxSize = 4 - psar.ScheduledActionName = "SATest1" - psar.Recurrence = "30 0 1 1,6,12 *" - if mockTest { - testServer.Response(200, nil, PutScheduledUpdateGroupActionResponse) - } - _, err = as.PutScheduledUpdateGroupAction(psar) - if err != nil { - t.Fatal(err) - } - - // List the scheduled actions for the group - sar := new(DescribeScheduledActionsParams) - sar.AutoScalingGroupName = asg.AutoScalingGroupName - if mockTest { - testServer.Response(200, nil, DescribeScheduledActionsResponse) - } - _, err = as.DescribeScheduledActions(sar) - if err != nil { - t.Fatal(err) - } - - // Delete the test scheduled action from the group - if mockTest { - testServer.Response(200, nil, DeleteScheduledActionResponse) - } - _, err = as.DeleteScheduledAction(asg.AutoScalingGroupName, psar.ScheduledActionName) - if err != nil { - t.Fatal(err) - } - testServer.Flush() -} - -// -------------------------------------------------------------------------- -// Detailed Unit Tests - -func (s *S) TestAttachInstances(c *C) { - testServer.Response(200, nil, AttachInstancesResponse) - resp, err := s.as.AttachInstances("my-test-asg", []string{"i-21321afs", "i-baaffg23"}) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "AttachInstances") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("InstanceIds.member.1"), Equals, "i-21321afs") - c.Assert(values.Get("InstanceIds.member.2"), Equals, "i-baaffg23") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") -} - -func (s *S) TestCreateAutoScalingGroup(c *C) { - testServer.Response(200, nil, CreateAutoScalingGroupResponse) - testServer.Response(200, nil, DeleteAutoScalingGroupResponse) - - createAS := &CreateAutoScalingGroupParams{ - AutoScalingGroupName: "my-test-asg", - AvailabilityZones: []string{"us-east-1a", "us-east-1b"}, - MinSize: 3, - MaxSize: 3, - DefaultCooldown: 600, - DesiredCapacity: 0, - LaunchConfigurationName: "my-test-lc", - LoadBalancerNames: []string{"elb-1", "elb-2"}, - Tags: []Tag{ - { - Key: "foo", - Value: "bar", - }, - { - Key: "baz", - Value: "qux", - }, - }, - VPCZoneIdentifier: "subnet-610acd08,subnet-530fc83a", - } - resp, err := s.as.CreateAutoScalingGroup(createAS) - c.Assert(err, IsNil) - defer s.as.DeleteAutoScalingGroup(createAS.AutoScalingGroupName, true) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "CreateAutoScalingGroup") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("AvailabilityZones.member.1"), Equals, "us-east-1a") - c.Assert(values.Get("AvailabilityZones.member.2"), Equals, "us-east-1b") - c.Assert(values.Get("MinSize"), Equals, "3") - c.Assert(values.Get("MaxSize"), Equals, "3") - c.Assert(values.Get("DefaultCooldown"), Equals, "600") - c.Assert(values.Get("DesiredCapacity"), Equals, "0") - c.Assert(values.Get("LaunchConfigurationName"), Equals, "my-test-lc") - c.Assert(values.Get("LoadBalancerNames.member.1"), Equals, "elb-1") - c.Assert(values.Get("LoadBalancerNames.member.2"), Equals, "elb-2") - c.Assert(values.Get("Tags.member.1.Key"), Equals, "foo") - c.Assert(values.Get("Tags.member.1.Value"), Equals, "bar") - c.Assert(values.Get("Tags.member.2.Key"), Equals, "baz") - c.Assert(values.Get("Tags.member.2.Value"), Equals, "qux") - c.Assert(values.Get("VPCZoneIdentifier"), Equals, "subnet-610acd08,subnet-530fc83a") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") -} - -func (s *S) TestCreateLaunchConfiguration(c *C) { - testServer.Response(200, nil, CreateLaunchConfigurationResponse) - testServer.Response(200, nil, DeleteLaunchConfigurationResponse) - - launchConfig := &LaunchConfiguration{ - LaunchConfigurationName: "my-test-lc", - AssociatePublicIpAddress: true, - EbsOptimized: true, - SecurityGroups: []string{"sec-grp1", "sec-grp2"}, - UserData: "1234", - KeyName: "secretKeyPair", - ImageId: "ami-0078da69", - InstanceType: "m1.small", - SpotPrice: "0.03", - BlockDeviceMappings: []BlockDeviceMapping{ - { - DeviceName: "/dev/sda1", - VirtualName: "ephemeral0", - }, - { - DeviceName: "/dev/sdb", - VirtualName: "ephemeral1", - }, - { - DeviceName: "/dev/sdf", - Ebs: EBS{ - DeleteOnTermination: true, - SnapshotId: "snap-2a2b3c4d", - VolumeSize: 100, - }, - }, - }, - InstanceMonitoring: InstanceMonitoring{ - Enabled: true, - }, - } - resp, err := s.as.CreateLaunchConfiguration(launchConfig) - c.Assert(err, IsNil) - defer s.as.DeleteLaunchConfiguration(launchConfig.LaunchConfigurationName) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "CreateLaunchConfiguration") - c.Assert(values.Get("LaunchConfigurationName"), Equals, "my-test-lc") - c.Assert(values.Get("AssociatePublicIpAddress"), Equals, "true") - c.Assert(values.Get("EbsOptimized"), Equals, "true") - c.Assert(values.Get("SecurityGroups.member.1"), Equals, "sec-grp1") - c.Assert(values.Get("SecurityGroups.member.2"), Equals, "sec-grp2") - c.Assert(values.Get("UserData"), Equals, "MTIzNA==") - c.Assert(values.Get("KeyName"), Equals, "secretKeyPair") - c.Assert(values.Get("ImageId"), Equals, "ami-0078da69") - c.Assert(values.Get("InstanceType"), Equals, "m1.small") - c.Assert(values.Get("SpotPrice"), Equals, "0.03") - c.Assert(values.Get("BlockDeviceMappings.member.1.DeviceName"), Equals, "/dev/sda1") - c.Assert(values.Get("BlockDeviceMappings.member.1.VirtualName"), Equals, "ephemeral0") - c.Assert(values.Get("BlockDeviceMappings.member.2.DeviceName"), Equals, "/dev/sdb") - c.Assert(values.Get("BlockDeviceMappings.member.2.VirtualName"), Equals, "ephemeral1") - c.Assert(values.Get("BlockDeviceMappings.member.3.DeviceName"), Equals, "/dev/sdf") - c.Assert(values.Get("BlockDeviceMappings.member.3.Ebs.DeleteOnTermination"), Equals, "true") - c.Assert(values.Get("BlockDeviceMappings.member.3.Ebs.SnapshotId"), Equals, "snap-2a2b3c4d") - c.Assert(values.Get("BlockDeviceMappings.member.3.Ebs.VolumeSize"), Equals, "100") - c.Assert(values.Get("InstanceMonitoring.Enabled"), Equals, "true") - c.Assert(resp.RequestId, Equals, "7c6e177f-f082-11e1-ac58-3714bEXAMPLE") -} - -func (s *S) TestCreateOrUpdateTags(c *C) { - testServer.Response(200, nil, CreateOrUpdateTagsResponse) - tags := []Tag{ - { - Key: "foo", - Value: "bar", - ResourceId: "my-test-asg", - }, - { - Key: "baz", - Value: "qux", - ResourceId: "my-test-asg", - PropagateAtLaunch: true, - }, - } - resp, err := s.as.CreateOrUpdateTags(tags) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "CreateOrUpdateTags") - c.Assert(values.Get("Tags.member.1.Key"), Equals, "foo") - c.Assert(values.Get("Tags.member.1.Value"), Equals, "bar") - c.Assert(values.Get("Tags.member.1.ResourceId"), Equals, "my-test-asg") - c.Assert(values.Get("Tags.member.2.Key"), Equals, "baz") - c.Assert(values.Get("Tags.member.2.Value"), Equals, "qux") - c.Assert(values.Get("Tags.member.2.ResourceId"), Equals, "my-test-asg") - c.Assert(values.Get("Tags.member.2.PropagateAtLaunch"), Equals, "true") - c.Assert(resp.RequestId, Equals, "b0203919-bf1b-11e2-8a01-13263EXAMPLE") -} - -func (s *S) TestDeleteAutoScalingGroup(c *C) { - testServer.Response(200, nil, DeleteAutoScalingGroupResponse) - resp, err := s.as.DeleteAutoScalingGroup("my-test-asg", true) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DeleteAutoScalingGroup") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(resp.RequestId, Equals, "70a76d42-9665-11e2-9fdf-211deEXAMPLE") -} - -func (s *S) TestDeleteAutoScalingGroupWithExistingInstances(c *C) { - testServer.Response(400, nil, DeleteAutoScalingGroupErrorResponse) - resp, err := s.as.DeleteAutoScalingGroup("my-test-asg", false) - testServer.WaitRequest() - c.Assert(resp, IsNil) - c.Assert(err, NotNil) - e, ok := err.(*Error) - if !ok { - c.Errorf("Unable to unmarshal error into AWS Autoscaling Error") - } - c.Assert(ok, Equals, true) - c.Assert(e.Message, Equals, "You cannot delete an AutoScalingGroup while there are instances or pending Spot instance request(s) still in the group.") - c.Assert(e.Code, Equals, "ResourceInUse") - c.Assert(e.StatusCode, Equals, 400) - c.Assert(e.RequestId, Equals, "70a76d42-9665-11e2-9fdf-211deEXAMPLE") -} - -func (s *S) TestDeleteLaunchConfiguration(c *C) { - testServer.Response(200, nil, DeleteLaunchConfigurationResponse) - resp, err := s.as.DeleteLaunchConfiguration("my-test-lc") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DeleteLaunchConfiguration") - c.Assert(values.Get("LaunchConfigurationName"), Equals, "my-test-lc") - c.Assert(resp.RequestId, Equals, "7347261f-97df-11e2-8756-35eEXAMPLE") -} - -func (s *S) TestDeleteLaunchConfigurationInUse(c *C) { - testServer.Response(400, nil, DeleteLaunchConfigurationInUseResponse) - resp, err := s.as.DeleteLaunchConfiguration("my-test-lc") - testServer.WaitRequest() - c.Assert(resp, IsNil) - c.Assert(err, NotNil) - e, ok := err.(*Error) - if !ok { - c.Errorf("Unable to unmarshal error into AWS Autoscaling Error") - } - c.Logf("%v %v %v", e.Code, e.Message, e.RequestId) - c.Assert(ok, Equals, true) - c.Assert(e.Message, Equals, "Cannot delete launch configuration my-test-lc because it is attached to AutoScalingGroup test") - c.Assert(e.Code, Equals, "ResourceInUse") - c.Assert(e.StatusCode, Equals, 400) - c.Assert(e.RequestId, Equals, "7347261f-97df-11e2-8756-35eEXAMPLE") -} - -func (s *S) TestDeleteTags(c *C) { - testServer.Response(200, nil, DeleteTagsResponse) - tags := []Tag{ - { - Key: "foo", - Value: "bar", - ResourceId: "my-test-asg", - }, - { - Key: "baz", - Value: "qux", - ResourceId: "my-test-asg", - PropagateAtLaunch: true, - }, - } - resp, err := s.as.DeleteTags(tags) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DeleteTags") - c.Assert(values.Get("Tags.member.1.Key"), Equals, "foo") - c.Assert(values.Get("Tags.member.1.Value"), Equals, "bar") - c.Assert(values.Get("Tags.member.1.ResourceId"), Equals, "my-test-asg") - c.Assert(values.Get("Tags.member.2.Key"), Equals, "baz") - c.Assert(values.Get("Tags.member.2.Value"), Equals, "qux") - c.Assert(values.Get("Tags.member.2.ResourceId"), Equals, "my-test-asg") - c.Assert(values.Get("Tags.member.2.PropagateAtLaunch"), Equals, "true") - c.Assert(resp.RequestId, Equals, "b0203919-bf1b-11e2-8a01-13263EXAMPLE") -} - -func (s *S) TestDescribeAccountLimits(c *C) { - testServer.Response(200, nil, DescribeAccountLimitsResponse) - - resp, err := s.as.DescribeAccountLimits() - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeAccountLimits") - c.Assert(resp.RequestId, Equals, "a32bd184-519d-11e3-a8a4-c1c467cbcc3b") - c.Assert(resp.MaxNumberOfAutoScalingGroups, Equals, 20) - c.Assert(resp.MaxNumberOfLaunchConfigurations, Equals, 100) - -} - -func (s *S) TestDescribeAdjustmentTypes(c *C) { - testServer.Response(200, nil, DescribeAdjustmentTypesResponse) - resp, err := s.as.DescribeAdjustmentTypes() - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeAdjustmentTypes") - c.Assert(resp.RequestId, Equals, "cc5f0337-b694-11e2-afc0-6544dEXAMPLE") - c.Assert(resp.AdjustmentTypes, DeepEquals, []AdjustmentType{{"ChangeInCapacity"}, {"ExactCapacity"}, {"PercentChangeInCapacity"}}) -} - -func (s *S) TestDescribeAutoScalingGroups(c *C) { - testServer.Response(200, nil, DescribeAutoScalingGroupsResponse) - resp, err := s.as.DescribeAutoScalingGroups([]string{"my-test-asg-lbs"}, 0, "") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - t, _ := time.Parse(time.RFC3339, "2013-05-06T17:47:15.107Z") - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeAutoScalingGroups") - c.Assert(values.Get("AutoScalingGroupNames.member.1"), Equals, "my-test-asg-lbs") - - expected := &DescribeAutoScalingGroupsResp{ - AutoScalingGroups: []AutoScalingGroup{ - { - AutoScalingGroupName: "my-test-asg-lbs", - Tags: []Tag{ - { - Key: "foo", - Value: "bar", - ResourceId: "my-test-asg-lbs", - PropagateAtLaunch: true, - ResourceType: "auto-scaling-group", - }, - { - Key: "baz", - Value: "qux", - ResourceId: "my-test-asg-lbs", - PropagateAtLaunch: true, - ResourceType: "auto-scaling-group", - }, - }, - Instances: []Instance{ - { - AvailabilityZone: "us-east-1b", - HealthStatus: "Healthy", - InstanceId: "i-zb1f313", - LaunchConfigurationName: "my-test-lc", - LifecycleState: "InService", - }, - { - AvailabilityZone: "us-east-1a", - HealthStatus: "Healthy", - InstanceId: "i-90123adv", - LaunchConfigurationName: "my-test-lc", - LifecycleState: "InService", - }, - }, - HealthCheckType: "ELB", - CreatedTime: t, - LaunchConfigurationName: "my-test-lc", - DesiredCapacity: 2, - AvailabilityZones: []string{"us-east-1b", "us-east-1a"}, - LoadBalancerNames: []string{"my-test-asg-loadbalancer"}, - MinSize: 2, - MaxSize: 10, - VPCZoneIdentifier: "subnet-32131da1,subnet-1312dad2", - HealthCheckGracePeriod: 120, - DefaultCooldown: 300, - AutoScalingGroupARN: "arn:aws:autoscaling:us-east-1:803981987763:autoScalingGroup:ca861182-c8f9-4ca7-b1eb-cd35505f5ebb:autoScalingGroupName/my-test-asg-lbs", - TerminationPolicies: []string{"Default"}, - }, - }, - RequestId: "0f02a07d-b677-11e2-9eb0-dd50EXAMPLE", - } - c.Assert(resp, DeepEquals, expected) -} - -func (s *S) TestDescribeAutoScalingInstances(c *C) { - testServer.Response(200, nil, DescribeAutoScalingInstancesResponse) - resp, err := s.as.DescribeAutoScalingInstances([]string{"i-78e0d40b"}, 0, "") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeAutoScalingInstances") - c.Assert(resp.RequestId, Equals, "df992dc3-b72f-11e2-81e1-750aa6EXAMPLE") - c.Assert(resp.AutoScalingInstances, DeepEquals, []Instance{ - { - AutoScalingGroupName: "my-test-asg", - AvailabilityZone: "us-east-1a", - HealthStatus: "Healthy", - InstanceId: "i-78e0d40b", - LaunchConfigurationName: "my-test-lc", - LifecycleState: "InService", - }, - }) -} - -func (s *S) TestDescribeLaunchConfigurations(c *C) { - testServer.Response(200, nil, DescribeLaunchConfigurationsResponse) - resp, err := s.as.DescribeLaunchConfigurations([]string{"my-test-lc"}, 0, "") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - t, _ := time.Parse(time.RFC3339, "2013-01-21T23:04:42.200Z") - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeLaunchConfigurations") - c.Assert(values.Get("LaunchConfigurationNames.member.1"), Equals, "my-test-lc") - expected := &DescribeLaunchConfigurationsResp{ - LaunchConfigurations: []LaunchConfiguration{ - { - AssociatePublicIpAddress: true, - BlockDeviceMappings: []BlockDeviceMapping{ - { - DeviceName: "/dev/sdb", - VirtualName: "ephemeral0", - }, - { - DeviceName: "/dev/sdf", - Ebs: EBS{ - SnapshotId: "snap-XXXXYYY", - VolumeSize: 100, - Iops: 50, - VolumeType: "io1", - DeleteOnTermination: true, - }, - }, - }, - EbsOptimized: false, - CreatedTime: t, - LaunchConfigurationName: "my-test-lc", - InstanceType: "m1.small", - ImageId: "ami-514ac838", - InstanceMonitoring: InstanceMonitoring{Enabled: true}, - LaunchConfigurationARN: "arn:aws:autoscaling:us-east-1:803981987763:launchConfiguration:9dbbbf87-6141-428a-a409-0752edbe6cad:launchConfigurationName/my-test-lc", - }, - }, - RequestId: "d05a22f8-b690-11e2-bf8e-2113fEXAMPLE", - } - c.Assert(resp, DeepEquals, expected) -} - -func (s *S) TestDescribeMetricCollectionTypes(c *C) { - testServer.Response(200, nil, DescribeMetricCollectionTypesResponse) - resp, err := s.as.DescribeMetricCollectionTypes() - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeMetricCollectionTypes") - c.Assert(resp.RequestId, Equals, "07f3fea2-bf3c-11e2-9b6f-f3cdbb80c073") - c.Assert(resp.Metrics, DeepEquals, []MetricCollection{ - { - Metric: "GroupMinSize", - }, - { - Metric: "GroupMaxSize", - }, - { - Metric: "GroupDesiredCapacity", - }, - { - Metric: "GroupInServiceInstances", - }, - { - Metric: "GroupPendingInstances", - }, - { - Metric: "GroupTerminatingInstances", - }, - { - Metric: "GroupTotalInstances", - }, - }) - c.Assert(resp.Granularities, DeepEquals, []MetricGranularity{ - { - Granularity: "1Minute", - }, - }) -} - -func (s *S) TestDescribeNotificationConfigurations(c *C) { - testServer.Response(200, nil, DescribeNotificationConfigurationsResponse) - resp, err := s.as.DescribeNotificationConfigurations([]string{"i-78e0d40b"}, 0, "") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeNotificationConfigurations") - c.Assert(resp.RequestId, Equals, "07f3fea2-bf3c-11e2-9b6f-f3cdbb80c073") - c.Assert(resp.NotificationConfigurations, DeepEquals, []NotificationConfiguration{ - { - AutoScalingGroupName: "my-test-asg", - NotificationType: "autoscaling: EC2_INSTANCE_LAUNCH", - TopicARN: "vajdoafj231j41231/topic", - }, - }) -} - -func (s *S) TestDescribePolicies(c *C) { - testServer.Response(200, nil, DescribePoliciesResponse) - resp, err := s.as.DescribePolicies("my-test-asg", []string{}, 2, "") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribePolicies") - c.Assert(values.Get("MaxRecords"), Equals, "2") - expected := &DescribePoliciesResp{ - RequestId: "ec3bffad-b739-11e2-b38d-15fbEXAMPLE", - NextToken: "3ef417fe-9202-12-8ddd-d13e1313413", - ScalingPolicies: []ScalingPolicy{ - { - PolicyARN: "arn:aws:autoscaling:us-east-1:803981987763:scalingPolicy:c322761b-3172-4d56-9a21-0ed9d6161d67:autoScalingGroupName/my-test-asg:policyName/MyScaleDownPolicy", - AdjustmentType: "ChangeInCapacity", - ScalingAdjustment: -1, - PolicyName: "MyScaleDownPolicy", - AutoScalingGroupName: "my-test-asg", - Cooldown: 60, - Alarms: []Alarm{ - { - AlarmName: "TestQueue", - AlarmARN: "arn:aws:cloudwatch:us-east-1:803981987763:alarm:TestQueue", - }, - }, - }, - { - PolicyARN: "arn:aws:autoscaling:us-east-1:803981987763:scalingPolicy:c55a5cdd-9be0-435b-b60b-a8dd313159f5:autoScalingGroupName/my-test-asg:policyName/MyScaleUpPolicy", - AdjustmentType: "ChangeInCapacity", - ScalingAdjustment: 1, - PolicyName: "MyScaleUpPolicy", - AutoScalingGroupName: "my-test-asg", - Cooldown: 60, - Alarms: []Alarm{ - { - AlarmName: "TestQueue", - AlarmARN: "arn:aws:cloudwatch:us-east-1:803981987763:alarm:TestQueue", - }, - }, - }, - }, - } - c.Assert(resp, DeepEquals, expected) -} - -func (s *S) TestDescribeScalingActivities(c *C) { - testServer.Response(200, nil, DescribeScalingActivitiesResponse) - resp, err := s.as.DescribeScalingActivities("my-test-asg", []string{}, 1, "") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeScalingActivities") - c.Assert(values.Get("MaxRecords"), Equals, "1") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - st, _ := time.Parse(time.RFC3339, "2012-04-12T17:32:07.882Z") - et, _ := time.Parse(time.RFC3339, "2012-04-12T17:32:08Z") - expected := &DescribeScalingActivitiesResp{ - RequestId: "7a641adc-84c5-11e1-a8a5-217ebEXAMPLE", - NextToken: "3ef417fe-9202-12-8ddd-d13e1313413", - Activities: []Activity{ - { - StatusCode: "Failed", - Progress: 0, - ActivityId: "063308ae-aa22-4a9b-94f4-9faeEXAMPLE", - StartTime: st, - AutoScalingGroupName: "my-test-asg", - Details: "{}", - Cause: "At 2012-04-12T17:31:30Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1. At 2012-04-12T17:32:07Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.", - Description: "Launching a new EC2 instance. Status Reason: The image id 'ami-4edb0327' does not exist. Launching EC2 instance failed.", - EndTime: et, - StatusMessage: "The image id 'ami-4edb0327' does not exist. Launching EC2 instance failed.", - }, - }, - } - c.Assert(resp, DeepEquals, expected) -} - -func (s *S) TestDescribeScalingProcessTypes(c *C) { - testServer.Response(200, nil, DescribeScalingProcessTypesResponse) - resp, err := s.as.DescribeScalingProcessTypes() - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeScalingProcessTypes") - c.Assert(resp.RequestId, Equals, "27f2eacc-b73f-11e2-ad99-c7aba3a9c963") - c.Assert(resp.Processes, DeepEquals, []ProcessType{ - {"AZRebalance"}, - {"AddToLoadBalancer"}, - {"AlarmNotification"}, - {"HealthCheck"}, - {"Launch"}, - {"ReplaceUnhealthy"}, - {"ScheduledActions"}, - {"Terminate"}, - }) -} - -func (s *S) TestDescribeScheduledActions(c *C) { - testServer.Response(200, nil, DescribeScheduledActionsResponse) - st, _ := time.Parse(time.RFC3339, "2014-06-01T00:30:00Z") - request := &DescribeScheduledActionsParams{ - AutoScalingGroupName: "ASGTest1", - MaxRecords: 1, - StartTime: st, - } - resp, err := s.as.DescribeScheduledActions(request) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeScheduledActions") - c.Assert(resp.RequestId, Equals, "0eb4217f-8421-11e3-9233-7100ef811766") - c.Assert(resp.ScheduledUpdateGroupActions, DeepEquals, []ScheduledUpdateGroupAction{ - { - AutoScalingGroupName: "ASGTest1", - ScheduledActionARN: "arn:aws:autoscaling:us-west-2:193024542802:scheduledUpdateGroupAction:61f68b2c-bde3-4316-9a81-eb95dc246509:autoScalingGroupName/ASGTest1:scheduledActionName/SATest1", - ScheduledActionName: "SATest1", - Recurrence: "30 0 1 1,6,12 *", - MaxSize: 4, - StartTime: st, - Time: st, - }, - }) -} - -func (s *S) TestDescribeTags(c *C) { - testServer.Response(200, nil, DescribeTagsResponse) - filter := NewFilter() - filter.Add("auto-scaling-group", "my-test-asg") - resp, err := s.as.DescribeTags(filter, 1, "") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeTags") - c.Assert(values.Get("MaxRecords"), Equals, "1") - c.Assert(values.Get("Filters.member.1.Name"), Equals, "auto-scaling-group") - c.Assert(values.Get("Filters.member.1.Values.member.1"), Equals, "my-test-asg") - c.Assert(resp.RequestId, Equals, "086265fd-bf3e-11e2-85fc-fbb1EXAMPLE") - c.Assert(resp.Tags, DeepEquals, []Tag{ - { - Key: "version", - Value: "1.0", - ResourceId: "my-test-asg", - PropagateAtLaunch: true, - ResourceType: "auto-scaling-group", - }, - }) -} - -func (s *S) TestDescribeTerminationPolicyTypes(c *C) { - testServer.Response(200, nil, DescribeTerminationPolicyTypesResponse) - resp, err := s.as.DescribeTerminationPolicyTypes() - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DescribeTerminationPolicyTypes") - c.Assert(resp.RequestId, Equals, "d9a05827-b735-11e2-a40c-c79a5EXAMPLE") - c.Assert(resp.TerminationPolicyTypes, DeepEquals, []string{"ClosestToNextInstanceHour", "Default", "NewestInstance", "OldestInstance", "OldestLaunchConfiguration"}) -} - -func (s *S) TestDetachInstances(c *C) { - testServer.Response(200, nil, DetachInstancesResponse) - resp, err := s.as.DetachInstances("my-asg", []string{"i-5f2e8a0d"}, true) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DetachInstances") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-asg") - c.Assert(values.Get("ShouldDecrementDesiredCapacity"), Equals, "true") - c.Assert(values.Get("InstanceIds.member.1"), Equals, "i-5f2e8a0d") - st, _ := time.Parse(time.RFC3339, "2014-06-14T00:07:30.280Z") - expected := &DetachInstancesResult{ - RequestId: "e04f3b11-f357-11e3-a434-7f10009d5849", - Activities: []Activity{ - { - StatusCode: "InProgress", - Progress: 50, - ActivityId: "e54ff599-bf05-4076-8b95-a0f090ed90bb", - StartTime: st, - AutoScalingGroupName: "my-asg", - Details: "{\"Availability Zone\":\"us-east-1a\"}", - Cause: "At 2014-06-14T00:07:30Z instance i-5f2e8a0d was detached in response to a user request, shrinking the capacity from 4 to 3.", - Description: "Detaching EC2 instance: i-5f2e8a0d", - }, - }, - } - c.Assert(resp, DeepEquals, expected) -} - -func (s *S) TestDisableMetricsCollection(c *C) { - testServer.Response(200, nil, DisableMetricsCollectionResponse) - resp, err := s.as.DisableMetricsCollection("my-test-asg", []string{"GroupMinSize"}) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "DisableMetricsCollection") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("Metrics.member.1"), Equals, "GroupMinSize") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") -} - -func (s *S) TestEnableMetricsCollection(c *C) { - testServer.Response(200, nil, DisableMetricsCollectionResponse) - resp, err := s.as.EnableMetricsCollection("my-test-asg", []string{"GroupMinSize", "GroupMaxSize"}, "1Minute") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "EnableMetricsCollection") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("Granularity"), Equals, "1Minute") - c.Assert(values.Get("Metrics.member.1"), Equals, "GroupMinSize") - c.Assert(values.Get("Metrics.member.2"), Equals, "GroupMaxSize") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") -} - -func (s *S) TestEnterStandby(c *C) { - testServer.Response(200, nil, EnterStandbyResponse) - resp, err := s.as.EnterStandby("my-asg", []string{"i-5b73d709"}, true) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "EnterStandby") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-asg") - c.Assert(values.Get("ShouldDecrementDesiredCapacity"), Equals, "true") - c.Assert(values.Get("InstanceIds.member.1"), Equals, "i-5b73d709") - st, _ := time.Parse(time.RFC3339, "2014-06-13T22:35:50.884Z") - expected := &EnterStandbyResult{ - RequestId: "126f2f31-f34b-11e3-bc51-b35178f0274f", - Activities: []Activity{ - { - StatusCode: "InProgress", - Progress: 50, - ActivityId: "462b4bc3-ad3b-4e67-a58d-96cd00f02f9e", - StartTime: st, - AutoScalingGroupName: "my-asg", - Details: "{\"Availability Zone\":\"us-east-1a\"}", - Cause: "At 2014-06-13T22:35:50Z instance i-5b73d709 was moved to standby in response to a user request, shrinking the capacity from 4 to 3.", - Description: "Moving EC2 instance to Standby: i-5b73d709", - }, - }, - } - c.Assert(resp, DeepEquals, expected) -} - -func (s *S) TestExecutePolicy(c *C) { - testServer.Response(200, nil, ExecutePolicyResponse) - resp, err := s.as.ExecutePolicy("my-scaleout-policy", "my-test-asg", true) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "ExecutePolicy") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("PolicyName"), Equals, "my-scaleout-policy") - c.Assert(values.Get("HonorCooldown"), Equals, "true") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") -} - -func (s *S) TestExitStandby(c *C) { - testServer.Response(200, nil, ExitStandbyResponse) - resp, err := s.as.ExitStandby("my-asg", []string{"i-5b73d709"}) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "ExitStandby") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-asg") - c.Assert(values.Get("InstanceIds.member.1"), Equals, "i-5b73d709") - st, _ := time.Parse(time.RFC3339, "2014-06-13T22:43:53.523Z") - expected := &ExitStandbyResult{ - RequestId: "321a11c8-f34c-11e3-a434-7f10009d5849", - Activities: []Activity{ - { - StatusCode: "PreInService", - Progress: 30, - ActivityId: "dca4efcf-eea6-4844-8064-cab1fecd1aa2", - StartTime: st, - AutoScalingGroupName: "my-asg", - Details: "{\"Availability Zone\":\"us-east-1a\"}", - Cause: "At 2014-06-13T22:43:53Z instance i-5b73d709 was moved out of standby in response to a user request, increasing the capacity from 3 to 4.", - Description: "Moving EC2 instance out of Standby: i-5b73d709", - }, - }, - } - c.Assert(resp, DeepEquals, expected) -} - -func (s *S) TestPutLifecycleHook(c *C) { - testServer.Response(200, nil, PutLifecycleHookResponse) - request := &PutLifecycleHookParams{ - AutoScalingGroupName: "my-asg", - LifecycleHookName: "ReadyForSoftwareInstall", - LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING", - NotificationTargetARN: "arn:aws:sqs:us-east-1:896650972448:lifecyclehookqueue", - RoleARN: "arn:aws:iam::896650972448:role/AutoScaling", - } - resp, err := s.as.PutLifecycleHook(request) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "PutLifecycleHook") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-asg") - c.Assert(values.Get("LifecycleHookName"), Equals, "ReadyForSoftwareInstall") - c.Assert(values.Get("RoleARN"), Equals, "arn:aws:iam::896650972448:role/AutoScaling") - c.Assert(values.Get("LifecycleTransition"), Equals, "autoscaling:EC2_INSTANCE_LAUNCHING") - c.Assert(values.Get("NotificationTargetARN"), Equals, "arn:aws:sqs:us-east-1:896650972448:lifecyclehookqueue") - c.Assert(values.Get("DefaultResult"), Equals, "") - c.Assert(values.Get("HeartbeatTimeout"), Equals, "") - c.Assert(values.Get("NotificationMetadata"), Equals, "") - c.Assert(resp.RequestId, Equals, "1952f458-f645-11e3-bc51-b35178f0274f") -} - -func (s *S) TestPutNotificationConfiguration(c *C) { - testServer.Response(200, nil, PutNotificationConfigurationResponse) - resp, err := s.as.PutNotificationConfiguration("my-test-asg", []string{"autoscaling:EC2_INSTANCE_LAUNCH", "autoscaling:EC2_INSTANCE_LAUNCH_ERROR"}, "myTopicARN") - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "PutNotificationConfiguration") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("TopicARN"), Equals, "myTopicARN") - c.Assert(values.Get("NotificationTypes.member.1"), Equals, "autoscaling:EC2_INSTANCE_LAUNCH") - c.Assert(values.Get("NotificationTypes.member.2"), Equals, "autoscaling:EC2_INSTANCE_LAUNCH_ERROR") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") -} - -func (s *S) TestPutScalingPolicy(c *C) { - testServer.Response(200, nil, PutScalingPolicyResponse) - request := &PutScalingPolicyParams{ - AutoScalingGroupName: "my-test-asg", - PolicyName: "my-scaleout-policy", - ScalingAdjustment: 30, - AdjustmentType: "PercentChangeInCapacity", - Cooldown: 0, - MinAdjustmentStep: 0, - } - resp, err := s.as.PutScalingPolicy(request) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "PutScalingPolicy") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("PolicyName"), Equals, "my-scaleout-policy") - c.Assert(values.Get("AdjustmentType"), Equals, "PercentChangeInCapacity") - c.Assert(values.Get("ScalingAdjustment"), Equals, "30") - c.Assert(resp.RequestId, Equals, "3cfc6fef-c08b-11e2-a697-2922EXAMPLE") - c.Assert(resp.PolicyARN, Equals, "arn:aws:autoscaling:us-east-1:803981987763:scalingPolicy:b0dcf5e8-02e6-4e31-9719-0675d0dc31ae:autoScalingGroupName/my-test-asg:policyName/my-scaleout-policy") -} - -func (s *S) TestPutScheduledUpdateGroupAction(c *C) { - testServer.Response(200, nil, PutScheduledUpdateGroupActionResponse) - st, _ := time.Parse(time.RFC3339, "2013-05-25T08:00:00Z") - request := &PutScheduledUpdateGroupActionParams{ - AutoScalingGroupName: "my-test-asg", - DesiredCapacity: 3, - ScheduledActionName: "ScaleUp", - StartTime: st, - } - resp, err := s.as.PutScheduledUpdateGroupAction(request) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "PutScheduledUpdateGroupAction") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("ScheduledActionName"), Equals, "ScaleUp") - c.Assert(values.Get("DesiredCapacity"), Equals, "3") - c.Assert(values.Get("StartTime"), Equals, "2013-05-25T08:00:00Z") - c.Assert(resp.RequestId, Equals, "3bc8c9bc-6a62-11e2-8a51-4b8a1EXAMPLE") -} - -func (s *S) TestPutScheduledUpdateGroupActionCron(c *C) { - testServer.Response(200, nil, PutScheduledUpdateGroupActionResponse) - st, _ := time.Parse(time.RFC3339, "2013-05-25T08:00:00Z") - request := &PutScheduledUpdateGroupActionParams{ - AutoScalingGroupName: "my-test-asg", - DesiredCapacity: 3, - ScheduledActionName: "scaleup-schedule-year", - StartTime: st, - Recurrence: "30 0 1 1,6,12 *", - } - resp, err := s.as.PutScheduledUpdateGroupAction(request) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "PutScheduledUpdateGroupAction") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("ScheduledActionName"), Equals, "scaleup-schedule-year") - c.Assert(values.Get("DesiredCapacity"), Equals, "3") - c.Assert(values.Get("Recurrence"), Equals, "30 0 1 1,6,12 *") - c.Assert(resp.RequestId, Equals, "3bc8c9bc-6a62-11e2-8a51-4b8a1EXAMPLE") - -} - -func (s *S) TestResumeProcesses(c *C) { - testServer.Response(200, nil, ResumeProcessesResponse) - resp, err := s.as.ResumeProcesses("my-test-asg", []string{"Launch", "Terminate"}) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "ResumeProcesses") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("ScalingProcesses.member.1"), Equals, "Launch") - c.Assert(values.Get("ScalingProcesses.member.2"), Equals, "Terminate") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") - -} - -func (s *S) TestSetDesiredCapacity(c *C) { - testServer.Response(200, nil, SetDesiredCapacityResponse) - resp, err := s.as.SetDesiredCapacity("my-test-asg", 3, true) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "SetDesiredCapacity") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("HonorCooldown"), Equals, "true") - c.Assert(values.Get("DesiredCapacity"), Equals, "3") - c.Assert(resp.RequestId, Equals, "9fb7e2db-6998-11e2-a985-57c82EXAMPLE") -} - -func (s *S) TestSetInstanceHealth(c *C) { - testServer.Response(200, nil, SetInstanceHealthResponse) - resp, err := s.as.SetInstanceHealth("i-baha3121", "Unhealthy", false) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "SetInstanceHealth") - c.Assert(values.Get("HealthStatus"), Equals, "Unhealthy") - c.Assert(values.Get("InstanceId"), Equals, "i-baha3121") - c.Assert(values.Get("ShouldRespectGracePeriod"), Equals, "false") - c.Assert(resp.RequestId, Equals, "9fb7e2db-6998-11e2-a985-57c82EXAMPLE") -} - -func (s *S) TestSuspendProcesses(c *C) { - testServer.Response(200, nil, SuspendProcessesResponse) - resp, err := s.as.SuspendProcesses("my-test-asg", []string{"Launch", "Terminate"}) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "SuspendProcesses") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("ScalingProcesses.member.1"), Equals, "Launch") - c.Assert(values.Get("ScalingProcesses.member.2"), Equals, "Terminate") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") -} - -func (s *S) TestTerminateInstanceInAutoScalingGroup(c *C) { - testServer.Response(200, nil, TerminateInstanceInAutoScalingGroupResponse) - st, _ := time.Parse(time.RFC3339, "2014-01-26T14:08:30.560Z") - resp, err := s.as.TerminateInstanceInAutoScalingGroup("i-br234123", false) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "TerminateInstanceInAutoScalingGroup") - c.Assert(values.Get("InstanceId"), Equals, "i-br234123") - c.Assert(values.Get("ShouldDecrementDesiredCapacity"), Equals, "false") - expected := &TerminateInstanceInAutoScalingGroupResp{ - Activity: Activity{ - ActivityId: "cczc44a87-7d04-dsa15-31-d27c219864c5", - Cause: "At 2014-01-26T14:08:30Z instance i-br234123 was taken out of service in response to a user request.", - Description: "Terminating EC2 instance: i-br234123", - Details: "{\"Availability Zone\":\"us-east-1b\"}", - Progress: 0, - StartTime: st, - StatusCode: "InProgress", - }, - RequestId: "8d798a29-f083-11e1-bdfb-cb223EXAMPLE", - } - c.Assert(resp, DeepEquals, expected) -} - -func (s *S) TestUpdateAutoScalingGroup(c *C) { - testServer.Response(200, nil, UpdateAutoScalingGroupResponse) - - asg := &AutoScalingGroup{ - AutoScalingGroupName: "my-test-asg", - AvailabilityZones: []string{"us-east-1a", "us-east-1b"}, - MinSize: 3, - MaxSize: 3, - DefaultCooldown: 600, - DesiredCapacity: 3, - LaunchConfigurationName: "my-test-lc", - VPCZoneIdentifier: "subnet-610acd08,subnet-530fc83a", - } - resp, err := s.as.UpdateAutoScalingGroup(asg) - c.Assert(err, IsNil) - values := testServer.WaitRequest().PostForm - c.Assert(values.Get("Version"), Equals, "2011-01-01") - c.Assert(values.Get("Action"), Equals, "UpdateAutoScalingGroup") - c.Assert(values.Get("AutoScalingGroupName"), Equals, "my-test-asg") - c.Assert(values.Get("AvailabilityZones.member.1"), Equals, "us-east-1a") - c.Assert(values.Get("AvailabilityZones.member.2"), Equals, "us-east-1b") - c.Assert(values.Get("MinSize"), Equals, "3") - c.Assert(values.Get("MaxSize"), Equals, "3") - c.Assert(values.Get("DefaultCooldown"), Equals, "600") - c.Assert(values.Get("DesiredCapacity"), Equals, "3") - c.Assert(values.Get("LaunchConfigurationName"), Equals, "my-test-lc") - c.Assert(values.Get("VPCZoneIdentifier"), Equals, "subnet-610acd08,subnet-530fc83a") - c.Assert(resp.RequestId, Equals, "8d798a29-f083-11e1-bdfb-cb223EXAMPLE") -} diff --git a/vendor/github.com/goamz/goamz/autoscaling/responses_test.go b/vendor/github.com/goamz/goamz/autoscaling/responses_test.go deleted file mode 100644 index 935231aa2..000000000 --- a/vendor/github.com/goamz/goamz/autoscaling/responses_test.go +++ /dev/null @@ -1,627 +0,0 @@ -package autoscaling - -var AttachInstancesResponse = ` -<AttachInstancesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</AttachInstancesResponse> -` -var BasicGroupResponse = ` -<DescribeAutoScalingGroupsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeAutoScalingGroupsResult> - <AutoScalingGroups/> - </DescribeAutoScalingGroupsResult> - <ResponseMetadata> - <RequestId>08c3bedc-8421-11e3-9bb5-bfa219b29cce</RequestId> - </ResponseMetadata> -</DescribeAutoScalingGroupsResponse> -` -var CreateAutoScalingGroupResponse = ` -<CreateAutoScalingGroupResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</CreateAutoScalingGroupResponse> -` -var CreateLaunchConfigurationResponse = ` -<CreateLaunchConfigurationResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> -<ResponseMetadata> - <RequestId>7c6e177f-f082-11e1-ac58-3714bEXAMPLE</RequestId> -</ResponseMetadata> -</CreateLaunchConfigurationResponse> -` -var CreateOrUpdateTagsResponse = ` -<CreateOrUpdateTagsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>b0203919-bf1b-11e2-8a01-13263EXAMPLE</RequestId> - </ResponseMetadata> -</CreateOrUpdateTagsResponse> -` -var DeleteAutoScalingGroupResponse = ` - <DeleteAutoScalingGroupResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>70a76d42-9665-11e2-9fdf-211deEXAMPLE</RequestId> - </ResponseMetadata> - </DeleteAutoScalingGroupResponse> -` -var DeleteAutoScalingGroupErrorResponse = ` -<ErrorResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <Error> - <Type>Sender</Type> - <Code>ResourceInUse</Code> - <Message>You cannot delete an AutoScalingGroup while there are instances or pending Spot instance request(s) still in the group.</Message> - </Error> - <RequestId>70a76d42-9665-11e2-9fdf-211deEXAMPLE</RequestId> -</ErrorResponse> -` -var DeleteLaunchConfigurationResponse = ` -<DeleteLaunchConfigurationResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>7347261f-97df-11e2-8756-35eEXAMPLE</RequestId> - </ResponseMetadata> -</DeleteLaunchConfigurationResponse> -` -var DeleteLaunchConfigurationInUseResponse = ` -<ErrorResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <Error> - <Type>Sender</Type> - <Code>ResourceInUse</Code> - <Message>Cannot delete launch configuration my-test-lc because it is attached to AutoScalingGroup test</Message> - </Error> - <RequestId>7347261f-97df-11e2-8756-35eEXAMPLE</RequestId> -</ErrorResponse> -` -var DeleteScheduledActionResponse = ` -<DeleteScheduledActionResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>0f38bb02-8421-11e3-9bb5-bfa219b29cce</RequestId> - </ResponseMetadata> -</DeleteScheduledActionResponse> -` -var DeleteTagsResponse = ` -<CreateOrUpdateTagsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>b0203919-bf1b-11e2-8a01-13263EXAMPLE</RequestId> - </ResponseMetadata> -</CreateOrUpdateTagsResponse> -` -var DescribeAccountLimitsResponse = ` -<DescribeAccountLimitsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeAccountLimitsResult> - <MaxNumberOfLaunchConfigurations>100</MaxNumberOfLaunchConfigurations> - <MaxNumberOfAutoScalingGroups>20</MaxNumberOfAutoScalingGroups> - </DescribeAccountLimitsResult> - <ResponseMetadata> - <RequestId>a32bd184-519d-11e3-a8a4-c1c467cbcc3b</RequestId> - </ResponseMetadata> -</DescribeAccountLimitsResponse> -` -var DescribeAdjustmentTypesResponse = ` -<DescribeAdjustmentTypesResponse xmlns="http://autoscaling.amazonaws.com/doc/201-01-01/"> - <DescribeAdjustmentTypesResult> - <AdjustmentTypes> - <member> - <AdjustmentType>ChangeInCapacity</AdjustmentType> - </member> - <member> - <AdjustmentType>ExactCapacity</AdjustmentType> - </member> - <member> - <AdjustmentType>PercentChangeInCapacity</AdjustmentType> - </member> - </AdjustmentTypes> - </DescribeAdjustmentTypesResult> - <ResponseMetadata> - <RequestId>cc5f0337-b694-11e2-afc0-6544dEXAMPLE</RequestId> - </ResponseMetadata> -</DescribeAdjustmentTypesResponse> -` -var DescribeAutoScalingGroupsResponse = ` -<DescribeAutoScalingGroupsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> -<DescribeAutoScalingGroupsResult> - <AutoScalingGroups> - <member> - <Tags> - <member> - <ResourceId>my-test-asg-lbs</ResourceId> - <PropagateAtLaunch>true</PropagateAtLaunch> - <Value>bar</Value> - <Key>foo</Key> - <ResourceType>auto-scaling-group</ResourceType> - </member> - <member> - <ResourceId>my-test-asg-lbs</ResourceId> - <PropagateAtLaunch>true</PropagateAtLaunch> - <Value>qux</Value> - <Key>baz</Key> - <ResourceType>auto-scaling-group</ResourceType> - </member> - </Tags> - <SuspendedProcesses/> - <AutoScalingGroupName>my-test-asg-lbs</AutoScalingGroupName> - <HealthCheckType>ELB</HealthCheckType> - <CreatedTime>2013-05-06T17:47:15.107Z</CreatedTime> - <EnabledMetrics/> - <LaunchConfigurationName>my-test-lc</LaunchConfigurationName> - <Instances> - <member> - <HealthStatus>Healthy</HealthStatus> - <AvailabilityZone>us-east-1b</AvailabilityZone> - <InstanceId>i-zb1f313</InstanceId> - <LaunchConfigurationName>my-test-lc</LaunchConfigurationName> - <LifecycleState>InService</LifecycleState> - </member> - <member> - <HealthStatus>Healthy</HealthStatus> - <AvailabilityZone>us-east-1a</AvailabilityZone> - <InstanceId>i-90123adv</InstanceId> - <LaunchConfigurationName>my-test-lc</LaunchConfigurationName> - <LifecycleState>InService</LifecycleState> - </member> - </Instances> - <DesiredCapacity>2</DesiredCapacity> - <AvailabilityZones> - <member>us-east-1b</member> - <member>us-east-1a</member> - </AvailabilityZones> - <LoadBalancerNames> - <member>my-test-asg-loadbalancer</member> - </LoadBalancerNames> - <MinSize>2</MinSize> - <VPCZoneIdentifier>subnet-32131da1,subnet-1312dad2</VPCZoneIdentifier> - <HealthCheckGracePeriod>120</HealthCheckGracePeriod> - <DefaultCooldown>300</DefaultCooldown> - <AutoScalingGroupARN>arn:aws:autoscaling:us-east-1:803981987763:autoScalingGroup:ca861182-c8f9-4ca7-b1eb-cd35505f5ebb:autoScalingGroupName/my-test-asg-lbs</AutoScalingGroupARN> - <TerminationPolicies> - <member>Default</member> - </TerminationPolicies> - <MaxSize>10</MaxSize> - </member> - </AutoScalingGroups> - </DescribeAutoScalingGroupsResult> - <ResponseMetadata> - <RequestId>0f02a07d-b677-11e2-9eb0-dd50EXAMPLE</RequestId> - </ResponseMetadata> -</DescribeAutoScalingGroupsResponse> -` -var DescribeAutoScalingInstancesResponse = ` -<DescribeAutoScalingInstancesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeAutoScalingInstancesResult> - <AutoScalingInstances> - <member> - <HealthStatus>Healthy</HealthStatus> - <AutoScalingGroupName>my-test-asg</AutoScalingGroupName> - <AvailabilityZone>us-east-1a</AvailabilityZone> - <InstanceId>i-78e0d40b</InstanceId> - <LaunchConfigurationName>my-test-lc</LaunchConfigurationName> - <LifecycleState>InService</LifecycleState> - </member> - </AutoScalingInstances> - </DescribeAutoScalingInstancesResult> - <ResponseMetadata> - <RequestId>df992dc3-b72f-11e2-81e1-750aa6EXAMPLE</RequestId> - </ResponseMetadata> -</DescribeAutoScalingInstancesResponse> -` -var DescribeLaunchConfigurationsResponse = ` -<DescribeLaunchConfigurationsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeLaunchConfigurationsResult> - <LaunchConfigurations> - <member> - <AssociatePublicIpAddress>true</AssociatePublicIpAddress> - <SecurityGroups/> - <CreatedTime>2013-01-21T23:04:42.200Z</CreatedTime> - <KernelId/> - <LaunchConfigurationName>my-test-lc</LaunchConfigurationName> - <UserData/> - <InstanceType>m1.small</InstanceType> - <LaunchConfigurationARN>arn:aws:autoscaling:us-east-1:803981987763:launchConfiguration:9dbbbf87-6141-428a-a409-0752edbe6cad:launchConfigurationName/my-test-lc</LaunchConfigurationARN> - <BlockDeviceMappings> - <member> - <VirtualName>ephemeral0</VirtualName> - <DeviceName>/dev/sdb</DeviceName> - </member> - <member> - <Ebs> - <SnapshotId>snap-XXXXYYY</SnapshotId> - <VolumeSize>100</VolumeSize> - <Iops>50</Iops> - <VolumeType>io1</VolumeType> - <DeleteOnTermination>true</DeleteOnTermination> - </Ebs> - <DeviceName>/dev/sdf</DeviceName> - </member> - </BlockDeviceMappings> - <ImageId>ami-514ac838</ImageId> - <KeyName/> - <RamdiskId/> - <InstanceMonitoring> - <Enabled>true</Enabled> - </InstanceMonitoring> - <EbsOptimized>false</EbsOptimized> - </member> - </LaunchConfigurations> - </DescribeLaunchConfigurationsResult> - <ResponseMetadata> - <RequestId>d05a22f8-b690-11e2-bf8e-2113fEXAMPLE</RequestId> - </ResponseMetadata> -</DescribeLaunchConfigurationsResponse> -` -var DescribeMetricCollectionTypesResponse = ` -<DescribeMetricCollectionTypesResponse xmlns="http://autoscaling.amazonaws.co -oc/2011-01-01/"> - <DescribeMetricCollectionTypesResult> - <Metrics> - <member> - <Metric>GroupMinSize</Metric> - </member> - <member> - <Metric>GroupMaxSize</Metric> - </member> - <member> - <Metric>GroupDesiredCapacity</Metric> - </member> - <member> - <Metric>GroupInServiceInstances</Metric> - </member> - <member> - <Metric>GroupPendingInstances</Metric> - </member> - <member> - <Metric>GroupTerminatingInstances</Metric> - </member> - <member> - <Metric>GroupTotalInstances</Metric> - </member> - </Metrics> - <Granularities> - <member> - <Granularity>1Minute</Granularity> - </member> - </Granularities> - </DescribeMetricCollectionTypesResult> - <ResponseMetadata> - <RequestId>07f3fea2-bf3c-11e2-9b6f-f3cdbb80c073</RequestId> - </ResponseMetadata> -</DescribeMetricCollectionTypesResponse> -` -var DescribeNotificationConfigurationsResponse = ` -<DescribeNotificationConfigurationsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeNotificationConfigurationsResult> - <NotificationConfigurations> - <member> - <AutoScalingGroupName>my-test-asg</AutoScalingGroupName> - <NotificationType>autoscaling: EC2_INSTANCE_LAUNCH</NotificationType> - <TopicARN>vajdoafj231j41231/topic</TopicARN> - </member> - </NotificationConfigurations> - </DescribeNotificationConfigurationsResult> - <ResponseMetadata> - <RequestId>07f3fea2-bf3c-11e2-9b6f-f3cdbb80c073</RequestId> - </ResponseMetadata> -</DescribeNotificationConfigurationsResponse> -` -var DescribePoliciesResponse = ` -<DescribePoliciesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribePoliciesResult> - <NextToken>3ef417fe-9202-12-8ddd-d13e1313413</NextToken> - <ScalingPolicies> - <member> - <PolicyARN>arn:aws:autoscaling:us-east-1:803981987763:scalingPolicy:c322761b-3172-4d56-9a21-0ed9d6161d67:autoScalingGroupName/my-test-asg:policyName/MyScaleDownPolicy</PolicyARN> - <AdjustmentType>ChangeInCapacity</AdjustmentType> - <ScalingAdjustment>-1</ScalingAdjustment> - <PolicyName>MyScaleDownPolicy</PolicyName> - <AutoScalingGroupName>my-test-asg</AutoScalingGroupName> - <Cooldown>60</Cooldown> - <Alarms> - <member> - <AlarmName>TestQueue</AlarmName> - <AlarmARN>arn:aws:cloudwatch:us-east-1:803981987763:alarm:TestQueue</AlarmARN> - </member> - </Alarms> - </member> - <member> - <PolicyARN>arn:aws:autoscaling:us-east-1:803981987763:scalingPolicy:c55a5cdd-9be0-435b-b60b-a8dd313159f5:autoScalingGroupName/my-test-asg:policyName/MyScaleUpPolicy</PolicyARN> - <AdjustmentType>ChangeInCapacity</AdjustmentType> - <ScalingAdjustment>1</ScalingAdjustment> - <PolicyName>MyScaleUpPolicy</PolicyName> - <AutoScalingGroupName>my-test-asg</AutoScalingGroupName> - <Cooldown>60</Cooldown> - <Alarms> - <member> - <AlarmName>TestQueue</AlarmName> - <AlarmARN>arn:aws:cloudwatch:us-east-1:803981987763:alarm:TestQueue</AlarmARN> - </member> - </Alarms> - </member> - </ScalingPolicies> - </DescribePoliciesResult> - <ResponseMetadata> - <RequestId>ec3bffad-b739-11e2-b38d-15fbEXAMPLE</RequestId> - </ResponseMetadata> -</DescribePoliciesResponse> -` -var DescribeScalingActivitiesResponse = ` -<DescribeScalingActivitiesResponse xmlns="http://ec2.amazonaws.com/doc/2011-01-01/"> -<DescribeScalingActivitiesResult> - <NextToken>3ef417fe-9202-12-8ddd-d13e1313413</NextToken> -<Activities> - <member> - <StatusCode>Failed</StatusCode> - <Progress>0</Progress> - <ActivityId>063308ae-aa22-4a9b-94f4-9faeEXAMPLE</ActivityId> - <StartTime>2012-04-12T17:32:07.882Z</StartTime> - <AutoScalingGroupName>my-test-asg</AutoScalingGroupName> - <Cause>At 2012-04-12T17:31:30Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1. At 2012-04-12T17:32:07Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.</Cause> - <Details>{}</Details> - <Description>Launching a new EC2 instance. Status Reason: The image id 'ami-4edb0327' does not exist. Launching EC2 instance failed.</Description> - <EndTime>2012-04-12T17:32:08Z</EndTime> - <StatusMessage>The image id 'ami-4edb0327' does not exist. Launching EC2 instance failed.</StatusMessage> - </member> -</Activities> - </DescribeScalingActivitiesResult> - <ResponseMetadata> - <RequestId>7a641adc-84c5-11e1-a8a5-217ebEXAMPLE</RequestId> - </ResponseMetadata> -</DescribeScalingActivitiesResponse> -` -var DescribeScalingProcessTypesResponse = ` -<DescribeScalingProcessTypesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeScalingProcessTypesResult> - <Processes> - <member> - <ProcessName>AZRebalance</ProcessName> - </member> - <member> - <ProcessName>AddToLoadBalancer</ProcessName> - </member> - <member> - <ProcessName>AlarmNotification</ProcessName> - </member> - <member> - <ProcessName>HealthCheck</ProcessName> - </member> - <member> - <ProcessName>Launch</ProcessName> - </member> - <member> - <ProcessName>ReplaceUnhealthy</ProcessName> - </member> - <member> - <ProcessName>ScheduledActions</ProcessName> - </member> - <member> - <ProcessName>Terminate</ProcessName> - </member> - </Processes> - </DescribeScalingProcessTypesResult> - <ResponseMetadata> - <RequestId>27f2eacc-b73f-11e2-ad99-c7aba3a9c963</RequestId> - </ResponseMetadata> -</DescribeScalingProcessTypesResponse> -` -var DescribeScheduledActionsResponse = ` -<DescribeScheduledActionsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeScheduledActionsResult> - <ScheduledUpdateGroupActions> - <member> - <ScheduledActionName>SATest1</ScheduledActionName> - <StartTime>2014-06-01T00:30:00Z</StartTime> - <Time>2014-06-01T00:30:00Z</Time> - <ScheduledActionARN>arn:aws:autoscaling:us-west-2:193024542802:scheduledUpdateGroupAction:61f68b2c-bde3-4316-9a81-eb95dc246509:autoScalingGroupName/ASGTest1:scheduledActionName/SATest1</ScheduledActionARN> - <AutoScalingGroupName>ASGTest1</AutoScalingGroupName> - <Recurrence>30 0 1 1,6,12 *</Recurrence> - <MaxSize>4</MaxSize> - </member> - </ScheduledUpdateGroupActions> - </DescribeScheduledActionsResult> - <ResponseMetadata> - <RequestId>0eb4217f-8421-11e3-9233-7100ef811766</RequestId> - </ResponseMetadata> -</DescribeScheduledActionsResponse> -` - -var DescribeTerminationPolicyTypesResponse = ` -<DescribeTerminationPolicyTypesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeTerminationPolicyTypesResult> - <TerminationPolicyTypes> - <member>ClosestToNextInstanceHour</member> - <member>Default</member> - <member>NewestInstance</member> - <member>OldestInstance</member> - <member>OldestLaunchConfiguration</member> - </TerminationPolicyTypes> - </DescribeTerminationPolicyTypesResult> - <ResponseMetadata> - <RequestId>d9a05827-b735-11e2-a40c-c79a5EXAMPLE</RequestId> - </ResponseMetadata> -</DescribeTerminationPolicyTypesResponse> -` -var DescribeTagsResponse = ` -<DescribeTagsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DescribeTagsResult> - <Tags> - <member> - <ResourceId>my-test-asg</ResourceId> - <PropagateAtLaunch>true</PropagateAtLaunch> - <Value>1.0</Value> - <Key>version</Key> - <ResourceType>auto-scaling-group</ResourceType> - </member> - </Tags> - </DescribeTagsResult> - <ResponseMetadata> - <RequestId>086265fd-bf3e-11e2-85fc-fbb1EXAMPLE</RequestId> - </ResponseMetadata> -</DescribeTagsResponse> -` -var DetachInstancesResponse = ` -<DetachInstancesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <DetachInstancesResult> - <Activities> - <member> - <ActivityId>e54ff599-bf05-4076-8b95-a0f090ed90bb</ActivityId> - <Progress>50</Progress> - <StatusCode>InProgress</StatusCode> - <StartTime>2014-06-14T00:07:30.280Z</StartTime> - <Cause>At 2014-06-14T00:07:30Z instance i-5f2e8a0d was detached in response to a user request, shrinking the capacity from 4 to 3.</Cause> - <AutoScalingGroupName>my-asg</AutoScalingGroupName> - <Details>{"Availability Zone":"us-east-1a"}</Details> - <Description>Detaching EC2 instance: i-5f2e8a0d</Description> - </member> - </Activities> - </DetachInstancesResult> - <ResponseMetadata> - <RequestId>e04f3b11-f357-11e3-a434-7f10009d5849</RequestId> - </ResponseMetadata> -</DetachInstancesResponse> -` -var DisableMetricsCollectionResponse = ` -<DisableMetricsCollectionResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</DisableMetricsCollectionResponse> -` -var EnableMetricsCollectionResponse = ` -<EnableMetricsCollectionResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</EnableMetricsCollectionResponse> -` -var EnterStandbyResponse = ` -<EnterStandbyResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <EnterStandbyResult> - <Activities> - <member> - <ActivityId>462b4bc3-ad3b-4e67-a58d-96cd00f02f9e</ActivityId> - <Progress>50</Progress> - <StatusCode>InProgress</StatusCode> - <StartTime>2014-06-13T22:35:50.884Z</StartTime> - <Cause>At 2014-06-13T22:35:50Z instance i-5b73d709 was moved to standby in response to a user request, shrinking the capacity from 4 to 3.</Cause> - <AutoScalingGroupName>my-asg</AutoScalingGroupName> - <Details>{"Availability Zone":"us-east-1a"}</Details> - <Description>Moving EC2 instance to Standby: i-5b73d709</Description> - </member> - </Activities> - </EnterStandbyResult> - <ResponseMetadata> - <RequestId>126f2f31-f34b-11e3-bc51-b35178f0274f</RequestId> - </ResponseMetadata> -</EnterStandbyResponse> -` -var ExecutePolicyResponse = ` -<EnableMetricsCollectionResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</EnableMetricsCollectionResponse> -` -var ExitStandbyResponse = ` -<ExitStandbyResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ExitStandbyResult> - <Activities> - <member> - <ActivityId>dca4efcf-eea6-4844-8064-cab1fecd1aa2</ActivityId> - <Progress>30</Progress> - <StatusCode>PreInService</StatusCode> - <StartTime>2014-06-13T22:43:53.523Z</StartTime> - <Cause>At 2014-06-13T22:43:53Z instance i-5b73d709 was moved out of standby in response to a user request, increasing the capacity from 3 to 4.</Cause> - <AutoScalingGroupName>my-asg</AutoScalingGroupName> - <Details>{"Availability Zone":"us-east-1a"}</Details> - <Description>Moving EC2 instance out of Standby: i-5b73d709</Description> - </member> - </Activities> - </ExitStandbyResult> - <ResponseMetadata> - <RequestId>321a11c8-f34c-11e3-a434-7f10009d5849</RequestId> - </ResponseMetadata> -</ExitStandbyResponse> -` -var PutLifecycleHookResponse = ` -<PutLifecycleHookResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <PutLifecycleHookResult/> - <ResponseMetadata> - <RequestId>1952f458-f645-11e3-bc51-b35178f0274f</RequestId> - </ResponseMetadata> -</PutLifecycleHookResponse> -` -var PutNotificationConfigurationResponse = ` -<EnableMetricsCollectionResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</EnableMetricsCollectionResponse> -` -var PutScalingPolicyResponse = ` -<PutScalingPolicyResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <PutScalingPolicyResult> - <PolicyARN>arn:aws:autoscaling:us-east-1:803981987763:scalingPolicy:b0dcf5e8-02e6-4e31-9719-0675d0dc31ae:autoScalingGroupName/my-test-asg:policyName/my-scaleout-policy</PolicyARN> - </PutScalingPolicyResult> - <ResponseMetadata> - <RequestId>3cfc6fef-c08b-11e2-a697-2922EXAMPLE</RequestId> - </ResponseMetadata> -</PutScalingPolicyResponse> -` -var PutScheduledUpdateGroupActionResponse = ` -<PutScheduledUpdateGroupActionResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>3bc8c9bc-6a62-11e2-8a51-4b8a1EXAMPLE</RequestId> - </ResponseMetadata> - </PutScheduledUpdateGroupActionResponse> - ` -var ResumeProcessesResponse = ` -<ResumeProcessesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</ResumeProcessesResponse> -` -var SetDesiredCapacityResponse = ` -<SetDesiredCapacityResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>9fb7e2db-6998-11e2-a985-57c82EXAMPLE</RequestId> - </ResponseMetadata> -</SetDesiredCapacityResponse> -` -var SetInstanceHealthResponse = ` -<SetInstanceHealthResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>9fb7e2db-6998-11e2-a985-57c82EXAMPLE</RequestId> - </ResponseMetadata> -</SetInstanceHealthResponse> -` -var SuspendProcessesResponse = ` -<SuspendProcessesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</SuspendProcessesResponse> -` -var TerminateInstanceInAutoScalingGroupResponse = ` -<TerminateInstanceInAutoScalingGroupResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <TerminateInstanceInAutoScalingGroupResult> - <Activity> - <StatusCode>InProgress</StatusCode> - <ActivityId>cczc44a87-7d04-dsa15-31-d27c219864c5</ActivityId> - <Progress>0</Progress> - <StartTime>2014-01-26T14:08:30.560Z</StartTime> - <Cause>At 2014-01-26T14:08:30Z instance i-br234123 was taken out of service in response to a user request.</Cause> - <Details>{"Availability Zone":"us-east-1b"}</Details> - <Description>Terminating EC2 instance: i-br234123</Description> - </Activity> - </TerminateInstanceInAutoScalingGroupResult> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</TerminateInstanceInAutoScalingGroupResponse> -` -var UpdateAutoScalingGroupResponse = ` -<UpdateAutoScalingGroupResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> - <ResponseMetadata> - <RequestId>8d798a29-f083-11e1-bdfb-cb223EXAMPLE</RequestId> - </ResponseMetadata> -</UpdateAutoScalingGroupResponse> -` |