aws-sdk 1.5.7 → 1.5.8

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 (80) hide show
  1. data/lib/aws.rb +2 -0
  2. data/lib/aws/api_config/EMR-2009-03-31.yml +349 -0
  3. data/lib/aws/auto_scaling.rb +8 -8
  4. data/lib/aws/auto_scaling/group.rb +2 -2
  5. data/lib/aws/auto_scaling/instance.rb +1 -1
  6. data/lib/aws/auto_scaling/launch_configuration.rb +4 -4
  7. data/lib/aws/auto_scaling/launch_configuration_collection.rb +11 -11
  8. data/lib/aws/auto_scaling/scaling_policy.rb +1 -1
  9. data/lib/aws/auto_scaling/scheduled_action.rb +1 -1
  10. data/lib/aws/auto_scaling/tag.rb +3 -3
  11. data/lib/aws/cloud_formation/stack.rb +7 -7
  12. data/lib/aws/cloud_formation/stack_collection.rb +13 -13
  13. data/lib/aws/cloud_formation/stack_event_collection.rb +2 -2
  14. data/lib/aws/cloud_formation/stack_resource.rb +1 -1
  15. data/lib/aws/cloud_formation/stack_resource_summary_collection.rb +10 -18
  16. data/lib/aws/cloud_formation/stack_summary_collection.rb +12 -16
  17. data/lib/aws/core.rb +7 -1
  18. data/lib/aws/core/collection.rb +12 -12
  19. data/lib/aws/core/configuration.rb +4 -0
  20. data/lib/aws/core/credential_providers.rb +23 -23
  21. data/lib/aws/core/inflection.rb +2 -0
  22. data/lib/aws/core/model.rb +6 -6
  23. data/lib/aws/core/policy.rb +102 -102
  24. data/lib/aws/core/resource.rb +81 -80
  25. data/lib/aws/core/response.rb +23 -23
  26. data/lib/aws/core/xml/frame.rb +4 -2
  27. data/lib/aws/dynamo_db/resource.rb +2 -2
  28. data/lib/aws/dynamo_db/table.rb +5 -5
  29. data/lib/aws/ec2/availability_zone.rb +2 -3
  30. data/lib/aws/ec2/export_task.rb +7 -7
  31. data/lib/aws/ec2/image.rb +5 -5
  32. data/lib/aws/ec2/instance.rb +40 -40
  33. data/lib/aws/ec2/instance_collection.rb +5 -2
  34. data/lib/aws/ec2/key_pair.rb +1 -1
  35. data/lib/aws/ec2/network_acl.rb +1 -1
  36. data/lib/aws/ec2/network_interface.rb +2 -2
  37. data/lib/aws/ec2/region.rb +1 -1
  38. data/lib/aws/ec2/resource.rb +1 -1
  39. data/lib/aws/ec2/route_table.rb +1 -1
  40. data/lib/aws/ec2/security_group.rb +4 -4
  41. data/lib/aws/ec2/subnet.rb +1 -1
  42. data/lib/aws/ec2/volume.rb +1 -1
  43. data/lib/aws/ec2/vpn_connection.rb +1 -1
  44. data/lib/aws/ec2/vpn_gateway.rb +2 -2
  45. data/lib/aws/elb/listener_opts.rb +1 -1
  46. data/lib/aws/elb/load_balancer.rb +5 -5
  47. data/lib/aws/elb/load_balancer_collection.rb +17 -9
  48. data/lib/aws/elb/load_balancer_policy.rb +2 -2
  49. data/lib/aws/emr.rb +84 -0
  50. data/lib/aws/emr/client.rb +309 -0
  51. data/lib/aws/emr/config.rb +18 -0
  52. data/lib/aws/emr/errors.rb +22 -0
  53. data/lib/aws/emr/instance_group.rb +138 -0
  54. data/lib/aws/emr/instance_group_collection.rb +82 -0
  55. data/lib/aws/emr/job_flow.rb +296 -0
  56. data/lib/aws/emr/job_flow_collection.rb +185 -0
  57. data/lib/aws/emr/request.rb +23 -0
  58. data/lib/aws/iam/access_key.rb +1 -1
  59. data/lib/aws/iam/account_alias_collection.rb +2 -2
  60. data/lib/aws/iam/client.rb +1 -1
  61. data/lib/aws/iam/group.rb +2 -2
  62. data/lib/aws/iam/policy_collection.rb +1 -1
  63. data/lib/aws/iam/server_certificate.rb +2 -2
  64. data/lib/aws/iam/signing_certificate.rb +1 -1
  65. data/lib/aws/iam/user.rb +2 -2
  66. data/lib/aws/iam/virtual_mfa_device.rb +1 -1
  67. data/lib/aws/s3/client.rb +57 -55
  68. data/lib/aws/s3/config.rb +2 -0
  69. data/lib/aws/s3/request.rb +14 -6
  70. data/lib/aws/simple_email_service/identity.rb +9 -7
  71. data/lib/aws/simple_workflow/domain.rb +1 -1
  72. data/lib/aws/simple_workflow/resource.rb +2 -2
  73. data/lib/aws/simple_workflow/workflow_execution.rb +5 -5
  74. data/lib/aws/sns/subscription_collection.rb +33 -35
  75. data/lib/aws/sns/topic_collection.rb +13 -18
  76. data/lib/aws/sns/topic_subscription_collection.rb +8 -9
  77. data/lib/aws/sqs/queue.rb +4 -4
  78. data/lib/aws/sqs/queue_collection.rb +17 -13
  79. metadata +13 -4
  80. data/lib/aws/cloud_formation/stack_summary.rb +0 -71
