aws-sdk 1.4.1 → 1.5.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 (193) hide show
  1. data/.yardopts +0 -1
  2. data/lib/aws/api_config/AutoScaling-2011-01-01.yml +772 -544
  3. data/lib/aws/api_config/CloudFormation-2010-05-15.yml +284 -185
  4. data/lib/aws/api_config/DynamoDB-2011-12-05.yml +458 -738
  5. data/lib/aws/api_config/EC2-2011-12-15.yml +3502 -2653
  6. data/lib/aws/api_config/ELB-2011-08-15.yml +484 -352
  7. data/lib/aws/api_config/IAM-2010-05-08.yml +899 -711
  8. data/lib/aws/api_config/SNS-2010-03-31.yml +235 -167
  9. data/lib/aws/api_config/SQS-2011-10-01.yml +290 -251
  10. data/lib/aws/api_config/STS-2011-06-15.yml +35 -41
  11. data/lib/aws/api_config/SimpleDB-2009-04-15.yml +290 -263
  12. data/lib/aws/api_config/SimpleEmailService-2010-12-01.yml +144 -130
  13. data/lib/aws/api_config/SimpleWorkflow-2012-01-25.yml +697 -1139
  14. data/lib/aws/auto_scaling/activity_collection.rb +1 -1
  15. data/lib/aws/auto_scaling/client.rb +724 -9
  16. data/lib/aws/auto_scaling/errors.rb +1 -5
  17. data/lib/aws/auto_scaling/group.rb +1 -1
  18. data/lib/aws/auto_scaling/group_collection.rb +1 -1
  19. data/lib/aws/auto_scaling/instance_collection.rb +1 -1
  20. data/lib/aws/auto_scaling/launch_configuration.rb +1 -1
  21. data/lib/aws/auto_scaling/launch_configuration_collection.rb +1 -1
  22. data/lib/aws/auto_scaling/notification_configuration_collection.rb +1 -1
  23. data/lib/aws/auto_scaling/request.rb +1 -2
  24. data/lib/aws/auto_scaling/scaling_policy_collection.rb +1 -1
  25. data/lib/aws/auto_scaling/scheduled_action_collection.rb +3 -3
  26. data/lib/aws/auto_scaling/tag_collection.rb +1 -1
  27. data/lib/aws/cloud_formation.rb +1 -18
  28. data/lib/aws/cloud_formation/client.rb +314 -8
  29. data/lib/aws/cloud_formation/errors.rb +1 -5
  30. data/lib/aws/cloud_formation/request.rb +1 -2
  31. data/lib/aws/cloud_formation/stack.rb +4 -3
  32. data/lib/aws/cloud_formation/stack_collection.rb +2 -2
  33. data/lib/aws/cloud_formation/stack_resource_collection.rb +1 -1
  34. data/lib/aws/cloud_formation/stack_resource_summary_collection.rb +2 -2
  35. data/lib/aws/cloud_formation/stack_summary_collection.rb +1 -1
  36. data/lib/aws/core.rb +29 -14
  37. data/lib/aws/core/async_handle.rb +11 -12
  38. data/lib/aws/core/client.rb +112 -102
  39. data/lib/aws/core/client/query_json.rb +110 -0
  40. data/lib/aws/core/client/query_xml.rb +122 -0
  41. data/lib/aws/core/data.rb +242 -0
  42. data/lib/aws/core/http/request.rb +7 -4
  43. data/lib/aws/core/lazy_error_classes.rb +60 -38
  44. data/lib/aws/core/option_grammar.rb +1 -0
  45. data/lib/aws/core/policy.rb +2 -1
  46. data/lib/aws/core/resource.rb +38 -33
  47. data/lib/aws/core/response.rb +109 -44
  48. data/lib/aws/core/signature/version_2.rb +42 -0
  49. data/lib/aws/core/signature/version_3.rb +73 -0
  50. data/lib/aws/core/signature/version_3_http.rb +72 -0
  51. data/lib/aws/core/signature/version_4.rb +138 -0
  52. data/lib/aws/core/uri_escape.rb +6 -9
  53. data/lib/aws/core/xml/frame.rb +242 -0
  54. data/lib/aws/core/xml/frame_stack.rb +85 -0
  55. data/lib/aws/core/xml/grammar.rb +299 -0
  56. data/lib/aws/core/xml/parser.rb +70 -0
  57. data/lib/aws/core/xml/root_frame.rb +65 -0
  58. data/lib/aws/core/{configured_xml_grammars.rb → xml/sax_handlers/libxml.rb} +22 -20
  59. data/lib/aws/core/xml/sax_handlers/nokogiri.rb +55 -0
  60. data/lib/aws/core/{authorize_with_session_token.rb → xml/sax_handlers/ox.rb} +19 -7
  61. data/lib/aws/core/{configured_option_grammars.rb → xml/sax_handlers/rexml.rb} +22 -23
  62. data/lib/aws/core/xml/stub.rb +123 -0
  63. data/lib/aws/dynamo_db/batch_get.rb +1 -1
  64. data/lib/aws/dynamo_db/client.rb +796 -14
  65. data/lib/aws/dynamo_db/errors.rb +1 -38
  66. data/lib/aws/dynamo_db/item_collection.rb +29 -28
  67. data/lib/aws/dynamo_db/request.rb +3 -53
  68. data/lib/aws/dynamo_db/table.rb +6 -2
  69. data/lib/aws/ec2/attachment.rb +1 -1
  70. data/lib/aws/ec2/client.rb +3954 -9
  71. data/lib/aws/ec2/dhcp_options.rb +3 -3
  72. data/lib/aws/ec2/errors.rb +10 -4
  73. data/lib/aws/ec2/instance.rb +7 -6
  74. data/lib/aws/ec2/instance_collection.rb +2 -2
  75. data/lib/aws/ec2/key_pair_collection.rb +3 -3
  76. data/lib/aws/ec2/network_acl.rb +4 -2
  77. data/lib/aws/ec2/network_acl/entry.rb +10 -10
  78. data/lib/aws/ec2/network_interface.rb +2 -3
  79. data/lib/aws/ec2/network_interface/attachment.rb +8 -8
  80. data/lib/aws/ec2/permission_collection.rb +3 -3
  81. data/lib/aws/ec2/request.rb +1 -3
  82. data/lib/aws/ec2/resource_tag_collection.rb +4 -8
  83. data/lib/aws/ec2/route_table.rb +3 -2
  84. data/lib/aws/ec2/route_table/route.rb +7 -7
  85. data/lib/aws/ec2/security_group.rb +2 -2
  86. data/lib/aws/ec2/security_group/egress_ip_permission_collection.rb +16 -5
  87. data/lib/aws/ec2/security_group/ingress_ip_permission_collection.rb +4 -3
  88. data/lib/aws/ec2/security_group/ip_permission.rb +1 -2
  89. data/lib/aws/ec2/snapshot_collection.rb +6 -3
  90. data/lib/aws/ec2/subnet.rb +1 -1
  91. data/lib/aws/ec2/volume.rb +1 -3
  92. data/lib/aws/ec2/volume_collection.rb +2 -0
  93. data/lib/aws/elb/availability_zone_collection.rb +2 -2
  94. data/lib/aws/elb/backend_server_policy_collection.rb +1 -1
  95. data/lib/aws/elb/client.rb +513 -9
  96. data/lib/aws/elb/errors.rb +2 -6
  97. data/lib/aws/elb/instance_collection.rb +2 -2
  98. data/lib/aws/elb/request.rb +1 -1
  99. data/lib/aws/errors.rb +61 -74
  100. data/lib/aws/iam.rb +2 -3
  101. data/lib/aws/iam/client.rb +1178 -10
  102. data/lib/aws/iam/collection.rb +2 -1
  103. data/lib/aws/iam/errors.rb +1 -6
  104. data/lib/aws/iam/group.rb +8 -9
  105. data/lib/aws/iam/request.rb +1 -1
  106. data/lib/aws/iam/server_certificate_collection.rb +8 -5
  107. data/lib/aws/iam/signing_certificate.rb +1 -1
  108. data/lib/aws/iam/user.rb +2 -2
  109. data/lib/aws/iam/user_policy.rb +3 -2
  110. data/lib/aws/rails.rb +1 -2
  111. data/lib/aws/record.rb +3 -3
  112. data/lib/aws/record/abstract_base.rb +0 -3
  113. data/lib/aws/record/attributes.rb +7 -7
  114. data/lib/aws/record/model.rb +19 -19
  115. data/lib/aws/record/model/finder_methods.rb +7 -7
  116. data/lib/aws/s3/bucket.rb +7 -2
  117. data/lib/aws/s3/client.rb +391 -398
  118. data/lib/aws/s3/client/xml.rb +44 -71
  119. data/lib/aws/s3/data_options.rb +3 -2
  120. data/lib/aws/s3/errors.rb +8 -11
  121. data/lib/aws/s3/multipart_upload_collection.rb +1 -3
  122. data/lib/aws/s3/object_collection.rb +2 -1
  123. data/lib/aws/s3/object_metadata.rb +2 -2
  124. data/lib/aws/s3/paginated_collection.rb +2 -2
  125. data/lib/aws/s3/prefix_and_delimiter_collection.rb +1 -1
  126. data/lib/aws/s3/presigned_post.rb +18 -17
  127. data/lib/aws/s3/request.rb +4 -3
  128. data/lib/aws/s3/s3_object.rb +8 -10
  129. data/lib/aws/simple_db/attribute.rb +2 -2
  130. data/lib/aws/simple_db/attribute_collection.rb +14 -4
  131. data/lib/aws/simple_db/client.rb +313 -14
  132. data/lib/aws/simple_db/domain.rb +1 -1
  133. data/lib/aws/simple_db/domain_collection.rb +4 -4
  134. data/lib/aws/simple_db/domain_metadata.rb +1 -1
  135. data/lib/aws/simple_db/errors.rb +14 -2
  136. data/lib/aws/simple_db/expect_condition_option.rb +1 -1
  137. data/lib/aws/simple_db/item.rb +1 -1
  138. data/lib/aws/simple_db/item_collection.rb +9 -9
  139. data/lib/aws/simple_db/item_data.rb +9 -6
  140. data/lib/aws/simple_db/request.rb +1 -1
  141. data/lib/aws/simple_email_service.rb +8 -7
  142. data/lib/aws/simple_email_service/client.rb +174 -9
  143. data/lib/aws/simple_email_service/email_address_collection.rb +0 -1
  144. data/lib/aws/simple_email_service/errors.rb +1 -5
  145. data/lib/aws/simple_email_service/quotas.rb +8 -6
  146. data/lib/aws/simple_email_service/request.rb +7 -1
  147. data/lib/aws/simple_workflow/client.rb +1383 -6
  148. data/lib/aws/simple_workflow/decision_task.rb +1 -3
  149. data/lib/aws/simple_workflow/errors.rb +1 -38
  150. data/lib/aws/simple_workflow/history_event_collection.rb +2 -2
  151. data/lib/aws/simple_workflow/request.rb +5 -49
  152. data/lib/aws/simple_workflow/type.rb +1 -1
  153. data/lib/aws/simple_workflow/type_collection.rb +4 -3
  154. data/lib/aws/simple_workflow/workflow_execution_collection.rb +2 -2
  155. data/lib/aws/sns/client.rb +345 -9
  156. data/lib/aws/sns/errors.rb +1 -5
  157. data/lib/aws/sns/request.rb +1 -2
  158. data/lib/aws/sns/subscription_collection.rb +2 -2
  159. data/lib/aws/sns/topic.rb +15 -14
  160. data/lib/aws/sns/topic_collection.rb +1 -1
  161. data/lib/aws/sqs/client.rb +334 -9
  162. data/lib/aws/sqs/errors.rb +1 -6
  163. data/lib/aws/sqs/queue.rb +20 -21
  164. data/lib/aws/sqs/queue_collection.rb +3 -3
  165. data/lib/aws/sqs/request.rb +2 -2
  166. data/lib/aws/sts.rb +8 -10
  167. data/lib/aws/sts/client.rb +67 -10
  168. data/lib/aws/sts/errors.rb +1 -5
  169. data/lib/aws/sts/request.rb +1 -1
  170. data/lib/user.rb +49 -0
  171. metadata +21 -28
  172. data/lib/aws/auto_scaling/client/xml.rb +0 -32
  173. data/lib/aws/cloud_formation/client/xml.rb +0 -32
  174. data/lib/aws/core/api_config.rb +0 -44
  175. data/lib/aws/core/authorize_v2.rb +0 -39
  176. data/lib/aws/core/authorize_v3.rb +0 -38
  177. data/lib/aws/core/authorize_v4.rb +0 -149
  178. data/lib/aws/core/configured_client_methods.rb +0 -76
  179. data/lib/aws/core/configured_grammars.rb +0 -63
  180. data/lib/aws/core/configured_json_client_methods.rb +0 -74
  181. data/lib/aws/core/ignore_result_element.rb +0 -34
  182. data/lib/aws/core/json_client.rb +0 -41
  183. data/lib/aws/core/xml_grammar.rb +0 -957
  184. data/lib/aws/ec2/client/xml.rb +0 -175
  185. data/lib/aws/elb/client/xml.rb +0 -33
  186. data/lib/aws/elb/listener_spec.rb +0 -14
  187. data/lib/aws/iam/client/xml.rb +0 -34
  188. data/lib/aws/simple_db/client/options.rb +0 -32
  189. data/lib/aws/simple_db/client/xml.rb +0 -63
  190. data/lib/aws/simple_email_service/client/xml.rb +0 -34
  191. data/lib/aws/sns/client/xml.rb +0 -34
  192. data/lib/aws/sqs/client/xml.rb +0 -33
  193. data/lib/aws/sts/client/xml.rb +0 -34
