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
@@ -5,7 +5,7 @@ module Fog
5
5
  class SNS < Fog::Service
6
6
 
7
7
  requires :aws_access_key_id, :aws_secret_access_key
8
- recognizes :host, :path, :port, :scheme, :persistent
8
+ recognizes :host, :path, :port, :scheme, :persistent, :region
9
9
 
10
10
  request_path 'fog/aws/requests/sns'
11
11
  request :add_permission
@@ -65,6 +65,8 @@ module Fog
65
65
  'sns.us-east-1.amazonaws.com'
66
66
  when 'us-west-1'
67
67
  'sns.us-west-1.amazonaws.com'
68
+ when 'us-west-2'
69
+ 'sns.us-west-2.amazonaws.com'
68
70
  else
69
71
  raise ArgumentError, "Unknown region: #{options[:region].inspect}"
70
72
  end
@@ -40,7 +40,7 @@ module Fog
40
40
 
41
41
  @region = options[:region] || 'us-east-1'
42
42
 
43
- unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1'].include?(@region)
43
+ unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region)
44
44
  raise ArgumentError, "Unknown region: #{@region.inspect}"
45
45
  end
46
46
  end
@@ -71,7 +71,7 @@ module Fog
71
71
  #
72
72
  # ==== Parameters
73
73
  # * options<~Hash> - config arguments for connection. Defaults to {}.
74
- # * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'ap-southeast-1']
74
+ # * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-southeast-1']
75
75
  #
76
76
  # ==== Returns
77
77
  # * SQS object with connection to AWS.
@@ -90,6 +90,8 @@ module Fog
90
90
  'queue.amazonaws.com'
91
91
  when 'us-west-1'
92
92
  'us-west-1.queue.amazonaws.com'
93
+ when 'us-west-2'
94
+ 'us-west-2.queue.amazonaws.com'
93
95
  else
94
96
  raise ArgumentError, "Unknown region: #{options[:region].inspect}"
95
97
  end
@@ -76,7 +76,7 @@ module Fog
76
76
  end
77
77
 
78
78
  def url(params, expires)
79
- Fog::Logger.warning("Fog::Storage::AWS => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]")
79
+ Fog::Logger.deprecation("Fog::Storage::AWS => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]")
80
80
  https_url(params, expires)
81
81
  end
82
82
 
@@ -199,6 +199,8 @@ module Fog
199
199
  's3.amazonaws.com'
200
200
  when 'us-west-1'
201
201
  's3-us-west-1.amazonaws.com'
202
+ when 'us-west-2'
203
+ 's3-us-west-2.amazonaws.com'
202
204
  else
203
205
  raise ArgumentError, "Unknown region: #{options[:region].inspect}"
204
206
  end
@@ -251,7 +253,11 @@ module Fog
251
253
  if @endpoint = options[:endpoint]
252
254
  endpoint = URI.parse(@endpoint)
253
255
  @host = endpoint.host
254
- @path = endpoint.path
256
+ @path = if endpoint.path.empty?
257
+ '/'
258
+ else
259
+ endpoint.path
260
+ end
255
261
  @port = endpoint.port
256
262
  @scheme = endpoint.scheme
257
263
  else
@@ -267,6 +273,8 @@ module Fog
267
273
  's3.amazonaws.com'
268
274
  when 'us-west-1'
269
275
  's3-us-west-1.amazonaws.com'
276
+ when 'us-west-2'
277
+ 's3-us-west-2.amazonaws.com'
270
278
  else
271
279
  raise ArgumentError, "Unknown region: #{options[:region].inspect}"
272
280
  end
@@ -13,6 +13,7 @@ module Fog
13
13
  service(:dns, 'aws/dns', 'DNS')
14
14
  service(:elasticache, 'aws/elasticache', 'Elasticache')
15
15
  service(:elb, 'aws/elb', 'ELB')
16
+ service(:emr, 'aws/emr', 'EMR')
16
17
  service(:iam, 'aws/iam', 'IAM')
17
18
  service(:rds, 'aws/rds', 'RDS')
18
19
  service(:ses, 'aws/ses', 'SES')
@@ -27,10 +28,34 @@ module Fog
27
28
  key << '.%d'
28
29
  end
29
30
  [*values].each_with_index do |value, index|
