aws-sdk 1.1.4 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/lib/aws.rb +2 -0
  2. data/lib/aws/api_config/ELB-2011-08-15.yml +380 -0
  3. data/lib/aws/api_config/SNS-2010-03-31.yml +2 -2
  4. data/lib/aws/api_config/SimpleEmailService-2010-12-01.yml +5 -5
  5. data/lib/aws/core.rb +18 -3
  6. data/lib/aws/core/client_logging.rb +5 -6
  7. data/lib/aws/core/collection.rb +241 -0
  8. data/lib/aws/core/collection/batchable.rb +133 -0
  9. data/lib/aws/core/collection/limitable.rb +92 -0
  10. data/lib/aws/core/collection/simple.rb +89 -0
  11. data/lib/aws/core/configuration.rb +23 -0
  12. data/lib/aws/core/option_grammar.rb +2 -0
  13. data/lib/aws/core/page_result.rb +73 -0
  14. data/lib/aws/ec2/security_group.rb +154 -89
  15. data/lib/aws/ec2/security_group/egress_ip_permission_collection.rb +1 -2
  16. data/lib/aws/ec2/security_group/{ip_permission_collection.rb → ingress_ip_permission_collection.rb} +4 -1
  17. data/lib/aws/ec2/security_group/ip_permission.rb +23 -45
  18. data/lib/aws/elb.rb +65 -0
  19. data/lib/aws/elb/availability_zone_collection.rb +138 -0
  20. data/lib/aws/elb/backend_server_policy_collection.rb +150 -0
  21. data/lib/aws/elb/client.rb +35 -0
  22. data/lib/aws/elb/client/xml.rb +33 -0
  23. data/lib/aws/elb/config.rb +18 -0
  24. data/lib/aws/elb/errors.rb +30 -0
  25. data/lib/aws/elb/instance_collection.rb +174 -0
  26. data/lib/aws/elb/listener.rb +189 -0
  27. data/lib/aws/elb/listener_collection.rb +119 -0
  28. data/lib/aws/elb/listener_opts.rb +45 -0
  29. data/lib/aws/elb/listener_spec.rb +14 -0
  30. data/lib/aws/elb/load_balancer.rb +255 -0
  31. data/lib/aws/elb/load_balancer_collection.rb +113 -0
  32. data/lib/aws/elb/load_balancer_policy.rb +93 -0
  33. data/lib/aws/elb/load_balancer_policy_collection.rb +208 -0
  34. data/lib/aws/elb/request.rb +23 -0
  35. data/lib/aws/iam/collection.rb +24 -26
  36. data/lib/aws/iam/group_user_collection.rb +21 -28
  37. data/lib/aws/iam/server_certificate_collection.rb +1 -37
  38. data/lib/aws/record.rb +1 -1
  39. data/lib/aws/record/base.rb +14 -1
  40. data/lib/aws/record/finder_methods.rb +4 -1
  41. data/lib/aws/record/validations.rb +73 -32
  42. data/lib/aws/{core/api_config_transform.rb → record/validators/method.rb} +9 -12
  43. data/lib/aws/s3/bucket_collection.rb +6 -4
  44. data/lib/aws/s3/client.rb +37 -6
  45. data/lib/aws/s3/config.rb +3 -1
  46. data/lib/aws/s3/prefixed_collection.rb +1 -2
  47. data/lib/aws/s3/presigned_post.rb +37 -4
  48. data/lib/aws/s3/s3_object.rb +93 -1
  49. data/lib/aws/simple_db/domain.rb +8 -0
  50. data/lib/aws/simple_db/item.rb +15 -0
  51. data/lib/aws/simple_db/item_collection.rb +255 -201
  52. data/lib/aws/simple_db/item_data.rb +1 -1
  53. data/lib/aws/simple_email_service/client.rb +0 -1
  54. data/lib/aws/sns/client.rb +0 -1
  55. metadata +107 -55
  56. data/lib/aws/core/collections.rb +0 -229
  57. data/lib/aws/simple_email_service/client/options.rb +0 -21
  58. data/lib/aws/sns/client/options.rb +0 -21
