aws-sdk 1.8.1.3 → 1.8.2
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.
- data/lib/aws-sdk.rb +2 -0
- data/lib/aws/api_config/Redshift-2012-12-01.yml +1149 -0
- data/lib/aws/auto_scaling.rb +2 -2
- data/lib/aws/auto_scaling/activity_collection.rb +1 -1
- data/lib/aws/auto_scaling/group_options.rb +1 -1
- data/lib/aws/auto_scaling/scaling_policy_options.rb +1 -1
- data/lib/aws/auto_scaling/scheduled_action_collection.rb +4 -4
- data/lib/aws/cloud_search/client.rb +1 -1
- data/lib/aws/cloud_watch.rb +1 -1
- data/lib/aws/cloud_watch/alarm.rb +1 -1
- data/lib/aws/cloud_watch/metric_collection.rb +1 -1
- data/lib/aws/core.rb +14 -10
- data/lib/aws/core/client.rb +12 -6
- data/lib/aws/core/configuration.rb +15 -12
- data/lib/aws/core/inflection.rb +2 -0
- data/lib/aws/core/response.rb +0 -12
- data/lib/aws/dynamo_db.rb +1 -1
- data/lib/aws/elastic_beanstalk.rb +1 -1
- data/lib/aws/rails.rb +1 -1
- data/lib/aws/record/abstract_base.rb +1 -1
- data/lib/aws/redshift.rb +52 -0
- data/lib/aws/redshift/client.rb +1291 -0
- data/lib/aws/redshift/config.rb +18 -0
- data/lib/aws/redshift/errors.rb +22 -0
- data/lib/aws/redshift/request.rb +29 -0
- data/lib/aws/route_53/resource_record_set.rb +47 -26
- data/lib/aws/s3/client.rb +1 -1
- data/lib/aws/simple_db.rb +2 -2
- data/lib/aws/simple_db/attribute_collection.rb +2 -2
- data/lib/aws/simple_db/item_collection.rb +4 -4
- data/lib/aws/simple_email_service.rb +3 -3
- data/lib/aws/simple_email_service/client.rb +1 -1
- data/lib/aws/simple_email_service/email_address_collection.rb +1 -1
- data/lib/aws/simple_workflow.rb +5 -5
- data/lib/aws/simple_workflow/activity_task.rb +6 -6
- data/lib/aws/simple_workflow/decision_task.rb +2 -2
- data/lib/aws/simple_workflow/decision_task_collection.rb +4 -4
- data/lib/aws/simple_workflow/domain_collection.rb +3 -3
- data/lib/aws/simple_workflow/history_event_collection.rb +1 -1
- data/lib/aws/simple_workflow/workflow_execution.rb +3 -3
- data/lib/aws/simple_workflow/workflow_execution_collection.rb +8 -8
- data/lib/aws/simple_workflow/workflow_type.rb +1 -1
- data/lib/aws/version.rb +1 -1
- metadata +8 -2
data/lib/aws/auto_scaling.rb
CHANGED
@@ -35,7 +35,7 @@ module AWS
|
|
35
35
|
# :access_key_id => 'YOUR_ACCESS_KEY_ID',
|
36
36
|
# :secret_access_key => 'YOUR_SECRET_ACCESS_KEY')
|
37
37
|
#
|
38
|
-
# Or you can set them directly on the AWS::
|
38
|
+
# Or you can set them directly on the AWS::AutoScaling interface:
|
39
39
|
#
|
40
40
|
# auto_scaling = AWS::AutoScaling.new(
|
41
41
|
# :access_key_id => 'YOUR_ACCESS_KEY_ID',
|
@@ -138,7 +138,7 @@ module AWS
|
|
138
138
|
resp.auto_scaling_notification_types
|
139
139
|
end
|
140
140
|
|
141
|
-
# @return [Array<String>] Returns the list of valid
|
141
|
+
# @return [Array<String>] Returns the list of valid adjustment types.
|
142
142
|
def adjustment_types
|
143
143
|
client.describe_adjustment_types.adjustment_types.map(&:adjustment_type)
|
144
144
|
end
|
@@ -33,12 +33,12 @@ module AWS
|
|
33
33
|
# You must specify an Auto Scaling group. This can be implicit
|
34
34
|
# or explicit:
|
35
35
|
#
|
36
|
-
# # given
|
37
|
-
# auto_scaling.
|
36
|
+
# # given explicitly
|
37
|
+
# auto_scaling.scheduled_actions.create('action-name', :group => 'group-name')
|
38
38
|
#
|
39
39
|
# # implied by the group
|
40
40
|
# group = auto_scaling.groups.first
|
41
|
-
# group.
|
41
|
+
# group.scheduled_actions.create('action-name')
|
42
42
|
#
|
43
43
|
# @param [String] name
|
44
44
|
#
|
@@ -111,7 +111,7 @@ module AWS
|
|
111
111
|
# the results are limited to that group. If unknown scheduled
|
112
112
|
# actions are requested, they are ignored with no error.
|
113
113
|
#
|
114
|
-
# @option
|
114
|
+
# @option options [Time,String] :start_time The earliest scheduled
|
115
115
|
# start time to return. If +:scheduled_actions+ is provided,
|
116
116
|
# this field will be ignored. Should be a Time object or
|
117
117
|
# an iso8601 string.
|
@@ -170,7 +170,7 @@ module AWS
|
|
170
170
|
# expressions and supports: Integer, floating point, hex and octal
|
171
171
|
# literals Shortcut evaluation of logical operators such that an
|
172
172
|
# expression a || b evaluates to the value a if a is +true+ without
|
173
|
-
#
|
173
|
+
# evaluating b at all JavaScript order of precedence for operators
|
174
174
|
# Arithmetic operators: + - * / % Boolean operators (including the
|
175
175
|
# ternary operator) Bitwise operators Comparison operators Common
|
176
176
|
# mathematic functions: abs ceil erf exp floor lgamma ln log2 log10
|
data/lib/aws/cloud_watch.rb
CHANGED
@@ -154,7 +154,7 @@ module AWS
|
|
154
154
|
# @option options [String,required] :comparison_operator The arithmetic
|
155
155
|
# operation to use when comparing the specified Statistic and
|
156
156
|
# Threshold. The specified Statistic value is used as the first
|
157
|
-
# operand. Valid values
|
157
|
+
# operand. Valid values include:
|
158
158
|
# * 'GreaterThanOrEqualToThreshold'
|
159
159
|
# * 'GreaterThanThreshold'
|
160
160
|
# * 'LessThanThreshold'
|
data/lib/aws/core.rb
CHANGED
@@ -34,6 +34,7 @@ require 'aws/core/autoloader'
|
|
34
34
|
# * {AWS::EMR}
|
35
35
|
# * {AWS::Glacier}
|
36
36
|
# * {AWS::IAM}
|
37
|
+
# * {AWS::Redshift}
|
37
38
|
# * {AWS::RDS}
|
38
39
|
# * {AWS::Route53}
|
39
40
|
# * {AWS::S3}
|
@@ -63,7 +64,7 @@ require 'aws/core/autoloader'
|
|
63
64
|
#
|
64
65
|
# == Rails
|
65
66
|
#
|
66
|
-
# If you are loading AWS inside a Rails web application, it is
|
67
|
+
# If you are loading AWS inside a Rails web application, it is recommended to
|
67
68
|
# place your configuration inside:
|
68
69
|
#
|
69
70
|
# config/initializers/aws-sdk.rb
|
@@ -181,7 +182,7 @@ module AWS
|
|
181
182
|
# @private
|
182
183
|
@@config = nil
|
183
184
|
|
184
|
-
# The global configuration for AWS. Generally you set your
|
185
|
+
# The global configuration for AWS. Generally you set your preferred
|
185
186
|
# configuration operations once after loading the aws-sdk gem.
|
186
187
|
#
|
187
188
|
# AWS.config({
|
@@ -236,7 +237,7 @@ module AWS
|
|
236
237
|
# @option options [Boolean] :dynamo_db_big_decimals (true) When +true+,
|
237
238
|
# {DynamoDB} will convert number values returned by {DynamoDB::Client}
|
238
239
|
# from strings to BigDecimal objects. If you set this to +false+,
|
239
|
-
# they will be
|
240
|
+
# they will be converted from strings into floats (with a potential
|
240
241
|
# loss of precision).
|
241
242
|
#
|
242
243
|
# @option options [String] :dynamo_db_endpoint ('dynamodb.amazonaws.com')
|
@@ -272,7 +273,7 @@ module AWS
|
|
272
273
|
#
|
273
274
|
# @option options [Integer] :http_open_timeout (15) The number of seconds
|
274
275
|
# before the +:http_handler+ should timeout while trying to open a new
|
275
|
-
# HTTP
|
276
|
+
# HTTP session.
|
276
277
|
#
|
277
278
|
# @option options [Integer] :http_read_timeout (60) The number of seconds
|
278
279
|
# before the +:http_handler+ should timeout while waiting for a HTTP
|
@@ -284,7 +285,7 @@ module AWS
|
|
284
285
|
# standard out.
|
285
286
|
#
|
286
287
|
# @option options [String] :iam_endpoint ('iam.amazonaws.com') The
|
287
|
-
# service endpoint for AWS
|
288
|
+
# service endpoint for AWS Identity Access Management (IAM).
|
288
289
|
#
|
289
290
|
# @option options [String] :import_export_endpoint ('importexport.amazonaws.com')
|
290
291
|
# The service endpoint for AWS Import/Export.
|
@@ -314,7 +315,7 @@ module AWS
|
|
314
315
|
#
|
315
316
|
# You can also create an instance of AWS::Core::LogFormatter
|
316
317
|
# with a custom log message pattern. See {Core::LogFormatter} for
|
317
|
-
# a complete list of pattern
|
318
|
+
# a complete list of pattern substitutions.
|
318
319
|
#
|
319
320
|
# pattern = "[AWS :operation :duration] :error_message"
|
320
321
|
# AWS.config(:log_formatter => AWS::Core::LogFormatter.new(pattern))
|
@@ -333,6 +334,9 @@ module AWS
|
|
333
334
|
#
|
334
335
|
# AWS.config(:proxy_uri => 'https://user:password@my.proxy:443/path?query')
|
335
336
|
#
|
337
|
+
# @option options [String] :redshift_endpoint ('redshift.us-east-1.amazonaws.com')
|
338
|
+
# The service endpoint for Amazon Redshift.
|
339
|
+
#
|
336
340
|
# @option options [String] :rds_endpoint ('rds.us-east-1.amazonaws.com')
|
337
341
|
# The service endpoint for Amazon Relational Database Service (RDS).
|
338
342
|
#
|
@@ -350,7 +354,7 @@ module AWS
|
|
350
354
|
# number of parts to split a file into when uploading in parts to S3.
|
351
355
|
#
|
352
356
|
# @option options [Integer] :s3_multipart_threshold (16777216) When
|
353
|
-
# uploading data to S3, if the number of bytes to send
|
357
|
+
# uploading data to S3, if the number of bytes to send exceeds
|
354
358
|
# +:s3_multipart_threshold+ then a multi part session is automatically
|
355
359
|
# started and the data is sent up in chunks. The size of each part
|
356
360
|
# is specified by +:s3_multipart_min_part_size+. Defaults to
|
@@ -383,7 +387,7 @@ module AWS
|
|
383
387
|
#
|
384
388
|
# @option options [Symbol] :s3_encryption_materials_location (:metadata)
|
385
389
|
# When set to +:instruction_file+, AWS::S3::S3Object will store
|
386
|
-
# encryption materials in a
|
390
|
+
# encryption materials in a separate object, instead of the object
|
387
391
|
# metadata.
|
388
392
|
#
|
389
393
|
# @option options [String] :simple_db_endpoint ('sdb.amazonaws.com')
|
@@ -424,7 +428,7 @@ module AWS
|
|
424
428
|
# risk.
|
425
429
|
#
|
426
430
|
# @option options [Boolean] :stub_requests (false) When +true+ requests
|
427
|
-
# are not sent to AWS, instead empty
|
431
|
+
# are not sent to AWS, instead empty responses are generated and
|
428
432
|
# returned to each service request.
|
429
433
|
#
|
430
434
|
# @option options [String] :sns_endpoint ('sns.us-east-1.amazonaws.com') The
|
@@ -443,7 +447,7 @@ module AWS
|
|
443
447
|
# to AWS are sent using HTTPS instead vanilla HTTP.
|
444
448
|
#
|
445
449
|
# @option options [String] :user_agent_prefix (nil) A string prefix to
|
446
|
-
# append to all
|
450
|
+
# append to all requests against AWS services. This should be set
|
447
451
|
# for clients and applications built ontop of the aws-sdk gem.
|
448
452
|
#
|
449
453
|
# @return [Core::Configuration] Returns the new configuration.
|
data/lib/aws/core/client.rb
CHANGED
@@ -65,7 +65,7 @@ module AWS
|
|
65
65
|
# @return [Configuration] This clients configuration.
|
66
66
|
attr_reader :config
|
67
67
|
|
68
|
-
# @return [CredentialProviders::Provider] Returns the
|
68
|
+
# @return [CredentialProviders::Provider] Returns the credential
|
69
69
|
# provider for this client.
|
70
70
|
# @private
|
71
71
|
attr_reader :credential_provider
|
@@ -79,7 +79,7 @@ module AWS
|
|
79
79
|
# @private
|
80
80
|
attr_reader :port
|
81
81
|
|
82
|
-
# @return [Integer] The number of
|
82
|
+
# @return [Integer] The number of seconds before requests made by
|
83
83
|
# this client should timeout if they have not received a response.
|
84
84
|
attr_reader :http_read_timeout
|
85
85
|
|
@@ -147,9 +147,9 @@ module AWS
|
|
147
147
|
@stubs[method_name] ||= new_stub_for(method_name)
|
148
148
|
end
|
149
149
|
|
150
|
-
# Primarily used for testing, this method returns an empty
|
150
|
+
# Primarily used for testing, this method returns an empty pseudo
|
151
151
|
# service response without making a request. Its used primarily for
|
152
|
-
# testing the
|
152
|
+
# testing the lighter level service interfaces.
|
153
153
|
# @private
|
154
154
|
def new_stub_for method_name
|
155
155
|
response = Response.new(Http::Request.new, Http::Response.new)
|
@@ -286,7 +286,7 @@ module AWS
|
|
286
286
|
end
|
287
287
|
|
288
288
|
def scaling_factor response
|
289
|
-
|
289
|
+
throttled?(response) ? (0.5 + Kernel.rand * 0.1) : 0.3
|
290
290
|
end
|
291
291
|
|
292
292
|
def should_retry? response
|
@@ -300,7 +300,7 @@ module AWS
|
|
300
300
|
def retryable_error? response
|
301
301
|
expired_credentials?(response) or
|
302
302
|
response.network_error? or
|
303
|
-
|
303
|
+
throttled?(response) or
|
304
304
|
response.error.kind_of?(Errors::ServerError)
|
305
305
|
end
|
306
306
|
|
@@ -312,6 +312,12 @@ module AWS
|
|
312
312
|
(response.error.code == 'ExpiredTokenException' || response.error.code == 'ExpiredToken')
|
313
313
|
end
|
314
314
|
|
315
|
+
def throttled? response
|
316
|
+
response.error and
|
317
|
+
response.error.respond_to?(:code) and
|
318
|
+
response.error.code.to_s.match(/Throttling/i)
|
319
|
+
end
|
320
|
+
|
315
321
|
def return_or_raise options, &block
|
316
322
|
response = yield
|
317
323
|
unless options[:async]
|
@@ -22,7 +22,7 @@ module AWS
|
|
22
22
|
# == Configuring Credentials
|
23
23
|
#
|
24
24
|
# In order to do anything with AWS you will need to assign credentials.
|
25
|
-
# The simplest method is to
|
25
|
+
# The simplest method is to assign your credentials into the default
|
26
26
|
# configuration:
|
27
27
|
#
|
28
28
|
# AWS.config(:access_key_id => 'KEY', :secret_access_key => 'SECRET')
|
@@ -81,7 +81,7 @@ module AWS
|
|
81
81
|
# @attr_reader [Boolean] dynamo_db_big_decimals (true) When +true+,
|
82
82
|
# {DynamoDB} will convert number values returned by {DynamoDB::Client}
|
83
83
|
# from strings to BigDecimal objects. If you set this to +false+,
|
84
|
-
# they will be
|
84
|
+
# they will be converted from strings into floats (with a potential
|
85
85
|
# loss of precision).
|
86
86
|
#
|
87
87
|
# @attr_reader [String] dynamo_db_endpoint ('dynamodb.us-east-1.amazonaws.com')
|
@@ -117,7 +117,7 @@ module AWS
|
|
117
117
|
#
|
118
118
|
# @attr_reader [Integer] http_open_timeout The number of seconds before
|
119
119
|
# the +http_handler+ should timeout while trying to open a new HTTP
|
120
|
-
#
|
120
|
+
# session.
|
121
121
|
#
|
122
122
|
# @attr_reader [Integer] http_read_timeout The number of seconds before
|
123
123
|
# the +http_handler+ should timeout while waiting for a HTTP
|
@@ -128,7 +128,7 @@ module AWS
|
|
128
128
|
# configured, then wire traces will be sent to standard out.
|
129
129
|
#
|
130
130
|
# @attr_reader [String] iam_endpoint ('iam.amazonaws.com')
|
131
|
-
# The service endpoint for AWS
|
131
|
+
# The service endpoint for AWS Identity Access Management (IAM).
|
132
132
|
#
|
133
133
|
# @attr_reader [String] import_export_endpoint ('importexport.amazonaws.com')
|
134
134
|
# The service endpoint for AWS Import/Export.
|
@@ -150,6 +150,9 @@ module AWS
|
|
150
150
|
# @attr_reader [URI,nil] route_53_endpoint ('route53.amazonaws.com')
|
151
151
|
# The service endpoint for Amazon Route 53.
|
152
152
|
#
|
153
|
+
# @attr_reader [URI,nil] redshift_endpoint ('redshift.us-east-1.amazonaws.com')
|
154
|
+
# The service endpoint for Amazon Redshift.
|
155
|
+
#
|
153
156
|
# @attr_reader [URI,nil] rds_endpoint ('rds.us-east-1.amazonaws.com')
|
154
157
|
# The service endpoint for Amazon Relational Database Service (RDS).
|
155
158
|
#
|
@@ -165,7 +168,7 @@ module AWS
|
|
165
168
|
# in parts to S3.
|
166
169
|
#
|
167
170
|
# @attr_reader [Integer] s3_multipart_threshold (16777216) When uploading
|
168
|
-
# data to S3, if the number of bytes to send
|
171
|
+
# data to S3, if the number of bytes to send exceeds
|
169
172
|
# +:s3_multipart_threshold+ then a multi part session is automatically
|
170
173
|
# started and the data is sent up in chunks. The size of each part
|
171
174
|
# is specified by +:s3_multipart_min_part_size+. Defaults to
|
@@ -203,7 +206,7 @@ module AWS
|
|
203
206
|
#
|
204
207
|
# @attr_reader [Symbol] s3_encryption_materials_location
|
205
208
|
# When set to +:instruction_file+, AWS::S3::S3Object will store
|
206
|
-
# encryption materials in a
|
209
|
+
# encryption materials in a separate object, instead of the object
|
207
210
|
# metadata.
|
208
211
|
#
|
209
212
|
# @attr_reader [String] simple_db_endpoint ('sdb.amazonaws.com')
|
@@ -242,7 +245,7 @@ module AWS
|
|
242
245
|
# risk.
|
243
246
|
#
|
244
247
|
# @attr_reader [Boolean] stub_requests (false) When +true+ requests are not
|
245
|
-
# sent to AWS, instead empty
|
248
|
+
# sent to AWS, instead empty responses are generated and returned to
|
246
249
|
# each service request.
|
247
250
|
#
|
248
251
|
# @attr_reader [String] sns_endpoint ('sns.us-east-1.amazonaws.com')
|
@@ -261,8 +264,8 @@ module AWS
|
|
261
264
|
# to AWS are sent using HTTPS instead vanilla HTTP.
|
262
265
|
#
|
263
266
|
# @attr_reader [String] user_agent_prefix (nil) A string prefix to
|
264
|
-
# append to all
|
265
|
-
# for clients and applications built
|
267
|
+
# append to all requests against AWS services. This should be set
|
268
|
+
# for clients and applications built on top of the aws-sdk gem.
|
266
269
|
#
|
267
270
|
class Configuration
|
268
271
|
|
@@ -274,8 +277,8 @@ module AWS
|
|
274
277
|
@created = options.delete(:__created__) || {}
|
275
278
|
|
276
279
|
# :signer is now a deprecated option, this ensures it will still
|
277
|
-
# work, but its now
|
278
|
-
#
|
280
|
+
# work, but its now preferred to set :credential_provider instead.
|
281
|
+
# Credential providers don't have to provide a #sign method.
|
279
282
|
if signer = options.delete(:signer)
|
280
283
|
options[:credential_provider] = signer
|
281
284
|
end
|
@@ -393,7 +396,7 @@ module AWS
|
|
393
396
|
end
|
394
397
|
|
395
398
|
# Configuration options that have dependencies are re-recreated
|
396
|
-
# anytime one of their
|
399
|
+
# anytime one of their dependent configuration values are
|
397
400
|
# changed.
|
398
401
|
# @private
|
399
402
|
def add_option_with_needs name, needs, &create_block
|
data/lib/aws/core/inflection.rb
CHANGED
@@ -35,6 +35,8 @@ module AWS
|
|
35
35
|
inflector['s3Key'] = 's3_key'
|
36
36
|
inflector['Ec2KeyName'] = 'ec2_key_name'
|
37
37
|
inflector['Ec2SubnetId'] = 'ec2_subnet_id'
|
38
|
+
inflector['Ec2VolumeId'] = 'ec2_volume_id'
|
39
|
+
inflector['Ec2InstanceId'] = 'ec2_instance_id'
|
38
40
|
inflector['ElastiCache'] = 'elasticache'
|
39
41
|
inflector['NotificationARNs'] = 'notification_arns'
|
40
42
|
|
data/lib/aws/core/response.rb
CHANGED
@@ -122,18 +122,6 @@ module AWS
|
|
122
122
|
error.nil?
|
123
123
|
end
|
124
124
|
|
125
|
-
# @return [Boolean] Returns true if the http request was throttled
|
126
|
-
# by AWS.
|
127
|
-
def throttled?
|
128
|
-
if !successful? and http_response.body
|
129
|
-
error = XML::Parser.new.parse(http_response.body)
|
130
|
-
error = error[:error] if error[:error]
|
131
|
-
error[:code] == "Throttling"
|
132
|
-
else
|
133
|
-
false
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
125
|
# @return [Boolean] Returns +true+ if the http request failed due to
|
138
126
|
# a networking issue.
|
139
127
|
def network_error?
|
data/lib/aws/dynamo_db.rb
CHANGED
@@ -29,7 +29,7 @@ module AWS
|
|
29
29
|
# credentials (e.g. requires a session token).
|
30
30
|
#
|
31
31
|
# @note If you make a request using AWS::DynamoDB with long-term credentials
|
32
|
-
# a request is made to Amazon STS for
|
32
|
+
# a request is made to Amazon STS for temporary session credentials.
|
33
33
|
# These will be cached in the process and re-used.
|
34
34
|
#
|
35
35
|
# = Tables
|
data/lib/aws/rails.rb
CHANGED
@@ -38,7 +38,7 @@ module AWS
|
|
38
38
|
|
39
39
|
# Adds extra functionality to Rails.
|
40
40
|
#
|
41
|
-
#
|
41
|
+
# Normally this method is invoked automatically when you require this
|
42
42
|
# gem in a Rails Application:
|
43
43
|
#
|
44
44
|
# Rails 3+ (RAILS_ROOT/Gemfile)
|
@@ -687,7 +687,7 @@ module AWS
|
|
687
687
|
|
688
688
|
def create_impl attributes = {}, create_method = :create, save_method = :save
|
689
689
|
if attributes.is_a?(Array)
|
690
|
-
attributes.map {|attr| send(create_method,
|
690
|
+
attributes.map {|attr| send(create_method, attr) }
|
691
691
|
else
|
692
692
|
obj = new(attributes)
|
693
693
|
obj.send(save_method)
|