aws-sdk-autoscaling 1.0.0.rc1 → 1.0.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,183 +1,181 @@
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 ScheduledAction
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 ScheduledAction
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 :scheduled_action_name :name
28
+ # @return [String]
29
+ def name
30
+ @name
31
+ end
32
+ alias :scheduled_action_name :name
34
33
 
35
- # The name of the group.
36
- # @return [String]
37
- def auto_scaling_group_name
38
- data.auto_scaling_group_name
39
- end
34
+ # The name of the group.
35
+ # @return [String]
36
+ def auto_scaling_group_name
37
+ data.auto_scaling_group_name
38
+ end
40
39
 
41
- # The Amazon Resource Name (ARN) of the scheduled action.
42
- # @return [String]
43
- def scheduled_action_arn
44
- data.scheduled_action_arn
45
- end
40
+ # The Amazon Resource Name (ARN) of the scheduled action.
41
+ # @return [String]
42
+ def scheduled_action_arn
43
+ data.scheduled_action_arn
44
+ end
46
45
 
47
- # This parameter is deprecated.
48
- # @return [Time]
49
- def time
50
- data.time
51
- end
46
+ # This parameter is deprecated.
47
+ # @return [Time]
48
+ def time
49
+ data.time
50
+ end
52
51
 
53
- # The date and time that the action is scheduled to begin. This date and
54
- # time can be up to one month in the future.
55
- #
56
- # When `StartTime` and `EndTime` are specified with `Recurrence`, they
57
- # form the boundaries of when the recurring action will start and stop.
58
- # @return [Time]
59
- def start_time
60
- data.start_time
61
- end
52
+ # The date and time that the action is scheduled to begin. This date and
53
+ # time can be up to one month in the future.
54
+ #
55
+ # When `StartTime` and `EndTime` are specified with `Recurrence`, they
56
+ # form the boundaries of when the recurring action will start and stop.
57
+ # @return [Time]
58
+ def start_time
59
+ data.start_time
60
+ end
62
61
 
63
- # The date and time that the action is scheduled to end. This date and
64
- # time can be up to one month in the future.
65
- # @return [Time]
66
- def end_time
67
- data.end_time
68
- end
62
+ # The date and time that the action is scheduled to end. This date and
63
+ # time can be up to one month in the future.
64
+ # @return [Time]
65
+ def end_time
66
+ data.end_time
67
+ end
69
68
 
70
- # The recurring schedule for the action.
71
- # @return [String]
72
- def recurrence
73
- data.recurrence
74
- end
69
+ # The recurring schedule for the action.
70
+ # @return [String]
71
+ def recurrence
72
+ data.recurrence
73
+ end
75
74
 
76
- # The minimum size of the group.
77
- # @return [Integer]
78
- def min_size
79
- data.min_size
80
- end
75
+ # The minimum size of the group.
76
+ # @return [Integer]
77
+ def min_size
78
+ data.min_size
79
+ end
81
80
 
82
- # The maximum size of the group.
83
- # @return [Integer]
84
- def max_size
85
- data.max_size
86
- end
81
+ # The maximum size of the group.
82
+ # @return [Integer]
83
+ def max_size
84
+ data.max_size
85
+ end
87
86
 
88
- # The number of instances you prefer to maintain in the group.
89
- # @return [Integer]
90
- def desired_capacity
91
- data.desired_capacity
92
- end
87
+ # The number of instances you prefer to maintain in the group.
88
+ # @return [Integer]
89
+ def desired_capacity
90
+ data.desired_capacity
91
+ end
93
92
 
94
- # @!endgroup
93
+ # @!endgroup
95
94
 
96
- # @return [Client]
97
- def client
98
- @client
99
- end
95
+ # @return [Client]
96
+ def client
97
+ @client
98
+ end
100
99
 
101
- # Loads, or reloads {#data} for the current {ScheduledAction}.
102
- # Returns `self` making it possible to chain methods.
103
- #
104
- # scheduled_action.reload.data
105
- #
106
- # @return [self]
107
- def load
108
- resp = @client.describe_scheduled_actions(scheduled_action_names: [@name])
109
- @data = resp.scheduledupdategroupactions[0]
110
- self
111
- end
112
- alias :reload :load
113
-
114
- # @return [Types::ScheduledUpdateGroupAction]
115
- # Returns the data for this {ScheduledAction}. Calls
116
- # {Client#describe_scheduled_actions} if {#data_loaded?} is `false`.
117
- def data
118
- load unless @data
119
- @data
120
- end
100
+ # Loads, or reloads {#data} for the current {ScheduledAction}.
101
+ # Returns `self` making it possible to chain methods.
102
+ #
103
+ # scheduled_action.reload.data
104
+ #
105
+ # @return [self]
106
+ def load
107
+ resp = @client.describe_scheduled_actions(scheduled_action_names: [@name])
108
+ @data = resp.scheduledupdategroupactions[0]
109
+ self
110
+ end
111
+ alias :reload :load
112
+
113
+ # @return [Types::ScheduledUpdateGroupAction]
114
+ # Returns the data for this {ScheduledAction}. Calls
115
+ # {Client#describe_scheduled_actions} if {#data_loaded?} is `false`.
116
+ def data
117
+ load unless @data
118
+ @data
119
+ end
121
120
 
