aws-sdk 1.12.0 → 1.13.0

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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/bin/aws-rb +18 -0
  4. data/lib/aws/api_config/{CloudFront-2012-07-01.yml → CloudFront-2013-05-12.yml} +73 -23
  5. data/lib/aws/api_config/{RDS-2013-02-12.yml → RDS-2013-05-15.yml} +92 -5
  6. data/lib/aws/api_config/Redshift-2012-12-01.yml +188 -12
  7. data/lib/aws/api_config/STS-2011-06-15.yml +10 -0
  8. data/lib/aws/auto_scaling/client.rb +6 -0
  9. data/lib/aws/cloud_formation/client.rb +6 -0
  10. data/lib/aws/cloud_front/client.rb +37 -1
  11. data/lib/aws/cloud_search/client.rb +6 -0
  12. data/lib/aws/cloud_watch/client.rb +6 -0
  13. data/lib/aws/core.rb +15 -20
  14. data/lib/aws/core/client.rb +36 -0
  15. data/lib/aws/core/credential_providers.rb +45 -0
  16. data/lib/aws/core/region_collection.rb +4 -1
  17. data/lib/aws/data_pipeline/client.rb +6 -0
  18. data/lib/aws/direct_connect/client.rb +6 -0
  19. data/lib/aws/dynamo_db/client.rb +35 -1249
  20. data/lib/aws/dynamo_db/client/v20111205.rb +1266 -0
  21. data/lib/aws/dynamo_db/client/v20120810.rb +1409 -0
  22. data/lib/aws/dynamo_db/client_base.rb +1 -0
  23. data/lib/aws/dynamo_db/client_v2.rb +25 -1396
  24. data/lib/aws/ec2/client.rb +6 -0
  25. data/lib/aws/elastic_beanstalk/client.rb +6 -0
  26. data/lib/aws/elastic_transcoder/client.rb +6 -0
  27. data/lib/aws/elasticache/client.rb +6 -0
  28. data/lib/aws/elb/client.rb +6 -0
  29. data/lib/aws/emr/client.rb +6 -0
  30. data/lib/aws/glacier/client.rb +14 -8
  31. data/lib/aws/iam/client.rb +6 -0
  32. data/lib/aws/import_export/client.rb +6 -0
  33. data/lib/aws/ops_works/client.rb +6 -0
  34. data/lib/aws/rds/client.rb +83 -18
  35. data/lib/aws/record/abstract_base.rb +19 -22
  36. data/lib/aws/record/attributes.rb +5 -1
  37. data/lib/aws/record/hash_model.rb +50 -6
  38. data/lib/aws/record/model.rb +26 -0
  39. data/lib/aws/record/validator.rb +1 -1
  40. data/lib/aws/redshift/client.rb +186 -53
  41. data/lib/aws/route_53/client.rb +6 -0
  42. data/lib/aws/route_53/hosted_zone.rb +1 -1
  43. data/lib/aws/route_53/resource_record_set.rb +3 -3
  44. data/lib/aws/s3/client.rb +4 -1
  45. data/lib/aws/s3/presigned_post.rb +18 -21
  46. data/lib/aws/simple_db/client.rb +6 -0
  47. data/lib/aws/simple_email_service/client.rb +6 -0
  48. data/lib/aws/simple_email_service/identity.rb +1 -1
  49. data/lib/aws/simple_workflow/client.rb +24 -18
  50. data/lib/aws/sns/client.rb +6 -0
  51. data/lib/aws/sqs/client.rb +21 -15
  52. data/lib/aws/storage_gateway/client.rb +6 -0
  53. data/lib/aws/sts/client.rb +57 -38
  54. data/lib/aws/support/client.rb +6 -0
  55. data/lib/aws/version.rb +1 -1
  56. metadata +6 -4
@@ -17,9 +17,15 @@ module AWS
17
17
  # Client class for Route53.
18
18
  class Client < Core::RESTXMLClient
19
19
 
20
+ API_VERSION = '2012-12-12'
21
+
20
22
  # @api private
21
23
  CACHEABLE_REQUESTS = Set[]
