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
@@ -26,7 +26,7 @@ module AWS
26
26
  # @param [String] name The name of the launch configuration to create.
27
27
  #
28
28
  # @param [EC2::Image,String] image An {EC2::Image} or image id string.
29
- #
29
+ #
30
30
  # @param [String] instance_type The type of instance (e.g.
31
31
  # 't1.micro', 'm1.small', 'm2.4xlarge', etc).
32
32
  #
@@ -34,10 +34,10 @@ module AWS
34
34
  #
35
35
  # @option options [Array<Hash>] :block_device_mappings
36
36
  #
37
- # @option options [Boolean] :detailed_instance_monitoring (true)
38
- # When enabled, CloudWatch will generate metrics every minute
39
- # and your account will be charged a fee. When you disable
40
- # detailed monitoring, by specifying False, Cloudwatch will
37
+ # @option options [Boolean] :detailed_instance_monitoring (true)
38
+ # When enabled, CloudWatch will generate metrics every minute
39
+ # and your account will be charged a fee. When you disable
40
+ # detailed monitoring, by specifying False, Cloudwatch will
41
41
  # generate metrics every 5 minutes.
42
42
  #
43
43
  # @option options [String] :kernel_id The ID of the kernel to
@@ -53,19 +53,19 @@ module AWS
53
53
  # @option options [Array<EC2::SecurityGroup>,Array<String>] :security_groups
54
54
  # The list of security groups to associate with the instances.
55
55
  # This may be an array of {EC2::SecurityGroup} objects, security
56
- # group names or security group ids.
56
+ # group names or security group ids.
57
57
  #
58
- # @option options [String] :user_data The user data available to
58
+ # @option options [String] :user_data The user data available to
59
59
  # the launched Amazon EC2 instances.
60
60
  #
61
61
  # @option options [String] :iam_instance_profile
62
62
  #
63
63
  # @option options [String] :spot_price
64
- #
64
+ #
65
65
  # @return [LaunchConfiguration]
66
66
  #
67
67
  def create name, image, instance_type, options = {}
68
-
68
+
69
69
  client_opts = {}
70
70
  client_opts[:launch_configuration_name] = name
71
71
  client_opts[:image_id] = image_id_opt(image)
@@ -111,7 +111,7 @@ module AWS
111
111
 
112
112
  resp = client.describe_launch_configurations(options)
113
113
  resp.launch_configurations.each do |details|
114
-
114
+
115
115
  launch_configuration = LaunchConfiguration.new_from(
116
116
  :describe_launch_configurations,
117
117
  details,
@@ -119,7 +119,7 @@ module AWS
119
119
  :config => config)
120
120
 
121
121
  yield(launch_configuration)
122
-
122
+
123
123
  end
124
124
  resp.data[:next_token]
125
125
  end
@@ -47,7 +47,7 @@ module AWS
47
47
  # @return [String]
48
48
  attr_reader :name
49
49
 
50
- attribute :arn, :as => :policy_arn, :static => true
50
+ attribute :arn, :from => :policy_arn, :static => true
51
51
 
52
52
  attribute :adjustment_type
53
53
 
@@ -43,7 +43,7 @@ module AWS
43
43
  # @return [String]
44
44
  attr_reader :name
45
45
 
46
- attribute :arn, :as => :scheduled_action_arn
46
+ attribute :arn, :from => :scheduled_action_arn
47
47
 
48
48
  attribute :auto_scaling_group_name, :static => true
49
49
 
@@ -26,13 +26,13 @@ module AWS
26
26
 
27
27
  super()
28
28
 
29
- @resource =
29
+ @resource =
30
30
  case options[:resource_type]
31
- when 'auto-scaling-group'
31
+ when 'auto-scaling-group'
32
32
  group_name = options[:resource_id]
33
33
  config = options.delete(:config)
34
34
  Group.new(group_name, :config => config)
35
- else
35
+ else
36
36
  msg = "unhandled resource type: #{options[:resource_type]}"
37
37
  raise ArgumentError, msg
38
38
  end
@@ -66,7 +66,7 @@ module AWS
66
66
 
67
67
  ## returned by GetTemplate
68
68
 
69
- template_attribute :template, :as => :template_body
69
+ template_attribute :template, :from => :template_body
70
70
 
71
71
  alias_method :template_body, :template
72
72
 
@@ -78,21 +78,21 @@ module AWS
78
78
 
79
79
  describe_attribute :stack_id, :static => true
80
80
 
81
- describe_attribute :status, :as => :stack_status
81
+ describe_attribute :status, :from => :stack_status
82
82
 