30
- params[format(key, index + 1)] = value
31
+ if value.respond_to?('keys')
32
+ k = format(key, index + 1)
33
+ value.each do | vkey, vvalue |
34
+ params["#{k}.#{vkey}"] = vvalue
35
+ end
36
+ else
37
+ params[format(key, index + 1)] = value
38
+ end
31
39
  end
32
40
  params
33
41
  end
42
+
43
+ def self.serialize_keys(key, value, options = {})
44
+ case value
45
+ when Hash
46
+ value.each do | k, v |
47
+ options.merge!(serialize_keys("#{key}.#{k}", v))
48
+ end
49
+ return options
50
+ when Array
51
+ value.each_with_index do | it, idx |
52
+ options.merge!(serialize_keys("#{key}.member.#{(idx + 1)}", it))
53
+ end
54
+ return options
55
+ else
56
+ return {key => value}
57
+ end
58
+ end
34
59
 
35
60
  def self.indexed_filters(filters)
36
61
  params = {}
@@ -19,6 +19,8 @@ class AWS < Fog::Bin
19
19
  Fog::AWS::Elasticache
20
20
  when :elb
21
21
  Fog::AWS::ELB
22
+ when :emr
23
+ Fog::AWS::EMR
22
24
  when :iam
23
25
  Fog::AWS::IAM
24
26
  when :sdb, :simpledb
@@ -47,22 +49,24 @@ class AWS < Fog::Bin
47
49
  when :auto_scaling
48
50
  Fog::AWS::AutoScaling.new
49
51
  when :cdn
50
- Fog::Logger.warning("AWS[:cdn] is deprecated, use CDN[:aws] instead")
52
+ Fog::Logger.warning("AWS[:cdn] is not recommended, use CDN[:aws] for portability")
51
53
  Fog::CDN.new(:provider => 'AWS')
52
54
  when :cloud_formation
53
55
  Fog::AWS::CloudFormation.new
54
56
  when :cloud_watch
55
57
  Fog::AWS::CloudWatch.new
56
58
  when :compute
57
- Fog::Logger.warning("AWS[:compute] is deprecated, use Compute[:aws] instead")
59
+ Fog::Logger.warning("AWS[:compute] is not recommended, use Comptue[:aws] for portability")
58
60
  Fog::Compute.new(:provider => 'AWS')
59
61
  when :dns
60
- Fog::Logger.warning("AWS[:dns] is deprecated, use DNS[:aws] instead")
62
+ Fog::Logger.warning("AWS[:dns] is not recommended, use DNS[:aws] for portability")
61
63
  Fog::DNS.new(:provider => 'AWS')
62
64
  when :elasticache
63
65
  Fog::AWS::Elasticache.new
64
66
  when :elb
65
67
  Fog::AWS::ELB.new
68
+ when :emr
69
+ Fog::AWS::EMR.new
66
70
  when :iam
67
71
  Fog::AWS::IAM.new
68
72
  when :rds
@@ -76,7 +80,7 @@ class AWS < Fog::Bin
76
80
  when :sqs
77
81
  Fog::AWS::SQS.new
78
82
  when :storage
79
- Fog::Logger.warning("AWS[:storage] is deprecated, use Storage[:aws] instead")
83
+ Fog::Logger.warning("AWS[:storage] is not recommended, use Storage[:aws] for portability")
80
84
  Fog::Storage.new(:provider => 'AWS')
81
85
  when :sns
82
86
  Fog::AWS::SNS.new
@@ -16,10 +16,10 @@ class Bluebox < Fog::Bin
16
16
  @@connections ||= Hash.new do |hash, key|
17
17
  hash[key] = case key
18
18
  when :compute
19
- Fog::Logger.warning("Bluebox[:compute] is deprecated, use Compute[:bluebox] instead")
19
+ Fog::Logger.warning("Bluebox[:compute] is not recommended, use Compute[:bluebox] for portability")
20
20
  Fog::Compute.new(:provider => 'Bluebox')
21
21
  when :dns
22
- Fog::Logger.warning("Bluebox[:storage] is deprecated, use Storage[:bluebox] instead")
22
+ Fog::Logger.warning("Bluebox[:dns] is not recommended, use DNS[:bluebox] for portability")
23
23
  Fog::DNS.new(:provider => 'Bluebox')