22
24
 
25
+ end
26
+
27
+ class Client::V20121212 < Client
28
+
23
29
  # client methods #
24
30
 
25
31
  # @!method change_resource_record_sets(options = {})
@@ -96,7 +96,7 @@ module AWS
96
96
  end
97
97
  alias_method :rrsets, :resource_record_sets
98
98
 
99
- private
99
+ protected
100
100
 
101
101
  def resource_identifiers
102
102
  [[:id, id], [:name, name], [:caller_reference, caller_reference]]
@@ -211,9 +211,7 @@ module AWS
211
211
  DeleteRequest.new(options[:name], options[:type], options)
212
212
  end
213
213
 
214
-
215
- private
216
-
214
+ protected
217
215
 
218
216
  def resource_identifiers
219
217
  [[:name, name], [:type, type], [:set_identifier, set_identifier]]
@@ -229,6 +227,8 @@ module AWS
229
227
  client.list_resource_record_sets(options)
230
228
  end
231
229
 
230
+ private
231
+
232
232
  # Format a hash of options that can be used to initialize a change
233
233
  # request.
234
234
  # @return [Hash]
@@ -181,7 +181,8 @@ module AWS
181
181
  end
182
182
  end
183
183
 
184
- if rules = options[:routing_rules]
184
+ rules = options[:routing_rules]
185
+ if rules.is_a?(Array) && !rules.empty?
185
186
  xml.RoutingRules do
186
187
  rules.each do |rule|
187
188
  xml.RoutingRule do
@@ -1724,5 +1725,7 @@ module AWS
1724
1725
 
1725
1726
  end
1726
1727
 
1728
+ class Client::V20060301 < Client; end
1729
+
1727
1730
  end
1728
1731
  end
@@ -74,18 +74,6 @@ module AWS
74
74
  # upload. By default any size object may be uploaded.
75
75
  attr_reader :content_length
76
76
 
77
- # @api private
78
- SPECIAL_FIELDS = [:cache_control,
79
- :content_type,
80
- :content_disposition,
81
- :content_encoding,
82
- :expires_header,
83
- :acl,
84
- :server_side_encryption,
85
- :success_action_redirect,
86
- :success_action_status,
87
- :filename]
88
-
89
77
  # @api private
90
78
  attr_reader :conditions
91
79
 
@@ -99,6 +87,16 @@ module AWS
99
87
  # the signature will expire an hour after it is generated.
100
88
  attr_reader :expires
101
89
 
90
+ # @api private
91
+ SPECIAL_FIELDS = [:key,
92
+ :policy,
93
+ :signature,
94
+ :expires,
95
+ :metadata,
96
+ :content_length,
97
+ :conditions,
98
+ :ignore]
99
+
102
100
  # Creates a new presigned post object.
103
101
  #
104
102
  # @param [Bucket] bucket The bucket to which data can be uploaded
@@ -200,8 +198,9 @@ module AWS
200
198
  @key = opts[:key]
201
199
  @secure = (opts[:secure] != false)
202
200
  @fields = {}
203
- SPECIAL_FIELDS.each do |name|
204
- @fields[name] = opts[name] if opts.key?(name)
201
+ # TODO normalize all values to @fields
202
+ opts.each do |opt_key, opt_val|
203
+ @fields[opt_key] = opt_val unless SPECIAL_FIELDS.include? opt_key
205
204
  end
206
205
  @metadata = opts[:metadata] || {}
207
206
  @content_length = range_value(opts[:content_length])
@@ -290,7 +289,8 @@ module AWS
290
289
  # presigned_post.where(:acl).starts_with("bucket-owner")
291
290
  #
292
291
  # @param [Symbol] field The field for which a condition should
293
- # be added. Valid values:
292
+ # be added. In addition to any arbitrary values you have set,
293
+ # the following values are also permitted:
294
294
  #
295
295
  # * `:key`
296
296
  # * `:content_length`
@@ -306,9 +306,6 @@ module AWS
306
306
  # @return [ConditionBuilder] An object that allows you to
307
307
  # specify a condition on the field.