83
- describe_attribute :status_reason, :as => :stack_status_reason
83
+ describe_attribute :status_reason, :from => :stack_status_reason
84
84
 
85
85
  describe_attribute :capabilities
86
86
 
87
87
  describe_attribute :description
88
88
 
89
- describe_attribute :disable_rollback, :as => :disable_rollback?
90
-
89
+ describe_attribute :disable_rollback, :from => :disable_rollback?
90
+
91
91
  alias_method :disable_rollback?, :disable_rollback
92
92
 
93
93
  describe_attribute :notification_arns
94
94
 
95
- describe_attribute :output_details, :as => :outputs
95
+ describe_attribute :output_details, :from => :outputs
96
96
 
97
97
  protected :output_details
98
98
 
@@ -104,7 +104,7 @@ module AWS
104
104
  end
105
105
  end
106
106
 
107
- describe_attribute :timeout, :as => :timeout_in_minutes
107
+ describe_attribute :timeout, :from => :timeout_in_minutes
108
108
 
109
109
  alias_method :timeout_in_minutes, :timeout
110
110
 
@@ -88,7 +88,7 @@ module AWS
88
88
  # 'SecurityGroup' => 'security-group-name',
89
89
  # 'InstanceType' => 'm1.large',
90
90
  # })
91
- #
91
+ #
92
92
  # @param [String] stack_name
93
93
  #
94
94
  # @param [String,URI,S3::S3Object,Object] template The stack template.
@@ -103,10 +103,10 @@ module AWS
103
103
  # @param [Hash] options
104
104
  #
105
105
  # @option options [Array<String>] :capabilities The list of capabilities
106
- # that you want to allow in the stack. If your stack contains IAM
107
- # resources, you must specify the CAPABILITY_IAM value for this
108
- # parameter; otherwise, this action returns an
109
- # InsufficientCapabilities error. IAM resources are the following:
106
+ # that you want to allow in the stack. If your stack contains IAM
107
+ # resources, you must specify the CAPABILITY_IAM value for this
108
+ # parameter; otherwise, this action returns an
109
+ # InsufficientCapabilities error. IAM resources are the following:
110
110
  #
111
111
  # * AWS::IAM::AccessKey
112
112
  # * AWS::IAM::Group
@@ -119,14 +119,14 @@ module AWS
119
119
  #
120
120
  # @option options [Object] :notify One or more SNS topics ARN
121
121
  # string or {SNS::Topic} objects. This param may be passed
122
- # as a single value or as an array. CloudFormation will publish
122
+ # as a single value or as an array. CloudFormation will publish
123
123
  # stack related events to these topics.
124
124
  #
125
125
  # @option options [Hash] :parameters A hash that specifies the
126
126
  # input parameters of the new stack.
127
127
  #
128
- # @option options [Integer] :timeout The number of minutes
129
- # that may pass before the stack creation fails. If
128
+ # @option options [Integer] :timeout The number of minutes
129
+ # that may pass before the stack creation fails. If
130
130
  # +:disable_rollback+ is false, the stack will be rolled back.
131
131
  #
132
132
  # @return [Stack]
@@ -158,7 +158,7 @@ module AWS
158
158
  # cloud_formation.stacks.with_status(:create_complete).each do |stack|
159
159
  # puts stack.name
160
160
  # end
161
- #
161
+ #
162
162
  # @param [Symbol,String] status_filter A status to filter stacks with.
163
163
  # Valid values include:
164
164
  # * +:create_in_progress+
@@ -188,12 +188,12 @@ module AWS
188
188
  protected
189
189
 
190
190
  def _each_item options = {}
191
- client.describe_stacks.data[:stacks].each do |summary|
191
+ client.describe_stacks(options).data[:stacks].each do |summary|
192
192
 
193
193
  stack = Stack.new_from(
194
- :describe_stacks,
195
- summary,
196
- summary[:stack_name],
194
+ :describe_stacks,
195
+ summary,
196
+ summary[:stack_name],
197
197
  :config => config)
198
198
 
199
199
  yield(stack)
@@ -33,9 +33,9 @@ module AWS
33
33
  def _each_item options = {}
34
34
  options[:stack_name] = stack.name
35
35
  resp = client.describe_stack_events(options)
36
- resp.stack_events.each do |details|
36
+ resp.data[:stack_events].each do |details|
37
37
 
38
- event = StackEvent.new(stack, details.to_hash)
38
+ event = StackEvent.new(stack, details)
39
39
 
40
40
  yield(event)
41
41
 
@@ -99,7 +99,7 @@ module AWS
99
99
  end