@@ -45,9 +45,9 @@ module AWS
45
45
 
46
46
  # @return [Hash]
47
47
  def configuration
48
- dhcp_configuration_set.inject({}) do |config,opt|
49
- key = opt.key.gsub(/-/, '_').to_sym
50
- values = opt.value_set.map(&:value)
48
+ dhcp_configuration_set.to_a.inject({}) do |config,opt|
49
+ key = opt[:key].gsub(/-/, '_').to_sym
50
+ values = opt[:value_set].map{|v| v[:value] }
51
51
  values = values.first if key == :domain_name
52
52
  values = values.first.to_i if key == :netbios_node_type
53
53
  config.merge(key => values)
@@ -13,13 +13,19 @@
13
13
 
14
14
  module AWS
15
15
  class EC2
16
-
17
- # @private
18
16
  module Errors
19
17
 
20
- BASE_ERROR_GRAMMAR = Client::XML::BaseError
18
+ # @private
19
+ GRAMMAR = Core::XML::Grammar.customize do
20
+ element "Errors" do
21
+ ignore
22
+ element "Error" do
23
+ ignore
24
+ end
25
+ end
26
+ end
21
27
 
22
- include Core::LazyErrorClasses
28
+ extend Core::LazyErrorClasses
23
29
 
24
30
  end