308
308
  def where(field)
309
- raise ArgumentError.new("unrecognized field name #{field}") unless
310
- [:key, :content_length, *SPECIAL_FIELDS].include?(field) or
311
- field =~ /^x-amz-meta-/
312
309
  ConditionBuilder.new(self, field)
313
310
  end
314
311
 
@@ -359,7 +356,6 @@ module AWS
359
356
  end
360
357
 
361
358
  fields.merge(optional_fields)
362
-
363
359
  end
364
360
 
365
361
  # @api private
@@ -439,8 +435,7 @@ module AWS
439
435
  # @api private
440
436
  private
441
437
  def optional_fields
442
- fields = (SPECIAL_FIELDS &
443
- @fields.keys).inject({}) do |fields, option_name|
438
+ fields = @fields.keys.inject({}) do |fields, option_name|
444
439
  fields[field_name(option_name)] =
445
440
  field_value(option_name)
446
441
  fields
@@ -461,6 +456,8 @@ module AWS
461
456
  "Expires"
462
457
  when :server_side_encryption
463
458
  "x-amz-server-side-encryption"
459
+ when :key, "Key", :policy, "Policy"
460
+ option_name.to_s.downcase
464
461
  when :acl, :success_action_redirect, :success_action_status
465
462
  option_name.to_s
466
463
  else
@@ -17,6 +17,8 @@ module AWS
17
17
  # Client class for Amazon SimpleDB.
18
18
  class Client < Core::QueryClient
19
19
 
20
+ API_VERSION = '2009-04-15'
21
+
20
22
  # @api private
21
23
  REGION_US_E1 = 'sdb.amazonaws.com'
22
24
 
@@ -37,6 +39,10 @@ module AWS
37
39
  :select,
38
40
  ]
39
41
 
42
+ end
43
+
44
+ class Client::V20090415 < Client
45
+
40
46
  # @param [String] name
41
47
  # @return [Boolean] Returns true if the given name is a valid
42
48
  # Amazon SimpleDB domain name.
@@ -17,11 +17,17 @@ module AWS
17
17
  # Client class for Amazon Simple E-mail Service (SES).
18
18
  class Client < Core::QueryClient
19
19
 
20
+ API_VERSION = '2010-12-01'
21
+
20
22
  REGION_US_E1 = 'email.us-east-1.amazonaws.com'
21
23
 
22
24
  # @api private
23
25
  CACHEABLE_REQUESTS = Set[]
24
26
 
27
+ end
28
+
29
+ class Client::V20101201 < Client
30
+
25
31
  # client methods #
26
32
 
27
33
  # @!method delete_identity(options = {})
@@ -90,7 +90,7 @@ module AWS
90
90
  def verify_dkim
91
91
  if domain?
92
92
  resp = client.verify_domain_dkim(:domain => identity)
93
- reps[:dkim_tokens]
93
+ resp[:dkim_tokens]
94
94
  else
95
95
  raise "unable to verify dkim for an email address"
96
96
  end
@@ -17,6 +17,8 @@ module AWS
17
17
  # Client class for Amazon Simple Workflow Service (SWF).
18
18
  class Client < Core::JSONClient
19
19
 
20
+ API_VERSION = '2012-01-25'
21
+
20
22
  # @api private
21
23
  CACHEABLE_REQUESTS = Set[
22
24
  :count_pending_activity_tasks,
@@ -36,6 +38,28 @@ module AWS
36
38
  :list_workfow_types,
37
39
  ]
38
40
 
41
+ protected
42
+
43
+ def cacheable_request? name, options
44
+ if name == :poll_for_decision_task
45
+ options.keys.include?(:next_page_token)
46
+ else
47
+ self.class::CACHEABLE_REQUESTS.include?(name)
48
+ end
49
+ end
50
+
51
+ def build_request *args
52
+ request = super(*args)
53
+ if request.headers['x-amz-target'] =~ /PollFor(Decision|Activity)Task/
54
+ request.read_timeout = 90
55
+ end
56
+ request
57
+ end
58
+
59
+ end
60
+
61
+ class Client::V20120125 < Client
62
+
39
63
  # client methods #