100
100
  end
101
101
  provider.provides *common_attributes.keys
102
- provider.provides :last_updated_timestamp, :get_as => :timestamp
102
+ provider.provides :last_updated_timestamp, :from => :timestamp
103
103
  end
104
104
 
105
105
  protected
@@ -32,10 +32,10 @@ module AWS
32
32
  # * +:resource_status+
33
33
  # * +:resource_status_reason+
34
34
  # * +:last_updated_timestamp+
35
- #
35
+ #
36
36
  class StackResourceSummaryCollection
37
37
 
38
- include Core::Collection::Simple
38
+ include Core::Collection::WithNextToken
39
39
 
40
40
  # @param [Stack] stack
41
41
  # @param [Hash] options
@@ -49,22 +49,14 @@ module AWS
49
49
 
50
50
  protected
51
51
 
52
- def _each_item options = {}
53
- next_token = nil
54
- begin
55
-
56
- options = {}
57
- options[:next_token] = next_token if next_token
58
- options[:stack_name] = stack.name
59
- resp = client.list_stack_resources(options)
60
-
61
- resp.stack_resource_summaries.each do |summary|
62
- yield(summary.to_hash)
63
- end
64
-
65
- next_token = resp.data[:next_token]
66
-
67
- end while next_token
52
+ def _each_item next_token, options = {}, &block
53
+ options[:next_token] = next_token if next_token
54
+ options[:stack_name] = stack.name
55
+ resp = client.list_stack_resources(options)
56
+ resp.data[:stack_resource_summaries].each do |summary|
57
+ yield(summary)
58
+ end
59
+ resp.data[:next_token]
68
60
  end
69
61
 
70
62
  end
@@ -49,7 +49,7 @@ module AWS
49
49
  #
50
50
  class StackSummaryCollection
51
51
 
52
- include Core::Collection::Simple
52
+ include Core::Collection::WithNextToken
53
53
 
54
54
  # @private
55
55
  def initialize options = {}
@@ -72,7 +72,7 @@ module AWS
72
72
  #
73
73
  # Status names may be symbolized (snake-cased) or upper-cased strings
74
74
  # (e.g. :create_in_progress, 'CREATE_IN_PROGRESS').
75
- #
75
+ #
76
76
  # @param [Symbol,String] status_filters One or more statuses to filter
77
77
  # stacks with. Valid values include:
78
78
  # * +:create_in_progress+
@@ -93,7 +93,7 @@ module AWS
93
93
  # * +:update_rollback_complete+
94
94
  #
95
95
  # @return [StackSummaryCollection] Returns a new stack summary
96
- # collection that restricts what stack summariess will be
96
+ # collection that restricts what stack summariess will be
97
97
  # enumerated.
98
98
  #
99
99
  def with_status *status_filters
@@ -104,22 +104,18 @@ module AWS
104
104
 
105
105
  protected
106
106
 
107
- def _each_item options = {}
108
- next_token = nil
109
- begin
110
-
111
- client_opts = {}
112
- client_opts[:next_token] = next_token if next_token
113
- client_opts[:stack_status_filter] = @filters if @filters
114
- resp = client.list_stacks(client_opts)
107
+ def _each_item next_token, options = {}, &block
108
+
109
+ options[:next_token] = next_token if next_token
110
+ options[:stack_status_filter] = @filters if @filters
115
111
 
116
- resp.stack_summaries.each do |summary|
117
- yield(summary.to_hash)
118
- end
112
+ resp = client.list_stacks(options)
113
+ resp.data[:stack_summaries].each do |summary|
114
+ yield(summary)
115
+ end
119
116
 
120
- next_token = resp.data[:next_token]
117
+ resp.data[:next_token]
121
118
 
122
- end while next_token
123
119
  end
124
120
 
125
121
  end
@@ -22,9 +22,11 @@ require 'aws/core/autoloader'
22
22
  #
23
23
  # * {AWS::AutoScaling}
24
24
  # * {AWS::CloudFormation}
25
+ # * {AWS::CloudWatch}
25
26
  # * {AWS::DynamoDB}
26
27
  # * {AWS::EC2}
27
28
  # * {AWS::ELB}
29
+ # * {AWS::EMR}
28
30
  # * {AWS::IAM}
29
31
  # * {AWS::S3}
30
32
  # * {AWS::SNS}
@@ -66,7 +68,7 @@ require 'aws/core/autoloader'
66
68
  module AWS
67
69
 
68
70
  # Current version of the AWS SDK for Ruby
69
- VERSION = "1.5.7"
71
+ VERSION = "1.5.8"
70
72
 
