aws-sdk-autoscaling 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-autoscaling.rb +2 -2
- data/lib/aws-sdk-autoscaling/activity.rb +131 -133
- data/lib/aws-sdk-autoscaling/auto_scaling_group.rb +940 -942
- data/lib/aws-sdk-autoscaling/client.rb +3146 -2674
- data/lib/aws-sdk-autoscaling/client_api.rb +1403 -1405
- data/lib/aws-sdk-autoscaling/errors.rb +4 -13
- data/lib/aws-sdk-autoscaling/instance.rb +351 -359
- data/lib/aws-sdk-autoscaling/launch_configuration.rb +198 -200
- data/lib/aws-sdk-autoscaling/lifecycle_hook.rb +288 -290
- data/lib/aws-sdk-autoscaling/load_balancer.rb +179 -187
- data/lib/aws-sdk-autoscaling/notification_configuration.rb +162 -167
- data/lib/aws-sdk-autoscaling/resource.rb +645 -647
- data/lib/aws-sdk-autoscaling/scaling_policy.rb +216 -218
- data/lib/aws-sdk-autoscaling/scheduled_action.rb +152 -154
- data/lib/aws-sdk-autoscaling/tag.rb +216 -224
- data/lib/aws-sdk-autoscaling/types.rb +3987 -3547
- data/lib/aws-sdk-autoscaling/waiters.rb +126 -127
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e0d64f5069738e9913771be07203843da745712
|
4
|
+
data.tar.gz: 5da5c4b67f12fc97f3a6c672b6fa6b24ae1d7708
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d8e47883554b4ca92abfd84abdf267adab3d791503ad1379dfd215d3df2d2df7c38994db4c0238c99dd70d5a49447c8f873c61012263003708c34b742c69aad
|
7
|
+
data.tar.gz: 0bf597c13cf7294b63fd6582b4f46b4839549fc01418df42c97330d6575dc63a78a9cc3c7d529098e5035c8e9d12cf67ff9a73b9de84db0fa6fa39f82bde3abe
|
data/lib/aws-sdk-autoscaling.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
@@ -53,6 +53,6 @@ require_relative 'aws-sdk-autoscaling/customizations'
|
|
53
53
|
# @service
|
54
54
|
module Aws::AutoScaling
|
55
55
|
|
56
|
-
GEM_VERSION = '1.0.0.
|
56
|
+
GEM_VERSION = '1.0.0.rc2'
|
57
57
|
|
58
58
|
end
|
@@ -1,161 +1,159 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::AutoScaling
|
9
|
+
class Activity
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(id, options = {})
|
14
|
+
# @param [String] id
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :id
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@id = extract_id(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def id
|
30
|
+
@id
|
31
|
+
end
|
32
|
+
alias :activity_id :id
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The name of the Auto Scaling group.
|
35
|
+
# @return [String]
|
36
|
+
def auto_scaling_group_name
|
37
|
+
data.auto_scaling_group_name
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# A friendly, more verbose description of the activity.
|
41
|
+
# @return [String]
|
42
|
+
def description
|
43
|
+
data.description
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The reason the activity began.
|
47
|
+
# @return [String]
|
48
|
+
def cause
|
49
|
+
data.cause
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
# The start time of the activity.
|
53
|
+
# @return [Time]
|
54
|
+
def start_time
|
55
|
+
data.start_time
|
56
|
+
end
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
# The end time of the activity.
|
59
|
+
# @return [Time]
|
60
|
+
def end_time
|
61
|
+
data.end_time
|
62
|
+
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
# The current status of the activity.
|
65
|
+
# @return [String]
|
66
|
+
def status_code
|
67
|
+
data.status_code
|
68
|
+
end
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
70
|
+
# A friendly, more verbose description of the activity status.
|
71
|
+
# @return [String]
|
72
|
+
def status_message
|
73
|
+
data.status_message
|
74
|
+
end
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
# A value between 0 and 100 that indicates the progress of the activity.
|
77
|
+
# @return [Integer]
|
78
|
+
def progress
|
79
|
+
data.progress
|
80
|
+
end
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
82
|
+
# The details about the activity.
|
83
|
+
# @return [String]
|
84
|
+
def details
|
85
|
+
data.details
|
86
|
+
end
|
88
87
|
|
89
|
-
|
88
|
+
# @!endgroup
|
90
89
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
# @return [Client]
|
91
|
+
def client
|
92
|
+
@client
|
93
|
+
end
|
95
94
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
95
|
+
# Loads, or reloads {#data} for the current {Activity}.
|
96
|
+
# Returns `self` making it possible to chain methods.
|
97
|
+
#
|
98
|
+
# activity.reload.data
|
99
|
+
#
|
100
|
+
# @return [self]
|
101
|
+
def load
|
102
|
+
resp = @client.describe_scaling_activities(activity_ids: [@id])
|
103
|
+
@data = resp.activities[0]
|
104
|
+
self
|
105
|
+
end
|
106
|
+
alias :reload :load
|
107
|
+
|
108
|
+
# @return [Types::Activity]
|
109
|
+
# Returns the data for this {Activity}. Calls
|
110
|
+
# {Client#describe_scaling_activities} if {#data_loaded?} is `false`.
|
111
|
+
def data
|
112
|
+
load unless @data
|
113
|
+
@data
|
114
|
+
end
|
116
115
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
116
|
+
# @return [Boolean]
|
117
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
118
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
119
|
+
def data_loaded?
|
120
|
+
!!@data
|
121
|
+
end
|
123
122
|
|
124
|
-
|
125
|
-
|
126
|
-
# @return [AutoScalingGroup, nil]
|
127
|
-
def group
|
128
|
-
if data.auto_scaling_group_name
|
129
|
-
AutoScalingGroup.new(
|
130
|
-
name: data.auto_scaling_group_name,
|
131
|
-
client: @client
|
132
|
-
)
|
133
|
-
else
|
134
|
-
nil
|
135
|
-
end
|
136
|
-
end
|
123
|
+
# @!group Associations
|
137
124
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
def extract_id(args, options)
|
148
|
-
value = args[0] || options.delete(:id)
|
149
|
-
case value
|
150
|
-
when String then value
|
151
|
-
when nil then raise ArgumentError, "missing required option :id"
|
152
|
-
else
|
153
|
-
msg = "expected :id to be a String, got #{value.class}"
|
154
|
-
raise ArgumentError, msg
|
155
|
-
end
|
125
|
+
# @return [AutoScalingGroup, nil]
|
126
|
+
def group
|
127
|
+
if data.auto_scaling_group_name
|
128
|
+
AutoScalingGroup.new(
|
129
|
+
name: data.auto_scaling_group_name,
|
130
|
+
client: @client
|
131
|
+
)
|
132
|
+
else
|
133
|
+
nil
|
156
134
|
end
|
135
|
+
end
|
157
136
|
|
158
|
-
|
137
|
+
# @deprecated
|
138
|
+
# @api private
|
139
|
+
def identifiers
|
140
|
+
{ id: @id }
|
159
141
|
end
|
142
|
+
deprecated(:identifiers)
|
143
|
+
|
144
|
+
private
|
145
|
+
|
146
|
+
def extract_id(args, options)
|
147
|
+
value = args[0] || options.delete(:id)
|
148
|
+
case value
|
149
|
+
when String then value
|
150
|
+
when nil then raise ArgumentError, "missing required option :id"
|
151
|
+
else
|
152
|
+
msg = "expected :id to be a String, got #{value.class}"
|
153
|
+
raise ArgumentError, msg
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
class Collection < Aws::Resources::Collection; end
|
160
158
|
end
|
161
159
|
end
|
@@ -1,1045 +1,1043 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::AutoScaling
|
9
|
+
class AutoScalingGroup
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(name, options = {})
|
14
|
+
# @param [String] name
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :name
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@name = extract_name(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def name
|
30
|
+
@name
|
31
|
+
end
|
32
|
+
alias :auto_scaling_group_name :name
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The Amazon Resource Name (ARN) of the group.
|
35
|
+
# @return [String]
|
36
|
+
def auto_scaling_group_arn
|
37
|
+
data.auto_scaling_group_arn
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The name of the associated launch configuration.
|
41
|
+
# @return [String]
|
42
|
+
def launch_configuration_name
|
43
|
+
data.launch_configuration_name
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The minimum size of the group.
|
47
|
+
# @return [Integer]
|
48
|
+
def min_size
|
49
|
+
data.min_size
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
# The maximum size of the group.
|
53
|
+
# @return [Integer]
|
54
|
+
def max_size
|
55
|
+
data.max_size
|
56
|
+
end
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
# The desired size of the group.
|
59
|
+
# @return [Integer]
|
60
|
+
def desired_capacity
|
61
|
+
data.desired_capacity
|
62
|
+
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
64
|
+
# The amount of time, in seconds, after a scaling activity completes
|
65
|
+
# before another scaling activity can start.
|
66
|
+
# @return [Integer]
|
67
|
+
def default_cooldown
|
68
|
+
data.default_cooldown
|
69
|
+
end
|
71
70
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
# One or more Availability Zones for the group.
|
72
|
+
# @return [Array<String>]
|
73
|
+
def availability_zones
|
74
|
+
data.availability_zones
|
75
|
+
end
|
77
76
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
77
|
+
# One or more load balancers associated with the group.
|
78
|
+
# @return [Array<String>]
|
79
|
+
def load_balancer_names
|
80
|
+
data.load_balancer_names
|
81
|
+
end
|
83
82
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
83
|
+
# The Amazon Resource Names (ARN) of the target groups for your load
|
84
|
+
# balancer.
|
85
|
+
# @return [Array<String>]
|
86
|
+
def target_group_arns
|
87
|
+
data.target_group_arns
|
88
|
+
end
|
90
89
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
90
|
+
# The service to use for the health checks. The valid values are `EC2`
|
91
|
+
# and `ELB`.
|
92
|
+
# @return [String]
|
93
|
+
def health_check_type
|
94
|
+
data.health_check_type
|
95
|
+
end
|
97
96
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
97
|
+
# The amount of time, in seconds, that Auto Scaling waits before
|
98
|
+
# checking the health status of an EC2 instance that has come into
|
99
|
+
# service.
|
100
|
+
# @return [Integer]
|
101
|
+
def health_check_grace_period
|
102
|
+
data.health_check_grace_period
|
103
|
+
end
|
105
104
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
105
|
+
# The date and time the group was created.
|
106
|
+
# @return [Time]
|
107
|
+
def created_time
|
108
|
+
data.created_time
|
109
|
+
end
|
111
110
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
111
|
+
# The suspended processes associated with the group.
|
112
|
+
# @return [Array<Types::SuspendedProcess>]
|
113
|
+
def suspended_processes
|
114
|
+
data.suspended_processes
|
115
|
+
end
|
117
116
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
117
|
+
# The name of the placement group into which you'll launch your
|
118
|
+
# instances, if any. For more information, see [Placement Groups][1] in
|
119
|
+
# the *Amazon Elastic Compute Cloud User Guide*.
|
120
|
+
#
|
121
|
+
#
|
122
|
+
#
|
123
|
+
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html
|
124
|
+
# @return [String]
|
125
|
+
def placement_group
|
126
|
+
data.placement_group
|
127
|
+
end
|
129
128
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
129
|
+
# One or more subnet IDs, if applicable, separated by commas.
|
130
|
+
#
|
131
|
+
# If you specify `VPCZoneIdentifier` and `AvailabilityZones`, ensure
|
132
|
+
# that the Availability Zones of the subnets match the values for
|
133
|
+
# `AvailabilityZones`.
|
134
|
+
# @return [String]
|
135
|
+
def vpc_zone_identifier
|
136
|
+
data.vpc_zone_identifier
|
137
|
+
end
|
139
138
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
139
|
+
# The metrics enabled for the group.
|
140
|
+
# @return [Array<Types::EnabledMetric>]
|
141
|
+
def enabled_metrics
|
142
|
+
data.enabled_metrics
|
143
|
+
end
|
145
144
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
145
|
+
# The current state of the group when DeleteAutoScalingGroup is in
|
146
|
+
# progress.
|
147
|
+
# @return [String]
|
148
|
+
def status
|
149
|
+
data.status
|
150
|
+
end
|
152
151
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
152
|
+
# The termination policies for the group.
|
153
|
+
# @return [Array<String>]
|
154
|
+
def termination_policies
|
155
|
+
data.termination_policies
|
156
|
+
end
|
158
157
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
158
|
+
# Indicates whether newly launched instances are protected from
|
159
|
+
# termination by Auto Scaling when scaling in.
|
160
|
+
# @return [Boolean]
|
161
|
+
def new_instances_protected_from_scale_in
|
162
|
+
data.new_instances_protected_from_scale_in
|
163
|
+
end
|
165
164
|
|
166
|
-
|
165
|
+
# @!endgroup
|
167
166
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
167
|
+
# @return [Client]
|
168
|
+
def client
|
169
|
+
@client
|
170
|
+
end
|
172
171
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
172
|
+
# Loads, or reloads {#data} for the current {AutoScalingGroup}.
|
173
|
+
# Returns `self` making it possible to chain methods.
|
174
|
+
#
|
175
|
+
# auto_scaling_group.reload.data
|
176
|
+
#
|
177
|
+
# @return [self]
|
178
|
+
def load
|
179
|
+
resp = @client.describe_auto_scaling_groups(auto_scaling_group_names: [@name])
|
180
|
+
@data = resp.autoscalinggroups[0]
|
181
|
+
self
|
182
|
+
end
|
183
|
+
alias :reload :load
|
184
|
+
|
185
|
+
# @return [Types::AutoScalingGroup]
|
186
|
+
# Returns the data for this {AutoScalingGroup}. Calls
|
187
|
+
# {Client#describe_auto_scaling_groups} if {#data_loaded?} is `false`.
|
188
|
+
def data
|
189
|
+
load unless @data
|
190
|
+
@data
|
191
|
+
end
|
193
192
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
193
|
+
# @return [Boolean]
|
194
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
195
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
196
|
+
def data_loaded?
|
197
|
+
!!@data
|
198
|
+
end
|
200
199
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
end
|
200
|
+
# @param [Hash] options ({})
|
201
|
+
# @return [Boolean]
|
202
|
+
# Returns `true` if the AutoScalingGroup exists.
|
203
|
+
def exists?(options = {})
|
204
|
+
begin
|
205
|
+
wait_until_exists(options.merge(max_attempts: 1))
|
206
|
+
true
|
207
|
+
rescue Aws::Waiters::Errors::UnexpectedError => e
|
208
|
+
raise e.error
|
209
|
+
rescue Aws::Waiters::Errors::WaiterFailed
|
210
|
+
false
|
213
211
|
end
|
212
|
+
end
|
214
213
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
214
|
+
# @param [Hash] options ({})
|
215
|
+
# @option options [Integer] :max_attempts (10)
|
216
|
+
# @option options [Float] :delay (5)
|
217
|
+
# @option options [Proc] :before_attempt
|
218
|
+
# @option options [Proc] :before_wait
|
219
|
+
# @return [AutoScalingGroup]
|
220
|
+
def wait_until_exists(options = {})
|
221
|
+
options, params = separate_params_and_options(options)
|
222
|
+
waiter = Waiters::GroupExists.new(options)
|
223
|
+
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
224
|
+
waiter.wait(params.merge(auto_scaling_group_names: [@name]))
|
225
|
+
AutoScalingGroup.new({
|
226
|
+
name: @name,
|
227
|
+
client: @client
|
228
|
+
})
|
229
|
+
end
|
231
230
|
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
231
|
+
# @param [Hash] options ({})
|
232
|
+
# @option options [Integer] :max_attempts (40)
|
233
|
+
# @option options [Float] :delay (15)
|
234
|
+
# @option options [Proc] :before_attempt
|
235
|
+
# @option options [Proc] :before_wait
|
236
|
+
# @return [AutoScalingGroup]
|
237
|
+
def wait_until_in_service(options = {})
|
238
|
+
options, params = separate_params_and_options(options)
|
239
|
+
waiter = Waiters::GroupInService.new(options)
|
240
|
+
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
241
|
+
waiter.wait(params.merge(auto_scaling_group_names: [@name]))
|
242
|
+
AutoScalingGroup.new({
|
243
|
+
name: @name,
|
244
|
+
client: @client
|
245
|
+
})
|
246
|
+
end
|
247
|
+
|
248
|
+
# @param [Hash] options ({})
|
249
|
+
# @option options [Integer] :max_attempts (40)
|
250
|
+
# @option options [Float] :delay (15)
|
251
|
+
# @option options [Proc] :before_attempt
|
252
|
+
# @option options [Proc] :before_wait
|
253
|
+
# @return [AutoScalingGroup]
|
254
|
+
def wait_until_not_exists(options = {})
|
255
|
+
options, params = separate_params_and_options(options)
|
256
|
+
waiter = Waiters::GroupNotExists.new(options)
|
257
|
+
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
258
|
+
waiter.wait(params.merge(auto_scaling_group_names: [@name]))
|
259
|
+
AutoScalingGroup.new({
|
260
|
+
name: @name,
|
261
|
+
client: @client
|
262
|
+
})
|
263
|
+
end
|
248
264
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
265
|
+
# @!group Actions
|
266
|
+
|
267
|
+
# @example Request syntax with placeholder values
|
268
|
+
#
|
269
|
+
# auto_scaling_group.attach_instances({
|
270
|
+
# instance_ids: ["XmlStringMaxLen19"],
|
271
|
+
# })
|
272
|
+
# @param [Hash] options ({})
|
273
|
+
# @option options [Array<String>] :instance_ids
|
274
|
+
# One or more instance IDs.
|
275
|
+
# @return [EmptyStructure]
|
276
|
+
def attach_instances(options = {})
|
277
|
+
options = options.merge(auto_scaling_group_name: @name)
|
278
|
+
resp = @client.attach_instances(options)
|
279
|
+
resp.data
|
280
|
+
end
|
281
|
+
|
282
|
+
# @example Request syntax with placeholder values
|
283
|
+
#
|
284
|
+
# auto_scaling_group.delete({
|
285
|
+
# force_delete: false,
|
286
|
+
# })
|
287
|
+
# @param [Hash] options ({})
|
288
|
+
# @option options [Boolean] :force_delete
|
289
|
+
# Specifies that the group will be deleted along with all instances
|
290
|
+
# associated with the group, without waiting for all instances to be
|
291
|
+
# terminated. This parameter also deletes any lifecycle actions
|
292
|
+
# associated with the group.
|
293
|
+
# @return [EmptyStructure]
|
294
|
+
def delete(options = {})
|
295
|
+
options = options.merge(auto_scaling_group_name: @name)
|
296
|
+
resp = @client.delete_auto_scaling_group(options)
|
297
|
+
resp.data
|
298
|
+
end
|
299
|
+
|
300
|
+
# @example Request syntax with placeholder values
|
301
|
+
#
|
302
|
+
# activity = auto_scaling_group.detach_instances({
|
303
|
+
# instance_ids: ["XmlStringMaxLen19"],
|
304
|
+
# should_decrement_desired_capacity: false, # required
|
305
|
+
# })
|
306
|
+
# @param [Hash] options ({})
|
307
|
+
# @option options [Array<String>] :instance_ids
|
308
|
+
# One or more instance IDs.
|
309
|
+
# @option options [required, Boolean] :should_decrement_desired_capacity
|
310
|
+
# If `True`, the Auto Scaling group decrements the desired capacity
|
311
|
+
# value by the number of instances detached.
|
312
|
+
# @return [Activity::Collection]
|
313
|
+
def detach_instances(options = {})
|
314
|
+
batch = []
|
315
|
+
options = options.merge(auto_scaling_group_name: @name)
|
316
|
+
resp = @client.detach_instances(options)
|
317
|
+
resp.data.activities.each do |a|
|
318
|
+
batch << Activity.new(
|
319
|
+
id: a.activity_id,
|
320
|
+
data: a,
|
262
321
|
client: @client
|
263
|
-
|
322
|
+
)
|
264
323
|
end
|
324
|
+
Activity::Collection.new([batch], size: batch.size)
|
325
|
+
end
|
265
326
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
327
|
+
# @example Request syntax with placeholder values
|
328
|
+
#
|
329
|
+
# auto_scaling_group.disable_metrics_collection({
|
330
|
+
# metrics: ["XmlStringMaxLen255"],
|
331
|
+
# })
|
332
|
+
# @param [Hash] options ({})
|
333
|
+
# @option options [Array<String>] :metrics
|
334
|
+
# One or more of the following metrics. If you omit this parameter, all
|
335
|
+
# metrics are disabled.
|
336
|
+
#
|
337
|
+
# * `GroupMinSize`
|
338
|
+
#
|
339
|
+
# * `GroupMaxSize`
|
340
|
+
#
|
341
|
+
# * `GroupDesiredCapacity`
|
342
|
+
#
|
343
|
+
# * `GroupInServiceInstances`
|
344
|
+
#
|
345
|
+
# * `GroupPendingInstances`
|
346
|
+
#
|
347
|
+
# * `GroupStandbyInstances`
|
348
|
+
#
|
349
|
+
# * `GroupTerminatingInstances`
|
350
|
+
#
|
351
|
+
# * `GroupTotalInstances`
|
352
|
+
# @return [EmptyStructure]
|
353
|
+
def disable_metrics_collection(options = {})
|
354
|
+
options = options.merge(auto_scaling_group_name: @name)
|
355
|
+
resp = @client.disable_metrics_collection(options)
|
356
|
+
resp.data
|
357
|
+
end
|
282
358
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
359
|
+
# @example Request syntax with placeholder values
|
360
|
+
#
|
361
|
+
# auto_scaling_group.enable_metrics_collection({
|
362
|
+
# metrics: ["XmlStringMaxLen255"],
|
363
|
+
# granularity: "XmlStringMaxLen255", # required
|
364
|
+
# })
|
365
|
+
# @param [Hash] options ({})
|
366
|
+
# @option options [Array<String>] :metrics
|
367
|
+
# One or more of the following metrics. If you omit this parameter, all
|
368
|
+
# metrics are enabled.
|
369
|
+
#
|
370
|
+
# * `GroupMinSize`
|
371
|
+
#
|
372
|
+
# * `GroupMaxSize`
|
373
|
+
#
|
374
|
+
# * `GroupDesiredCapacity`
|
375
|
+
#
|
376
|
+
# * `GroupInServiceInstances`
|
377
|
+
#
|
378
|
+
# * `GroupPendingInstances`
|
379
|
+
#
|
380
|
+
# * `GroupStandbyInstances`
|
381
|
+
#
|
382
|
+
# * `GroupTerminatingInstances`
|
383
|
+
#
|
384
|
+
# * `GroupTotalInstances`
|
385
|
+
# @option options [required, String] :granularity
|
386
|
+
# The granularity to associate with the metrics to collect. The only
|
387
|
+
# valid value is `1Minute`.
|
388
|
+
# @return [EmptyStructure]
|
389
|
+
def enable_metrics_collection(options = {})
|
390
|
+
options = options.merge(auto_scaling_group_name: @name)
|
391
|
+
resp = @client.enable_metrics_collection(options)
|
392
|
+
resp.data
|
393
|
+
end
|
300
394
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
395
|
+
# @example Request syntax with placeholder values
|
396
|
+
#
|
397
|
+
# scalingpolicy = auto_scaling_group.put_scaling_policy({
|
398
|
+
# policy_name: "XmlStringMaxLen255", # required
|
399
|
+
# policy_type: "XmlStringMaxLen64",
|
400
|
+
# adjustment_type: "XmlStringMaxLen255", # required
|
401
|
+
# min_adjustment_step: 1,
|
402
|
+
# min_adjustment_magnitude: 1,
|
403
|
+
# scaling_adjustment: 1,
|
404
|
+
# cooldown: 1,
|
405
|
+
# metric_aggregation_type: "XmlStringMaxLen32",
|
406
|
+
# step_adjustments: [
|
407
|
+
# {
|
408
|
+
# metric_interval_lower_bound: 1.0,
|
409
|
+
# metric_interval_upper_bound: 1.0,
|
410
|
+
# scaling_adjustment: 1, # required
|
411
|
+
# },
|
412
|
+
# ],
|
413
|
+
# estimated_instance_warmup: 1,
|
414
|
+
# })
|
415
|
+
# @param [Hash] options ({})
|
416
|
+
# @option options [required, String] :policy_name
|
417
|
+
# The name of the policy.
|
418
|
+
# @option options [String] :policy_type
|
419
|
+
# The policy type. Valid values are `SimpleScaling` and `StepScaling`.
|
420
|
+
# If the policy type is null, the value is treated as `SimpleScaling`.
|
421
|
+
# @option options [required, String] :adjustment_type
|
422
|
+
# The adjustment type. Valid values are `ChangeInCapacity`,
|
423
|
+
# `ExactCapacity`, and `PercentChangeInCapacity`.
|
424
|
+
#
|
425
|
+
# For more information, see [Dynamic Scaling][1] in the *Auto Scaling
|
426
|
+
# User Guide*.
|
427
|
+
#
|
428
|
+
#
|
429
|
+
#
|
430
|
+
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/as-scale-based-on-demand.html
|
431
|
+
# @option options [Integer] :min_adjustment_step
|
432
|
+
# Available for backward compatibility. Use `MinAdjustmentMagnitude`
|
433
|
+
# instead.
|
434
|
+
# @option options [Integer] :min_adjustment_magnitude
|
435
|
+
# The minimum number of instances to scale. If the value of
|
436
|
+
# `AdjustmentType` is `PercentChangeInCapacity`, the scaling policy
|
437
|
+
# changes the `DesiredCapacity` of the Auto Scaling group by at least
|
438
|
+
# this many instances. Otherwise, the error is `ValidationError`.
|
439
|
+
# @option options [Integer] :scaling_adjustment
|
440
|
+
# The amount by which to scale, based on the specified adjustment type.
|
441
|
+
# A positive value adds to the current capacity while a negative number
|
442
|
+
# removes from the current capacity.
|
443
|
+
#
|
444
|
+
# This parameter is required if the policy type is `SimpleScaling` and
|
445
|
+
# not supported otherwise.
|
446
|
+
# @option options [Integer] :cooldown
|
447
|
+
# The amount of time, in seconds, after a scaling activity completes and
|
448
|
+
# before the next scaling activity can start. If this parameter is not
|
449
|
+
# specified, the default cooldown period for the group applies.
|
450
|
+
#
|
451
|
+
# This parameter is not supported unless the policy type is
|
452
|
+
# `SimpleScaling`.
|
453
|
+
#
|
454
|
+
# For more information, see [Auto Scaling Cooldowns][1] in the *Auto
|
455
|
+
# Scaling User Guide*.
|
456
|
+
#
|
457
|
+
#
|
458
|
+
#
|
459
|
+
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html
|
460
|
+
# @option options [String] :metric_aggregation_type
|
461
|
+
# The aggregation type for the CloudWatch metrics. Valid values are
|
462
|
+
# `Minimum`, `Maximum`, and `Average`. If the aggregation type is null,
|
463
|
+
# the value is treated as `Average`.
|
464
|
+
#
|
465
|
+
# This parameter is not supported if the policy type is `SimpleScaling`.
|
466
|
+
# @option options [Array<Types::StepAdjustment>] :step_adjustments
|
467
|
+
# A set of adjustments that enable you to scale based on the size of the
|
468
|
+
# alarm breach.
|
469
|
+
#
|
470
|
+
# This parameter is required if the policy type is `StepScaling` and not
|
471
|
+
# supported otherwise.
|
472
|
+
# @option options [Integer] :estimated_instance_warmup
|
473
|
+
# The estimated time, in seconds, until a newly launched instance can
|
474
|
+
# contribute to the CloudWatch metrics. The default is to use the value
|
475
|
+
# specified for the default cooldown period for the group.
|
476
|
+
#
|
477
|
+
# This parameter is not supported if the policy type is `SimpleScaling`.
|
478
|
+
# @return [ScalingPolicy]
|
479
|
+
def put_scaling_policy(options = {})
|
480
|
+
options = options.merge(auto_scaling_group_name: @name)
|
481
|
+
resp = @client.put_scaling_policy(options)
|
482
|
+
ScalingPolicy.new(
|
483
|
+
name: options[:policy_name],
|
484
|
+
client: @client
|
485
|
+
)
|
486
|
+
end
|
327
487
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
488
|
+
# @example Request syntax with placeholder values
|
489
|
+
#
|
490
|
+
# scheduledaction = auto_scaling_group.put_scheduled_update_group_action({
|
491
|
+
# scheduled_action_name: "XmlStringMaxLen255", # required
|
492
|
+
# time: Time.now,
|
493
|
+
# start_time: Time.now,
|
494
|
+
# end_time: Time.now,
|
495
|
+
# recurrence: "XmlStringMaxLen255",
|
496
|
+
# min_size: 1,
|
497
|
+
# max_size: 1,
|
498
|
+
# desired_capacity: 1,
|
499
|
+
# })
|
500
|
+
# @param [Hash] options ({})
|
501
|
+
# @option options [required, String] :scheduled_action_name
|
502
|
+
# The name of this scaling action.
|
503
|
+
# @option options [Time,DateTime,Date,Integer,String] :time
|
504
|
+
# This parameter is deprecated.
|
505
|
+
# @option options [Time,DateTime,Date,Integer,String] :start_time
|
506
|
+
# The time for this action to start, in "YYYY-MM-DDThh:mm:ssZ" format
|
507
|
+
# in UTC/GMT only (for example, `2014-06-01T00:00:00Z`).
|
508
|
+
#
|
509
|
+
# If you specify `Recurrence` and `StartTime`, Auto Scaling performs the
|
510
|
+
# action at this time, and then performs the action based on the
|
511
|
+
# specified recurrence.
|
512
|
+
#
|
513
|
+
# If you try to schedule your action in the past, Auto Scaling returns
|
514
|
+
# an error message.
|
515
|
+
# @option options [Time,DateTime,Date,Integer,String] :end_time
|
516
|
+
# The time for the recurring schedule to end. Auto Scaling does not
|
517
|
+
# perform the action after this time.
|
518
|
+
# @option options [String] :recurrence
|
519
|
+
# The recurring schedule for this action, in Unix cron syntax format.
|
520
|
+
# For more information, see [Cron][1] in Wikipedia.
|
521
|
+
#
|
522
|
+
#
|
523
|
+
#
|
524
|
+
# [1]: http://en.wikipedia.org/wiki/Cron
|
525
|
+
# @option options [Integer] :min_size
|
526
|
+
# The minimum size for the Auto Scaling group.
|
527
|
+
# @option options [Integer] :max_size
|
528
|
+
# The maximum size for the Auto Scaling group.
|
529
|
+
# @option options [Integer] :desired_capacity
|
530
|
+
# The number of EC2 instances that should be running in the group.
|
531
|
+
# @return [ScheduledAction]
|
532
|
+
def put_scheduled_update_group_action(options = {})
|
533
|
+
options = options.merge(auto_scaling_group_name: @name)
|
534
|
+
resp = @client.put_scheduled_update_group_action(options)
|
535
|
+
ScheduledAction.new(
|
536
|
+
name: options[:scheduled_action_name],
|
537
|
+
client: @client
|
538
|
+
)
|
539
|
+
end
|
359
540
|
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
options = options.merge(auto_scaling_group_name: @name)
|
392
|
-
resp = @client.enable_metrics_collection(options)
|
393
|
-
resp.data
|
394
|
-
end
|
541
|
+
# @example Request syntax with placeholder values
|
542
|
+
#
|
543
|
+
# auto_scaling_group.resume_processes({
|
544
|
+
# scaling_processes: ["XmlStringMaxLen255"],
|
545
|
+
# })
|
546
|
+
# @param [Hash] options ({})
|
547
|
+
# @option options [Array<String>] :scaling_processes
|
548
|
+
# One or more of the following processes. If you omit this parameter,
|
549
|
+
# all processes are specified.
|
550
|
+
#
|
551
|
+
# * `Launch`
|
552
|
+
#
|
553
|
+
# * `Terminate`
|
554
|
+
#
|
555
|
+
# * `HealthCheck`
|
556
|
+
#
|
557
|
+
# * `ReplaceUnhealthy`
|
558
|
+
#
|
559
|
+
# * `AZRebalance`
|
560
|
+
#
|
561
|
+
# * `AlarmNotification`
|
562
|
+
#
|
563
|
+
# * `ScheduledActions`
|
564
|
+
#
|
565
|
+
# * `AddToLoadBalancer`
|
566
|
+
# @return [EmptyStructure]
|
567
|
+
def resume_processes(options = {})
|
568
|
+
options = options.merge(auto_scaling_group_name: @name)
|
569
|
+
resp = @client.resume_processes(options)
|
570
|
+
resp.data
|
571
|
+
end
|
395
572
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
# The name of the policy.
|
419
|
-
# @option options [String] :policy_type
|
420
|
-
# The policy type. Valid values are `SimpleScaling` and `StepScaling`.
|
421
|
-
# If the policy type is null, the value is treated as `SimpleScaling`.
|
422
|
-
# @option options [required, String] :adjustment_type
|
423
|
-
# The adjustment type. Valid values are `ChangeInCapacity`,
|
424
|
-
# `ExactCapacity`, and `PercentChangeInCapacity`.
|
425
|
-
#
|
426
|
-
# For more information, see [Dynamic Scaling][1] in the *Auto Scaling
|
427
|
-
# User Guide*.
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/as-scale-based-on-demand.html
|
432
|
-
# @option options [Integer] :min_adjustment_step
|
433
|
-
# Available for backward compatibility. Use `MinAdjustmentMagnitude`
|
434
|
-
# instead.
|
435
|
-
# @option options [Integer] :min_adjustment_magnitude
|
436
|
-
# The minimum number of instances to scale. If the value of
|
437
|
-
# `AdjustmentType` is `PercentChangeInCapacity`, the scaling policy
|
438
|
-
# changes the `DesiredCapacity` of the Auto Scaling group by at least
|
439
|
-
# this many instances. Otherwise, the error is `ValidationError`.
|
440
|
-
# @option options [Integer] :scaling_adjustment
|
441
|
-
# The amount by which to scale, based on the specified adjustment type.
|
442
|
-
# A positive value adds to the current capacity while a negative number
|
443
|
-
# removes from the current capacity.
|
444
|
-
#
|
445
|
-
# This parameter is required if the policy type is `SimpleScaling` and
|
446
|
-
# not supported otherwise.
|
447
|
-
# @option options [Integer] :cooldown
|
448
|
-
# The amount of time, in seconds, after a scaling activity completes and
|
449
|
-
# before the next scaling activity can start. If this parameter is not
|
450
|
-
# specified, the default cooldown period for the group applies.
|
451
|
-
#
|
452
|
-
# This parameter is not supported unless the policy type is
|
453
|
-
# `SimpleScaling`.
|
454
|
-
#
|
455
|
-
# For more information, see [Auto Scaling Cooldowns][1] in the *Auto
|
456
|
-
# Scaling User Guide*.
|
457
|
-
#
|
458
|
-
#
|
459
|
-
#
|
460
|
-
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html
|
461
|
-
# @option options [String] :metric_aggregation_type
|
462
|
-
# The aggregation type for the CloudWatch metrics. Valid values are
|
463
|
-
# `Minimum`, `Maximum`, and `Average`. If the aggregation type is null,
|
464
|
-
# the value is treated as `Average`.
|
465
|
-
#
|
466
|
-
# This parameter is not supported if the policy type is `SimpleScaling`.
|
467
|
-
# @option options [Array<Types::StepAdjustment>] :step_adjustments
|
468
|
-
# A set of adjustments that enable you to scale based on the size of the
|
469
|
-
# alarm breach.
|
470
|
-
#
|
471
|
-
# This parameter is required if the policy type is `StepScaling` and not
|
472
|
-
# supported otherwise.
|
473
|
-
# @option options [Integer] :estimated_instance_warmup
|
474
|
-
# The estimated time, in seconds, until a newly launched instance can
|
475
|
-
# contribute to the CloudWatch metrics. The default is to use the value
|
476
|
-
# specified for the default cooldown period for the group.
|
477
|
-
#
|
478
|
-
# This parameter is not supported if the policy type is `SimpleScaling`.
|
479
|
-
# @return [ScalingPolicy]
|
480
|
-
def put_scaling_policy(options = {})
|
481
|
-
options = options.merge(auto_scaling_group_name: @name)
|
482
|
-
resp = @client.put_scaling_policy(options)
|
483
|
-
ScalingPolicy.new(
|
484
|
-
name: options[:policy_name],
|
485
|
-
client: @client
|
486
|
-
)
|
487
|
-
end
|
573
|
+
# @example Request syntax with placeholder values
|
574
|
+
#
|
575
|
+
# auto_scaling_group.set_desired_capacity({
|
576
|
+
# desired_capacity: 1, # required
|
577
|
+
# honor_cooldown: false,
|
578
|
+
# })
|
579
|
+
# @param [Hash] options ({})
|
580
|
+
# @option options [required, Integer] :desired_capacity
|
581
|
+
# The number of EC2 instances that should be running in the Auto Scaling
|
582
|
+
# group.
|
583
|
+
# @option options [Boolean] :honor_cooldown
|
584
|
+
# By default, `SetDesiredCapacity` overrides any cooldown period
|
585
|
+
# associated with the Auto Scaling group. Specify `True` to make Auto
|
586
|
+
# Scaling to wait for the cool-down period associated with the Auto
|
587
|
+
# Scaling group to complete before initiating a scaling activity to set
|
588
|
+
# your Auto Scaling group to its new capacity.
|
589
|
+
# @return [EmptyStructure]
|
590
|
+
def set_desired_capacity(options = {})
|
591
|
+
options = options.merge(auto_scaling_group_name: @name)
|
592
|
+
resp = @client.set_desired_capacity(options)
|
593
|
+
resp.data
|
594
|
+
end
|
488
595
|
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
# The recurring schedule for this action, in Unix cron syntax format.
|
521
|
-
# For more information, see [Cron][1] in Wikipedia.
|
522
|
-
#
|
523
|
-
#
|
524
|
-
#
|
525
|
-
# [1]: http://en.wikipedia.org/wiki/Cron
|
526
|
-
# @option options [Integer] :min_size
|
527
|
-
# The minimum size for the Auto Scaling group.
|
528
|
-
# @option options [Integer] :max_size
|
529
|
-
# The maximum size for the Auto Scaling group.
|
530
|
-
# @option options [Integer] :desired_capacity
|
531
|
-
# The number of EC2 instances that should be running in the group.
|
532
|
-
# @return [ScheduledAction]
|
533
|
-
def put_scheduled_update_group_action(options = {})
|
534
|
-
options = options.merge(auto_scaling_group_name: @name)
|
535
|
-
resp = @client.put_scheduled_update_group_action(options)
|
536
|
-
ScheduledAction.new(
|
537
|
-
name: options[:scheduled_action_name],
|
538
|
-
client: @client
|
539
|
-
)
|
540
|
-
end
|
596
|
+
# @example Request syntax with placeholder values
|
597
|
+
#
|
598
|
+
# auto_scaling_group.suspend_processes({
|
599
|
+
# scaling_processes: ["XmlStringMaxLen255"],
|
600
|
+
# })
|
601
|
+
# @param [Hash] options ({})
|
602
|
+
# @option options [Array<String>] :scaling_processes
|
603
|
+
# One or more of the following processes. If you omit this parameter,
|
604
|
+
# all processes are specified.
|
605
|
+
#
|
606
|
+
# * `Launch`
|
607
|
+
#
|
608
|
+
# * `Terminate`
|
609
|
+
#
|
610
|
+
# * `HealthCheck`
|
611
|
+
#
|
612
|
+
# * `ReplaceUnhealthy`
|
613
|
+
#
|
614
|
+
# * `AZRebalance`
|
615
|
+
#
|
616
|
+
# * `AlarmNotification`
|
617
|
+
#
|
618
|
+
# * `ScheduledActions`
|
619
|
+
#
|
620
|
+
# * `AddToLoadBalancer`
|
621
|
+
# @return [EmptyStructure]
|
622
|
+
def suspend_processes(options = {})
|
623
|
+
options = options.merge(auto_scaling_group_name: @name)
|
624
|
+
resp = @client.suspend_processes(options)
|
625
|
+
resp.data
|
626
|
+
end
|
541
627
|
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
628
|
+
# @example Request syntax with placeholder values
|
629
|
+
#
|
630
|
+
# autoscalinggroup = auto_scaling_group.update({
|
631
|
+
# launch_configuration_name: "ResourceName",
|
632
|
+
# min_size: 1,
|
633
|
+
# max_size: 1,
|
634
|
+
# desired_capacity: 1,
|
635
|
+
# default_cooldown: 1,
|
636
|
+
# availability_zones: ["XmlStringMaxLen255"],
|
637
|
+
# health_check_type: "XmlStringMaxLen32",
|
638
|
+
# health_check_grace_period: 1,
|
639
|
+
# placement_group: "XmlStringMaxLen255",
|
640
|
+
# vpc_zone_identifier: "XmlStringMaxLen2047",
|
641
|
+
# termination_policies: ["XmlStringMaxLen1600"],
|
642
|
+
# new_instances_protected_from_scale_in: false,
|
643
|
+
# })
|
644
|
+
# @param [Hash] options ({})
|
645
|
+
# @option options [String] :launch_configuration_name
|
646
|
+
# The name of the launch configuration.
|
647
|
+
# @option options [Integer] :min_size
|
648
|
+
# The minimum size of the Auto Scaling group.
|
649
|
+
# @option options [Integer] :max_size
|
650
|
+
# The maximum size of the Auto Scaling group.
|
651
|
+
# @option options [Integer] :desired_capacity
|
652
|
+
# The number of EC2 instances that should be running in the Auto Scaling
|
653
|
+
# group. This number must be greater than or equal to the minimum size
|
654
|
+
# of the group and less than or equal to the maximum size of the group.
|
655
|
+
# @option options [Integer] :default_cooldown
|
656
|
+
# The amount of time, in seconds, after a scaling activity completes
|
657
|
+
# before another scaling activity can start. The default is 300.
|
658
|
+
#
|
659
|
+
# For more information, see [Auto Scaling Cooldowns][1] in the *Auto
|
660
|
+
# Scaling User Guide*.
|
661
|
+
#
|
662
|
+
#
|
663
|
+
#
|
664
|
+
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html
|
665
|
+
# @option options [Array<String>] :availability_zones
|
666
|
+
# One or more Availability Zones for the group.
|
667
|
+
# @option options [String] :health_check_type
|
668
|
+
# The service to use for the health checks. The valid values are `EC2`
|
669
|
+
# and `ELB`.
|
670
|
+
# @option options [Integer] :health_check_grace_period
|
671
|
+
# The amount of time, in seconds, that Auto Scaling waits before
|
672
|
+
# checking the health status of an EC2 instance that has come into
|
673
|
+
# service. The default is 0.
|
674
|
+
#
|
675
|
+
# For more information, see [Health Checks][1] in the *Auto Scaling User
|
676
|
+
# Guide*.
|
677
|
+
#
|
678
|
+
#
|
679
|
+
#
|
680
|
+
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/healthcheck.html
|
681
|
+
# @option options [String] :placement_group
|
682
|
+
# The name of the placement group into which you'll launch your
|
683
|
+
# instances, if any. For more information, see [Placement Groups][1] in
|
684
|
+
# the *Amazon Elastic Compute Cloud User Guide*.
|
685
|
+
#
|
686
|
+
#
|
687
|
+
#
|
688
|
+
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html
|
689
|
+
# @option options [String] :vpc_zone_identifier
|
690
|
+
# The ID of the subnet, if you are launching into a VPC. You can specify
|
691
|
+
# several subnets in a comma-separated list.
|
692
|
+
#
|
693
|
+
# When you specify `VPCZoneIdentifier` with `AvailabilityZones`, ensure
|
694
|
+
# that the subnets' Availability Zones match the values you specify for
|
695
|
+
# `AvailabilityZones`.
|
696
|
+
#
|
697
|
+
# For more information, see [Launching Auto Scaling Instances in a
|
698
|
+
# VPC][1] in the *Auto Scaling User Guide*.
|
699
|
+
#
|
700
|
+
#
|
701
|
+
#
|
702
|
+
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/asg-in-vpc.html
|
703
|
+
# @option options [Array<String>] :termination_policies
|
704
|
+
# A standalone termination policy or a list of termination policies used
|
705
|
+
# to select the instance to terminate. The policies are executed in the
|
706
|
+
# order that they are listed.
|
707
|
+
#
|
708
|
+
# For more information, see [Controlling Which Instances Auto Scaling
|
709
|
+
# Terminates During Scale In][1] in the *Auto Scaling User Guide*.
|
710
|
+
#
|
711
|
+
#
|
712
|
+
#
|
713
|
+
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html
|
714
|
+
# @option options [Boolean] :new_instances_protected_from_scale_in
|
715
|
+
# Indicates whether newly launched instances are protected from
|
716
|
+
# termination by Auto Scaling when scaling in.
|
717
|
+
# @return [AutoScalingGroup]
|
718
|
+
def update(options = {})
|
719
|
+
options = options.merge(auto_scaling_group_name: @name)
|
720
|
+
resp = @client.update_auto_scaling_group(options)
|
721
|
+
AutoScalingGroup.new(
|
722
|
+
name: options[:auto_scaling_group_name],
|
723
|
+
client: @client
|
724
|
+
)
|
725
|
+
end
|
573
726
|
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
def set_desired_capacity(options = {})
|
727
|
+
# @!group Associations
|
728
|
+
|
729
|
+
# @example Request syntax with placeholder values
|
730
|
+
#
|
731
|
+
# activities = auto_scaling_group.activities({
|
732
|
+
# activity_ids: ["XmlString"],
|
733
|
+
# })
|
734
|
+
# @param [Hash] options ({})
|
735
|
+
# @option options [Array<String>] :activity_ids
|
736
|
+
# The activity IDs of the desired scaling activities. If you omit this
|
737
|
+
# parameter, all activities for the past six weeks are described. If you
|
738
|
+
# specify an Auto Scaling group, the results are limited to that group.
|
739
|
+
# The list of requested activities cannot contain more than 50 items. If
|
740
|
+
# unknown activities are requested, they are ignored with no error.
|
741
|
+
# @return [Activity::Collection]
|
742
|
+
def activities(options = {})
|
743
|
+
batches = Enumerator.new do |y|
|
592
744
|
options = options.merge(auto_scaling_group_name: @name)
|
593
|
-
resp = @client.
|
594
|
-
resp.
|
745
|
+
resp = @client.describe_scaling_activities(options)
|
746
|
+
resp.each_page do |page|
|
747
|
+
batch = []
|
748
|
+
page.data.activities.each do |a|
|
749
|
+
batch << Activity.new(
|
750
|
+
id: a.activity_id,
|
751
|
+
data: a,
|
752
|
+
client: @client
|
753
|
+
)
|
754
|
+
end
|
755
|
+
y.yield(batch)
|
756
|
+
end
|
595
757
|
end
|
758
|
+
Activity::Collection.new(batches)
|
759
|
+
end
|
596
760
|
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
# * `Launch`
|
608
|
-
#
|
609
|
-
# * `Terminate`
|
610
|
-
#
|
611
|
-
# * `HealthCheck`
|
612
|
-
#
|
613
|
-
# * `ReplaceUnhealthy`
|
614
|
-
#
|
615
|
-
# * `AZRebalance`
|
616
|
-
#
|
617
|
-
# * `AlarmNotification`
|
618
|
-
#
|
619
|
-
# * `ScheduledActions`
|
620
|
-
#
|
621
|
-
# * `AddToLoadBalancer`
|
622
|
-
# @return [EmptyStructure]
|
623
|
-
def suspend_processes(options = {})
|
624
|
-
options = options.merge(auto_scaling_group_name: @name)
|
625
|
-
resp = @client.suspend_processes(options)
|
626
|
-
resp.data
|
761
|
+
# @return [Instance::Collection]
|
762
|
+
def instances
|
763
|
+
batch = []
|
764
|
+
data.instances.each do |i|
|
765
|
+
batch << Instance.new(
|
766
|
+
group_name: @name,
|
767
|
+
id: i.instance_id,
|
768
|
+
data: i,
|
769
|
+
client: @client
|
770
|
+
)
|
627
771
|
end
|
772
|
+
Instance::Collection.new([batch], size: batch.size)
|
773
|
+
end
|
628
774
|
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
# max_size: 1,
|
635
|
-
# desired_capacity: 1,
|
636
|
-
# default_cooldown: 1,
|
637
|
-
# availability_zones: ["XmlStringMaxLen255"],
|
638
|
-
# health_check_type: "XmlStringMaxLen32",
|
639
|
-
# health_check_grace_period: 1,
|
640
|
-
# placement_group: "XmlStringMaxLen255",
|
641
|
-
# vpc_zone_identifier: "XmlStringMaxLen2047",
|
642
|
-
# termination_policies: ["XmlStringMaxLen1600"],
|
643
|
-
# new_instances_protected_from_scale_in: false,
|
644
|
-
# })
|
645
|
-
# @param [Hash] options ({})
|
646
|
-
# @option options [String] :launch_configuration_name
|
647
|
-
# The name of the launch configuration.
|
648
|
-
# @option options [Integer] :min_size
|
649
|
-
# The minimum size of the Auto Scaling group.
|
650
|
-
# @option options [Integer] :max_size
|
651
|
-
# The maximum size of the Auto Scaling group.
|
652
|
-
# @option options [Integer] :desired_capacity
|
653
|
-
# The number of EC2 instances that should be running in the Auto Scaling
|
654
|
-
# group. This number must be greater than or equal to the minimum size
|
655
|
-
# of the group and less than or equal to the maximum size of the group.
|
656
|
-
# @option options [Integer] :default_cooldown
|
657
|
-
# The amount of time, in seconds, after a scaling activity completes
|
658
|
-
# before another scaling activity can start. The default is 300.
|
659
|
-
#
|
660
|
-
# For more information, see [Auto Scaling Cooldowns][1] in the *Auto
|
661
|
-
# Scaling User Guide*.
|
662
|
-
#
|
663
|
-
#
|
664
|
-
#
|
665
|
-
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html
|
666
|
-
# @option options [Array<String>] :availability_zones
|
667
|
-
# One or more Availability Zones for the group.
|
668
|
-
# @option options [String] :health_check_type
|
669
|
-
# The service to use for the health checks. The valid values are `EC2`
|
670
|
-
# and `ELB`.
|
671
|
-
# @option options [Integer] :health_check_grace_period
|
672
|
-
# The amount of time, in seconds, that Auto Scaling waits before
|
673
|
-
# checking the health status of an EC2 instance that has come into
|
674
|
-
# service. The default is 0.
|
675
|
-
#
|
676
|
-
# For more information, see [Health Checks][1] in the *Auto Scaling User
|
677
|
-
# Guide*.
|
678
|
-
#
|
679
|
-
#
|
680
|
-
#
|
681
|
-
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/healthcheck.html
|
682
|
-
# @option options [String] :placement_group
|
683
|
-
# The name of the placement group into which you'll launch your
|
684
|
-
# instances, if any. For more information, see [Placement Groups][1] in
|
685
|
-
# the *Amazon Elastic Compute Cloud User Guide*.
|
686
|
-
#
|
687
|
-
#
|
688
|
-
#
|
689
|
-
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html
|
690
|
-
# @option options [String] :vpc_zone_identifier
|
691
|
-
# The ID of the subnet, if you are launching into a VPC. You can specify
|
692
|
-
# several subnets in a comma-separated list.
|
693
|
-
#
|
694
|
-
# When you specify `VPCZoneIdentifier` with `AvailabilityZones`, ensure
|
695
|
-
# that the subnets' Availability Zones match the values you specify for
|
696
|
-
# `AvailabilityZones`.
|
697
|
-
#
|
698
|
-
# For more information, see [Launching Auto Scaling Instances in a
|
699
|
-
# VPC][1] in the *Auto Scaling User Guide*.
|
700
|
-
#
|
701
|
-
#
|
702
|
-
#
|
703
|
-
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/asg-in-vpc.html
|
704
|
-
# @option options [Array<String>] :termination_policies
|
705
|
-
# A standalone termination policy or a list of termination policies used
|
706
|
-
# to select the instance to terminate. The policies are executed in the
|
707
|
-
# order that they are listed.
|
708
|
-
#
|
709
|
-
# For more information, see [Controlling Which Instances Auto Scaling
|
710
|
-
# Terminates During Scale In][1] in the *Auto Scaling User Guide*.
|
711
|
-
#
|
712
|
-
#
|
713
|
-
#
|
714
|
-
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html
|
715
|
-
# @option options [Boolean] :new_instances_protected_from_scale_in
|
716
|
-
# Indicates whether newly launched instances are protected from
|
717
|
-
# termination by Auto Scaling when scaling in.
|
718
|
-
# @return [AutoScalingGroup]
|
719
|
-
def update(options = {})
|
720
|
-
options = options.merge(auto_scaling_group_name: @name)
|
721
|
-
resp = @client.update_auto_scaling_group(options)
|
722
|
-
AutoScalingGroup.new(
|
723
|
-
name: options[:auto_scaling_group_name],
|
775
|
+
# @return [LaunchConfiguration, nil]
|
776
|
+
def launch_configuration
|
777
|
+
if data.launch_configuration_name
|
778
|
+
LaunchConfiguration.new(
|
779
|
+
name: data.launch_configuration_name,
|
724
780
|
client: @client
|
725
781
|
)
|
782
|
+
else
|
783
|
+
nil
|
726
784
|
end
|
785
|
+
end
|
727
786
|
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
# The activity IDs of the desired scaling activities. If you omit this
|
738
|
-
# parameter, all activities for the past six weeks are described. If you
|
739
|
-
# specify an Auto Scaling group, the results are limited to that group.
|
740
|
-
# The list of requested activities cannot contain more than 50 items. If
|
741
|
-
# unknown activities are requested, they are ignored with no error.
|
742
|
-
# @return [Activity::Collection]
|
743
|
-
def activities(options = {})
|
744
|
-
batches = Enumerator.new do |y|
|
745
|
-
options = options.merge(auto_scaling_group_name: @name)
|
746
|
-
resp = @client.describe_scaling_activities(options)
|
747
|
-
resp.each_page do |page|
|
748
|
-
batch = []
|
749
|
-
page.data.activities.each do |a|
|
750
|
-
batch << Activity.new(
|
751
|
-
id: a.activity_id,
|
752
|
-
data: a,
|
753
|
-
client: @client
|
754
|
-
)
|
755
|
-
end
|
756
|
-
y.yield(batch)
|
757
|
-
end
|
758
|
-
end
|
759
|
-
Activity::Collection.new(batches)
|
760
|
-
end
|
787
|
+
# @param [String] name
|
788
|
+
# @return [LifecycleHook]
|
789
|
+
def lifecycle_hook(name)
|
790
|
+
LifecycleHook.new(
|
791
|
+
group_name: @name,
|
792
|
+
name: name,
|
793
|
+
client: @client
|
794
|
+
)
|
795
|
+
end
|
761
796
|
|
762
|
-
|
763
|
-
|
797
|
+
# @example Request syntax with placeholder values
|
798
|
+
#
|
799
|
+
# lifecycle_hooks = auto_scaling_group.lifecycle_hooks({
|
800
|
+
# lifecycle_hook_names: ["AsciiStringMaxLen255"],
|
801
|
+
# })
|
802
|
+
# @param [Hash] options ({})
|
803
|
+
# @option options [Array<String>] :lifecycle_hook_names
|
804
|
+
# The names of one or more lifecycle hooks. If you omit this parameter,
|
805
|
+
# all lifecycle hooks are described.
|
806
|
+
# @return [LifecycleHook::Collection]
|
807
|
+
def lifecycle_hooks(options = {})
|
808
|
+
batches = Enumerator.new do |y|
|
764
809
|
batch = []
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
810
|
+
options = options.merge(auto_scaling_group_name: @name)
|
811
|
+
resp = @client.describe_lifecycle_hooks(options)
|
812
|
+
resp.data.lifecycle_hooks.each do |l|
|
813
|
+
batch << LifecycleHook.new(
|
814
|
+
group_name: l.auto_scaling_group_name,
|
815
|
+
name: l.lifecycle_hook_name,
|
816
|
+
data: l,
|
770
817
|
client: @client
|
771
818
|
)
|
772
819
|
end
|
773
|
-
|
820
|
+
y.yield(batch)
|
774
821
|
end
|
822
|
+
LifecycleHook::Collection.new(batches)
|
823
|
+
end
|
775
824
|
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
825
|
+
# @param [String] name
|
826
|
+
# @return [LoadBalancer]
|
827
|
+
def load_balancer(name)
|
828
|
+
LoadBalancer.new(
|
829
|
+
group_name: @name,
|
830
|
+
name: name,
|
831
|
+
client: @client
|
832
|
+
)
|
833
|
+
end
|
834
|
+
|
835
|
+
# @example Request syntax with placeholder values
|
836
|
+
#
|
837
|
+
# load_balancers = auto_scaling_group.load_balancers({
|
838
|
+
# next_token: "XmlString",
|
839
|
+
# max_records: 1,
|
840
|
+
# })
|
841
|
+
# @param [Hash] options ({})
|
842
|
+
# @option options [String] :next_token
|
843
|
+
# The token for the next set of items to return. (You received this
|
844
|
+
# token from a previous call.)
|
845
|
+
# @option options [Integer] :max_records
|
846
|
+
# The maximum number of items to return with this call.
|
847
|
+
# @return [LoadBalancer::Collection]
|
848
|
+
def load_balancers(options = {})
|
849
|
+
batches = Enumerator.new do |y|
|
850
|
+
batch = []
|
851
|
+
options = options.merge(auto_scaling_group_name: @name)
|
852
|
+
resp = @client.describe_load_balancers(options)
|
853
|
+
resp.data.load_balancers.each do |l|
|
854
|
+
batch << LoadBalancer.new(
|
855
|
+
group_name: @name,
|
856
|
+
name: l.load_balancer_name,
|
857
|
+
data: l,
|
781
858
|
client: @client
|
782
859
|
)
|
783
|
-
else
|
784
|
-
nil
|
785
860
|
end
|
861
|
+
y.yield(batch)
|
786
862
|
end
|
863
|
+
LoadBalancer::Collection.new(batches)
|
864
|
+
end
|
787
865
|
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
)
|
796
|
-
|
797
|
-
|
798
|
-
# @example Request syntax with placeholder values
|
799
|
-
#
|
800
|
-
# lifecyclehooks = auto_scaling_group.lifecycle_hooks({
|
801
|
-
# lifecycle_hook_names: ["AsciiStringMaxLen255"],
|
802
|
-
# })
|
803
|
-
# @param [Hash] options ({})
|
804
|
-
# @option options [Array<String>] :lifecycle_hook_names
|
805
|
-
# The names of one or more lifecycle hooks. If you omit this parameter,
|
806
|
-
# all lifecycle hooks are described.
|
807
|
-
# @return [LifecycleHook::Collection]
|
808
|
-
def lifecycle_hooks(options = {})
|
809
|
-
batches = Enumerator.new do |y|
|
866
|
+
# @example Request syntax with placeholder values
|
867
|
+
#
|
868
|
+
# auto_scaling_group.notification_configurations()
|
869
|
+
# @param [Hash] options ({})
|
870
|
+
# @return [NotificationConfiguration::Collection]
|
871
|
+
def notification_configurations(options = {})
|
872
|
+
batches = Enumerator.new do |y|
|
873
|
+
options = Aws::Util.deep_merge(options, auto_scaling_group_names: [@name])
|
874
|
+
resp = @client.describe_notification_configurations(options)
|
875
|
+
resp.each_page do |page|
|
810
876
|
batch = []
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
data: l,
|
877
|
+
page.data.notification_configurations.each do |n|
|
878
|
+
batch << NotificationConfiguration.new(
|
879
|
+
group_name: n.auto_scaling_group_name,
|
880
|
+
type: n.notification_type,
|
881
|
+
topic_arn: n.topic_arn,
|
882
|
+
data: n,
|
818
883
|
client: @client
|
819
884
|
)
|
820
885
|
end
|
821
886
|
y.yield(batch)
|
822
887
|
end
|
823
|
-
LifecycleHook::Collection.new(batches)
|
824
|
-
end
|
825
|
-
|
826
|
-
# @param [String] name
|
827
|
-
# @return [LoadBalancer]
|
828
|
-
def load_balancer(name)
|
829
|
-
LoadBalancer.new(
|
830
|
-
group_name: @name,
|
831
|
-
name: name,
|
832
|
-
client: @client
|
833
|
-
)
|
834
888
|
end
|
889
|
+
NotificationConfiguration::Collection.new(batches)
|
890
|
+
end
|
835
891
|
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
892
|
+
# @example Request syntax with placeholder values
|
893
|
+
#
|
894
|
+
# policies = auto_scaling_group.policies({
|
895
|
+
# policy_names: ["ResourceName"],
|
896
|
+
# policy_types: ["XmlStringMaxLen64"],
|
897
|
+
# })
|
898
|
+
# @param [Hash] options ({})
|
899
|
+
# @option options [Array<String>] :policy_names
|
900
|
+
# One or more policy names or policy ARNs to be described. If you omit
|
901
|
+
# this parameter, all policy names are described. If an group name is
|
902
|
+
# provided, the results are limited to that group. This list is limited
|
903
|
+
# to 50 items. If you specify an unknown policy name, it is ignored with
|
904
|
+
# no error.
|
905
|
+
# @option options [Array<String>] :policy_types
|
906
|
+
# One or more policy types. Valid values are `SimpleScaling` and
|
907
|
+
# `StepScaling`.
|
908
|
+
# @return [ScalingPolicy::Collection]
|
909
|
+
def policies(options = {})
|
910
|
+
batches = Enumerator.new do |y|
|
911
|
+
options = options.merge(auto_scaling_group_name: @name)
|
912
|
+
resp = @client.describe_policies(options)
|
913
|
+
resp.each_page do |page|
|
851
914
|
batch = []
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
group_name: @name,
|
857
|
-
name: l.load_balancer_name,
|
858
|
-
data: l,
|
915
|
+
page.data.scaling_policies.each do |s|
|
916
|
+
batch << ScalingPolicy.new(
|
917
|
+
name: s.policy_name,
|
918
|
+
data: s,
|
859
919
|
client: @client
|
860
920
|
)
|
861
921
|
end
|
862
922
|
y.yield(batch)
|
863
923
|
end
|
864
|
-
LoadBalancer::Collection.new(batches)
|
865
|
-
end
|
866
|
-
|
867
|
-
# @example Request syntax with placeholder values
|
868
|
-
#
|
869
|
-
# notificationconfigurations = auto_scaling_group.notification_configurations()
|
870
|
-
# @param [Hash] options ({})
|
871
|
-
# @return [NotificationConfiguration::Collection]
|
872
|
-
def notification_configurations(options = {})
|
873
|
-
batches = Enumerator.new do |y|
|
874
|
-
options = Aws::Util.deep_merge(options, auto_scaling_group_names: [@name])
|
875
|
-
resp = @client.describe_notification_configurations(options)
|
876
|
-
resp.each_page do |page|
|
877
|
-
batch = []
|
878
|
-
page.data.notification_configurations.each do |n|
|
879
|
-
batch << NotificationConfiguration.new(
|
880
|
-
group_name: n.auto_scaling_group_name,
|
881
|
-
type: n.notification_type,
|
882
|
-
topic_arn: n.topic_arn,
|
883
|
-
data: n,
|
884
|
-
client: @client
|
885
|
-
)
|
886
|
-
end
|
887
|
-
y.yield(batch)
|
888
|
-
end
|
889
|
-
end
|
890
|
-
NotificationConfiguration::Collection.new(batches)
|
891
924
|
end
|
925
|
+
ScalingPolicy::Collection.new(batches)
|
926
|
+
end
|
892
927
|
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
928
|
+
# @example Request syntax with placeholder values
|
929
|
+
#
|
930
|
+
# scheduled_actions = auto_scaling_group.scheduled_actions({
|
931
|
+
# scheduled_action_names: ["ResourceName"],
|
932
|
+
# start_time: Time.now,
|
933
|
+
# end_time: Time.now,
|
934
|
+
# })
|
935
|
+
# @param [Hash] options ({})
|
936
|
+
# @option options [Array<String>] :scheduled_action_names
|
937
|
+
# Describes one or more scheduled actions. If you omit this parameter,
|
938
|
+
# all scheduled actions are described. If you specify an unknown
|
939
|
+
# scheduled action, it is ignored with no error.
|
940
|
+
#
|
941
|
+
# You can describe up to a maximum of 50 instances with a single call.
|
942
|
+
# If there are more items to return, the call returns a token. To get
|
943
|
+
# the next set of items, repeat the call with the returned token.
|
944
|
+
# @option options [Time,DateTime,Date,Integer,String] :start_time
|
945
|
+
# The earliest scheduled start time to return. If scheduled action names
|
946
|
+
# are provided, this parameter is ignored.
|
947
|
+
# @option options [Time,DateTime,Date,Integer,String] :end_time
|
948
|
+
# The latest scheduled start time to return. If scheduled action names
|
949
|
+
# are provided, this parameter is ignored.
|
950
|
+
# @return [ScheduledAction::Collection]
|
951
|
+
def scheduled_actions(options = {})
|
952
|
+
batches = Enumerator.new do |y|
|
953
|
+
options = options.merge(auto_scaling_group_name: @name)
|
954
|
+
resp = @client.describe_scheduled_actions(options)
|
955
|
+
resp.each_page do |page|
|
956
|
+
batch = []
|
957
|
+
page.data.scheduled_update_group_actions.each do |s|
|
958
|
+
batch << ScheduledAction.new(
|
959
|
+
name: s.scheduled_action_name,
|
960
|
+
data: s,
|
961
|
+
client: @client
|
962
|
+
)
|
924
963
|
end
|
964
|
+
y.yield(batch)
|
925
965
|
end
|
926
|
-
ScalingPolicy::Collection.new(batches)
|
927
966
|
end
|
967
|
+
ScheduledAction::Collection.new(batches)
|
968
|
+
end
|
928
969
|
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
# all scheduled actions are described. If you specify an unknown
|
940
|
-
# scheduled action, it is ignored with no error.
|
941
|
-
#
|
942
|
-
# You can describe up to a maximum of 50 instances with a single call.
|
943
|
-
# If there are more items to return, the call returns a token. To get
|
944
|
-
# the next set of items, repeat the call with the returned token.
|
945
|
-
# @option options [Time,DateTime,Date,Integer,String] :start_time
|
946
|
-
# The earliest scheduled start time to return. If scheduled action names
|
947
|
-
# are provided, this parameter is ignored.
|
948
|
-
# @option options [Time,DateTime,Date,Integer,String] :end_time
|
949
|
-
# The latest scheduled start time to return. If scheduled action names
|
950
|
-
# are provided, this parameter is ignored.
|
951
|
-
# @return [ScheduledAction::Collection]
|
952
|
-
def scheduled_actions(options = {})
|
953
|
-
batches = Enumerator.new do |y|
|
954
|
-
options = options.merge(auto_scaling_group_name: @name)
|
955
|
-
resp = @client.describe_scheduled_actions(options)
|
956
|
-
resp.each_page do |page|
|
957
|
-
batch = []
|
958
|
-
page.data.scheduled_update_group_actions.each do |s|
|
959
|
-
batch << ScheduledAction.new(
|
960
|
-
name: s.scheduled_action_name,
|
961
|
-
data: s,
|
962
|
-
client: @client
|
963
|
-
)
|
964
|
-
end
|
965
|
-
y.yield(batch)
|
966
|
-
end
|
967
|
-
end
|
968
|
-
ScheduledAction::Collection.new(batches)
|
969
|
-
end
|
970
|
+
# @param [String] key
|
971
|
+
# @return [Tag]
|
972
|
+
def tag(key)
|
973
|
+
Tag.new(
|
974
|
+
key: key,
|
975
|
+
resource_id: @name,
|
976
|
+
resource_type: "auto-scaling-group",
|
977
|
+
client: @client
|
978
|
+
)
|
979
|
+
end
|
970
980
|
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
981
|
+
# @return [Tag::Collection]
|
982
|
+
def tags
|
983
|
+
batch = []
|
984
|
+
data.tags.each do |t|
|
985
|
+
batch << Tag.new(
|
986
|
+
key: t.key,
|
987
|
+
resource_id: t.resource_id,
|
988
|
+
resource_type: t.resource_type,
|
989
|
+
data: t,
|
978
990
|
client: @client
|
979
991
|
)
|
980
992
|
end
|
993
|
+
Tag::Collection.new([batch], size: batch.size)
|
994
|
+
end
|
981
995
|
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
996
|
+
# @deprecated
|
997
|
+
# @api private
|
998
|
+
def identifiers
|
999
|
+
{ name: @name }
|
1000
|
+
end
|
1001
|
+
deprecated(:identifiers)
|
1002
|
+
|
1003
|
+
private
|
1004
|
+
|
1005
|
+
def extract_name(args, options)
|
1006
|
+
value = args[0] || options.delete(:name)
|
1007
|
+
case value
|
1008
|
+
when String then value
|
1009
|
+
when nil then raise ArgumentError, "missing required option :name"
|
1010
|
+
else
|
1011
|
+
msg = "expected :name to be a String, got #{value.class}"
|
1012
|
+
raise ArgumentError, msg
|
995
1013
|
end
|
1014
|
+
end
|
996
1015
|
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1016
|
+
def yield_waiter_and_warn(waiter, &block)
|
1017
|
+
if !@waiter_block_warned
|
1018
|
+
msg = "pass options to configure the waiter; "
|
1019
|
+
msg << "yielding the waiter is deprecated"
|
1020
|
+
warn(msg)
|
1021
|
+
@waiter_block_warned = true
|
1001
1022
|
end
|
1002
|
-
|
1003
|
-
|
1004
|
-
private
|
1023
|
+
yield(waiter.waiter)
|
1024
|
+
end
|
1005
1025
|
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1026
|
+
def separate_params_and_options(options)
|
1027
|
+
opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
|
1028
|
+
waiter_opts = {}
|
1029
|
+
waiter_params = {}
|
1030
|
+
options.each_pair do |key, value|
|
1031
|
+
if opts.include?(key)
|
1032
|
+
waiter_opts[key] = value
|
1011
1033
|
else
|
1012
|
-
|
1013
|
-
raise ArgumentError, msg
|
1014
|
-
end
|
1015
|
-
end
|
1016
|
-
|
1017
|
-
def yield_waiter_and_warn(waiter, &block)
|
1018
|
-
if !@waiter_block_warned
|
1019
|
-
msg = "pass options to configure the waiter; "
|
1020
|
-
msg << "yielding the waiter is deprecated"
|
1021
|
-
warn(msg)
|
1022
|
-
@waiter_block_warned = true
|
1023
|
-
end
|
1024
|
-
yield(waiter.waiter)
|
1025
|
-
end
|
1026
|
-
|
1027
|
-
def separate_params_and_options(options)
|
1028
|
-
opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
|
1029
|
-
waiter_opts = {}
|
1030
|
-
waiter_params = {}
|
1031
|
-
options.each_pair do |key, value|
|
1032
|
-
if opts.include?(key)
|
1033
|
-
waiter_opts[key] = value
|
1034
|
-
else
|
1035
|
-
waiter_params[key] = value
|
1036
|
-
end
|
1034
|
+
waiter_params[key] = value
|
1037
1035
|
end
|
1038
|
-
waiter_opts[:client] ||= @client
|
1039
|
-
[waiter_opts, waiter_params]
|
1040
1036
|
end
|
1041
|
-
|
1042
|
-
|
1037
|
+
waiter_opts[:client] ||= @client
|
1038
|
+
[waiter_opts, waiter_params]
|
1043
1039
|
end
|
1040
|
+
|
1041
|
+
class Collection < Aws::Resources::Collection; end
|
1044
1042
|
end
|
1045
1043
|
end
|