brightbox-cli 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. data/README +13 -17
  2. data/README.rdoc +13 -17
  3. data/brightbox-cli.gemspec +1 -1
  4. data/lib/brightbox-cli/accounts.rb +7 -0
  5. data/lib/brightbox-cli/api.rb +3 -0
  6. data/lib/brightbox-cli/commands/config-client-list.rb +1 -1
  7. data/lib/brightbox-cli/commands/firewall-rules-create.rb +4 -0
  8. data/lib/brightbox-cli/commands/firewall-rules-update.rb +49 -0
  9. data/lib/brightbox-cli/commands/groups-show.rb +1 -1
  10. data/lib/brightbox-cli/commands/groups-update.rb +3 -1
  11. data/lib/brightbox-cli/commands/images-destroy.rb +1 -1
  12. data/lib/brightbox-cli/commands/images-list.rb +9 -3
  13. data/lib/brightbox-cli/commands/images-register.rb +1 -1
  14. data/lib/brightbox-cli/commands/images-update.rb +3 -1
  15. data/lib/brightbox-cli/commands/lbs-update.rb +4 -2
  16. data/lib/brightbox-cli/commands/{servers-activate-cloud.rb → servers-activate-console.rb} +2 -1
  17. data/lib/brightbox-cli/commands/servers-update.rb +2 -1
  18. data/lib/brightbox-cli/config.rb +17 -2
  19. data/lib/brightbox-cli/detailed_server.rb +1 -1
  20. data/lib/brightbox-cli/firewall_rule.rb +6 -0
  21. data/lib/brightbox-cli/gli_global_hooks.rb +8 -1
  22. data/lib/brightbox-cli/images.rb +22 -1
  23. data/lib/brightbox-cli/nilable_hash.rb +7 -0
  24. data/lib/brightbox-cli/server_groups.rb +0 -6
  25. data/lib/brightbox-cli/servers.rb +6 -2
  26. data/lib/brightbox-cli/tables.rb +13 -0
  27. data/lib/brightbox-cli/vendor/fog/README.rdoc +2 -9
  28. data/lib/brightbox-cli/vendor/fog/Rakefile +3 -2
  29. data/lib/brightbox-cli/vendor/fog/changelog.txt +213 -0
  30. data/lib/brightbox-cli/vendor/fog/docs/_layouts/default.html +1 -1
  31. data/lib/brightbox-cli/vendor/fog/docs/about/contributing.markdown +1 -1
  32. data/lib/brightbox-cli/vendor/fog/docs/about/getting_started.markdown +28 -3
  33. data/lib/brightbox-cli/vendor/fog/docs/dns/index.markdown +1 -1
  34. data/lib/brightbox-cli/vendor/fog/docs/index.markdown +2 -10
  35. data/lib/brightbox-cli/vendor/fog/docs/storage/index.markdown +2 -2
  36. data/lib/brightbox-cli/vendor/fog/fog.gemspec +6 -5
  37. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/auto_scaling.rb +3 -1
  38. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_formation.rb +3 -0
  39. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_watch.rb +3 -1
  40. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/compute.rb +5 -3
  41. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/elb.rb +4 -2
  42. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/emr.rb +133 -0
  43. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/addresses.rb +1 -1
  44. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/key_pairs.rb +1 -1
  45. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/security_groups.rb +1 -1
  46. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/server.rb +4 -2
  47. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/servers.rb +1 -1
  48. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/snapshots.rb +1 -1
  49. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/spot_request.rb +21 -4
  50. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/spot_requests.rb +45 -1
  51. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/volumes.rb +1 -1
  52. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elb/load_balancer.rb +2 -0
  53. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/storage/file.rb +1 -1
  54. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cdn/get_invalidation_list.rb +0 -1
  55. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_formation/update_stack.rb +19 -0
  56. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/add_instance_groups.rb +28 -0
  57. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/add_job_flow_steps.rb +17 -0
  58. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/describe_job_flows.rb +140 -0
  59. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/modify_instance_groups.rb +17 -0
  60. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/run_job_flow.rb +19 -0
  61. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/set_termination_protection.rb +17 -0
  62. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/terminate_job_flows.rb +17 -0
  63. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/rds.rb +3 -1
  64. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_formation/create_stack.rb +6 -0
  65. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_formation/update_stack.rb +62 -0
  66. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +141 -36
  67. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/delete_security_group.rb +25 -0
  68. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/delete_tags.rb +1 -1
  69. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_addresses.rb +2 -2
  70. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_availability_zones.rb +5 -2
  71. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_images.rb +1 -1
  72. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_instances.rb +15 -6
  73. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_key_pairs.rb +2 -2
  74. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_regions.rb +2 -2
  75. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_reserved_instances.rb +1 -1
  76. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -2
  77. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_snapshots.rb +4 -4
  78. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_volumes.rb +2 -2
  79. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/modify_instance_attribute.rb +1 -1
  80. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +41 -29
  81. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/describe_load_balancers.rb +3 -3
  82. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +1 -1
  83. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/add_instance_groups.rb +46 -0
  84. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/add_job_flow_steps.rb +49 -0
  85. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/describe_job_flows.rb +108 -0
  86. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/modify_instance_groups.rb +40 -0
  87. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/run_job_flow.rb +106 -0
  88. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/set_termination_protection.rb +39 -0
  89. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/terminate_job_flows.rb +37 -0
  90. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/simpledb/get_attributes.rb +2 -2
  91. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/simpledb/select.rb +1 -1
  92. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/acl_utils.rb +62 -0
  93. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_bucket_acl.rb +7 -1
  94. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_acl.rb +7 -1
  95. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_url.rb +2 -2
  96. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_bucket_acl.rb +2 -2
  97. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_object_acl.rb +1 -1
  98. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/ses.rb +1 -1
  99. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/simpledb.rb +2 -0
  100. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sns.rb +3 -1
  101. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sqs.rb +4 -2
  102. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/storage.rb +10 -2
  103. data/lib/brightbox-cli/vendor/fog/lib/fog/aws.rb +26 -1
  104. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/aws.rb +8 -4
  105. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/bluebox.rb +2 -2
  106. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/brightbox.rb +1 -1
  107. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/dnsimple.rb +1 -1
  108. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/dnsmadeeasy.rb +1 -1
  109. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/ecloud.rb +1 -1
  110. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/glesys.rb +1 -1
  111. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/go_grid.rb +1 -1
  112. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/google.rb +1 -1
  113. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/libvirt.rb +1 -1
  114. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/linode.rb +2 -2
  115. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/local.rb +1 -1
  116. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/new_servers.rb +1 -1
  117. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/ninefold.rb +2 -2
  118. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/openstack.rb +1 -1
  119. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/rackspace.rb +3 -3
  120. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb +1 -1
  121. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/stormondemand.rb +1 -1
  122. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/virtual_box.rb +1 -1
  123. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/vmfusion.rb +1 -1
  124. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/voxel.rb +1 -1
  125. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/zerigo.rb +1 -1
  126. data/lib/brightbox-cli/vendor/fog/lib/fog/bin.rb +1 -1
  127. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/compute.rb +2 -0
  128. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/cloud_ip.rb +10 -2
  129. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server.rb +11 -3
  130. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server_group.rb +9 -0
  131. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +13 -0
  132. data/lib/brightbox-cli/vendor/fog/lib/fog/core/connection.rb +1 -1
  133. data/lib/brightbox-cli/vendor/fog/lib/fog/core/credentials.rb +3 -3
  134. data/lib/brightbox-cli/vendor/fog/lib/fog/core/deprecation.rb +2 -2
  135. data/lib/brightbox-cli/vendor/fog/lib/fog/core/logger.rb +8 -3
  136. data/lib/brightbox-cli/vendor/fog/lib/fog/core/mock.rb +4 -0
  137. data/lib/brightbox-cli/vendor/fog/lib/fog/core/provider.rb +7 -2
  138. data/lib/brightbox-cli/vendor/fog/lib/fog/core/service.rb +8 -2
  139. data/lib/brightbox-cli/vendor/fog/lib/fog/dnsmadeeasy/models/dns/record.rb +3 -2
  140. data/lib/brightbox-cli/vendor/fog/lib/fog/dynect/dns.rb +25 -3
  141. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/compute.rb +1 -1
  142. data/lib/brightbox-cli/vendor/fog/lib/fog/go_grid/requests/compute/grid_server_power.rb +1 -1
  143. data/lib/brightbox-cli/vendor/fog/lib/fog/google/models/storage/file.rb +1 -1
  144. data/lib/brightbox-cli/vendor/fog/lib/fog/google/requests/storage/get_object_url.rb +2 -2
  145. data/lib/brightbox-cli/vendor/fog/lib/fog/google/storage.rb +1 -1
  146. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/models/storage/file.rb +8 -6
  147. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/models/storage/files.rb +3 -2
  148. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/requests/storage/head_namespace.rb +20 -0
  149. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/storage.rb +4 -2
  150. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/server.rb +7 -1
  151. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/create_server.rb +6 -11
  152. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/load_balancers.rb +1 -0
  153. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/callback.rb +1 -1
  154. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/record.rb +1 -1
  155. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/zone.rb +1 -1
  156. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/dns.rb +1 -0
  157. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/record.rb +7 -3
  158. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/zone.rb +1 -1
  159. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/create_record.rb +8 -2
  160. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/get_record.rb +17 -5
  161. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/get_records.rb +10 -2
  162. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/get_record.rb +1 -1
  163. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/get_records.rb +7 -8
  164. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/update_record.rb +43 -0
  165. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/balancers.rb +1 -1
  166. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/configs.rb +1 -1
  167. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/images.rb +1 -1
  168. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/servers.rb +1 -1
  169. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/templates.rb +1 -1
  170. data/lib/brightbox-cli/vendor/fog/lib/fog/terremark/vcloud.rb +1 -1
  171. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/compute.rb +41 -23
  172. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/models/compute/server.rb +19 -0
  173. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/models/compute/servers.rb +8 -2
  174. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/datacenters.rb +34 -0
  175. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +83 -10
  176. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/vm_clone.rb +76 -37
  177. data/lib/brightbox-cli/vendor/fog/lib/fog.rb +1 -1
  178. data/lib/brightbox-cli/vendor/fog/tests/aws/models/cloud_watch/alarm_data_tests.rb +8 -6
  179. data/lib/brightbox-cli/vendor/fog/tests/aws/models/cloud_watch/alarm_history_tests.rb +3 -1
  180. data/lib/brightbox-cli/vendor/fog/tests/aws/models/compute/security_group_tests.rb +15 -10
  181. data/lib/brightbox-cli/vendor/fog/tests/aws/models/elb/model_tests.rb +4 -4
  182. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/cloud_formation/stack_tests.rb +14 -0
  183. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/instance_tests.rb +16 -1
  184. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/security_group_tests.rb +251 -32
  185. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/tag_tests.rb +2 -2
  186. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/helper.rb +172 -0
  187. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/instance_group_tests.rb +106 -0
  188. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/job_flow_tests.rb +88 -0
  189. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/acl_utils_tests.rb +209 -0
  190. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/bucket_tests.rb +80 -55
  191. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/object_tests.rb +42 -24
  192. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/account_tests.rb +11 -6
  193. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/api_client_tests.rb +23 -12
  194. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/cloud_ip_tests.rb +29 -20
  195. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/helper.rb +70 -14
  196. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/image_tests.rb +17 -14
  197. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/interface_tests.rb +3 -2
  198. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/load_balancer_tests.rb +57 -11
  199. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_group_tests.rb +29 -22
  200. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_tests.rb +38 -21
  201. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_type_tests.rb +7 -6
  202. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/user_tests.rb +11 -16
  203. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/zone_tests.rb +7 -6
  204. data/lib/brightbox-cli/vendor/fog/tests/compute/helper.rb +1 -1
  205. data/lib/brightbox-cli/vendor/fog/tests/core/credential_tests.rb +2 -2
  206. data/lib/brightbox-cli/vendor/fog/tests/core/mocking_tests.rb +60 -0
  207. data/lib/brightbox-cli/vendor/fog/tests/dns/models/record_tests.rb +4 -2
  208. data/lib/brightbox-cli/vendor/fog/tests/dns/models/records_tests.rb +4 -2
  209. data/lib/brightbox-cli/vendor/fog/tests/dns/models/zone_tests.rb +3 -1
  210. data/lib/brightbox-cli/vendor/fog/tests/dns/models/zones_tests.rb +4 -2
  211. data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/helper.rb +4 -2
  212. data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/server_tests.rb +1 -1
  213. data/lib/brightbox-cli/vendor/fog/tests/helper.rb +4 -0
  214. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/dns_tests.rb +16 -12
  215. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/records_tests.rb +13 -11
  216. data/lib/brightbox-cli/vendor/fog/tests/slicehost/requests/dns/dns_tests.rb +58 -11
  217. data/lib/brightbox-cli/vendor/fog/tests/vsphere/compute_tests.rb +18 -10
  218. data/lib/brightbox-cli/vendor/fog/tests/vsphere/requests/compute/vm_clone_tests.rb +3 -7
  219. data/lib/brightbox-cli/version.rb +1 -1
  220. data/lib/brightbox_cli.rb +1 -0
  221. data/spec/fixtures/vcr_cassettes/list_server_groups.yml +37 -6
  222. data/spec/nilable_hash_spec.rb +30 -0
  223. metadata +48 -18
  224. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/hash_to_acl.rb +0 -44