@@ -15,6 +15,8 @@ AWS::Core::Configuration.module_eval do
15
15
 
16
16
  add_service 'S3', 's3', 's3.amazonaws.com'
17
17
 
18
+ add_option :s3_force_path_style, false, :boolean => true
19
+
18
20
  add_option :s3_multipart_threshold, 16 * 1024 * 1024
19
21
 
20
22
  add_option :s3_multipart_min_part_size, 5 * 1024 * 1024
@@ -31,6 +31,9 @@ module AWS
31
31
  # @private
32
32
  attr_accessor :body_stream
33
33
 
34
+ # @private
35
+ attr_accessor :force_path_style
36
+
34
37
  def metadata= metadata
35
38
  Array(metadata).each do |name, value|
36
39
  headers["x-amz-meta-#{name}"] = value
@@ -46,12 +49,20 @@ module AWS
46
49
  end
47
50
 
48
51
  def host
49
- Client.path_style_bucket_name?(bucket) ? @host : "#{bucket}.#{@host}"
52
+ path_style? ? @host : "#{bucket}.#{@host}"
53
+ end
54
+
55
+ def path_style?
56
+ if force_path_style
57
+ true
58
+ else
59
+ Client.path_style_bucket_name?(bucket)
60
+ end
50
61
  end
51
62
 
52
63
  def path
53
64
  parts = []
54
- parts << bucket if bucket and Client.path_style_bucket_name?(bucket)
65
+ parts << bucket if bucket and path_style?
55
66
  parts << escape_path(key) if key
56
67
  "/#{parts.join('/')}"
57
68
  end
@@ -120,10 +131,7 @@ module AWS
120
131
 
121
132
  # virtual hosted-style requests require the hostname to appear
122
133
  # in the canonicalized resource prefixed by a forward slash.
123
- if
124
- Client.dns_compatible_bucket_name?(bucket) and
125
- !Client.path_style_bucket_name?(bucket)
126
- then
134
+ if Client.dns_compatible_bucket_name?(bucket) and !path_style?
127
135
  parts << "/#{bucket}"
128
136
  end
129
137
 
@@ -23,7 +23,7 @@ module AWS
23
23
  # @attr [String] complaint_topic_arn
24
24
  #
25
25
  # @attr [Boolean] forwarding_enabled When +false+, complaint and bounce