40
64
 
41
65
  # @!method count_closed_workflow_executions(options = {})
@@ -1286,24 +1310,6 @@ module AWS
1286
1310
 
1287
1311
  define_client_methods('2012-01-25')
1288
1312
 
1289
- protected
1290
-
1291
- def cacheable_request? name, options
1292
- if name == :poll_for_decision_task
1293
- options.keys.include?(:next_page_token)
1294
- else
1295
- self.class::CACHEABLE_REQUESTS.include?(name)
1296
- end
1297
- end
1298
-
1299
- def build_request *args
1300
- request = super(*args)
1301
- if request.headers['x-amz-target'] =~ /PollFor(Decision|Activity)Task/
1302
- request.read_timeout = 90
1303
- end
1304
- request
1305
- end
1306
-
1307
1313
  end
1308
1314
  end
1309
1315
  end
@@ -17,9 +17,15 @@ module AWS
17
17
  # Client class for Amazon Simple Notifications Service (SNS).
18
18
  class Client < Core::QueryClient
19
19
 
20
+ API_VERSION = '2010-03-31'
21
+
20
22
  # @api private
21
23
  CACHEABLE_REQUESTS = Set[]
22
24
 
25
+ end
26
+
27
+ class Client::V20100331 < Client
28
+
23
29
  # client methods #
24
30
 
25
31
  # @!method add_permission(options = {})
@@ -17,9 +17,30 @@ module AWS
17
17
  # Client class for Amazon Simple Queue Service (SQS).
18
18
  class Client < Core::QueryClient
19
19
 
20
+ API_VERSION = '2012-11-05'
21
+
20
22
  # @api private
21
23
  CACHEABLE_REQUESTS = Set[]
22
24
 
25
+ private
26
+
27
+ def build_request *args
28
+ request = super(*args)
29
+ if url_param = request.params.find { |p| p.name == "QueueUrl" }
30
+ url = URI.parse(url_param.value)
31
+ request.host = url.host
32
+ request.uri = url.request_uri
33
+ if matches = request.host.match(/^sqs\.(.+?)\./)
34
+ request.region = matches[1]
35
+ end
36
+ end
37
+ request
38
+ end
39
+
40
+ end
41
+
42
+ class Client::V20121105 < Client
43
+
23
44
  # client methods #
24
45
 
25
46
  # @!method add_permission(options = {})
@@ -277,21 +298,6 @@ module AWS
277
298
 
278
299
  define_client_methods('2012-11-05')
279
300
 
280
- private
281
-
282
- def build_request *args
283
- request = super(*args)
284
- if url_param = request.params.find { |p| p.name == "QueueUrl" }
285
- url = URI.parse(url_param.value)
286
- request.host = url.host
287
- request.uri = url.request_uri
288
- if matches = request.host.match(/^sqs\.(.+?)\./)
289
- request.region = matches[1]
290
- end
291
- end
292
- request
293
- end
294
-
295
301
  end
296
302
  end
297
303
  end
@@ -17,9 +17,15 @@ module AWS
17
17
  # Client class for AWS Storage Gateway.
18
18
  class Client < Core::JSONClient
19
19
 
20
+ API_VERSION = '2012-06-30'
21
+
20
22
  # @api private
21
23
  CACHEABLE_REQUESTS = Set[]
22
24
 
25
+ end
26
+
27
+ class Client::V20120630 < Client
28
+
23
29
  # client methods #
24
30
 
25
31
  # @!method activate_gateway(options = {})
@@ -17,6 +17,8 @@ module AWS
17
17
  # Client class for AWS Security Token Service (STS).
18
18
  class Client < Core::QueryClient
19
19
 
20
+ API_VERSION = '2011-06-15'
21
+
20
22
  REGION_US_E1 = 'sts.amazonaws.com'
21
23
 
22
24
  # @api private
@@ -31,6 +33,10 @@ module AWS
31
33
  end
32
34
  end
33
35
 
36
+ end
37
+
38
+ class Client::V20110615 < Client
39
+
34
40
  # client methods #