24
24
  else
25
25
  raise ArgumentError, "Unrecognized service: #{service}"
@@ -14,7 +14,7 @@ class Brightbox < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("Brightbox[:compute] is deprecated, use Compute[:brightbox] instead")
17
+ Fog::Logger.warning("Brightbox[:compute] is not recommended, use Compute[:brightbox] for portability")
18
18
  Fog::Compute.new(:provider => 'Brightbox')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class DNSimple < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :dns
17
- Fog::Logger.warning("DNSimple[:dns] is deprecated, use Storage[:dnsimple] instead")
17
+ Fog::Logger.warning("DNSimple[:dns] is not recommended, use DNS[:dnsimple] for portability")
18
18
  Fog::DNS.new(:provider => 'DNSimple')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class DNSMadeEasy < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :dns
17
- Fog::Logger.warning("DNSMadeEasy[:dns] is deprecated, use Storage[:dnsmadeeasy] instead")
17
+ Fog::Logger.warning("DNSMadeEasy[:dns] is not recommended, use DNS[:dnsmadeeasy] for portability")
18
18
  Fog::DNS.new(:provider => 'DNSMadeEasy')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class Ecloud < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("Ecloud[:compute] is deprecated, use Compute[:ecloud] instead")
17
+ Fog::Logger.warning("Ecloud[:compute] is not recommended, use Compute[:ecloud] for portability")
18
18
  Fog::Compute.new(:provider => 'Ecloud')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class Glesys < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Formatador.display_line("[yellow][WARN] Glesys[:compute] is deprecated, use Compute[:glesys] instead[/]")
17
+ Fog::Logger.warning("Glesys[:compute] is not recommended, use Compute[:glesys] for portability")
18
18
  Fog::Compute.new(:provider => 'Glesys')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{service}"
@@ -14,7 +14,7 @@ class GoGrid < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("GoGrid[:compute] is deprecated, use Compute[:gogrid] instead")
17
+ Fog::Logger.warning("GoGrid[:compute] is not recommended, use Compute[:gogrid] for portability")
18
18
  Fog::Compute.new(:provider => 'GoGrid')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class Google < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :storage
17
- Fog::Logger.warning("Google[:storage] is deprecated, use Storage[:google] instead")
17
+ Fog::Logger.warning("Google[:storage] is not recommended, use Storage[:google] for portability")
18
18
  Fog::Storage.new(:provider => 'Google')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ module Libvirt # deviates from other bin stuff to accomodate gem
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("Libvirt[:compute] is deprecated, use Compute[:libvirt] instead")
17
+ Fog::Logger.warning("Libvirt[:compute] is not recommended, use Compute[:libvirt] for portability")
18
18
  Fog::Compute.new(:provider => 'Libvirt')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -16,10 +16,10 @@ class Linode < Fog::Bin
16
16
  @@connections ||= Hash.new do |hash, key|
17
17
  hash[key] = case key
18
18
  when :compute
19
- Fog::Logger.warning("Linode[:compute] is deprecated, use Compute[:linode] instead")
19
+ Fog::Logger.warning("Linode[:compute] is not recommended, use Compute[:linode] for portability")
20
20
  Fog::Compute.new(:provider => 'Linode')
21
21
  when :dns
22
- Fog::Logger.warning("Linode[:storage] is deprecated, use Storage[:linode] instead")
22
+ Fog::Logger.warning("Linode[:dns] is not recommended, use DNS[:linode] for portability")
23
23
  Fog::DNS.new(:provider => 'Linode')
24
24
  else
25
25
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class Local < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :storage
17
- Fog::Logger.warning("Local[:storage] is deprecated, use Storage[:local] instead")
17
+ Fog::Logger.warning("Local[:storage] is not recommended, use Storage[:local] for portability")
18
18
  Fog::Storage.new(:provider => 'Local')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class NewServers < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("NewServers[:compute] is deprecated, use Compute[:newservers] instead")
17
+ Fog::Logger.warning("NewServers[:compute] is not recommended, use Compute[:newservers] for portability")
18
18
  Fog::Compute.new(:provider => 'NewServers')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -16,10 +16,10 @@ class Ninefold < Fog::Bin