26
- # notifications will not be forwarded via email. Can only be set to
26
+ # notifications will not be forwarded via email. Can only be set to
27
27
  # +false+ when there is both a +bounce_topic+ and +complaint_topic+.
28
28
  #
29
29
  class Identity < Core::Resource
@@ -42,9 +42,9 @@ module AWS
42
42
 
43
43
  attribute :verification_token, :static => true
44
44
 
45
- mutable_attribute :bounce_topic_arn, :as => :bounce_topic
45
+ mutable_attribute :bounce_topic_arn, :from => :bounce_topic
46
46
 
47
- mutable_attribute :complaint_topic_arn, :as => :complaint_topic
47
+ mutable_attribute :complaint_topic_arn, :from => :complaint_topic
48
48
 
49
49
  mutable_attribute :forwarding_enabled
50
50
 
@@ -109,7 +109,7 @@ module AWS
109
109
  verification_status == 'Success'
110
110
  end
111
111
 
112
- # @return [Boolean] Returns +true+ if verification for this email
112
+ # @return [Boolean] Returns +true+ if verification for this email
113
113
  # address/domain is still pending.
114
114
  def pending?
115
115
  verification_status == 'Pending'
@@ -118,13 +118,15 @@ module AWS
118
118
  # Deletes the current identity.
119
119
  # @return [nil]
120
120
  def delete
121
- client.delete_identity(:identity => identity)
121
+ client.delete_identity(:identity => identity)
122
122
  nil
123
123
  end
124
124
 
125
125
  # @return [Boolean] Returns true if the identity exists.
126
126
  def exists?
127
- !!get_resource[:verification_attributes][identity]
127
+ options = { :identities => [identity] }
128
+ resp = client.get_identity_verification_attributes(options)
129
+ !!resp[:verification_attributes][identity]
128
130
  end
129
131
 
130
132
  protected
@@ -158,7 +160,7 @@ module AWS
158
160
  when :forwarding_enabled
159
161
  method = :set_identity_feedback_forwarding_enabled
160
162
  client_opts[:forwarding_enabled] = value
161
- else raise "unhandled attribute: #{attr.name}"
163
+ else raise "unhandled attribute: #{attr.name}"
162
164
  end
163
165
  client.send(method, client_opts)
164
166
  end
@@ -45,7 +45,7 @@ module AWS
45
45
  info_attribute :status, :to_sym => true
46
46
 
47
47
  config_attribute :retention_period,
48
- :as => 'workflowExecutionRetentionPeriodInDays',
48
+ :from => 'workflowExecutionRetentionPeriodInDays',
49
49
  :duration => true,
50
50
  :static => true
51
51
 
@@ -29,12 +29,12 @@ module AWS
29
29
 
30
30
  # the simple workflow attributes are all given as 'lowerCamelCase'
31
31
  # this converts the :snake_case name to the correct format
32
- unless options[:as]
32
+ unless options[:from]
33
33
  parts = []
34
34
  name.to_s.split(/_/).each_with_index do |part,n|
35
35
  parts << (n == 0 ? part : part.capitalize)
36
36
  end
37
- options[:as] = parts.join.to_sym
37
+ options[:from] = parts.join.to_sym
38
38
  end
39
39
 
40
40
  if options[:duration]
@@ -96,27 +96,27 @@ module AWS
96
96
  info_attribute :close_status, :to_sym => true
97
97
  protected :close_status
98
98
 
99
- info_attribute :closed_at, :as => 'closeTimestamp', :timestamp => true
99
+ info_attribute :closed_at, :from => 'closeTimestamp', :timestamp => true
100
100
 
101
101
  info_attribute :execution_status, :to_sym => true
102
102
  protected :execution_status
103
103
 
104
- info_attribute :parent_details, :as => 'parent', :static => true
104
+ info_attribute :parent_details, :from => 'parent', :static => true
105
105
  protected :parent_details
106
106
 
107
107
  info_attribute :started_at,
108
- :as => 'startTimestamp',
108
+ :from => 'startTimestamp',
109
109
  :timestamp => true,