35
41
 
36
42
  # @!method assume_role(options = {})
@@ -45,19 +51,19 @@ module AWS
45
51
  # * `:policy` - (String) A supplemental policy that is associated with
46
52
  # the temporary security credentials from the AssumeRole call. The
47
53
  # resulting permissions of the temporary security credentials are an
48
- # intersection of this policy and the policy that is associated with
49
- # the role. Use this policy to further restrict the permissions of
50
- # the temporary security credentials.
54
+ # intersection of this policy and the access policy that is
55
+ # associated with the role. Use this policy to further restrict the
56
+ # permissions of the temporary security credentials.
51
57
  # * `:duration_seconds` - (Integer) The duration, in seconds, of the
52
58
  # role session. The value can range from 900 seconds (15 minutes) to
53
- # 3600 seconds (1 hour). By default, the value is set to 3600 seconds
54
- # (1 hour).
55
- # * `:external_id` - (String) A unique identifier that is generated by
56
- # a third party for each of their customers. For each role that the
57
- # third party can assume, they should instruct their customers to
58
- # create a role with the external ID that was generated by the third
59
- # party. Each time the third party assumes the role, they must pass
60
- # the customer's correct external ID. The external ID is useful in
59
+ # 3600 seconds (1 hour). By default, the value is set to 3600
60
+ # seconds.
61
+ # * `:external_id` - (String) A unique identifier that is used by third
62
+ # parties to assume a role in their customers' accounts. For each
63
+ # role that the third party can assume, they should instruct their
64
+ # customers to create a role with the external ID that the third
65
+ # party generated. Each time the third party assumes the role, they
66
+ # must pass the customer's external ID. The external ID is useful in
61
67
  # order to help third parties bind a role to the customer who created
62
68
  # it. For more information about the external ID, see About the
63
69
  # External ID in Using Temporary Security Credentials.
@@ -89,27 +95,27 @@ module AWS
89
95
  # included as part of the ARN and assumed role ID in the
90
96
  # AssumedRoleUser response element.
91
97
  # * `:web_identity_token` - *required* - (String) The OAuth 2.0 access
92
- # token or OpenID Connect id token that is provided by the identity
98
+ # token or OpenID Connect ID token that is provided by the identity
93
99
  # provider. Your application must get this token by authenticating
94
100
  # the user who is using your application with a web identity provider
95
101
  # before the application makes an AssumeRoleWithWebIdentity call.
96
102
  # * `:provider_id` - (String) The fully-qualified host component of the
97
- # domain name of the identity provider. Do not include URL schemes
98
- # and port numbers. Specify this value only for OAuth access tokens.
99
- # Currently, www.amazon.com and graph.facebook.com are supported. Do
100
- # not specify this value for OpenID Connect id tokens, such as
101
- # accounts.google.com.
103
+ # domain name of the identity provider. Specify this value only for
104
+ # OAuth access tokens. Do not specify this value for OpenID Connect
105
+ # ID tokens, such as accounts.google.com. Do not include URL schemes
106
+ # and port numbers. Currently, www.amazon.com and graph.facebook.com
107
+ # are supported.
102
108
  # * `:policy` - (String) A supplemental policy that is associated with
103
109
  # the temporary security credentials from the
104
110
  # AssumeRoleWithWebIdentity call. The resulting permissions of the
105
111
  # temporary security credentials are an intersection of this policy
106
- # and the policy that is associated with the role. Use this policy to
107
- # further restrict the permissions of the temporary security
108
- # credentials.
112
+ # and the access policy that is associated with the role. Use this
113
+ # policy to further restrict the permissions of the temporary
114
+ # security credentials.
109
115
  # * `:duration_seconds` - (Integer) The duration, in seconds, of the
110
116
  # role session. The value can range from 900 seconds (15 minutes) to
111
- # 3600 seconds (1 hour). By default, the value is set to 3600 seconds
112
- # (1 hour).
117
+ # 3600 seconds (1 hour). By default, the value is set to 3600
118
+ # seconds.
113
119
  # @return [Core::Response]
114
120
  # The #data method of the response object returns