@@ -61,7 +61,7 @@ module AWS
61
61
  # fetch its most recent data.
62
62
  # @return [Item] The item this data belongs to.
63
63
  def item
64
- domain[name]
64
+ domain.items[name]
65
65
  end
66
66
 
67
67
  end
@@ -18,7 +18,6 @@ module AWS
18
18
  class Client < Core::Client
19
19
 
20
20
  AWS.register_autoloads(self, 'aws/simple_email_service/client') do
21
- autoload :Options, 'options'
22
21
  autoload :XML, 'xml'
23
22
  end
24
23
 
@@ -18,7 +18,6 @@ module AWS
18
18
  class Client < Core::Client
19
19
 
20
20
  AWS.register_autoloads(self) do
21
- autoload :Options, 'options'
22
21
  autoload :XML, 'xml'
23
22
  end
24
23
 
metadata CHANGED
@@ -1,71 +1,96 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 31
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 2
9
+ - 0
10
+ version: 1.2.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Amazon Web Services
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-09-08 00:00:00.000000000 -07:00
17
+
18
+ date: 2011-10-04 00:00:00 -07:00
13
19
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
16
22
  name: uuidtools
17
- requirement: &2162240460 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
18
25
  none: false
19
- requirements:
26
+ requirements:
20
27
  - - ~>
21
- - !ruby/object:Gem::Version
22
- version: '2.1'
28
+ - !ruby/object:Gem::Version
29
+ hash: 1
30
+ segments:
31
+ - 2
32
+ - 1
33
+ version: "2.1"
23
34
  type: :runtime
24
- prerelease: false
25
- version_requirements: *2162240460
26
- - !ruby/object:Gem::Dependency
35
+ requirement: *id001
36
+ - !ruby/object:Gem::Dependency
27
37
  name: httparty
28
- requirement: &2162266720 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ version_requirements: &id002 !ruby/object:Gem::Requirement
29
40
  none: false
30
- requirements:
41
+ requirements:
31
42
  - - ~>
32
- - !ruby/object:Gem::Version
33
- version: '0.7'
43
+ - !ruby/object:Gem::Version
44
+ hash: 5
45
+ segments:
46
+ - 0
47
+ - 7
48
+ version: "0.7"
34
49
  type: :runtime
35
- prerelease: false
36
- version_requirements: *2162266720
37
- - !ruby/object:Gem::Dependency
50
+ requirement: *id002
51
+ - !ruby/object:Gem::Dependency
38
52
  name: nokogiri
39
- requirement: &2162310280 !ruby/object:Gem::Requirement
53
+ prerelease: false
54
+ version_requirements: &id003 !ruby/object:Gem::Requirement
40
55
  none: false
41
- requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 15
60
+ segments:
61
+ - 1
62
+ - 4
63
+ - 4
44
64
  version: 1.4.4
45
65
  type: :runtime
46
- prerelease: false
47
- version_requirements: *2162310280
48
- - !ruby/object:Gem::Dependency
66
+ requirement: *id003
67
+ - !ruby/object:Gem::Dependency
49
68
  name: json
50
- requirement: &2162368960 !ruby/object:Gem::Requirement
69
+ prerelease: false
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
51
71
  none: false
52
- requirements:
72
+ requirements:
53
73
  - - ~>
54
- - !ruby/object:Gem::Version
55
- version: '1.4'
74
+ - !ruby/object:Gem::Version
75
+ hash: 7
76
+ segments:
77
+ - 1
78
+ - 4
79
+ version: "1.4"
56
80
  type: :runtime
57
- prerelease: false
58
- version_requirements: *2162368960
81
+ requirement: *id004
59
82
  description: AWS SDK for Ruby
60
83
  email:
61
84
  executables: []
85
+
62
86
  extensions: []
87
+
63
88
  extra_rdoc_files: []
64
- files:
89
+
90
+ files:
65
91
  - ca-bundle.crt
66
92
  - rails/init.rb
67
93
  - lib/aws/core/api_config.rb
68
- - lib/aws/core/api_config_transform.rb
69
94
  - lib/aws/core/async_handle.rb
70
95
  - lib/aws/core/authorize_v2.rb