25
31
  end
@@ -343,7 +343,7 @@ module AWS
343
343
 
344
344
  provider(:terminate_instances, :start_instances, :stop_instances) do |provider|
345
345
  provider.find do |resp|
346
- resp.instances_set.find { |i| i.instance_id == id }
346
+ resp.instances_set.find {|i| i.instance_id == id }
347
347
  end
348
348
  provider.provides :status, :get_as => :current_state
349
349
  provider.provides :status_code, :get_as => :current_state
@@ -351,7 +351,7 @@ module AWS
351
351
 
352
352
  provider(:monitor_instances, :unmonitor_instances) do |provider|
353
353
  provider.find do |resp|
354
- resp.instances_set.find { |i| i.instance_id == id }
354
+ resp.instances_set.find {|i| i.instance_id == id }
355
355
  end
356
356
  provider.provides :monitoring
357
357
  end
@@ -448,8 +448,8 @@ module AWS
448
448
  # Enables or disables monitoring for this instance.
449
449
  # @param [Boolean] state A true or false value. Enables monintoring
450
450
  # for a true value, disables it for a false value.
451
- def monitoring_enabled= value
452
- value ? enable_monitoring : disable_monitoring
451
+ def monitoring_enabled= state
452
+ state ? enable_monitoring : disable_monitoring
453
453
  end