115
121
  # a hash with the following structure:
@@ -125,6 +131,18 @@ module AWS
125
131
  # * `:arn` - (String)
126
132
  # * `:packed_policy_size` - (Integer)
127
133
 
134
+ # @!method decode_authorization_message(options = {})
135
+ # Calls the DecodeAuthorizationMessage API operation.
136
+ # @param [Hash] options
137
+ #
138
+ # * `:encoded_message` - *required* - (String) The encoded message that
139
+ # was returned with the response.
140
+ # @return [Core::Response]
141
+ # The #data method of the response object returns
142
+ # a hash with the following structure:
143
+ #
144
+ # * `:decoded_message` - (String)
145
+
128
146
  # @!method get_federation_token(options = {})
129
147
  # Calls the GetFederationToken API operation.
130
148
  # @param [Hash] options
@@ -144,11 +162,11 @@ module AWS
144
162
  # such as in an Amazon S3 bucket policy.
145
163
  # * `:duration_seconds` - (Integer) The duration, in seconds, that the
146
164
  # session should last. Acceptable durations for federation sessions
147
- # range from 900s (15 minutes) to 129600s (36 hours), with 43200s (12
148
- # hours) as the default. Sessions for AWS account owners are
149
- # restricted to a maximum of 3600s (one hour). If the duration is
150
- # longer than one hour, the session for AWS account owners defaults
151
- # to one hour.
165
+ # range from 900 seconds (15 minutes) to 129600 seconds (36 hours),
166
+ # with 43200 seconds (12 hours) as the default. Sessions for AWS
167
+ # account owners are restricted to a maximum of 3600 seconds (one
168
+ # hour). If the duration is longer than one hour, the session for AWS
169
+ # account owners defaults to one hour.
152
170
  # @return [Core::Response]
153
171
  # The #data method of the response object returns
154
172
  # a hash with the following structure:
@@ -169,11 +187,11 @@ module AWS
169
187
  #
170
188
  # * `:duration_seconds` - (Integer) The duration, in seconds, that the
171
189
  # credentials should remain valid. Acceptable durations for IAM user
172
- # sessions range from 900s (15 minutes) to 129600s (36 hours), with
173
- # 43200s (12 hours) as the default. Sessions for AWS account owners
174
- # are restricted to a maximum of 3600s (one hour). If the duration is
175
- # longer than one hour, the session for AWS account owners defaults
176
- # to one hour.
190
+ # sessions range from 900 seconds (15 minutes) to 129600 seconds (36
191
+ # hours), with 43200 seconds (12 hours) as the default. Sessions for
192
+ # AWS account owners are restricted to a maximum of 3600 seconds (one
193
+ # hour). If the duration is longer than one hour, the session for AWS
194
+ # account owners defaults to one hour.
177
195
  # * `:serial_number` - (String) The identification number of the MFA
178
196
  # device that is associated with the IAM user who is making the
179
197
  # GetSessionToken call. Specify this value if the IAM user has a
@@ -183,12 +201,13 @@ module AWS
183
201
  # arn:aws:iam::123456789012:mfa/user). You can find the device for an
184
202
  # IAM user by going to the AWS Management Console and viewing the
185
203
  # user's security credentials.
186
- # * `:token_code` - (String) The value provided by the MFA device. If
187
- # any policy requires the IAM user to submit an MFA code, specify
188
- # this value. If MFA authentication is required, and the user does
189
- # not provide a code when requesting a set of temporary security
190
- # credentials, the user will receive an "access denied" response when
191
- # requesting resources that require MFA authentication.
204
+ # * `:token_code` - (String) The value provided by the MFA device, if
205
+ # MFA is required. If any policy requires the IAM user to submit an
206
+ # MFA code, specify this value. If MFA authentication is required,
207
+ # and the user does not provide a code when requesting a set of
208
+ # temporary security credentials, the user will receive an "access
209
+ # denied" response when requesting resources that require MFA
210
+ # authentication.
192
211
  # @return [Core::Response]
193
212
  # The #data method of the response object returns
194
213
  # a hash with the following structure: