aws-sdk 1.8.1.3 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/lib/aws-sdk.rb +2 -0
  2. data/lib/aws/api_config/Redshift-2012-12-01.yml +1149 -0
  3. data/lib/aws/auto_scaling.rb +2 -2
  4. data/lib/aws/auto_scaling/activity_collection.rb +1 -1
  5. data/lib/aws/auto_scaling/group_options.rb +1 -1
  6. data/lib/aws/auto_scaling/scaling_policy_options.rb +1 -1
  7. data/lib/aws/auto_scaling/scheduled_action_collection.rb +4 -4
  8. data/lib/aws/cloud_search/client.rb +1 -1
  9. data/lib/aws/cloud_watch.rb +1 -1
  10. data/lib/aws/cloud_watch/alarm.rb +1 -1
  11. data/lib/aws/cloud_watch/metric_collection.rb +1 -1
  12. data/lib/aws/core.rb +14 -10
  13. data/lib/aws/core/client.rb +12 -6
  14. data/lib/aws/core/configuration.rb +15 -12
  15. data/lib/aws/core/inflection.rb +2 -0
  16. data/lib/aws/core/response.rb +0 -12
  17. data/lib/aws/dynamo_db.rb +1 -1
  18. data/lib/aws/elastic_beanstalk.rb +1 -1
  19. data/lib/aws/rails.rb +1 -1
  20. data/lib/aws/record/abstract_base.rb +1 -1
  21. data/lib/aws/redshift.rb +52 -0
  22. data/lib/aws/redshift/client.rb +1291 -0
  23. data/lib/aws/redshift/config.rb +18 -0
  24. data/lib/aws/redshift/errors.rb +22 -0
  25. data/lib/aws/redshift/request.rb +29 -0
  26. data/lib/aws/route_53/resource_record_set.rb +47 -26
  27. data/lib/aws/s3/client.rb +1 -1
  28. data/lib/aws/simple_db.rb +2 -2
  29. data/lib/aws/simple_db/attribute_collection.rb +2 -2
  30. data/lib/aws/simple_db/item_collection.rb +4 -4
  31. data/lib/aws/simple_email_service.rb +3 -3
  32. data/lib/aws/simple_email_service/client.rb +1 -1
  33. data/lib/aws/simple_email_service/email_address_collection.rb +1 -1
  34. data/lib/aws/simple_workflow.rb +5 -5
  35. data/lib/aws/simple_workflow/activity_task.rb +6 -6
  36. data/lib/aws/simple_workflow/decision_task.rb +2 -2
  37. data/lib/aws/simple_workflow/decision_task_collection.rb +4 -4
  38. data/lib/aws/simple_workflow/domain_collection.rb +3 -3
  39. data/lib/aws/simple_workflow/history_event_collection.rb +1 -1
  40. data/lib/aws/simple_workflow/workflow_execution.rb +3 -3
  41. data/lib/aws/simple_workflow/workflow_execution_collection.rb +8 -8
  42. data/lib/aws/simple_workflow/workflow_type.rb +1 -1
  43. data/lib/aws/version.rb +1 -1
  44. metadata +8 -2
@@ -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::AutoSclaing interface:
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 adjustmet types.
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
@@ -30,7 +30,7 @@ module AWS
30
30
  # # ...
31
31
  # end
32
32
  #
33
- # If you know the id of an activity you can get a refernce to it:
33
+ # If you know the id of an activity you can get a reference to it:
34
34
  #
35
35
  # activity = auto_scaling.activities['activity-id']
36
36
  #
@@ -15,7 +15,7 @@ module AWS
15
15
  class AutoScaling
16
16
 
17
17
  # This mixin provides a method for parsing Auto Scaling group options
18
- # (for create and upate methods).
18
+ # (for create and update methods).
19
19
  # @private
20
20
  module GroupOptions
21
21
 
@@ -14,7 +14,7 @@
14
14
  module AWS
15
15
  class AutoScaling
16
16
 
17
- # Provides a hepler method for parsing scaling policy options.
17
+ # Provides a helper method for parsing scaling policy options.
18
18
  # @private
19
19
  module ScalingPolicyOptions
20
20
 
@@ -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 explicity
37
- # auto_scaling.secheduled_actions.create('action-name', :group => 'group-name')
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.secheduled_actions.create('action-name')
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 opitons [Time,String] :start_time The earliest scheduled
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
- # evaluting b at all JavaScript order of precendence for operators
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
@@ -51,7 +51,7 @@ module AWS
51
51
  # cw = AWS::CloudWatch.new
52
52
  #
53
53
  # resp = cw.client.describe_alarms
54
- # resp[:metric_alarams].each do |alarm|
54
+ # resp[:metric_alarms].each do |alarm|
55
55
  # puts alarm[:alarm_name]
56
56
  # end
57
57
  #
@@ -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 inlucde:
157
+ # operand. Valid values include:
158
158
  # * 'GreaterThanOrEqualToThreshold'
159
159
  # * 'GreaterThanThreshold'
160
160
  # * 'LessThanThreshold'
@@ -27,7 +27,7 @@ module AWS
27
27
  #
28
28
  # @example Filtering by a namespace
29
29
  #
30
- # trafic_metrics = metrics.filter('namespace', 'traffic')
30
+ # traffic_metrics = metrics.filter('namespace', 'traffic')
31
31
  #
32
32
  # @example Filtering by a metric name
33
33
  #
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 recomended to
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 prefered
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 convereted from strings into floats (with a potential
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 sesssion.
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 Idenity Access Management (IAM).
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 substituions.
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 exceedes
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 seperate object, instead of the object
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 reponses are generated and
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 requets against AWS services. This should be set
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.
@@ -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 credentail
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 secords before requests made by
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 psuedo
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 ligher level service interfaces.
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
- response.throttled? ? (0.5 + Kernel.rand * 0.1) : 0.3
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
- response.throttled? or
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 assing your credentials into the default
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 convereted from strings into floats (with a potential
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
- # sesssion.
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 Idenity Access Management (IAM).
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 exceedes
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 seperate object, instead of the object
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 reponses are generated and returned to
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 requets against AWS services. This should be set
265
- # for clients and applications built ontop of the aws-sdk gem.
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 prefered to set :credential_provider instead.
278
- # Credentail providers don't have to provide a #sign method.
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 dependendent configuration values are
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
@@ -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
 
@@ -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 temproary session credentials.
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
@@ -16,7 +16,7 @@ require 'aws/elb/config'
16
16
 
17
17
  module AWS
18
18
 
19
- # Provides an expressive, object-oriented interface to AWS Elastic Beantalk.
19
+ # Provides an expressive, object-oriented interface to AWS Elastic Beanstalk.
20
20
  #
21
21
  # == Credentials
22
22
  #
data/lib/aws/rails.rb CHANGED
@@ -38,7 +38,7 @@ module AWS
38
38
 
39
39
  # Adds extra functionality to Rails.
40
40
  #
41
- # Normailly this method is invoked automatically when you require this
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, attributes) }
690
+ attributes.map {|attr| send(create_method, attr) }
691
691
  else
692
692
  obj = new(attributes)
693
693
  obj.send(save_method)