110
110
  :static => true
111
111
 
112
112
  info_attribute :tag_list, :static => true
113
113
  protected :tag_list
114
114
 
115
- info_attribute :type_details, :as => 'workflowType', :static => true
115
+ info_attribute :type_details, :from => 'workflowType', :static => true
116
116
  protected :type_details
117
117
 
118
118
  attribute :latest_activity_task_scheduled_at,
119
- :as => 'latestActivityTaskTimestamp',
119
+ :from => 'latestActivityTaskTimestamp',
120
120
  :timestamp => true
121
121
 
122
122
  attribute :latest_execution_context
@@ -25,52 +25,50 @@ module AWS
25
25
  #
26
26
  class SubscriptionCollection
27
27
 
28
- include Core::Model
29
- include Enumerable
28
+ include Core::Collection::WithNextToken
29
+
30
+ # Returns a subscription with the given ARN. This does not make
31
+ # a request to AWS.
32
+ # @param [String] arn The subscription ARN.
33
+ # @return [Subscription]
34
+ def [] arn
35
+ Subscription.new(arn, :config => config)
36
+ end
37
+
38
+ protected
30
39
 
31
40
  # Yield each subscription belonging to this account.
32
41
  # @yieldparam [Subscription] subscription Each of the
33
42
  # subscriptions in the account.
34
43
  # @return [nil]
35
- def each
36
- next_token = nil
37
- begin
38
- opts = request_opts
39
- opts[:next_token] = next_token if next_token
40
- resp = client.send(list_request, opts)
41
- resp.subscriptions.each do |sub|
42
- subscription = Subscription.new(sub.subscription_arn,
43
- :endpoint => sub.endpoint,
44
- :protocol => sub.protocol.tr('-','_').to_sym,
45
- :owner_id => sub.owner,
46
- :topic_arn => sub.topic_arn,
47
- :config => config
48
- )
49
- yield(subscription)
50
- end
51
- next_token = resp.data[:next_token]
52
- end until next_token.nil?
53
- nil
54
- end
44
+ def _each_item next_token, options, &block
45
+
46
+ options[:next_token] = next_token if next_token
47
+
48
+ resp = client.send(client_method, options.merge(request_options))
49
+ resp.data[:subscriptions].each do |sub|
50
+
51
+ subscription = Subscription.new(
52
+ sub[:subscription_arn],
53
+ :endpoint => sub[:endpoint],
54
+ :protocol => sub[:protocol].tr('-','_').to_sym,
55
+ :owner_id => sub[:owner],
56
+ :topic_arn => sub[:topic_arn],
57
+ :config => config)
58
+
59
+ yield(subscription)
60
+
61
+ end
62
+
63
+ resp.data[:next_token]
55
64
 
56
- # Retrieves a subscription object by ARN. This method does not
57
- # make any requests to the service.
58
- #
59
- # @param [String] arn The ARN of the subscription to retrieve.
60
- # @return [Subscription] The subscription with the given ARN.
61
- def [] arn
62
- Subscription.new(arn, :config => config)
63
65
  end
64
66
 
65
- # @private
66
- protected
67
- def list_request
67
+ def client_method
68
68
  :list_subscriptions
69
69
  end
70
70
 
71
- # @private
72
- protected
73
- def request_opts
71
+ def request_options
74
72
  {}
75
73
  end
76
74
 
@@ -16,9 +16,7 @@ module AWS
16
16
 
17
17
  class TopicCollection
18
18
 
19
- include Core::Model
20
- include Enumerable
21
-
19
+ include Core::Collection::WithNextToken
22
20
 
23
21
  # Creates and returns a new SNS Topic.
24
22
  # @return [Topic] Returns a new topic with the given name.
@@ -40,25 +38,22 @@ module AWS
40
38
  Topic.new(topic_arn, :config => config)
41
39
  end
42
40
 
43
- # Yields once for each topic.
44
- # @yieldparam [Topic] topic
45
- # @return [nil]
46
- def each &block
41
+ protected
42
+
43
+ def _each_item next_token, options, &block
44
+
45
+ options[:next_token] = next_token if next_token
47
46
 