@@ -44,7 +44,7 @@ module Fog
44
44
  response = Excon::Response.new
45
45
  response.status = 200
46
46
 
47
- load_balancer['Instances'] = instances.dup
47
+ load_balancer['Instances'] = load_balancer['Instances'] | instances.dup
48
48
 
49
49
  response.body = {
50
50
  'ResponseMetadata' => {
@@ -0,0 +1,46 @@
1
+ module Fog
2
+ module AWS
3
+ class EMR
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/emr/add_instance_groups'
7
+
8
+ # adds an instance group to a running cluster
9
+ # http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_AddInstanceGroups.html
10
+ # ==== Parameters
11
+ # * JobFlowId <~String> - Job flow in which to add the instance groups
12
+ # * InstanceGroups<~Array> - Instance Groups to add
13
+ # * 'BidPrice'<~String> - Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.
14
+ # * 'InstanceCount'<~Integer> - Target number of instances for the instance group
15
+ # * 'InstanceRole'<~String> - MASTER | CORE | TASK The role of the instance group in the cluster
16
+ # * 'InstanceType'<~String> - The Amazon EC2 instance type for all instances in the instance group
17
+ # * 'MarketType'<~String> - ON_DEMAND | SPOT Market type of the Amazon EC2 instances used to create a cluster node
18
+ # * 'Name'<~String> - Friendly name given to the instance group.
19
+ #
20
+ # ==== Returns
21
+ # * response<~Excon::Response>:
22
+ # * body<~Hash>:
23
+ def add_instance_groups(job_flow_id, options={})
24
+
25
+ if instance_groups = options.delete('InstanceGroups')
26
+ options.merge!(Fog::AWS.indexed_param('InstanceGroups.member.%d', [*instance_groups]))
27
+ end
28
+
29
+ request({
30
+ 'Action' => 'AddInstanceGroups',
31
+ 'JobFlowId' => job_flow_id,
32
+ :parser => Fog::Parsers::AWS::EMR::AddInstanceGroups.new,
33
+ }.merge(options))
34
+ end
35
+
36
+ end
37
+
38
+ class Mock
39
+ def add_instance_groups(job_flow_id, options={})
40
+ Fog::Mock.not_implemented
41
+ end
42
+
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,49 @@
1
+ module Fog
2
+ module AWS
3
+ class EMR
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/emr/add_job_flow_steps'
7
+
8
+ # adds new steps to a running job flow.
9
+ # http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_AddJobFlowSteps.html
10
+ # ==== Parameters
11
+ # * JobFlowId <~String> - A string that uniquely identifies the job flow
12
+ # * Steps <~Array> - A list of steps to be executed by the job flow
13
+ # * 'ActionOnFailure'<~String> - TERMINATE_JOB_FLOW | CANCEL_AND_WAIT | CONTINUE Specifies the action to take if the job flow step fails
14
+ # * 'HadoopJarStep'<~Array> - Specifies the JAR file used for the job flow step
15
+ # * 'Args'<~String list> - A list of command line arguments passed to the JAR file's main function when executed.
16
+ # * 'Jar'<~String> - A path to a JAR file run during the step.
17
+ # * 'MainClass'<~String> - The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file
18
+ # * 'Properties'<~Array> - A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function
19
+ # * 'Key'<~String> - The unique identifier of a key value pair
20
+ # * 'Value'<~String> - The value part of the identified key
21
+ # * 'Name'<~String> - The name of the job flow step
22
+ #
23
+ # ==== Returns
24
+ # * response<~Excon::Response>:
25
+ # * body<~Hash>:
26
+ def add_job_flow_steps(job_flow_id, options={})
27
+
28
+ if steps = options.delete('Steps')
29
+ options.merge!(Fog::AWS.serialize_keys('Steps', steps))
30
+ end
31
+
32
+ request({
33
+ 'Action' => 'AddJobFlowSteps',
34
+ 'JobFlowId' => job_flow_id,
35
+ :parser => Fog::Parsers::AWS::EMR::AddJobFlowSteps.new,
36
+ }.merge(options))
37
+ end
38
+ end
39
+
40
+ class Mock
41
+
42
+ def add_job_flow_steps(db_name, options={})
43
+ Fog::Mock.not_implemented
44
+ end
45
+
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,108 @@
1
+ module Fog
2
+ module AWS
3
+ class EMR
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/emr/describe_job_flows'
7
+
8
+ # returns a list of job flows that match all of the supplied parameters.
9
+ # http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_DescribeJobFlows.html
10
+ # ==== Parameters
11
+ # * CreatedAfter <~DateTime> - Return only job flows created after this date and time
12
+ # * CreatedBefore <~DateTime> - Return only job flows created before this date and time
13
+ # * JobFlowIds <~String list> - Return only job flows whose job flow ID is contained in this list
14
+ # * JobFlowStates <~String list> - RUNNING | WAITING | SHUTTING_DOWN | STARTING Return only job flows whose state is contained in this list
15
+ #
16
+ # ==== Returns
17
+ # * response<~Excon::Response>:
18
+ # * body<~Hash>:
19
+ # * JobFlows <~Array> - A list of job flows matching the parameters supplied.
20
+ # * AmiVersion <~String> - A list of bootstrap actions that will be run before Hadoop is started on the cluster nodes.
21
+ # * 'BootstrapActions'<~Array> - A list of the bootstrap actions run by the job flow
22
+ # * 'BootstrapConfig <~Array> - A description of the bootstrap action
23
+ # * 'Name' <~String> - The name of the bootstrap action
24
+ # * 'ScriptBootstrapAction' <~Array> - The script run by the bootstrap action.
25
+ # * 'Args' <~String list> - A list of command line arguments to pass to the bootstrap action script.
26
+ # * 'Path' <~String> - Location of the script to run during a bootstrap action.
27
+ # * 'ExecutionStatusDetail'<~Array> - Describes the execution status of the job flow
28
+ # * 'CreationDateTime <~DateTime> - The creation date and time of the job flow.
29
+ # * 'EndDateTime <~DateTime> - The completion date and time of the job flow.
30
+ # * 'LastStateChangeReason <~String> - Description of the job flow last changed state.
31
+ # * 'ReadyDateTime <~DateTime> - The date and time when the job flow was ready to start running bootstrap actions.
32
+ # * 'StartDateTime <~DateTime> - The start date and time of the job flow.
33
+ # * 'State <~DateTime> - COMPLETED | FAILED | TERMINATED | RUNNING | SHUTTING_DOWN | STARTING | WAITING | BOOTSTRAPPING The state of the job flow.
34
+ # * Instances <~Array> - A specification of the number and type of Amazon EC2 instances on which to run the job flow.
35
+ # * 'Ec2KeyName'<~String> - Specifies the name of the Amazon EC2 key pair that can be used to ssh to the master node as the user called "hadoop.
36
+ # * 'HadoopVersion'<~String> - "0.18" | "0.20" Specifies the Hadoop version for the job flow
37
+ # * 'InstanceCount'<~Integer> - The number of Amazon EC2 instances used to execute the job flow
38
+ # * 'InstanceGroups'<~Array> - Configuration for the job flow's instance groups
39
+ # * 'BidPrice' <~String> - Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.
40
+ # * 'CreationDateTime' <~DateTime> - The date/time the instance group was created.
41
+ # * 'EndDateTime' <~DateTime> - The date/time the instance group was terminated.
42
+ # * 'InstanceGroupId' <~String> - Unique identifier for the instance group.
43
+ # * 'InstanceRequestCount'<~Integer> - Target number of instances for the instance group
44
+ # * 'InstanceRole'<~String> - MASTER | CORE | TASK The role of the instance group in the cluster
45
+ # * 'InstanceRunningCount'<~Integer> - Actual count of running instances
46
+ # * 'InstanceType'<~String> - The Amazon EC2 instance type for all instances in the instance group
47
+ # * 'LastStateChangeReason'<~String> - Details regarding the state of the instance group
48
+ # * 'Market'<~String> - ON_DEMAND | SPOT Market type of the Amazon EC2 instances used to create a cluster
49
+ # * 'Name'<~String> - Friendly name for the instance group
50
+ # * 'ReadyDateTime'<~DateTime> - The date/time the instance group was available to the cluster
51
+ # * 'StartDateTime'<~DateTime> - The date/time the instance group was started
52
+ # * 'State'<~String> - PROVISIONING | STARTING | BOOTSTRAPPING | RUNNING | RESIZING | ARRESTED | SHUTTING_DOWN | TERMINATED | FAILED | ENDED State of instance group
53
+ # * 'KeepJobFlowAliveWhenNoSteps' <~Boolean> - Specifies whether the job flow should terminate after completing all steps
54
+ # * 'MasterInstanceId'<~String> - The Amazon EC2 instance identifier of the master node
55
+ # * 'MasterInstanceType'<~String> - The EC2 instance type of the master node
56
+ # * 'MasterPublicDnsName'<~String> - The DNS name of the master node
57
+ # * 'NormalizedInstanceHours'<~Integer> - An approximation of the cost of the job flow, represented in m1.small/hours.
58
+ # * 'Placement'<~Array> - Specifies the Availability Zone the job flow will run in
59
+ # * 'AvailabilityZone' <~String> - The Amazon EC2 Availability Zone for the job flow.
60
+ # * 'SlaveInstanceType'<~String> - The EC2 instance type of the slave nodes
61
+ # * 'TerminationProtected'<~Boolean> - Specifies whether to lock the job flow to prevent the Amazon EC2 instances from being terminated by API call, user intervention, or in the event of a job flow error
62
+ # * LogUri <~String> - Specifies the location in Amazon S3 to write the log files of the job flow. If a value is not provided, logs are not created
63
+ # * Name <~String> - The name of the job flow
64
+ # * Steps <~Array> - A list of steps to be executed by the job flow
65
+ # * 'ExecutionStatusDetail'<~Array> - Describes the execution status of the job flow
66
+ # * 'CreationDateTime <~DateTime> - The creation date and time of the job flow.
67
+ # * 'EndDateTime <~DateTime> - The completion date and time of the job flow.
68
+ # * 'LastStateChangeReason <~String> - Description of the job flow last changed state.
69
+ # * 'ReadyDateTime <~DateTime> - The date and time when the job flow was ready to start running bootstrap actions.
70
+ # * 'StartDateTime <~DateTime> - The start date and time of the job flow.
71
+ # * 'State <~DateTime> - COMPLETED | FAILED | TERMINATED | RUNNING | SHUTTING_DOWN | STARTING | WAITING | BOOTSTRAPPING The state of the job flow.
72
+ # * StepConfig <~Array> - The step configuration
73
+ # * 'ActionOnFailure'<~String> - TERMINATE_JOB_FLOW | CANCEL_AND_WAIT | CONTINUE Specifies the action to take if the job flow step fails
74
+ # * 'HadoopJarStep'<~Array> - Specifies the JAR file used for the job flow step
75
+ # * 'Args'<~String list> - A list of command line arguments passed to the JAR file's main function when executed.
76
+ # * 'Jar'<~String> - A path to a JAR file run during the step.
77
+ # * 'MainClass'<~String> - The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file
78
+ # * 'Properties'<~Array> - A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function
79
+ # * 'Key'<~String> - The unique identifier of a key value pair
80
+ # * 'Value'<~String> - The value part of the identified key
81
+ # * 'Name'<~String> - The name of the job flow step
82
+ def describe_job_flows(options={})
83
+
84
+ if job_ids = options.delete('JobFlowIds')
85
+ options.merge!(Fog::AWS.serialize_keys('JobFlowIds', job_ids))
86
+ end
87
+
88
+ if job_states = options.delete('JobFlowStates')
89
+ options.merge!(Fog::AWS.serialize_keys('JobFlowStates', job_states))
90
+ end
91
+
92
+ request({
93
+ 'Action' => 'DescribeJobFlows',
94
+ :parser => Fog::Parsers::AWS::EMR::DescribeJobFlows.new,
95
+ }.merge(options))
96
+ end
97
+ end
98
+
99
+ class Mock
100
+
101
+ def describe_job_flows(db_name, options={})
102
+ Fog::Mock.not_implemented
103
+ end
104
+
105
+ end
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,40 @@
1
+ module Fog
2
+ module AWS
3
+ class EMR
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/emr/modify_instance_groups'
7
+
8
+ # modifies the number of nodes and configuration settings of an instance group..
9
+ # http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_ModifyInstanceGroups.html
10
+ # ==== Parameters
11
+ # * InstanceGroups <~InstanceGroupModifyConfig list> - Instance groups to change
12
+ # * InstanceCount <~Integer> - Target size for instance group
13
+ # * InstanceGroupId <~String> - Unique ID of the instance group to expand or shrink
14
+ #
15
+ # ==== Returns
16
+ # * response<~Excon::Response>:
17
+ # * body<~Hash>
18
+ def modify_instance_groups(options={})
19
+
20
+ if job_ids = options.delete('InstanceGroups')
21
+ options.merge!(Fog::AWS.serialize_keys('InstanceGroups', job_ids))
22
+ end
23
+
24
+ request({
25
+ 'Action' => 'ModifyInstanceGroups',
26
+ :parser => Fog::Parsers::AWS::EMR::ModifyInstanceGroups.new,
27
+ }.merge(options))
28
+ end
29
+ end
30
+
31
+ class Mock
32
+
33
+ def modify_instance_groups(options={})
34
+ Fog::Mock.not_implemented
35
+ end
36
+
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,106 @@
1
+ module Fog
2
+ module AWS
3
+ class EMR
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/emr/run_job_flow'
7
+
8
+ # creates and starts running a new job flow
9
+ # http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_RunJobFlow.html
10
+ # ==== Parameters
11
+ # * AdditionalInfo <~String> - A JSON string for selecting additional features.
12
+ # * BootstrapActions <~Array> - A list of bootstrap actions that will be run before Hadoop is started on the cluster nodes.
13
+ # * 'Name'<~String> - The name of the bootstrap action
14
+ # * 'ScriptBootstrapAction'<~Array> - The script run by the bootstrap action
15
+ # * 'Args' <~Array> - A list of command line arguments to pass to the bootstrap action script
16
+ # * 'Path' <~String> - Location of the script to run during a bootstrap action. Can be either a location in Amazon S3 or on a local file system.
17
+ # * Instances <~Array> - A specification of the number and type of Amazon EC2 instances on which to run the job flow.
18
+ # * 'Ec2KeyName'<~String> - Specifies the name of the Amazon EC2 key pair that can be used to ssh to the master node as the user called "hadoop.
19
+ # * 'HadoopVersion'<~String> - "0.18" | "0.20" Specifies the Hadoop version for the job flow
20
+ # * 'InstanceCount'<~Integer> - The number of Amazon EC2 instances used to execute the job flow
21
+ # * 'InstanceGroups'<~Array> - Configuration for the job flow's instance groups
22
+ # * 'BidPrice' <~String> - Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.
23
+ # * 'InstanceCount'<~Integer> - Target number of instances for the instance group
24
+ # * 'InstanceRole'<~String> - MASTER | CORE | TASK The role of the instance group in the cluster
25
+ # * 'InstanceType'<~String> - The Amazon EC2 instance type for all instances in the instance group
26
+ # * 'MarketType'<~String> - ON_DEMAND | SPOT Market type of the Amazon EC2 instances used to create a cluster node
27
+ # * 'Name'<~String> - Friendly name given to the instance group.
28
+ # * 'KeepJobFlowAliveWhenNoSteps' <~Boolean> - Specifies whether the job flow should terminate after completing all steps
29
+ # * 'MasterInstanceType'<~String> - The EC2 instance type of the master node
30
+ # * 'Placement'<~Array> - Specifies the Availability Zone the job flow will run in
31
+ # * 'AvailabilityZone' <~String> - The Amazon EC2 Availability Zone for the job flow.
32
+ # * 'SlaveInstanceType'<~String> - The EC2 instance type of the slave nodes
33
+ # * 'TerminationProtected'<~Boolean> - Specifies whether to lock the job flow to prevent the Amazon EC2 instances from being terminated by API call, user intervention, or in the event of a job flow error
34
+ # * LogUri <~String> - Specifies the location in Amazon S3 to write the log files of the job flow. If a value is not provided, logs are not created
35
+ # * Name <~String> - The name of the job flow
36
+ # * Steps <~Array> - A list of steps to be executed by the job flow
37
+ # * 'ActionOnFailure'<~String> - TERMINATE_JOB_FLOW | CANCEL_AND_WAIT | CONTINUE Specifies the action to take if the job flow step fails
38
+ # * 'HadoopJarStep'<~Array> - Specifies the JAR file used for the job flow step
39
+ # * 'Args'<~String list> - A list of command line arguments passed to the JAR file's main function when executed.
40
+ # * 'Jar'<~String> - A path to a JAR file run during the step.
41
+ # * 'MainClass'<~String> - The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file
42
+ # * 'Properties'<~Array> - A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function
43
+ # * 'Key'<~String> - The unique identifier of a key value pair
44
+ # * 'Value'<~String> - The value part of the identified key
45
+ # * 'Name'<~String> - The name of the job flow step
46
+ #
47
+ # ==== Returns
48
+ # * response<~Excon::Response>:
49
+ # * body<~Hash>:
50
+ def run_job_flow(name, options={})
51
+
52
+ if bootstrap_actions = options.delete('BootstrapActions')
53
+ options.merge!(Fog::AWS.serialize_keys('BootstrapActions', bootstrap_actions))
54
+ end
55
+
56
+ if instances = options.delete('Instances')
57
+ options.merge!(Fog::AWS.serialize_keys('Instances', instances))
58
+ end
59
+
60
+ if steps = options.delete('Steps')
61
+ options.merge!(Fog::AWS.serialize_keys('Steps', steps))
62
+ end
63
+
64
+ request({
65
+ 'Action' => 'RunJobFlow',
66
+ 'Name' => name,
67
+ :parser => Fog::Parsers::AWS::EMR::RunJobFlow.new,
68
+ }.merge(options))
69
+ end
70
+
71
+ def run_hive(name, options={})
72
+ steps = []
73
+ steps << {
74
+ 'Name' => 'Setup Hive',
75
+ 'HadoopJarStep' => {
76
+ 'Jar' => 's3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar',
77
+ 'Args' => ['s3://us-east-1.elasticmapreduce/libs/hive/hive-script', '--base-path', 's3://us-east-1.elasticmapreduce/libs/hive/', '--install-hive']},
78
+ 'ActionOnFailure' => 'TERMINATE_JOB_FLOW'
79
+ }
80
+ steps << {
81
+ 'Name' => 'Install Hive Site Configuration',
82
+ 'HadoopJarStep' => {
83
+ 'Jar' => 's3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar',
84
+ 'Args' => ['s3://us-east-1.elasticmapreduce/libs/hive/hive-script', '--base-path', 's3://us-east-1.elasticmapreduce/libs/hive/', '--install-hive-site', '--hive-site=s3://raybeam.okl/prod/hive/hive-site.xml']},
85
+ 'ActionOnFailure' => 'TERMINATE_JOB_FLOW'
86
+ }
87
+ options['Steps'] = steps
88
+
89
+ if not options['Instances'].nil?
90
+ options['Instances']['KeepJobFlowAliveWhenNoSteps'] = true
91
+ end
92
+
93
+ run_job_flow name, options
94
+ end
95
+ end
96
+
97
+ class Mock
98
+
99
+ def run_job_flow(db_name, options={})
100
+ Fog::Mock.not_implemented
101
+ end
102
+
103
+ end
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,39 @@
1
+ module Fog
2
+ module AWS
3
+ class EMR
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/emr/set_termination_protection'
7
+
8
+ # locks a job flow so the Amazon EC2 instances in the cluster cannot be terminated by user intervention.
9
+ # http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_SetTerminationProtection.html
10
+ # ==== Parameters
11
+ # * JobFlowIds <~String list> - list of strings that uniquely identify the job flows to protect
12
+ # * TerminationProtected <~Boolean> - indicates whether to protect the job flow
13
+ #
14
+ # ==== Returns
15
+ # * response<~Excon::Response>:
16
+ # * body<~Hash>
17
+ def set_termination_protection(is_protected, options={})
18
+
19
+ if job_ids = options.delete('JobFlowIds')
20
+ options.merge!(Fog::AWS.serialize_keys('JobFlowIds', job_ids))
21
+ end
22
+ request({
23
+ 'Action' => 'SetTerminationProtection',
24
+ 'TerminationProtected' => is_protected,
25
+ :parser => Fog::Parsers::AWS::EMR::SetTerminationProtection.new,
26
+ }.merge(options))
27
+ end
28
+ end
29
+
30
+ class Mock
31
+
32
+ def set_termination_protection(db_name, options={})
33
+ Fog::Mock.not_implemented
34
+ end
35
+
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,37 @@
1
+ module Fog
2
+ module AWS
3
+ class EMR
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/emr/terminate_job_flows'
7
+
8
+ # shuts a list of job flows down.
9
+ # http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_TerminateJobFlows.html
10
+ # ==== Parameters
11
+ # * JobFlowIds <~String list> - list of strings that uniquely identify the job flows to protect
12
+ #
13
+ # ==== Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>
16
+ def terminate_job_flows(options={})
17
+
18
+ if job_ids = options.delete('JobFlowIds')
19
+ options.merge!(Fog::AWS.serialize_keys('JobFlowIds', job_ids))
20
+ end
21
+ request({
22
+ 'Action' => 'TerminateJobFlows',
23
+ :parser => Fog::Parsers::AWS::EMR::TerminateJobFlows.new,
24
+ }.merge(options))
25
+ end
26
+ end
27
+
28
+ class Mock
29
+
30
+ def terminate_job_flows(db_name, options={})
31
+ Fog::Mock.not_implemented
32
+ end
33
+
34
+ end
35
+ end
36
+ end
37
+ end
@@ -29,7 +29,7 @@ module Fog
29
29
  # * 'RequestId'
30
30
  def get_attributes(domain_name, item_name, options = {})
31
31
  if options.is_a?(Array)
32
- Fog::Logger.warning("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
32
+ Fog::Logger.deprecation("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
33
33
  options = {'AttributeName' => options}
34
34
  end
35
35
  options['AttributeName'] ||= []
@@ -49,7 +49,7 @@ module Fog
49
49
 
50
50
  def get_attributes(domain_name, item_name, options = {})
51
51
  if options.is_a?(Array)
52
- Fog::Logger.warning("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
52
+ Fog::Logger.deprecation("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
53
53
  options['AttributeName'] ||= options if options.is_a?(Array)
54
54
  end
55
55
  options['AttributeName'] ||= []
@@ -23,7 +23,7 @@ module Fog
23
23
  # * 'NextToken'<~String> - offset to start with if there are are more domains to list
24
24
  def select(select_expression, options = {})
25
25
  if options.is_a?(String)
26
- Fog::Logger.warning("get_attributes with string next_token param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
26
+ Fog::Logger.deprecation("get_attributes with string next_token param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
27
27
  options = {'NextToken' => options}
28
28
  end
29
29
  options['NextToken'] ||= nil
@@ -0,0 +1,62 @@
1
+ module Fog
2
+ module Storage
3
+ class AWS
4
+
5
+ require 'fog/aws/parsers/storage/access_control_list'
6
+
7
+ private
8
+ def self.hash_to_acl(acl)
9
+ data = "<AccessControlPolicy>\n"
10
+
11
+ if acl['Owner'] && (acl['Owner']['ID'] || acl['Owner']['DisplayName'])
12
+ data << " <Owner>\n"
13
+ data << " <ID>#{acl['Owner']['ID']}</ID>\n" if acl['Owner']['ID']
14
+ data << " <DisplayName>#{acl['Owner']['DisplayName']}</DisplayName>\n" if acl['Owner']['DisplayName']
15
+ data << " </Owner>\n"
16
+ end
17
+
18
+ grants = [acl['AccessControlList']].flatten.compact
19
+
20
+ data << " <AccessControlList>\n" if grants.any?
21
+ grants.each do |grant|
22
+ data << " <Grant>\n"
23
+ grantee = grant['Grantee']
24
+ type = case
25
+ when grantee.has_key?('ID')
26
+ 'CanonicalUser'
27
+ when grantee.has_key?('EmailAddress')
28
+ 'AmazonCustomerByEmail'
29
+ when grantee.has_key?('URI')
30
+ 'Group'
31
+ end
32
+
33
+ data << " <Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"#{type}\">\n"
34
+ case type
35
+ when 'CanonicalUser'
36
+ data << " <ID>#{grantee['ID']}</ID>\n" if grantee['ID']
37
+ data << " <DisplayName>#{grantee['DisplayName']}</DisplayName>\n" if grantee['DisplayName']
38
+ when 'AmazonCustomerByEmail'
39
+ data << " <EmailAddress>#{grantee['EmailAddress']}</EmailAddress>\n" if grantee['EmailAddress']
40
+ when 'Group'
41
+ data << " <URI>#{grantee['URI']}</URI>\n" if grantee['URI']
42
+ end
43
+ data << " </Grantee>\n"
44
+ data << " <Permission>#{grant['Permission']}</Permission>\n"
45
+ data << " </Grant>\n"
46
+ end
47
+ data << " </AccessControlList>\n" if grants.any?
48
+
49
+ data << "</AccessControlPolicy>"
50
+
51
+ data
52
+ end
53
+
54
+ def self.acl_to_hash(acl_xml)
55
+ parser = Fog::Parsers::Storage::AWS::AccessControlList.new
56
+ Nokogiri::XML::SAX::Parser.new(parser).parse(acl_xml)
57
+ parser.response
58
+ end
59
+
60
+ end
61
+ end
62
+ end
@@ -48,11 +48,17 @@ module Fog
48
48
 
49
49
  class Mock # :nodoc:all
50
50
 
51
+ require 'fog/aws/requests/storage/acl_utils'
52
+
51
53
  def get_bucket_acl(bucket_name)
52
54
  response = Excon::Response.new
53
55
  if acl = self.data[:acls][:bucket][bucket_name]
54
56
  response.status = 200
55
- response.body = acl
57
+ if acl.is_a?(String)
58
+ response.body = Fog::Storage::AWS.acl_to_hash(acl)
59
+ else
60
+ response.body = acl
61
+ end
56
62
  else
57
63
  response.status = 404
58
64
  raise(Excon::Errors.status_error({:expects => 200}, response))
@@ -59,11 +59,17 @@ module Fog
59
59
 
60
60
  class Mock # :nodoc:all
61
61
 
62
+ require 'fog/aws/requests/storage/acl_utils'
63
+
62
64
  def get_object_acl(bucket_name, object_name, options = {})
63
65
  response = Excon::Response.new
64
66
  if acl = self.data[:acls][:object][bucket_name] && self.data[:acls][:object][bucket_name][object_name]
65
67
  response.status = 200
66
- response.body = acl
68
+ if acl.is_a?(String)
69
+ response.body = Fog::Storage::AWS.acl_to_hash(acl)
70
+ else
71
+ response.body = acl
72
+ end
67
73
  else
68
74
  response.status = 404
69
75
  raise(Excon::Errors.status_error({:expects => 200}, response))
@@ -18,7 +18,7 @@ module Fog
18
18
  # http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html
19
19
 
20
20
  def get_object_url(bucket_name, object_name, expires)
21
- Fog::Logger.warning("Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead [light_black](#{caller.first})[/]")
21
+ Fog::Logger.deprecation("Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead [light_black](#{caller.first})[/]")
22
22
  get_object_https_url(bucket_name, object_name, expires)
23
23
  end
24
24
 
@@ -27,7 +27,7 @@ module Fog
27
27
  class Mock # :nodoc:all
28
28
 
29
29
  def get_object_url(bucket_name, object_name, expires)
30
- Fog::Logger.warning("Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead [light_black](#{caller.first})[/]")
30
+ Fog::Logger.deprecation("Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead [light_black](#{caller.first})[/]")
31
31
  get_object_https_url(bucket_name, object_name, expires)
32
32
  end
33
33
 
@@ -3,8 +3,8 @@ module Fog
3
3
  class AWS
4
4
  class Real
5
5
 
6
- require 'fog/aws/requests/storage/hash_to_acl'
7
-
6
+ require 'fog/aws/requests/storage/acl_utils'
7
+
8
8
  # Change access control list for an S3 bucket
9
9
  #
10
10
  # ==== Parameters
@@ -3,7 +3,7 @@ module Fog
3
3
  class AWS
4
4
  class Real
5
5
 
6
- require 'fog/aws/requests/storage/hash_to_acl'
6
+ require 'fog/aws/requests/storage/acl_utils'
7
7
 
8
8
  # Change access control list for an S3 object
9
9
  #
@@ -40,7 +40,7 @@ module Fog
40
40
  #
41
41
  # ==== Parameters
42
42
  # * options<~Hash> - config arguments for connection. Defaults to {}.
43
- # * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1'i, 'ap-southeast-1']
43
+ # * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-southeast-1']
44
44
  #
45
45
  # ==== Returns
46
46
  # * SES object with connection to AWS.
@@ -86,6 +86,8 @@ module Fog
86
86
  'sdb.amazonaws.com'
87
87
  when 'us-west-1'
88
88
  'sdb.us-west-1.amazonaws.com'
89
+ when 'us-west-2'
90
+ 'sdb.us-west-2.amazonaws.com'
89
91
  else
90
92
  raise ArgumentError, "Unknown region: #{options[:region].inspect}"
91
93
  end