454
454
 
455
455
  # @return [Booelan] Returns +true+ if CloudWatch monitoring is
@@ -656,8 +656,9 @@ module AWS
656
656
  protected
657
657
  def attributes_from_response_object(obj)
658
658
  if atts = super(obj)
659
- atts[:status] = obj.instance_state.name.tr("-","_").to_sym if
660
- obj.respond_to?(:instance_state)
659
+ if obj[:instance_state]
660
+ atts[:status] = obj[:instance_state].name.tr("-","_").to_sym
661
+ end
661
662
  atts
662
663
  end
663
664
  end
@@ -261,8 +261,8 @@ module AWS
261
261
  # @yield [Instance] Yields each instance in the collection.
262
262
  def each(&block)
263
263
  response = filtered_request(:describe_instances)
264
- response.reservation_set.each do |r|
265
- r.instances_set.each do |i|
264
+ response.reservation_set.each do |reservation|
265
+ reservation.instances_set.each do |i|
266
266
  yield(Instance.new(i.instance_id, :config => config))
267
267
  end
268
268
  end
@@ -85,9 +85,9 @@ module AWS
85
85
  response = client.send(client_method, options)
86
86
 
87
87
  options = {}
88
- options[:fingerprint] = response.key_fingerprint
89
- if response.respond_to?(:key_material)
90
- options[:private_key] = response.key_material
88
+ options[:fingerprint] = response.data[:key_fingerprint]
89
+ if response[:key_material]
90
+ options[:private_key] = response.data[:key_material]
91
91
  end
