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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51fa29a246960d90fc1addf4f1aedd5aaee57379
4
- data.tar.gz: a8950dc540ad4c7676ea2360137cff3a6b7d0e60
3
+ metadata.gz: 5e0d64f5069738e9913771be07203843da745712
4
+ data.tar.gz: 5da5c4b67f12fc97f3a6c672b6fa6b24ae1d7708
5
5
  SHA512:
6
- metadata.gz: 4c4b06cf492a2b19f35cd2b27839e19832bf2efe6242d408e8889a1395f017a69a6bdfc367cbe4e5c8004fd7e67acf6c07acb1df3499463c59c169294d184c50
7
- data.tar.gz: f0c3fcc8e9c9cabb74eb73fdd53287bccfb36494946ae2db55ff1f9bd468af049da64c9500688b31a6970c36438623bd34d6080b9881a69e518952b0fd868c5f
6
+ metadata.gz: 0d8e47883554b4ca92abfd84abdf267adab3d791503ad1379dfd215d3df2d2df7c38994db4c0238c99dd70d5a49447c8f873c61012263003708c34b742c69aad
7
+ data.tar.gz: 0bf597c13cf7294b63fd6582b4f46b4839549fc01418df42c97330d6575dc63a78a9cc3c7d529098e5035c8e9d12cf67ff9a73b9de84db0fa6fa39f82bde3abe
@@ -1,6 +1,6 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
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.rc1'
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 info on making contributions:
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
- module AutoScaling
10
- class Activity
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(id, options = {})
15
- # @param [String] id
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :id
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @id = extract_id(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
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
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def id
31
- @id
32
- end
33
- alias :activity_id :id
28
+ # @return [String]
29
+ def id
30
+ @id
31
+ end
32
+ alias :activity_id :id
34
33
 
35
- # The name of the Auto Scaling group.
36
- # @return [String]
37
- def auto_scaling_group_name
38
- data.auto_scaling_group_name
39
- end
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
- # A friendly, more verbose description of the activity.
42
- # @return [String]
43
- def description
44
- data.description
45
- end
40
+ # A friendly, more verbose description of the activity.
41
+ # @return [String]
42
+ def description
43
+ data.description
44
+ end
46
45
 
47
- # The reason the activity began.
48
- # @return [String]
49
- def cause
50
- data.cause
51
- end
46
+ # The reason the activity began.
47
+ # @return [String]
48
+ def cause
49
+ data.cause
50
+ end
52
51
 
53
- # The start time of the activity.
54
- # @return [Time]
55
- def start_time
56
- data.start_time
57
- end
52
+ # The start time of the activity.
53
+ # @return [Time]
54
+ def start_time
55
+ data.start_time
56
+ end
58
57
 
59
- # The end time of the activity.
60
- # @return [Time]
61
- def end_time
62
- data.end_time
63
- end
58
+ # The end time of the activity.
59
+ # @return [Time]
60
+ def end_time
61
+ data.end_time
62
+ end
64
63
 
65
- # The current status of the activity.
66
- # @return [String]
67
- def status_code
68
- data.status_code
69
- end
64
+ # The current status of the activity.
65
+ # @return [String]
66
+ def status_code
67
+ data.status_code
68
+ end
70
69
 
71
- # A friendly, more verbose description of the activity status.
72
- # @return [String]
73
- def status_message
74
- data.status_message
75
- end
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
- # A value between 0 and 100 that indicates the progress of the activity.
78
- # @return [Integer]
79
- def progress
80
- data.progress
81
- end
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
- # The details about the activity.
84
- # @return [String]
85
- def details
86
- data.details
87
- end
82
+ # The details about the activity.
83
+ # @return [String]
84
+ def details
85
+ data.details
86
+ end
88
87
 
89
- # @!endgroup
88
+ # @!endgroup
90
89
 
91
- # @return [Client]
92
- def client
93
- @client
94
- end
90
+ # @return [Client]
91
+ def client
92
+ @client
93
+ end
95
94
 
96
- # Loads, or reloads {#data} for the current {Activity}.
97
- # Returns `self` making it possible to chain methods.
98
- #
99
- # activity.reload.data
100
- #
101
- # @return [self]
102
- def load
103
- resp = @client.describe_scaling_activities(activity_ids: [@id])
104
- @data = resp.activities[0]
105
- self
106
- end
107
- alias :reload :load
108
-
109
- # @return [Types::Activity]
110
- # Returns the data for this {Activity}. Calls
111
- # {Client#describe_scaling_activities} if {#data_loaded?} is `false`.
112
- def data
113
- load unless @data
114
- @data
115
- end
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
- # @return [Boolean]
118
- # Returns `true` if this resource is loaded. Accessing attributes or
119
- # {#data} on an unloaded resource will trigger a call to {#load}.
120
- def data_loaded?
121
- !!@data
122
- end
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
- # @!group Associations
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
- # @deprecated
139
- # @api private
140
- def identifiers
141
- { id: @id }
142
- end
143
- deprecated(:identifiers)
144
-
145
- private
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
- class Collection < Aws::Resources::Collection; end
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 info on making contributions:
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
- module AutoScaling
10
- class AutoScalingGroup
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(name, options = {})
15
- # @param [String] name
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :name
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @name = extract_name(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
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
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def name
31
- @name
32
- end
33
- alias :auto_scaling_group_name :name
28
+ # @return [String]
29
+ def name
30
+ @name
31
+ end
32
+ alias :auto_scaling_group_name :name
34
33
 
35
- # The Amazon Resource Name (ARN) of the group.
36
- # @return [String]
37
- def auto_scaling_group_arn
38
- data.auto_scaling_group_arn
39
- end
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
- # The name of the associated launch configuration.
42
- # @return [String]
43
- def launch_configuration_name
44
- data.launch_configuration_name
45
- end
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
- # The minimum size of the group.
48
- # @return [Integer]
49
- def min_size
50
- data.min_size
51
- end
46
+ # The minimum size of the group.
47
+ # @return [Integer]
48
+ def min_size
49
+ data.min_size
50
+ end
52
51
 
53
- # The maximum size of the group.
54
- # @return [Integer]
55
- def max_size
56
- data.max_size
57
- end
52
+ # The maximum size of the group.
53
+ # @return [Integer]
54
+ def max_size
55
+ data.max_size
56
+ end
58
57
 
59
- # The desired size of the group.
60
- # @return [Integer]
61
- def desired_capacity
62
- data.desired_capacity
63
- end
58
+ # The desired size of the group.
59
+ # @return [Integer]
60
+ def desired_capacity
61
+ data.desired_capacity
62
+ end
64
63
 
65
- # The amount of time, in seconds, after a scaling activity completes
66
- # before another scaling activity can start.
67
- # @return [Integer]
68
- def default_cooldown
69
- data.default_cooldown
70
- end
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
- # One or more Availability Zones for the group.
73
- # @return [Array<String>]
74
- def availability_zones
75
- data.availability_zones
76
- end
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
- # One or more load balancers associated with the group.
79
- # @return [Array<String>]
80
- def load_balancer_names
81
- data.load_balancer_names
82
- end
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
- # The Amazon Resource Names (ARN) of the target groups for your load
85
- # balancer.
86
- # @return [Array<String>]
87
- def target_group_arns
88
- data.target_group_arns
89
- end
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
- # The service to use for the health checks. The valid values are `EC2`
92
- # and `ELB`.
93
- # @return [String]
94
- def health_check_type
95
- data.health_check_type
96
- end
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
- # The amount of time, in seconds, that Auto Scaling waits before
99
- # checking the health status of an EC2 instance that has come into
100
- # service.
101
- # @return [Integer]
102
- def health_check_grace_period
103
- data.health_check_grace_period
104
- end
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
- # The date and time the group was created.
107
- # @return [Time]
108
- def created_time
109
- data.created_time
110
- end
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
- # The suspended processes associated with the group.
113
- # @return [Array<Types::SuspendedProcess>]
114
- def suspended_processes
115
- data.suspended_processes
116
- end
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
- # The name of the placement group into which you'll launch your
119
- # instances, if any. For more information, see [Placement Groups][1] in
120
- # the *Amazon Elastic Compute Cloud User Guide*.
121
- #
122
- #
123
- #
124
- # [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html
125
- # @return [String]
126
- def placement_group
127
- data.placement_group
128
- end
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
- # One or more subnet IDs, if applicable, separated by commas.
131
- #
132
- # If you specify `VPCZoneIdentifier` and `AvailabilityZones`, ensure
133
- # that the Availability Zones of the subnets match the values for
134
- # `AvailabilityZones`.
135
- # @return [String]
136
- def vpc_zone_identifier
137
- data.vpc_zone_identifier
138
- end
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
- # The metrics enabled for the group.
141
- # @return [Array<Types::EnabledMetric>]
142
- def enabled_metrics
143
- data.enabled_metrics
144
- end
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
- # The current state of the group when DeleteAutoScalingGroup is in
147
- # progress.
148
- # @return [String]
149
- def status
150
- data.status
151
- end
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
- # The termination policies for the group.
154
- # @return [Array<String>]
155
- def termination_policies
156
- data.termination_policies
157
- end
152
+ # The termination policies for the group.
153
+ # @return [Array<String>]
154
+ def termination_policies
155
+ data.termination_policies
156
+ end
158
157
 
159
- # Indicates whether newly launched instances are protected from
160
- # termination by Auto Scaling when scaling in.
161
- # @return [Boolean]
162
- def new_instances_protected_from_scale_in
163
- data.new_instances_protected_from_scale_in
164
- end
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
- # @!endgroup
165
+ # @!endgroup
167
166
 
168
- # @return [Client]
169
- def client
170
- @client
171
- end
167
+ # @return [Client]
168
+ def client
169
+ @client
170
+ end
172
171
 
173
- # Loads, or reloads {#data} for the current {AutoScalingGroup}.
174
- # Returns `self` making it possible to chain methods.
175
- #
176
- # auto_scaling_group.reload.data
177
- #
178
- # @return [self]
179
- def load
180
- resp = @client.describe_auto_scaling_groups(auto_scaling_group_names: [@name])
181
- @data = resp.autoscalinggroups[0]
182
- self
183
- end
184
- alias :reload :load
185
-
186
- # @return [Types::AutoScalingGroup]
187
- # Returns the data for this {AutoScalingGroup}. Calls
188
- # {Client#describe_auto_scaling_groups} if {#data_loaded?} is `false`.
189
- def data
190
- load unless @data
191
- @data
192
- end
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
- # @return [Boolean]
195
- # Returns `true` if this resource is loaded. Accessing attributes or
196
- # {#data} on an unloaded resource will trigger a call to {#load}.
197
- def data_loaded?
198
- !!@data
199
- end
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
- # @param [Hash] options ({})
202
- # @return [Boolean]
203
- # Returns `true` if the AutoScalingGroup exists.
204
- def exists?(options = {})
205
- begin
206
- wait_until_exists(options.merge(max_attempts: 1))
207
- true
208
- rescue Aws::Waiters::Errors::UnexpectedError => e
209
- raise e.error
210
- rescue Aws::Waiters::Errors::WaiterFailed
211
- false
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
- # @param [Hash] options ({})
216
- # @option options [Integer] :max_attempts (10)
217
- # @option options [Float] :delay (5)
218
- # @option options [Proc] :before_attempt
219
- # @option options [Proc] :before_wait
220
- # @return [AutoScalingGroup]
221
- def wait_until_exists(options = {})
222
- options, params = separate_params_and_options(options)
223
- waiter = Waiters::GroupExists.new(options)
224
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
225
- waiter.wait(params.merge(auto_scaling_group_names: [@name]))
226
- AutoScalingGroup.new({
227
- name: @name,
228
- client: @client
229
- })
230
- end
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
- # @param [Hash] options ({})
233
- # @option options [Integer] :max_attempts (40)
234
- # @option options [Float] :delay (15)
235
- # @option options [Proc] :before_attempt
236
- # @option options [Proc] :before_wait
237
- # @return [AutoScalingGroup]
238
- def wait_until_in_service(options = {})
239
- options, params = separate_params_and_options(options)
240
- waiter = Waiters::GroupInService.new(options)
241
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
242
- waiter.wait(params.merge(auto_scaling_group_names: [@name]))
243
- AutoScalingGroup.new({
244
- name: @name,
245
- client: @client
246
- })
247
- end
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
- # @param [Hash] options ({})
250
- # @option options [Integer] :max_attempts (40)
251
- # @option options [Float] :delay (15)
252
- # @option options [Proc] :before_attempt
253
- # @option options [Proc] :before_wait
254
- # @return [AutoScalingGroup]
255
- def wait_until_not_exists(options = {})
256
- options, params = separate_params_and_options(options)
257
- waiter = Waiters::GroupNotExists.new(options)
258
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
259
- waiter.wait(params.merge(auto_scaling_group_names: [@name]))
260
- AutoScalingGroup.new({
261
- name: @name,
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
- # @!group Actions
267
-
268
- # @example Request syntax with placeholder values
269
- #
270
- # auto_scaling_group.attach_instances({
271
- # instance_ids: ["XmlStringMaxLen19"],
272
- # })
273
- # @param [Hash] options ({})
274
- # @option options [Array<String>] :instance_ids
275
- # One or more instance IDs.
276
- # @return [EmptyStructure]
277
- def attach_instances(options = {})
278
- options = options.merge(auto_scaling_group_name: @name)
279
- resp = @client.attach_instances(options)
280
- resp.data
281
- end
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
- # @example Request syntax with placeholder values
284
- #
285
- # auto_scaling_group.delete({
286
- # force_delete: false,
287
- # })
288
- # @param [Hash] options ({})
289
- # @option options [Boolean] :force_delete
290
- # Specifies that the group will be deleted along with all instances
291
- # associated with the group, without waiting for all instances to be
292
- # terminated. This parameter also deletes any lifecycle actions
293
- # associated with the group.
294
- # @return [EmptyStructure]
295
- def delete(options = {})
296
- options = options.merge(auto_scaling_group_name: @name)
297
- resp = @client.delete_auto_scaling_group(options)
298
- resp.data
299
- end
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
- # @example Request syntax with placeholder values
302
- #
303
- # activity = auto_scaling_group.detach_instances({
304
- # instance_ids: ["XmlStringMaxLen19"],
305
- # should_decrement_desired_capacity: false, # required
306
- # })
307
- # @param [Hash] options ({})
308
- # @option options [Array<String>] :instance_ids
309
- # One or more instance IDs.
310
- # @option options [required, Boolean] :should_decrement_desired_capacity
311
- # If `True`, the Auto Scaling group decrements the desired capacity
312
- # value by the number of instances detached.
313
- # @return [Activity::Collection]
314
- def detach_instances(options = {})
315
- batch = []
316
- options = options.merge(auto_scaling_group_name: @name)
317
- resp = @client.detach_instances(options)
318
- resp.data.activities.each do |a|
319
- batch << Activity.new(
320
- id: a.activity_id,
321
- data: a,
322
- client: @client
323
- )
324
- end
325
- Activity::Collection.new([batch], size: batch.size)
326
- end
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
- # @example Request syntax with placeholder values
329
- #
330
- # auto_scaling_group.disable_metrics_collection({
331
- # metrics: ["XmlStringMaxLen255"],
332
- # })
333
- # @param [Hash] options ({})
334
- # @option options [Array<String>] :metrics
335
- # One or more of the following metrics. If you omit this parameter, all
336
- # metrics are disabled.
337
- #
338
- # * `GroupMinSize`
339
- #
340
- # * `GroupMaxSize`
341
- #
342
- # * `GroupDesiredCapacity`
343
- #
344
- # * `GroupInServiceInstances`
345
- #
346
- # * `GroupPendingInstances`
347
- #
348
- # * `GroupStandbyInstances`
349
- #
350
- # * `GroupTerminatingInstances`
351
- #
352
- # * `GroupTotalInstances`
353
- # @return [EmptyStructure]
354
- def disable_metrics_collection(options = {})
355
- options = options.merge(auto_scaling_group_name: @name)
356
- resp = @client.disable_metrics_collection(options)
357
- resp.data
358
- end
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
- # @example Request syntax with placeholder values
361
- #
362
- # auto_scaling_group.enable_metrics_collection({
363
- # metrics: ["XmlStringMaxLen255"],
364
- # granularity: "XmlStringMaxLen255", # required
365
- # })
366
- # @param [Hash] options ({})
367
- # @option options [Array<String>] :metrics
368
- # One or more of the following metrics. If you omit this parameter, all
369
- # metrics are enabled.
370
- #
371
- # * `GroupMinSize`
372
- #
373
- # * `GroupMaxSize`
374
- #
375
- # * `GroupDesiredCapacity`
376
- #
377
- # * `GroupInServiceInstances`
378
- #
379
- # * `GroupPendingInstances`
380
- #
381
- # * `GroupStandbyInstances`
382
- #
383
- # * `GroupTerminatingInstances`
384
- #
385
- # * `GroupTotalInstances`
386
- # @option options [required, String] :granularity
387
- # The granularity to associate with the metrics to collect. The only
388
- # valid value is `1Minute`.
389
- # @return [EmptyStructure]
390
- def enable_metrics_collection(options = {})
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
- # @example Request syntax with placeholder values
397
- #
398
- # scalingpolicy = auto_scaling_group.put_scaling_policy({
399
- # policy_name: "XmlStringMaxLen255", # required
400
- # policy_type: "XmlStringMaxLen64",
401
- # adjustment_type: "XmlStringMaxLen255", # required
402
- # min_adjustment_step: 1,
403
- # min_adjustment_magnitude: 1,
404
- # scaling_adjustment: 1,
405
- # cooldown: 1,
406
- # metric_aggregation_type: "XmlStringMaxLen32",
407
- # step_adjustments: [
408
- # {
409
- # metric_interval_lower_bound: 1.0,
410
- # metric_interval_upper_bound: 1.0,
411
- # scaling_adjustment: 1, # required
412
- # },
413
- # ],
414
- # estimated_instance_warmup: 1,
415
- # })
416
- # @param [Hash] options ({})
417
- # @option options [required, String] :policy_name
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
- # @example Request syntax with placeholder values
490
- #
491
- # scheduledaction = auto_scaling_group.put_scheduled_update_group_action({
492
- # scheduled_action_name: "XmlStringMaxLen255", # required
493
- # time: Time.now,
494
- # start_time: Time.now,
495
- # end_time: Time.now,
496
- # recurrence: "XmlStringMaxLen255",
497
- # min_size: 1,
498
- # max_size: 1,
499
- # desired_capacity: 1,
500
- # })
501
- # @param [Hash] options ({})
502
- # @option options [required, String] :scheduled_action_name
503
- # The name of this scaling action.
504
- # @option options [Time,DateTime,Date,Integer,String] :time
505
- # This parameter is deprecated.
506
- # @option options [Time,DateTime,Date,Integer,String] :start_time
507
- # The time for this action to start, in "YYYY-MM-DDThh:mm:ssZ" format
508
- # in UTC/GMT only (for example, `2014-06-01T00:00:00Z`).
509
- #
510
- # If you specify `Recurrence` and `StartTime`, Auto Scaling performs the
511
- # action at this time, and then performs the action based on the
512
- # specified recurrence.
513
- #
514
- # If you try to schedule your action in the past, Auto Scaling returns
515
- # an error message.
516
- # @option options [Time,DateTime,Date,Integer,String] :end_time
517
- # The time for the recurring schedule to end. Auto Scaling does not
518
- # perform the action after this time.
519
- # @option options [String] :recurrence
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
- # @example Request syntax with placeholder values
543
- #
544
- # auto_scaling_group.resume_processes({
545
- # scaling_processes: ["XmlStringMaxLen255"],
546
- # })
547
- # @param [Hash] options ({})
548
- # @option options [Array<String>] :scaling_processes
549
- # One or more of the following processes. If you omit this parameter,
550
- # all processes are specified.
551
- #
552
- # * `Launch`
553
- #
554
- # * `Terminate`
555
- #
556
- # * `HealthCheck`
557
- #
558
- # * `ReplaceUnhealthy`
559
- #
560
- # * `AZRebalance`
561
- #
562
- # * `AlarmNotification`
563
- #
564
- # * `ScheduledActions`
565
- #
566
- # * `AddToLoadBalancer`
567
- # @return [EmptyStructure]
568
- def resume_processes(options = {})
569
- options = options.merge(auto_scaling_group_name: @name)
570
- resp = @client.resume_processes(options)
571
- resp.data
572
- end
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
- # @example Request syntax with placeholder values
575
- #
576
- # auto_scaling_group.set_desired_capacity({
577
- # desired_capacity: 1, # required
578
- # honor_cooldown: false,
579
- # })
580
- # @param [Hash] options ({})
581
- # @option options [required, Integer] :desired_capacity
582
- # The number of EC2 instances that should be running in the Auto Scaling
583
- # group.
584
- # @option options [Boolean] :honor_cooldown
585
- # By default, `SetDesiredCapacity` overrides any cooldown period
586
- # associated with the Auto Scaling group. Specify `True` to make Auto
587
- # Scaling to wait for the cool-down period associated with the Auto
588
- # Scaling group to complete before initiating a scaling activity to set
589
- # your Auto Scaling group to its new capacity.
590
- # @return [EmptyStructure]
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.set_desired_capacity(options)
594
- resp.data
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
- # @example Request syntax with placeholder values
598
- #
599
- # auto_scaling_group.suspend_processes({
600
- # scaling_processes: ["XmlStringMaxLen255"],
601
- # })
602
- # @param [Hash] options ({})
603
- # @option options [Array<String>] :scaling_processes
604
- # One or more of the following processes. If you omit this parameter,
605
- # all processes are specified.
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
- # @example Request syntax with placeholder values
630
- #
631
- # autoscalinggroup = auto_scaling_group.update({
632
- # launch_configuration_name: "ResourceName",
633
- # min_size: 1,
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
- # @!group Associations
729
-
730
- # @example Request syntax with placeholder values
731
- #
732
- # activities = auto_scaling_group.activities({
733
- # activity_ids: ["XmlString"],
734
- # })
735
- # @param [Hash] options ({})
736
- # @option options [Array<String>] :activity_ids
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
- # @return [Instance::Collection]
763
- def instances
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
- data.instances.each do |i|
766
- batch << Instance.new(
767
- group_name: @name,
768
- id: i.instance_id,
769
- data: i,
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
- Instance::Collection.new([batch], size: batch.size)
820
+ y.yield(batch)
774
821
  end
822
+ LifecycleHook::Collection.new(batches)
823
+ end
775
824
 
776
- # @return [LaunchConfiguration, nil]
777
- def launch_configuration
778
- if data.launch_configuration_name
779
- LaunchConfiguration.new(
780
- name: data.launch_configuration_name,
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
- # @param [String] name
789
- # @return [LifecycleHook]
790
- def lifecycle_hook(name)
791
- LifecycleHook.new(
792
- group_name: @name,
793
- name: name,
794
- client: @client
795
- )
796
- end
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
- options = options.merge(auto_scaling_group_name: @name)
812
- resp = @client.describe_lifecycle_hooks(options)
813
- resp.data.lifecycle_hooks.each do |l|
814
- batch << LifecycleHook.new(
815
- group_name: l.auto_scaling_group_name,
816
- name: l.lifecycle_hook_name,
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
- # @example Request syntax with placeholder values
837
- #
838
- # loadbalancers = auto_scaling_group.load_balancers({
839
- # next_token: "XmlString",
840
- # max_records: 1,
841
- # })
842
- # @param [Hash] options ({})
843
- # @option options [String] :next_token
844
- # The token for the next set of items to return. (You received this
845
- # token from a previous call.)
846
- # @option options [Integer] :max_records
847
- # The maximum number of items to return with this call.
848
- # @return [LoadBalancer::Collection]
849
- def load_balancers(options = {})
850
- batches = Enumerator.new do |y|
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
- options = options.merge(auto_scaling_group_name: @name)
853
- resp = @client.describe_load_balancers(options)
854
- resp.data.load_balancers.each do |l|
855
- batch << LoadBalancer.new(
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
- # @example Request syntax with placeholder values
894
- #
895
- # policies = auto_scaling_group.policies({
896
- # policy_names: ["ResourceName"],
897
- # policy_types: ["XmlStringMaxLen64"],
898
- # })
899
- # @param [Hash] options ({})
900
- # @option options [Array<String>] :policy_names
901
- # One or more policy names or policy ARNs to be described. If you omit
902
- # this parameter, all policy names are described. If an group name is
903
- # provided, the results are limited to that group. This list is limited
904
- # to 50 items. If you specify an unknown policy name, it is ignored with
905
- # no error.
906
- # @option options [Array<String>] :policy_types
907
- # One or more policy types. Valid values are `SimpleScaling` and
908
- # `StepScaling`.
909
- # @return [ScalingPolicy::Collection]
910
- def policies(options = {})
911
- batches = Enumerator.new do |y|
912
- options = options.merge(auto_scaling_group_name: @name)
913
- resp = @client.describe_policies(options)
914
- resp.each_page do |page|
915
- batch = []
916
- page.data.scaling_policies.each do |s|
917
- batch << ScalingPolicy.new(
918
- name: s.policy_name,
919
- data: s,
920
- client: @client
921
- )
922
- end
923
- y.yield(batch)
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
- # @example Request syntax with placeholder values
930
- #
931
- # scheduledactions = auto_scaling_group.scheduled_actions({
932
- # scheduled_action_names: ["ResourceName"],
933
- # start_time: Time.now,
934
- # end_time: Time.now,
935
- # })
936
- # @param [Hash] options ({})
937
- # @option options [Array<String>] :scheduled_action_names
938
- # Describes one or more scheduled actions. If you omit this parameter,
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
- # @param [String] key
972
- # @return [Tag]
973
- def tag(key)
974
- Tag.new(
975
- key: key,
976
- resource_id: @name,
977
- resource_type: "auto-scaling-group",
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
- # @return [Tag::Collection]
983
- def tags
984
- batch = []
985
- data.tags.each do |t|
986
- batch << Tag.new(
987
- key: t.key,
988
- resource_id: t.resource_id,
989
- resource_type: t.resource_type,
990
- data: t,
991
- client: @client
992
- )
993
- end
994
- Tag::Collection.new([batch], size: batch.size)
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
- # @deprecated
998
- # @api private
999
- def identifiers
1000
- { name: @name }
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
- deprecated(:identifiers)
1003
-
1004
- private
1023
+ yield(waiter.waiter)
1024
+ end
1005
1025
 
1006
- def extract_name(args, options)
1007
- value = args[0] || options.delete(:name)
1008
- case value
1009
- when String then value
1010
- when nil then raise ArgumentError, "missing required option :name"
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
- msg = "expected :name to be a String, got #{value.class}"
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
- class Collection < Aws::Resources::Collection; end
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