71
96
  - lib/aws/core/authorize_v3.rb
@@ -74,7 +99,10 @@ files:
74
99
  - lib/aws/core/cacheable.rb
75
100
  - lib/aws/core/client.rb
76
101
  - lib/aws/core/client_logging.rb
77
- - lib/aws/core/collections.rb
102
+ - lib/aws/core/collection/batchable.rb
103
+ - lib/aws/core/collection/limitable.rb
104
+ - lib/aws/core/collection/simple.rb
105
+ - lib/aws/core/collection.rb
78
106
  - lib/aws/core/configuration.rb
79
107
  - lib/aws/core/configured_client_methods.rb
80
108
  - lib/aws/core/configured_grammars.rb
@@ -95,6 +123,7 @@ files:
95
123
  - lib/aws/core/model.rb
96
124
  - lib/aws/core/naming.rb
97
125
  - lib/aws/core/option_grammar.rb
126
+ - lib/aws/core/page_result.rb
98
127
  - lib/aws/core/policy.rb
99
128
  - lib/aws/core/resource.rb
100
129
  - lib/aws/core/resource_cache.rb
@@ -136,8 +165,8 @@ files:
136
165
  - lib/aws/ec2/resource.rb
137
166
  - lib/aws/ec2/resource_tag_collection.rb
138
167
  - lib/aws/ec2/security_group/egress_ip_permission_collection.rb
168
+ - lib/aws/ec2/security_group/ingress_ip_permission_collection.rb
139
169
  - lib/aws/ec2/security_group/ip_permission.rb
140
- - lib/aws/ec2/security_group/ip_permission_collection.rb
141
170
  - lib/aws/ec2/security_group.rb
142
171
  - lib/aws/ec2/security_group_collection.rb
143
172
  - lib/aws/ec2/snapshot.rb
@@ -149,6 +178,23 @@ files:
149
178
  - lib/aws/ec2/volume.rb
150
179
  - lib/aws/ec2/volume_collection.rb
151
180
  - lib/aws/ec2.rb
181
+ - lib/aws/elb/availability_zone_collection.rb
182
+ - lib/aws/elb/backend_server_policy_collection.rb
183
+ - lib/aws/elb/client/xml.rb
184
+ - lib/aws/elb/client.rb
185
+ - lib/aws/elb/config.rb
186
+ - lib/aws/elb/errors.rb
187
+ - lib/aws/elb/instance_collection.rb
188
+ - lib/aws/elb/listener.rb
189
+ - lib/aws/elb/listener_collection.rb
190
+ - lib/aws/elb/listener_opts.rb
191
+ - lib/aws/elb/listener_spec.rb
192
+ - lib/aws/elb/load_balancer.rb
193
+ - lib/aws/elb/load_balancer_collection.rb
194
+ - lib/aws/elb/load_balancer_policy.rb
195
+ - lib/aws/elb/load_balancer_policy_collection.rb
196
+ - lib/aws/elb/request.rb
197
+ - lib/aws/elb.rb
152
198
  - lib/aws/errors.rb
153
199
  - lib/aws/iam/access_key.rb
154
200
  - lib/aws/iam/access_key_collection.rb
@@ -209,6 +255,7 @@ files:
209
255
  - lib/aws/record/validators/format.rb
210
256
  - lib/aws/record/validators/inclusion.rb
211
257
  - lib/aws/record/validators/length.rb
258
+ - lib/aws/record/validators/method.rb
212
259
  - lib/aws/record/validators/numericality.rb
213
260
  - lib/aws/record/validators/presence.rb
214
261
  - lib/aws/record.rb
@@ -264,7 +311,6 @@ files:
264
311
  - lib/aws/simple_db/put_attributes.rb
265
312
  - lib/aws/simple_db/request.rb
266
313
  - lib/aws/simple_db.rb
267
- - lib/aws/simple_email_service/client/options.rb
268
314
  - lib/aws/simple_email_service/client/xml.rb
269
315
  - lib/aws/simple_email_service/client.rb
270
316
  - lib/aws/simple_email_service/config.rb
@@ -273,7 +319,6 @@ files:
273
319
  - lib/aws/simple_email_service/quotas.rb