92
92
 
93
93
  KeyPair.new(response.key_name, options)
@@ -21,7 +21,7 @@ module AWS
21
21
  #
22
22
  # @attr_reader [String] vpc_id
23
23
  #
24
- # @attr_reader [Boolean] default? Returns true if this is the default
24
+ # @attr_reader [Boolean] default Returns true if this is the default
25
25
  # network ACL.
26
26
  #
27
27
  class NetworkACL < Resource
@@ -40,7 +40,9 @@ module AWS
40
40
 
41
41
  attribute :vpc_id, :static => true
42
42
 
43
- attribute :default?, :static => true
43
+ attribute :default, :static => true
44
+
45
+ alias_method :default?, :default
44
46
 
45
47
  attribute :entry_set
46
48
 
@@ -20,18 +20,18 @@ module AWS
20
20
 
21
21
  def initialize network_acl, details
22
22
  @network_acl = network_acl
23
- @rule_number = details.rule_number
24
- @protocol = details.protocol.to_i
25
- @action = details.rule_action.to_sym
26
- @egress = details.egress?
23
+ @rule_number = details[:rule_number]
24
+ @protocol = details[:protocol].to_i
25
+ @action = details[:rule_action].to_sym
26
+ @egress = details[:egress]
27
27
  @ingress = !@egress
28
- @cidr_block = details.cidr_block
29
- if details.respond_to?(:icmp_type_code)
30
- @icmp_type = details.icmp_type_code.type
31
- @icmp_code = details.icmp_type_code.code
28
+ @cidr_block = details[:cidr_block]
29
+ if type_code = details[:icmp_type_code]
30
+ @icmp_type = type_code[:type]
31
+ @icmp_code = type_code[:code]
32
32
  end