16
16
  @@connections ||= Hash.new do |hash, key|
17
17
  hash[key] = case key
18
18
  when :compute
19
- Fog::Logger.warning("Ninefold[:compute] is deprecated, use Compute[:ninefold] instead")
19
+ Fog::Logger.warning("Ninefold[:compute] is not recommended, use Compute[:ninefold] for portability")
20
20
  Fog::Compute.new(:provider => 'Ninefold')
21
21
  when :storage
22
- Fog::Logger.warning("Ninefold[:storage] is deprecated, use Storage[:ninefold] instead")
22
+ Fog::Logger.warning("Ninefold[:storage] is not recommended, use Storage[:ninefold] for portability")
23
23
  Fog::Storage.new(:provider => 'Ninefold')
24
24
  else
25
25
  raise ArgumentError, "Unrecognized service: #{service}"
@@ -14,7 +14,7 @@ class OpenStack < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("OpenStack[:compute] is deprecated, use Compute[:rackspace] instead")
17
+ Fog::Logger.warning("OpenStack[:compute] is not recommended, use Compute[:rackspace] for portability")
18
18
  Fog::Compute.new(:provider => 'OpenStack')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -22,17 +22,17 @@ class Rackspace < Fog::Bin
22
22
  @@connections ||= Hash.new do |hash, key|
23
23
  hash[key] = case key
24
24
  when :cdn
25
- Fog::Logger.warning("Rackspace[:cdn] is deprecated, use CDN[:rackspace] instead")
25
+ Fog::Logger.warning("Rackspace[:cdn] is not recommended, use CDN[:rackspace] for portability")
26
26
  Fog::CDN.new(:provider => 'Rackspace')
27
27
  when :compute
28
- Fog::Logger.warning("Rackspace[:compute] is deprecated, use Compute[:rackspace] instead")
28
+ Fog::Logger.warning("Rackspace[:compute] is not recommended, use Compute[:rackspace] for portability")
29
29
  Fog::Compute.new(:provider => 'Rackspace')
30
30
  when :dns
31
31
  Fog::DNS.new(:provider => 'Rackspace')
32
32
  when :load_balancers
33
33
  Fog::Rackspace::LoadBalancers.new
34
34
  when :storage
35
- Fog::Logger.warning("Rackspace[:storage] is deprecated, use Storage[:rackspace] instead")
35
+ Fog::Logger.warning("Rackspace[:storage] is not recommended, use Storage[:rackspace] for portability")
36
36
  Fog::Storage.new(:provider => 'Rackspace')
37
37
  else
38
38
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -16,7 +16,7 @@ class Slicehost < Fog::Bin
16
16
  @@connections ||= Hash.new do |hash, key|
17
17
  hash[key] = case key
18
18
  when :compute
19
- Fog::Logger.warning("Slicehost[:compute] is deprecated, use Compute[:slicehost] instead")
19
+ Fog::Logger.warning("Slicehost[:compute] is not recommended, use Compute[:slicehost] for portability")
20
20
  Fog::Compute.new(:provider => 'Slicehost')
21
21
  when :dns
22
22
  Fog::Logger.warning("Slicehost[:dns] is deprecated, use Storage[:slicehost] instead")
@@ -14,7 +14,7 @@ class StormOnDemand < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("StormOnDemand[:compute] is deprecated, use Compute[:stormondemand] instead")
17
+ Fog::Logger.warning("StormOnDemand[:compute] is not recommended, use Compute[:stormondemand] for portability")
18
18
  Fog::Compute.new(:provider => 'StormOnDemand')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ module VirtualBox # deviates from other bin stuff to accomodate gem
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("VirtualBox[:compute] is deprecated, use Compute[:virtualbox] instead")
17
+ Fog::Logger.warning("VirtualBox[:compute] is not recommended, use Compute[:virtualbox] for portability")
18
18
  Fog::Compute.new(:provider => 'VirtualBox')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ module Vmfusion # deviates from other bin stuff to accomodate gem
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("Vmfusion[:compute] is deprecated, use Compute[:Vmfusion] instead")
17
+ Fog::Logger.warning("Vmfusion[:compute] is not recommended, use Compute[:vmfusion] for portability")
18
18
  Fog::Compute.new(:provider => 'Vmfusion')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class Voxel < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :compute