274
320
  - lib/aws/simple_email_service/request.rb
275
321
  - lib/aws/simple_email_service.rb
276
- - lib/aws/sns/client/options.rb
277
322
  - lib/aws/sns/client/xml.rb
278
323
  - lib/aws/sns/client.rb
279
324
  - lib/aws/sns/config.rb
@@ -309,6 +354,7 @@ files:
309
354
  - lib/aws-sdk.rb
310
355
  - lib/aws.rb
311
356
  - lib/aws/api_config/EC2-2011-02-28.yml
357
+ - lib/aws/api_config/ELB-2011-08-15.yml
312
358
  - lib/aws/api_config/IAM-2010-07-15.yml
313
359
  - lib/aws/api_config/SimpleDB-2009-04-15.yml
314
360
  - lib/aws/api_config/SimpleEmailService-2010-12-01.yml
@@ -322,31 +368,37 @@ files:
322
368
  - LICENSE.txt
323
369
  has_rdoc: true
324
370
  homepage: http://aws.amazon.com/sdkforruby
325
- licenses:
371
+ licenses:
326
372
  - Apache 2.0
327
373
  post_install_message:
328
374
  rdoc_options: []
329
- require_paths:
375
+
376
+ require_paths:
330
377
  - lib
331
- required_ruby_version: !ruby/object:Gem::Requirement
378
+ required_ruby_version: !ruby/object:Gem::Requirement
332
379
  none: false
333
- requirements:
334
- - - ! '>='
335
- - !ruby/object:Gem::Version
336
- version: '0'
337
- segments:
380
+ requirements:
381
+ - - ">="
382
+ - !ruby/object:Gem::Version
383
+ hash: 3
384
+ segments:
338
385
  - 0
339
- hash: -1242339500272234048
340
- required_rubygems_version: !ruby/object:Gem::Requirement
386
+ version: "0"
387
+ required_rubygems_version: !ruby/object:Gem::Requirement
341
388
  none: false
342
- requirements:
343
- - - ! '>='
344
- - !ruby/object:Gem::Version
345
- version: '0'
389
+ requirements:
390
+ - - ">="
391
+ - !ruby/object:Gem::Version
392
+ hash: 3
393
+ segments:
394
+ - 0
395
+ version: "0"
346
396
  requirements: []
397
+
347
398
  rubyforge_project:
348
- rubygems_version: 1.6.1
399
+ rubygems_version: 1.4.1
349
400
  signing_key:
350
401
  specification_version: 3
351
402
  summary: AWS SDK for Ruby
352
403
  test_files: []