33
- if details.respond_to?(:port_range)
34
- @port_range = (details.port_range.from..details.port_range.to)
33
+ if range = details[:port_range]
34
+ @port_range = (range[:from]..range[:to])
35
35
  end
36
36
  end
37
37
 
@@ -45,10 +45,9 @@ module AWS
45
45
 
46
46
  attribute :private_dns_name, :static => true
47
47
 
48
- mutable_attribute :source_dest_check?,
49
- :set_as => :source_dest_check
48
+ mutable_attribute :source_dest_check
50
49
 
51
- alias_method :source_dest_check, :source_dest_check?
50
+ alias_method :source_dest_check?, :source_dest_check
52
51
 
53
52
  attribute :attachment_details, :as => :attachment
54
53
 
@@ -20,15 +20,15 @@ module AWS
20
20
 
21
21
  def initialize network_interface, details
22
22
  @network_interface = network_interface
23
- @attachment_id = details.attachment_id
24
- @instance = Instance.new(details.instance_id,
25
- :owner_id => details.instance_owner_id,
23
+ @attachment_id = details[:attachment_id]
24
+ @instance = Instance.new(details[:instance_id],
25
+ :owner_id => details[:instance_owner_id],
26
26
  :config => network_interface.config)
27
- @instance_owner_id = details.instance_owner_id
28
- @device_index = details.device_index
29
- @status = details.status.to_sym
30
- @attach_time = details.attach_time
31
- @delete_on_termination = details.delete_on_termination?
27
+ @instance_owner_id = details[:instance_owner_id]
28
+ @device_index = details[:device_index]
29
+ @status = details[:status].to_sym
30
+ @attach_time = details[:attach_time]
31
+ @delete_on_termination = details[:delete_on_termination]
32
32
  end
33
33
 
34
34
  # @return [String] Returns the attachment id.
@@ -35,8 +35,8 @@ module AWS
35
35
  def each(&block)
36
36
  resp = client.send(describe_call, describe_params)
37
37
  resp.send(inflected_permissions_attribute).each do |permission|
38
- if permission.respond_to?(:user_id)
39
- user_id = permission.user_id
38
+ if permission[:user_id]
39
+ user_id = permission[:user_id]
40
40
  yield(user_id)
41
41
  end
42
42
  end
@@ -57,7 +57,7 @@ module AWS
57
57
  def public?
58
58
  resp = client.send(describe_call, describe_params)
59
59
  resp.send(inflected_permissions_attribute).any? do |permission|
60
- permission.respond_to?(:group) and permission.group == "all"
60
+ permission[:group] and permission[:group] == "all"
61
61
  end
62
62
  end
63
63
 
@@ -16,9 +16,7 @@ module AWS
16
16
 
17
17
  # @private
18
18
  class Request < Core::Http::Request
19
- include Core::AuthorizeV2
20
- include Core::AuthorizeWithSessionToken
19
+ include Core::Signature::Version2
21
20
  end
22
-
23
21
  end
24
22
  end
@@ -57,9 +57,8 @@ module AWS
57
57
  @tags.to_a.empty?
58
58
  end
59
59
 
60
+ # @param [String or Symbol] key The key of the tag to check.
60
61
  # @return [Boolean] True if the resource has a tag for the given key.
61
- #
62
- # @param [String or Symbol] The key of the tag to check.
63
62
  def has_key?(key)
64
63
  if cached = cached_tags
65
64
  return cached.has_key?(key.to_s)
@@ -70,9 +69,8 @@ module AWS
70
69
  alias_method :include?, :has_key?
71
70
  alias_method :member?, :has_key?
72
71
 
72
+ # @param [String or Symbol] value The value to check.
73
73
  # @return [Boolean] True if the resource has a tag with the given value.
74
- #
75
- # @param [String or Symbol] The value to check.
76
74
  def has_value?(value)
77
75
  if cached = cached_tags
78
76
  return cached.values.include?(value)
@@ -82,10 +80,8 @@ module AWS
82
80
  alias_method :value?, :has_value?
83
81
 
84
82
  # Changes the value of a tag.
85
- #
86
- # @param [String or Symbol] The key of the tag to set.
87
- #
88
- # @param [String] The new value. If this is nil, the tag will
83
+ # @param [String or Symbol] key The key of the tag to set.
84
+ # @param [String] value The new value. If this is nil, the tag will
89
85
  # be deleted.
90
86
  def []=(key, value)
91
87
  if value
@@ -107,8 +107,9 @@ module AWS
107
107
  # {RouteTable::Association} objects (association to subnets).
108
108
  def associations
109
109
  association_set.collect do |details|
110
- subnet_id = details.respond_to?(:subnet_id) ? details.subnet_id : nil
111
- Association.new(self, details.route_table_association_id, subnet_id)
110
+ Association.new(self,
111
+ details[:route_table_association_id],
112
+ details[:subnet_id])
112
113
  end
113
114
  end
114
115
 
@@ -32,22 +32,22 @@ module AWS
32
32
 
33
33
  @destination_cidr_block = details.destination_cidr_block
34
34
 
35
- if details.respond_to?(:gateway_id)
35
+ if details[:gateway_id]
36
36
  @internet_gateway = InternetGateway.new(
37
- details.gateway_id,
37
+ details[:gateway_id],
38
38
  :config => route_table.config)
39
39
  end
40
40
 
41
- if details.respond_to?(:instance_id)
42
- @instance = Instance.new(details.instance_id,
41
+ if details[:instance_id]
42
+ @instance = Instance.new(details[:instance_id],
43
43
  :vpc_id => route_table.vpc_id,
44
- :owner_id => details.instance_owner_id,
44
+ :owner_id => details[:instance_owner_id],
45
45
  :config => route_table.config)
46
46
  end
47
47
 
48
- if details.respond_to?(:network_interface_id)
48
+ if details[:network_interface_id]
49
49
  @network_interface = NetworkInterface.new(
50
- details.network_interface_id,
50
+ details[:network_interface_id],
51
51
  :vpc_id => route_table.vpc_id,
52
52
  :config => route_table.config)
53
53
  end
@@ -114,7 +114,7 @@ module AWS
114
114
  # # only allow ping from a particular address
115
115
  # security_group.allow_ping('123.123.123.123/0')
116
116
  #
117
- # @param [String] ip_ranges One or more IP ranges to allow ping from.
117
+ # @param [String] sources One or more IP ranges to allow ping from.
118
118
  # Defaults to 0.0.0.0/0
119
119
  #
120
120
  # @return [nil]
@@ -127,7 +127,7 @@ module AWS
127
127
  # Removes ingress rules for ICMP pings. Defaults to 0.0.0.0/0 for
128
128
  # the list of IP ranges to revoke.
129
129
  #
130
- # @param [String] ip_ranges One or more IP ranges to allow ping from.
130
+ # @param [String] sources One or more IP ranges to disallow ping from.
131
131
  # Defaults to 0.0.0.0/0
132
132
  #
133
133
  # @return [nil]
@@ -14,14 +14,25 @@
14
14
  module AWS
15
15
  class EC2
16
16
  class SecurityGroup < Resource
17
- class EgressIpPermissionCollection < IpPermissionCollection
17
+ class EgressIpPermissionCollection
18
+
19
+ include Core::Model
20
+ include Enumerable
21
+
22
+ def initialize security_group, options = {}
23
+ @security_group = security_group
24
+ super
25
+ end
26
+
27
+ # @return [SecurityGroup]
28
+ attr_reader :security_group
18
29
 
19
30
  def each
20
31
  security_group.ip_permissions_list_egress.each do |p|
21
32
 
22
33
  # egress permissions don't always have ports
23
- if p.respond_to?(:from_port)
24
- ports = [p.from_port, p.to_port]
34
+ if p[:from_port]
35
+ ports = [p[:from_port], p[:to_port]]
25
36
  else
26
37
  ports = nil
27
38
  end
@@ -29,8 +40,8 @@ module AWS
29
40
  ip_ranges = p.ip_ranges.collect{|ip| ip.cidr_ip }
30
41
 
31
42
  groups = p.groups.collect do |group|
32
- SecurityGroup.new(group.group_id,
33
- :owner_id => group.user_id,
43
+ SecurityGroup.new(group[:group_id],
44
+ :owner_id => group[:user_id],
34
45
  :vpc_id => security_group.vpc_id,
35
46
  :config => config)
36
47
  end
@@ -20,17 +20,18 @@ module AWS
20
20
  include Core::Model
21
21
  include Enumerable
22
22
 
23
- attr_reader :security_group
24
-
25
23
  def initialize security_group, options = {}
26
24
  @security_group = security_group
27
25
  super
28
26
  end
29
27
 
28
+ # @return [SecurityGroup]
29
+ attr_reader :security_group
30
+
30
31
  def each
31
32
  security_group.ip_permissions_list.each do |p|
32
33
 
33
- ports = p.respond_to?(:from_port) ? [p.from_port, p.to_port] : nil
34
+ ports = p[:from_port] ? [p[:from_port], p[:to_port]] : nil
34
35
 
35
36
  ip_ranges = p.ip_ranges.collect{|ip| ip.cidr_ip }
36
37
 
@@ -20,8 +20,7 @@ module AWS
20
20
 
21
21
  # @param protocol [:tcp, :udp, :icmp]
22
22
  #
23
- # @param port [Range,Integer] An integer or a range of integers
24
- # to open ports for.
23
+ # @param [Integer,Range<Integer>] ports A port or port range to allow.
25
24
  #
26
25
  # @param [Hash] options
27
26
  #
@@ -94,14 +94,17 @@ module AWS
94
94
  # @param [Hash] opts Options for creating the snapshot.
95
95
  # Either +:volume+ or +:volume_id+ is required.
96
96
  #
97
- # @param opts [Volume] :volume The Amazon EBS volume of which
97
+ # @option opts [Volume] :volume The Amazon EBS volume of which
98
98
  # to take a snapshot.
99
99
  #
100
- # @param opts [String] :volume_id The ID of the Amazon EBS
100
+ # @option opts [String] :volume_id The ID of the Amazon EBS
101
101
  # volume of which to take a snapshot.
102
102
  #
103
- # @param opts [String] :description An optional description of
103
+ # @option opts [String] :description An optional description of
104
104
  # the snapshot. May contain up to 255 characters.
105
+ #
106
+ # @return [Snapshot]
107
+ #
105
108
  def create opts = {}
106
109
  if volume = opts.delete(:volume)
107
110
  opts[:volume_id] = volume.id
@@ -92,7 +92,7 @@ module AWS
92
92
  # route table associated with this subnet, that association
93
93
  # is replaced.
94
94
  #
95
- # @param [RouteTable,String] route_Table A {RouteTable} object or
95
+ # @param [RouteTable,String] route_table A {RouteTable} object or
96
96
  # a route table id string.
97
97
  #
98
98
  # @return [RouteTable::Association]
@@ -66,9 +66,7 @@ module AWS
66
66
 
67
67
  attribute :snapshot_id, :static => true
68
68
 
69
- attribute :size, :static => true do
70
- translates_output {|value| value.to_i if value }
71
- end
69
+ attribute :size, :static => true
72
70
 
73
71
  attribute :availability_zone_name, :as => :availability_zone,
74
72
  :static => true
@@ -74,7 +74,9 @@ module AWS
74
74
  # The Availability Zone in which to create the new volume.
75
75
  # To get a list of the availability zones you can use, see
76
76
  # {EC2#availability_zones}.
77
+ #
77
78
  # @return [Volume]
79
+ #
78
80
  def create options = {}
79
81
  if snapshot = options.delete(:snapshot)
80
82
  options[:snapshot_id] = snapshot.id