17
- Fog::Logger.warning("Voxel[:compute] is deprecated, use Compute[:voxel] instead")
17
+ Fog::Logger.warning("Voxel[:comupte] is not recommended, use Compute[:voxel]] for portability")
18
18
  Fog::Compute.new(:provider => 'Voxel')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -14,7 +14,7 @@ class Zerigo < Fog::Bin
14
14
  @@connections ||= Hash.new do |hash, key|
15
15
  hash[key] = case key
16
16
  when :dns
17
- Fog::Logger.warning("Zerigo[:dns] is deprecated, use Storage[:zerigo] instead")
17
+ Fog::Logger.warning("Zerigo[:dns] is not recommended, use DNS[:zerigo] for portability")
18
18
  Fog::DNS.new(:provider => 'Zerigo')
19
19
  else
20
20
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
@@ -4,7 +4,7 @@ module Fog
4
4
  class << self
5
5
 
6
6
  def available_providers
7
- @available_providers ||= @providers.select {|provider| Kernel.const_get(provider).available?}.sort
7
+ @available_providers ||= Fog.providers.values.select {|provider| Kernel.const_get(provider).available?}.sort
8
8
  end
9
9
 
10
10
  end
@@ -85,6 +85,7 @@ module Fog
85
85
  request :remove_nodes_load_balancer
86
86
  request :remove_servers_server_group
87
87
  request :reset_ftp_password_account
88
+ request :reset_secret_api_client
88
89
  request :resize_server
89
90
  request :shutdown_server
90
91
  request :snapshot_server
@@ -94,6 +95,7 @@ module Fog
94
95
  request :update_account
95
96
  request :update_api_client
96
97
  request :update_cloud_ip
98
+ request :update_firewall_rule
97
99
  request :update_image
98
100
  request :update_load_balancer
99
101
  request :update_server
@@ -23,9 +23,17 @@ module Fog
23
23
  attribute :server_id, :aliases => "server", :squash => "id"
24
24
  attribute :load_balancer, :alias => "load_balancer", :squash => "id"
25
25
 
26
- def map(interface_to_map)
26
+ def map(destination)
27
27
  requires :identity
28
- connection.map_cloud_ip(identity, :interface => interface_to_map)
28
+ case destination
29
+ when Fog::Compute::Brightbox::Server
30
+ final_destination = destination.interfaces.first["id"]
31
+ when Fog::Compute::Brightbox::LoadBalancer
32
+ final_destination = destination.id
33
+ else
34
+ final_destination = destination
35
+ end
36
+ connection.map_cloud_ip(identity, :destination => final_destination)
29
37
  end
30
38
 
31
39
  def mapped?
@@ -36,7 +36,7 @@ module Fog
36
36
  attribute :server_type
37
37
 
38
38
  def initialize(attributes={})
39
- self.image_id ||= 'img-2ab98' # Ubuntu Lucid 10.04 server (i686)
39
+ self.image_id ||= 'img-4gqhs' # Ubuntu Lucid 10.04 server (i686)
40
40
  super
41
41
  end
42
42
 
@@ -108,11 +108,19 @@ module Fog
108
108
  end
109
109
 
110
110
  def private_ip_address
111
- interfaces.first
111
+ unless interfaces.empty?
112
+ interfaces.first["ipv4_address"]
113
+ else
114
+ nil
115
+ end
112
116
  end
113
117
 
114
118
  def public_ip_address
115
- cloud_ips.first
119
+ unless cloud_ips.empty?
120
+ cloud_ips.first["public_ip"]
121
+ else
122
+ nil
123
+ end
116
124
  end
117
125
 
118
126
  def ready?
@@ -18,6 +18,8 @@ module Fog
18
18
  attribute :default
19
19
  attribute :created_at, :type => :time
20
20
 
21
+ attribute :server_ids, :aliases => "servers"
22
+
21
23
  def save