404
+
@@ -1,229 +0,0 @@
1
- # Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- # Licensed under the Apache License, Version 2.0 (the "License"). You
3
- # may not use this file except in compliance with the License. A copy of
4
- # the License is located at
5
- #
6
- # http://aws.amazon.com/apache2.0/
7
- #
8
- # or in the "license" file accompanying this file. This file is
9
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
10
- # ANY KIND, either express or implied. See the License for the specific
11
- # language governing permissions and limitations under the License.
12
-
13
- module AWS
14
- module Core
15
-
16
- # There are 3 collection modules:
17
- #
18
- # AWS::Collections::Basic
19
- # - single request returns all items
20
- # - (sqs, ec2, ses)
21
- #
22
- # AWS::Collections::Paged
23
- # - responses may be truncated
24
- # - truncated responses return a "next token"
25
- # - (sns, sdb)
26
- #
27
- # AWS::Collections::PagedWithLimits
28
- # - requests accept a "max items"
29
- # - responses may be "truncated"
30
- # - truncated responses return a "next token"
31
- # - (s3, iam)
32
- #
33
- # @private
34
- module Collections
35
-
36
- # @private
37
- module Basic
38
-
39
- include Model
40
- include Enumerable
41
-
42
- def enumerator options = {}
43
- Enumerator.new(self, :each, options)
44
- end
45
-
46
- def each options = {}, &block
47
- each_batch(options) do |batch|
48
- batch.each(&block)
49
- end
50
- nil
51
- end
52
-
53
- def each_batch options = {}, &block
54
-
55
- options = options.dup
56
-
57
- limit = options.delete(:limit)
58
- batch_size = options.delete(:batch_size)
59
-
60
- total = 0 # count of items yeileded across all batches
61
-
62
- each_response(options, limit, batch_size) do |response|
63
-
64
- batch = []
65
- each_item(response) do |item|
66
- batch << item
67
- if limit and (total += 1) == limit
68
- yield(batch)
69
- return
70
- end
71
- end
72
-
73
- yield(batch)
74
-
75
- batch.size
76
-
77
- end
78
-
79
- nil
80
-
81
- end
82
-
83
- def in_groups_of size, options = {}, &block
84
-
85
- group = []
86
-
87
- each_batch(options) do |batch|
88
- batch.each do |item|
89
- group << item
90
- if group.size == size
91
- yield(group)
92
- group = []
93
- end
94
- end
95
- end
96
-
97
- yield(group) unless group.empty?
98
-
99
- nil
100
-
101
- end
102
-
103
- # @note +limit+ has no effect, simply ignored
104
- # @note +batch_size+ has no effect, simply ignored
105
- # @private
106
- protected
107
- def each_response options, limit, batch_size, &block
108
- response = client.send(request_method, options)
109
- yield(response)
110
- end
111
-
112
- # @note Define this method in classes including this module.
113
- # @private
114
- protected
115
- def request_method
116
- raise NotImplementedError
117
- end
118
-
119
- # @note Define this method in classes including this module.
120
- # @private
121
- protected
122
- def each_item response
123
- raise NotImplementedError
124
- end
125
-
126
- end
127
-
128
- # @private
129
- module Paged
130
-
131
- include Basic
132
-
133
- # @note +limit+ has no effect, simply ignored
134
- # @note +batch_size+ has no effect, simply ignored
135
- protected
136
- def each_response options, limit, batch_size, &block
137
-
138
- next_token = nil
139
-
140
- begin
141
-
142
- page_opts = {}
143
- page_opts[next_token_key] = next_token if next_token
144
-
145
- response = client.send(request_method, options.merge(page_opts))
146
-
147
- yield(response)
148
-
149
- next_token = next_token_for(response)
150
-
151
- end until next_token.nil?
152
-
153
- end
154
-
155
- # Override this methid in collections that use a different name
156
- # for the param that offsets the find (e.g. :marker, :next_key, etc).
157
- # @private
158
- protected
159
- def next_token_key
160
- raise NotImplementedError
161
- end
162
-
163
- # Override this method in collections that have an alternate method
164
- # for finding the next token.
165
- # @private
166
- protected
167
- def next_token_for response
168
- method = next_token_key
169
- response.respond_to?(method) ? response.send(method) : nil
170
- end
171
-
172
- end
173
-
174
- # @private
175
- module PagedWithLimits
176
-
177
- include Paged
178
-
179
- # A custom first method makes getting exactly one item much more
180
- # efficient. Without the :limit => 1, an entire page of items
181
- # is received and then only one is grabbed.
182
- # @private
183
- def first
184
- enumerator(:limit => 1).first
185
- end
186
-
187
- # @private
188
- protected
189
- def each_response options, limit, batch_size, &block
190
-
191
- total = 0
192
- next_token = nil
193
-
194
- begin
195
-
196
- page_opts = {}
197
-
198
- page_opts[next_token_key] = next_token if next_token
199
-
200
- if limit or batch_size
201
- max_items = []
202
- max_items << (limit - total) if limit
203
- max_items << batch_size if batch_size
204
- page_opts[limit_key] = max_items.min
205
- end
206
-
207
- response = client.send(request_method, options.merge(page_opts))
208
-
209
- total += yield(response)
210
-
211
- next_token = next_token_for(response)
212
-
213
- end until next_token.nil? or (limit and limit == total)
214
-
215
- end
216
-
217
- # Override this methid in collections that use a different name
218
- # for the param that offsets the find (e.g. :marker, :next_key, etc).
219
- # @private
220
- protected
221
- def limit_key
222
- raise NotImplementedError
223
- end
224
-
225
- end
226
-
227
- end
228
- end
229
- end