122
- # @return [Boolean]
123
- # Returns `true` if this resource is loaded. Accessing attributes or
124
- # {#data} on an unloaded resource will trigger a call to {#load}.
125
- def data_loaded?
126
- !!@data
127
- end
121
+ # @return [Boolean]
122
+ # Returns `true` if this resource is loaded. Accessing attributes or
123
+ # {#data} on an unloaded resource will trigger a call to {#load}.
124
+ def data_loaded?
125
+ !!@data
126
+ end
128
127
 
129
- # @!group Actions
130
-
131
- # @example Request syntax with placeholder values
132
- #
133
- # scheduled_action.delete({
134
- # auto_scaling_group_name: "ResourceName", # required
135
- # })
136
- # @param [Hash] options ({})
137
- # @option options [required, String] :auto_scaling_group_name
138
- # The name of the Auto Scaling group.
139
- # @return [EmptyStructure]
140
- def delete(options = {})
141
- options = options.merge(scheduled_action_name: @name)
142
- resp = @client.delete_scheduled_action(options)
143
- resp.data
144
- end
128
+ # @!group Actions
129
+
130
+ # @example Request syntax with placeholder values
131
+ #
132
+ # scheduled_action.delete({
133
+ # auto_scaling_group_name: "ResourceName", # required
134
+ # })
135
+ # @param [Hash] options ({})
136
+ # @option options [required, String] :auto_scaling_group_name
137
+ # The name of the Auto Scaling group.
138
+ # @return [EmptyStructure]
139
+ def delete(options = {})
140
+ options = options.merge(scheduled_action_name: @name)
141
+ resp = @client.delete_scheduled_action(options)
142
+ resp.data
143
+ end
145
144
 
146
- # @!group Associations
147
-
148
- # @return [AutoScalingGroup, nil]
149
- def group
150
- if data.auto_scaling_group_name
151
- AutoScalingGroup.new(
152
- name: data.auto_scaling_group_name,
153
- client: @client
154
- )
155
- else
156
- nil
157
- end
158
- end
145
+ # @!group Associations
159
146
 
160
- # @deprecated
161
- # @api private
162
- def identifiers
163
- { name: @name }
164
- end
165
- deprecated(:identifiers)
166
-
167
- private
168
-
169
- def extract_name(args, options)
170
- value = args[0] || options.delete(:name)
171
- case value
172
- when String then value
173
- when nil then raise ArgumentError, "missing required option :name"
174
- else
175
- msg = "expected :name to be a String, got #{value.class}"
176
- raise ArgumentError, msg
177
- end
147
+ # @return [AutoScalingGroup, nil]
148
+ def group
149
+ if data.auto_scaling_group_name
150
+ AutoScalingGroup.new(
151
+ name: data.auto_scaling_group_name,
152
+ client: @client
153
+ )
154
+ else
155
+ nil
178
156
  end
157
+ end
179
158
 
180
- class Collection < Aws::Resources::Collection; end
159
+ # @deprecated
160
+ # @api private
161
+ def identifiers
162
+ { name: @name }
181
163
  end
164
+ deprecated(:identifiers)
165
+
166
+ private
167
+
168
+ def extract_name(args, options)
169
+ value = args[0] || options.delete(:name)
170
+ case value
171
+ when String then value
172
+ when nil then raise ArgumentError, "missing required option :name"
173
+ else
174
+ msg = "expected :name to be a String, got #{value.class}"
175
+ raise ArgumentError, msg
176
+ end
177
+ end
178
+
179
+ class Collection < Aws::Resources::Collection; end
182
180
  end
183
181
  end