71
73
  register_autoloads(self) do
72
74
  autoload :Errors, 'errors'
@@ -278,6 +280,10 @@ module AWS
278
280
  # @option options [String] :s3_endpoint ('s3.amazonaws.com') The
279
281
  # service endpoint for Amazon S3.
280
282
  #
283
+ # @option options [Boolean] :s3_force_path_style (false) When
284
+ # +true+, requests will always use path style. This can be useful
285
+ # for testing environments.
286
+ #
281
287
  # @option options [Integer] :s3_multipart_max_parts (1000) The maximum
282
288
  # number of parts to split a file into when uploading in parts to S3.
283
289
  #
@@ -23,12 +23,12 @@ module AWS
23
23
  end
24
24
 
25
25
  include Enumerable
26
-
26
+
27
27
  # Yields once for every item in this collection.
28
28
  #
29
29
  # collection.each {|item| ... }
30
30
  #
31
- # @note If you want fewer than all items, it is generally better
31
+ # @note If you want fewer than all items, it is generally better
32
32
  # to call {#page} than {#each} with a +:limit+.
33
33
  #
34
34
  # @param [Hash] options
@@ -36,13 +36,13 @@ module AWS
36
36
  # @option options [Integer] :limit (nil) The maximum number of
37
37
  # items to enumerate from this collection.
38
38
  #
39
- # @option options [next_token] :next_token (nil)
39
+ # @option options [next_token] :next_token (nil)
40
40
  # Acts as an offset. +:next_token+ may be returned by {#each} and
41
41
  # {#each_batch} when a +:limit+ is provided.
42
42
  #
43
43
  # @return [nil_or_next_token] Returns nil if all items were enumerated.
44
44
  # If some items were excluded because of a +:limit+ option then
45
- # a +next_token+ is returned. Calling an enumerable method on
45
+ # a +next_token+ is returned. Calling an enumerable method on
46
46
  # the same collection with the +next_token+ acts like an offset.
47
47
  #
48
48
  def each options = {}, &block
@@ -82,7 +82,7 @@ module AWS
82
82
  _each_batch(options.dup, &block)
83
83
  end
84
84
 
85
- # Use this method when you want to call a method provided by
85
+ # Use this method when you want to call a method provided by
86
86
  # Enumerable, but you need to pass options:
87
87
  #
88
88
  # # raises an error because collect does not accept arguments
@@ -99,7 +99,7 @@ module AWS
99
99
  # collection.
100
100
  #
101
101
  def enum options = {}
102
- Enumerator.new(self, :each, options)
102
+ Enumerator.new(self, :each, options)
103
103
  end
104
104
  alias_method :enumerator, :enum
105
105
 
@@ -113,7 +113,7 @@ module AWS
113
113
  end
114
114
 
115
115
  # Yields items from this collection in groups of an exact
116
- # size (except for perhaps the last group).
116
+ # size (except for perhaps the last group).
117
117
  #
118
118
  # collection.in_groups_of (10, :limit => 30) do |group|
119
119
  #
@@ -124,7 +124,7 @@ module AWS
124
124
  # end
125
125
  #
126
126
  # end
127
- #
127
+ #
128
128
  # @param [Integer] size Size each each group of objects
129
129
  # should be yielded in.
130
130
  # @param [Hash] options
@@ -187,13 +187,13 @@ module AWS
187
187
  #
188
188
  # @option options [String] :next_token (nil) A token that indicates
189
189
  # an offset to use when paging items. Next tokens are returned
190
- # by {PageResult#next_token}.
190
+ # by {PageResult#next_token}.
191
191
  #
192
192
  # Next tokens should only be consumed by the same collection that
193
193
  # created them.
194
194
  #
195
195
  def page options = {}
196
-
196
+
197
197
  each_opts = options.dup
198
198
 
199
199
  per_page = each_opts.delete(:per_page)
@@ -241,7 +241,7 @@ module AWS
241
241
  limit = limit.to_i if limit
242
242
  limit
243
243
  end
244
-
244
+
245
245
  # Override this method in collection classes that provide
246
246
  # an alternative way to provide the limit than passinging
247
247
  # it to the enumerable method as :limit.
@@ -252,7 +252,7 @@ module AWS
252
252
  #
253
253
  # The collection class including this module should define _limit
254
254
  # and return the cached limit value (of 10 from this example).
255
- # This value may still be overridden by a locally passed
255
+ # This value may still be overridden by a locally passed
256
256
  # +:limit+ option:
257
257
  #
258
258
  # # limit 5 wins out