22
24
  options = {
23
25
  :name => name,
@@ -28,6 +30,13 @@ module Fog
28
30
  true
29
31
  end
30
32
 
33
+ def servers
34
+ srv_ids = server_ids.collect {|srv| srv["id"]}
35
+ srv_ids.collect do |srv_id|
36
+ connection.servers.get(srv_id)
37
+ end
38
+ end
39
+
31
40
  # Adds specified servers to this server group
32
41
  #
33
42
  # @param [Array] identifiers array of server identifier strings to add
@@ -0,0 +1,13 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+
6
+ def update_firewall_rule(id, options)
7
+ request("put", "/1.0/firewall_rules/#{id}", [202], options)
8
+ end
9
+
10
+ end
11
+ end
12
+ end
13
+ end
@@ -18,7 +18,7 @@ module Fog
18
18
  end
19
19
 
20
20
  response = @excon.request(params, &block)
21
-
21
+
22
22
  if parser
23
23
  body.finish
24
24
  response.body = parser.response
@@ -5,15 +5,15 @@ module Fog
5
5
 
6
6
  # Assign a new credential to use from configuration file
7
7
  # @param [String, Symbol] new_credential name of new credential to use
8
- # @ return [String, Symbol] name of the new credential
8
+ # @ return [Symbol] name of the new credential
9
9
  def self.credential=(new_credential)
10
10
  @credentials = nil
11
- @credential = new_credential
11
+ @credential = new_credential && new_credential.to_sym
12
12
  end
13
13
 
14
14
  # @return [String, Symbol] The credential to use in Fog
15
15
  def self.credential
16
- @credential ||= ENV["FOG_CREDENTIAL"] || :default
16
+ @credential ||= ( ENV["FOG_CREDENTIAL"] && ENV["FOG_CREDENTIAL"].to_sym ) || :default
17
17
  end
18
18
 
19
19
  # @return [String] The path for configuration_file
@@ -4,7 +4,7 @@ module Fog
4
4
  def deprecate(older, newer)
5
5
  module_eval <<-EOS, __FILE__, __LINE__
6
6
  def #{older}(*args)
7
- Fog::Logger.warning("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
7
+ Fog::Logger.deprecation("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
8
8
  send(:#{newer}, *args)
9
9
  end
10
10
  EOS
@@ -13,7 +13,7 @@ module Fog
13
13
  def self_deprecate(older, newer)
14
14
  module_eval <<-EOS, __FILE__, __LINE__
15
15
  def self.#{older}(*args)
16
- Fog::Logger.warning("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
16
+ Fog::Logger.deprecation("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
17
17
  send(:#{newer}, *args)
18
18
  end
19
19
  EOS
@@ -2,7 +2,8 @@ module Fog
2
2
  class Logger
3
3
 
4
4
  @channels = {
5
- :warning => ::STDOUT
5
+ :deprecation => ::STDOUT,
6
+ :warning => ::STDOUT
6
7
  }
7
8
 
8
9
  def self.[](channel)
@@ -14,11 +15,15 @@ module Fog
14
15
  end
15
16
 
16
17
  def self.debug(message)
17
- self.write(:debug, "[light_black][DEBUG] #{message}[/]")
18
+ self.write(:debug, "[light_black][DEBUG] #{message}[/]\n")
19
+ end
20
+
21
+ def self.deprecation(message)
22
+ self.write(:deprecation, "[yellow][DEPRECATION] #{message}[/]\n")
18
23
  end
19
24
 
20
25
  def self.warning(message)
21
- self.write(:warning, "[yellow][WARNING] #{message}[/]")
26
+ self.write(:warning, "[yellow][WARNING] #{message}[/]\n")
22
27
  end
23
28
 
24
29
  def self.write(key, value)
@@ -6,6 +6,10 @@ module Fog
6
6
  @mocking = true
7
7
  end
8
8
 
9
+ def self.unmock!
10
+ @mocking = false
11
+ end
12
+
9
13
  def self.mock?
10
14
  @mocking
11
15
  end
@@ -1,13 +1,18 @@
1
1
  module Fog
2
2
 
3
3
  def self.providers
4
- @providers ||= []
4
+ @providers ||= {}
5
+ end
6
+
7
+ def self.providers=(new_providers)
8
+ @providers = new_providers
5
9
  end
6
10
 
7
11
  module Provider
8
12
 
9
13
  def self.extended(base)
10
- Fog.providers << base.to_s.split('::').last
14
+ provider = base.to_s.split('::').last
15
+ Fog.providers[provider.downcase.to_sym] = provider
11
16
  end
12
17
 
13
18
  def [](service_key)