@@ -1,260 +1,252 @@
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 Tag
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(key, resource_id, resource_type, options = {})
15
- # @param [String] key
16
- # @param [String] resource_id
17
- # @param [String] resource_type
18
- # @option options [Client] :client
19
- # @overload def initialize(options = {})
20
- # @option options [required, String] :key
21
- # @option options [required, String] :resource_id
22
- # @option options [required, String] :resource_type
23
- # @option options [Client] :client
24
- def initialize(*args)
25
- options = Hash === args.last ? args.pop.dup : {}
26
- @key = extract_key(args, options)
27
- @resource_id = extract_resource_id(args, options)
28
- @resource_type = extract_resource_type(args, options)
29
- @data = options.delete(:data)
30
- @client = options.delete(:client) || Client.new(options)
31
- end
32
-
33
- # @!group Read-Only Attributes
34
-
35
- # @return [String]
36
- def key
37
- @key
38
- end
8
+ module Aws::AutoScaling
9
+ class Tag
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(key, resource_id, resource_type, options = {})
14
+ # @param [String] key
15
+ # @param [String] resource_id
16
+ # @param [String] resource_type
17
+ # @option options [Client] :client
18
+ # @overload def initialize(options = {})
19
+ # @option options [required, String] :key
20
+ # @option options [required, String] :resource_id
21
+ # @option options [required, String] :resource_type
22
+ # @option options [Client] :client
23
+ def initialize(*args)
24
+ options = Hash === args.last ? args.pop.dup : {}
25
+ @key = extract_key(args, options)
26
+ @resource_id = extract_resource_id(args, options)
27
+ @resource_type = extract_resource_type(args, options)
28
+ @data = options.delete(:data)
29
+ @client = options.delete(:client) || Client.new(options)
30
+ end
39
31
 
40
- # @return [String]
41
- def resource_id
42
- @resource_id
43
- end
32
+ # @!group Read-Only Attributes
44
33
 
45
- # @return [String]
46
- def resource_type
47
- @resource_type
48
- end
34
+ # @return [String]
35
+ def key
36
+ @key
37
+ end
49
38
 
50
- # The tag value.
51
- # @return [String]
52
- def value
53
- data.value
54
- end
39
+ # @return [String]
40
+ def resource_id
41
+ @resource_id
42
+ end
55
43
 
56
- # Determines whether the tag is added to new instances as they are
57
- # launched in the group.
58
- # @return [Boolean]
59
- def propagate_at_launch
60
- data.propagate_at_launch
61
- end
44
+ # @return [String]
45
+ def resource_type
46
+ @resource_type
47
+ end
62
48
 
63
- # @!endgroup
49
+ # The tag value.
50
+ # @return [String]
51
+ def value
52
+ data.value
53
+ end
64
54
 
65
- # @return [Client]
66
- def client
67
- @client
68
- end
55
+ # Determines whether the tag is added to new instances as they are
56
+ # launched in the group.
57
+ # @return [Boolean]
58
+ def propagate_at_launch
59
+ data.propagate_at_launch
60
+ end
69
61
 
70
- # Loads, or reloads {#data} for the current {Tag}.
71
- # Returns `self` making it possible to chain methods.
72
- #
73
- # tag.reload.data
74
- #
75
- # @return [self]
76
- def load
77
- resp = @client.describe_tags(filters: [
78
- {
79
- name: "key",
80
- values: [@key]
81
- },
82
- {
83
- name: @resource_type,
84
- values: [@resource_id]
85
- }
86
- ])
87
- @data = resp.tags[0]
88
- self
89
- end
90
- alias :reload :load
62
+ # @!endgroup
91
63
 
92
- # @return [Types::TagDescription]
93
- # Returns the data for this {Tag}. Calls
94
- # {Client#describe_tags} if {#data_loaded?} is `false`.
95
- def data
96
- load unless @data
97
- @data
98
- end
64
+ # @return [Client]
65
+ def client
66
+ @client
67
+ end
99
68
 
100
- # @return [Boolean]
101
- # Returns `true` if this resource is loaded. Accessing attributes or
102
- # {#data} on an unloaded resource will trigger a call to {#load}.
103
- def data_loaded?
104
- !!@data
105
- end
69
+ # Loads, or reloads {#data} for the current {Tag}.
70
+ # Returns `self` making it possible to chain methods.
71
+ #
72
+ # tag.reload.data
73
+ #
74
+ # @return [self]
75
+ def load
76
+ resp = @client.describe_tags(filters: [
77
+ {
78
+ name: "key",
79
+ values: [@key]
80
+ },
81
+ {
82
+ name: @resource_type,
83
+ values: [@resource_id]
84
+ }
85
+ ])
86
+ @data = resp.tags[0]
87
+ self
88
+ end
89
+ alias :reload :load
90
+
91
+ # @return [Types::TagDescription]
92
+ # Returns the data for this {Tag}. Calls
93
+ # {Client#describe_tags} if {#data_loaded?} is `false`.
94
+ def data
95
+ load unless @data
96
+ @data
97
+ end
106
98
 