48
- next_token = nil
47
+ resp = client.list_topics(options)
48
+ resp.data[:topics].each do |details|
49
49
 
50
- begin
51
-
52
- list_options = next_token ? { :next_token => next_token } : {}
53
- response = client.list_topics(list_options)
50
+ topic = Topic.new(details[:topic_arn], :config => config)
54
51
 
55
- response.topics.each do |t|
56
- topic = Topic.new(t.topic_arn, :config => config)
57
- yield(topic)
58
- end
52
+ yield(topic)
53
+
54
+ end
59
55
 
60
- end while(next_token = response.data[:next_token])
61
- nil
56
+ resp.data[:next_token]
62
57
 
63
58
  end
64
59
 
@@ -22,30 +22,29 @@ module AWS
22
22
  # topic.subscriptions.
23
23
  # select { |s| s.protocol == :email }.
24
24
  # map(&:endpoint)
25
+ #
25
26
  class TopicSubscriptionCollection < SubscriptionCollection
26
27
 
27
28
  include Core::Model
28
29
  include Enumerable
29
30
 
30
- # @return [Topic] The topic to which all the subscriptions
31
- # belong.
32
- attr_reader :topic
33
-
34
31
  # @private
35
32
  def initialize(topic, opts = {})
36
33
  @topic = topic
37
34
  super
38
35
  end
39
36
 
40
- # @private
37
+ # @return [Topic] The topic to which all the subscriptions
38
+ # belong.
39
+ attr_reader :topic
40
+
41
41
  protected
42
- def list_request
42
+
43
+ def client_method
43
44
  :list_subscriptions_by_topic
44
45
  end
45
46
 
46
- # @private
47
- protected
48
- def request_opts
47
+ def request_options
49
48
  { :topic_arn => topic.arn }
50
49
  end
51
50
 
@@ -540,14 +540,14 @@ module AWS
540
540
 
541
541
  end
542
542
 
543
- # @overload batch_change_message_visibility(visibility_timeout, *messages)
543
+ # @overload batch_change_visibility(visibility_timeout, *messages)
544
544
  #
545
545
  # Accepts a single +:visibility_timeout+ value and a list of
546
546
  # messages ({ReceivedMessage} objects or receipt handle strings).
547
547
  # This form of the method is useful when you want to set the same
548
548
  # timeout value for each message.
549
549
  #
550
- # queue.bacth_change_message_visibility(10, messages)
550
+ # queue.batch_change_visibility(10, messages)
551
551
  #
552
552
  # @param [Integer] visibility_timeout The new value for the message's
553
553
  # visibility timeout (in seconds).
@@ -560,7 +560,7 @@ module AWS
560
560
  #
561
561
  # @return [nil]
562
562
  #
563
- # @overload batch_change_message_visibility(*messages_with_timeouts)
563
+ # @overload batch_change_visibility(*messages_with_timeouts)
564
564
  #
565
565
  # Accepts a list of hashes. Each hash should provide the visibility
566
566
  # timeout and message (a {ReceivedMessage} object or the recipt handle
@@ -572,7 +572,7 @@ module AWS
572
572
  # messages << { :message => 'handle1', :visibility_timeout => 5 }
573
573
  # messages << { :message => 'handle2', :visibility_timeout => 10 }
574
574
  #
575
- # queue.bacth_change_message_visibility(*messages)
575
+ # queue.batch_change_visibility(*messages)
576
576
  #
577
577
  # @param [Hash] message A list hashes, each with a +:visibility_timeout+
578
578
  # and a +:message+.
@@ -31,8 +31,7 @@ module AWS
31
31
  # sqs.queues[url].send_message("HELLO")
32
32
  class QueueCollection
33
33
 
34
- include Core::Model
35
- include Enumerable
34
+ include Core::Collection::Simple
36
35
 
37
36
  # @private
38
37
  def initialize(opts = {})