107
- # @!group Actions
99
+ # @return [Boolean]
100
+ # Returns `true` if this resource is loaded. Accessing attributes or
101
+ # {#data} on an unloaded resource will trigger a call to {#load}.
102
+ def data_loaded?
103
+ !!@data
104
+ end
108
105
 
109
- # @example Request syntax with placeholder values
110
- #
111
- # tag.create({
112
- # tags: [ # required
113
- # {
114
- # resource_id: "XmlString",
115
- # resource_type: "XmlString",
116
- # key: "TagKey", # required
117
- # value: "TagValue",
118
- # propagate_at_launch: false,
119
- # },
120
- # ],
121
- # })
122
- # @param [Hash] options ({})
123
- # @option options [required, Array<Types::Tag>] :tags
124
- # One or more tags.
125
- # @return [EmptyStructure]
126
- def create(options = {})
127
- options = Aws::Util.deep_merge(options, tags: [{
128
- resource_type: @resource_type,
129
- resource_id: @resource_id,
130
- key: @key
131
- }])
132
- resp = @client.create_or_update_tags(options)
133
- resp.data
134
- end
106
+ # @!group Actions
107
+
108
+ # @example Request syntax with placeholder values
109
+ #
110
+ # tag.create({
111
+ # tags: [ # required
112
+ # {
113
+ # resource_id: "XmlString",
114
+ # resource_type: "XmlString",
115
+ # key: "TagKey", # required
116
+ # value: "TagValue",
117
+ # propagate_at_launch: false,
118
+ # },
119
+ # ],
120
+ # })
121
+ # @param [Hash] options ({})
122
+ # @option options [required, Array<Types::Tag>] :tags
123
+ # One or more tags.
124
+ # @return [EmptyStructure]
125
+ def create(options = {})
126
+ options = Aws::Util.deep_merge(options, tags: [{
127
+ resource_type: @resource_type,
128
+ resource_id: @resource_id,
129
+ key: @key
130
+ }])
131
+ resp = @client.create_or_update_tags(options)
132
+ resp.data
133
+ end
135
134
 
136
- # @example Request syntax with placeholder values
137
- #
138
- # tag.delete({
139
- # tags: [ # required
140
- # {
141
- # resource_id: "XmlString",
142
- # resource_type: "XmlString",
143
- # key: "TagKey", # required
144
- # value: "TagValue",
145
- # propagate_at_launch: false,
146
- # },
147
- # ],
148
- # })
149
- # @param [Hash] options ({})
150
- # @option options [required, Array<Types::Tag>] :tags
151
- # One or more tags.
152
- # @return [EmptyStructure]
153
- def delete(options = {})
154
- options = Aws::Util.deep_merge(options, tags: [{
155
- resource_type: @resource_type,
156
- resource_id: @resource_id,
157
- key: @key
158
- }])
159
- resp = @client.delete_tags(options)
160
- resp.data
161
- end
135
+ # @example Request syntax with placeholder values
136
+ #
137
+ # tag.delete({
138
+ # tags: [ # required
139
+ # {
140
+ # resource_id: "XmlString",
141
+ # resource_type: "XmlString",
142
+ # key: "TagKey", # required
143
+ # value: "TagValue",
144
+ # propagate_at_launch: false,
145
+ # },
146
+ # ],
147
+ # })
148
+ # @param [Hash] options ({})
149
+ # @option options [required, Array<Types::Tag>] :tags
150
+ # One or more tags.
151
+ # @return [EmptyStructure]
152
+ def delete(options = {})
153
+ options = Aws::Util.deep_merge(options, tags: [{
154
+ resource_type: @resource_type,
155
+ resource_id: @resource_id,
156
+ key: @key
157
+ }])
158
+ resp = @client.delete_tags(options)
159
+ resp.data
160
+ end
162
161
 
163
- # @deprecated
164
- # @api private
165
- def identifiers
166
- {
167
- key: @key,
168
- resource_id: @resource_id,
169
- resource_type: @resource_type
170
- }
171
- end
172
- deprecated(:identifiers)
162
+ # @deprecated
163
+ # @api private
164
+ def identifiers
165
+ {
166
+ key: @key,
167
+ resource_id: @resource_id,
168
+ resource_type: @resource_type
169
+ }
170
+ end
171
+ deprecated(:identifiers)
173
172
 
174
- private
173
+ private
175
174
 
176
- def extract_key(args, options)
177
- value = args[0] || options.delete(:key)
178
- case value
179
- when String then value
180
- when nil then raise ArgumentError, "missing required option :key"
181
- else
182
- msg = "expected :key to be a String, got #{value.class}"
183
- raise ArgumentError, msg
184
- end
175
+ def extract_key(args, options)
176
+ value = args[0] || options.delete(:key)
177
+ case value
178
+ when String then value
179
+ when nil then raise ArgumentError, "missing required option :key"
180
+ else
181
+ msg = "expected :key to be a String, got #{value.class}"
182
+ raise ArgumentError, msg
185
183
  end
184
+ end
186
185
 
187
- def extract_resource_id(args, options)
188
- value = args[1] || options.delete(:resource_id)
189
- case value
190
- when String then value
191
- when nil then raise ArgumentError, "missing required option :resource_id"
192
- else
193
- msg = "expected :resource_id to be a String, got #{value.class}"
194
- raise ArgumentError, msg
195
- end
186
+ def extract_resource_id(args, options)
187
+ value = args[1] || options.delete(:resource_id)
188
+ case value
189
+ when String then value
190
+ when nil then raise ArgumentError, "missing required option :resource_id"
191
+ else
192
+ msg = "expected :resource_id to be a String, got #{value.class}"
193
+ raise ArgumentError, msg
196
194
  end
195
+ end
197
196
 
198
- def extract_resource_type(args, options)
199
- value = args[2] || options.delete(:resource_type)
200
- case value
201
- when String then value
202
- when nil then raise ArgumentError, "missing required option :resource_type"
203
- else
204
- msg = "expected :resource_type to be a String, got #{value.class}"
205
- raise ArgumentError, msg
206
- end
197
+ def extract_resource_type(args, options)
198
+ value = args[2] || options.delete(:resource_type)
199
+ case value
200
+ when String then value
201
+ when nil then raise ArgumentError, "missing required option :resource_type"
202
+ else
203
+ msg = "expected :resource_type to be a String, got #{value.class}"
204
+ raise ArgumentError, msg
207
205
  end
206
+ end
208
207
 
209
- class Collection < Aws::Resources::Collection
210
-
211
- # @!group Batch Actions
212
-
213
- # @example Request syntax with placeholder values
214
- #
215
- # tag.batch_create()
216
- # @param options ({})
217
- # @return [void]
218
- def batch_create(options = {})
219
- batch_enum.each do |batch|
220
- params = Aws::Util.copy_hash(options)
221
- params[:tags] ||= []
222
- batch.each do |item|
223
- params[:tags] << {
224
- resource_type: item.resource_type,
225
- resource_id: item.resource_id,
226
- key: item.key
227
- }
228
- end
229
- batch[0].client.create_or_update_tags(params)
208
+ class Collection < Aws::Resources::Collection
209
+
210
+ # @!group Batch Actions
211
+
212
+ # @param options ({})
213
+ # @return [void]
214
+ def batch_create(options = {})
215
+ batch_enum.each do |batch|
216
+ params = Aws::Util.copy_hash(options)
217
+ params[:tags] ||= []
218
+ batch.each do |item|
219
+ params[:tags] << {
220
+ resource_type: item.resource_type,
221
+ resource_id: item.resource_id,
222
+ key: item.key
223
+ }
230
224
  end
231
- nil
225
+ batch[0].client.create_or_update_tags(params)
232
226
  end
233
-
234
- # @example Request syntax with placeholder values
235
- #
236
- # tag.batch_delete!()
237
- # @param options ({})
238
- # @return [void]
239
- def batch_delete!(options = {})
240
- batch_enum.each do |batch|
241
- params = Aws::Util.copy_hash(options)
242
- params[:tags] ||= []
243
- batch.each do |item|
244
- params[:tags] << {
245
- resource_type: item.resource_type,
246
- resource_id: item.resource_id,
247
- key: item.key
248
- }
249
- end
250
- batch[0].client.delete_tags(params)
227
+ nil
228
+ end
229
+
230
+ # @param options ({})
231
+ # @return [void]
232
+ def batch_delete!(options = {})
233
+ batch_enum.each do |batch|
234
+ params = Aws::Util.copy_hash(options)
235
+ params[:tags] ||= []
236
+ batch.each do |item|
237
+ params[:tags] << {
238
+ resource_type: item.resource_type,
239
+ resource_id: item.resource_id,
240
+ key: item.key
241
+ }
251
242
  end
252
- nil
243
+ batch[0].client.delete_tags(params)
253
244
  end
245
+ nil
246
+ end
254
247
 
255
- # @!endgroup
248
+ # @!endgroup
256
249
 
257
- end
258
250
  end
259
251
  end
260
252
  end