@@ -109,16 +108,6 @@ module AWS
109
108
 
110
109
  end
111
110
 
112
- # @yieldparam [Queue] queue Each {Queue} object in the collection.
113
- def each(&block)
114
- options = {}
115
- options[:queue_name_prefix] = prefix if prefix
116
- client.list_queues(options)[:queue_urls].each do |url|
117
- queue = self[url]
118
- yield(queue)
119
- end
120
- end
121
-
122
111
  # @param [String] prefix The queue name prefix.
123
112
  # @return [QueueCollection] A new collection representing only
124
113
  # the queues whose names start with the given prefix.
@@ -130,7 +119,7 @@ module AWS
130
119
  def [] url
131
120
  Queue.new(url, :config => config)
132
121
  end
133
-
122
+
134
123
  # Returns the queue with the given name. This requires making
135
124
  # a request to SQS to get the queue url. If you know the url,
136
125
  # you should use {#[]} instead.
@@ -164,6 +153,21 @@ module AWS
164
153
  client.get_queue_url(client_opts.merge(options))[:queue_url]
165
154
  end
166
155
 
156
+ protected
157
+
158
+ # @yieldparam [Queue] queue Each {Queue} object in the collection.
159
+ def _each_item options, &block
160
+
161
+ options[:queue_name_prefix] = prefix if prefix
162
+
163
+ resp = client.list_queues(options)
164
+ resp.data[:queue_urls].each do |url|
165
+ queue = self[url]
166
+ yield(queue)
167
+ end
168
+
169
+ end
170
+
167
171
  end
168
172
 
169
173
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.7
4
+ version: 1.5.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-12 00:00:00.000000000 Z
12
+ date: 2012-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uuidtools
@@ -119,7 +119,6 @@ files:
119
119
  - lib/aws/cloud_formation/stack_resource.rb
120
120
  - lib/aws/cloud_formation/stack_resource_collection.rb
121
121
  - lib/aws/cloud_formation/stack_resource_summary_collection.rb
122
- - lib/aws/cloud_formation/stack_summary.rb
123
122
  - lib/aws/cloud_formation/stack_summary_collection.rb
124
123
  - lib/aws/cloud_formation.rb
125
124
  - lib/aws/cloud_watch/alarm.rb
@@ -292,6 +291,15 @@ files:
292
291
  - lib/aws/elb/load_balancer_policy_collection.rb
293
292
  - lib/aws/elb/request.rb
294
293
  - lib/aws/elb.rb
294
+ - lib/aws/emr/client.rb
295
+ - lib/aws/emr/config.rb
296
+ - lib/aws/emr/errors.rb
297
+ - lib/aws/emr/instance_group.rb
298
+ - lib/aws/emr/instance_group_collection.rb
299
+ - lib/aws/emr/job_flow.rb
300
+ - lib/aws/emr/job_flow_collection.rb
301
+ - lib/aws/emr/request.rb
302
+ - lib/aws/emr.rb
295
303
  - lib/aws/errors.rb
296
304
  - lib/aws/iam/access_key.rb
297
305
  - lib/aws/iam/access_key_collection.rb
@@ -481,6 +489,7 @@ files:
481
489
  - lib/aws/api_config/DynamoDB-2011-12-05.yml
482
490
  - lib/aws/api_config/EC2-2012-06-01.yml
483
491
  - lib/aws/api_config/ELB-2011-08-15.yml
492
+ - lib/aws/api_config/EMR-2009-03-31.yml
484
493
  - lib/aws/api_config/IAM-2010-05-08.yml
485
494
  - lib/aws/api_config/SimpleDB-2009-04-15.yml
486
495
  - lib/aws/api_config/SimpleEmailService-2010-12-01.yml
@@ -508,7 +517,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
508
517
  version: '0'
509
518
  segments:
510
519
  - 0
511
- hash: -730295580872100044
520
+ hash: -3495806020275811726
512
521
  required_rubygems_version: !ruby/object:Gem::Requirement
513
522
  none: false
514
523
  requirements: