brightbox-cli 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. data/.gitignore +1 -1
  2. data/brightbox-cli.gemspec +10 -9
  3. data/lib/brightbox-cli/commands/servers-activate-console.rb +1 -1
  4. data/lib/brightbox-cli/commands/types-show.rb +5 -4
  5. data/lib/brightbox-cli/config.rb +1 -1
  6. data/lib/brightbox-cli/detailed_server.rb +2 -1
  7. data/lib/brightbox-cli/gli_global_hooks.rb +1 -8
  8. data/lib/brightbox-cli/server_groups.rb +4 -0
  9. data/lib/brightbox-cli/servers.rb +5 -13
  10. data/lib/brightbox-cli/types.rb +1 -1
  11. data/lib/brightbox-cli/vendor/fog/.gitignore +1 -0
  12. data/lib/brightbox-cli/vendor/fog/README.rdoc +1 -1
  13. data/lib/brightbox-cli/vendor/fog/Rakefile +4 -3
  14. data/lib/brightbox-cli/vendor/fog/changelog.txt +213 -0
  15. data/lib/brightbox-cli/vendor/fog/docs/compute/index.markdown +15 -1
  16. data/lib/brightbox-cli/vendor/fog/docs/index.markdown +1 -1
  17. data/lib/brightbox-cli/vendor/fog/docs/storage/index.markdown +4 -4
  18. data/lib/brightbox-cli/vendor/fog/examples/compute_tests.rb +18 -6
  19. data/lib/brightbox-cli/vendor/fog/examples/dns_tests.rb +1 -1
  20. data/lib/brightbox-cli/vendor/fog/examples/storage_tests.rb +1 -1
  21. data/lib/brightbox-cli/vendor/fog/fog.gemspec +4 -3
  22. data/lib/brightbox-cli/vendor/fog/lib/fog.rb +1 -1
  23. data/lib/brightbox-cli/vendor/fog/lib/fog/aws.rb +16 -1
  24. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/auto_scaling.rb +2 -17
  25. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_formation.rb +1 -16
  26. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_watch.rb +2 -17
  27. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/compute.rb +10 -21
  28. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/elasticache.rb +1 -7
  29. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/elb.rb +34 -24
  30. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/emr.rb +5 -4
  31. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/iam.rb +16 -1
  32. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/auto_scaling/group.rb +2 -2
  33. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/cloud_watch/metric_statistic.rb +1 -2
  34. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/security_group.rb +3 -3
  35. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/security_groups.rb +25 -0
  36. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/server.rb +4 -1
  37. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/dns/records.rb +3 -3
  38. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elb/listener.rb +9 -7
  39. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elb/load_balancer.rb +6 -0
  40. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/storage/directory.rb +21 -0
  41. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/storage/file.rb +19 -5
  42. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/storage/files.rb +4 -4
  43. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/compute/describe_instances.rb +2 -2
  44. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/compute/describe_security_groups.rb +2 -2
  45. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/sqs/receive_message.rb +1 -1
  46. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/rds.rb +41 -18
  47. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/create_security_group.rb +6 -4
  48. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/create_tags.rb +3 -2
  49. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_availability_zones.rb +3 -0
  50. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -0
  51. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb +2 -0
  52. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb +3 -1
  53. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/create_load_balancer.rb +7 -2
  54. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/create_load_balancer_listeners.rb +10 -1
  55. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb +1 -1
  56. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/describe_load_balancers.rb +5 -1
  57. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/set_load_balancer_listener_ssl_certificate.rb +27 -0
  58. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb +1 -1
  59. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/run_job_flow.rb +9 -7
  60. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/add_user_to_group.rb +24 -0
  61. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/create_access_key.rb +24 -0
  62. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/create_group.rb +21 -0
  63. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/create_user.rb +21 -0
  64. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/delete_access_key.rb +17 -0
  65. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/delete_group.rb +19 -0
  66. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/delete_user.rb +17 -0
  67. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/delete_user_policy.rb +16 -0
  68. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/list_access_keys.rb +21 -0
  69. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/list_groups.rb +18 -0
  70. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/list_groups_for_user.rb +24 -0
  71. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/list_user_policies.rb +18 -0
  72. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/list_users.rb +17 -0
  73. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/put_user_policy.rb +18 -0
  74. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/remove_user_from_group.rb +19 -0
  75. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/iam/upload_server_certificate.rb +1 -1
  76. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/authorize_db_security_group_ingress.rb +30 -1
  77. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/create_db_instance.rb +67 -1
  78. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/create_db_security_group.rb +19 -1
  79. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/delete_db_instance.rb +19 -3
  80. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/delete_db_security_group.rb +11 -1
  81. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/describe_db_instances.rb +56 -1
  82. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/describe_db_reserved_instances.rb +1 -1
  83. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/describe_db_security_groups.rb +44 -2
  84. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/modify_db_instance.rb +26 -1
  85. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/reboot_db_instance.rb +17 -1
  86. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/rds/revoke_db_security_group_ingress.rb +27 -1
  87. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/change_message_visibility.rb +1 -1
  88. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/delete_message.rb +1 -1
  89. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/sqs/receive_message.rb +13 -14
  90. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/copy_object.rb +14 -6
  91. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/delete_object.rb +73 -2
  92. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_bucket.rb +3 -2
  93. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_bucket_object_versions.rb +95 -2
  94. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_bucket_versioning.rb +32 -0
  95. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object.rb +27 -1
  96. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_http_url.rb +4 -3
  97. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_https_url.rb +4 -3
  98. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_bucket_versioning.rb +41 -0
  99. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_bucket_website.rb +17 -0
  100. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_object.rb +25 -9
  101. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/ses.rb +2 -7
  102. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/simpledb.rb +4 -17
  103. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sns.rb +1 -14
  104. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sqs.rb +5 -11
  105. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/storage.rb +6 -22
  106. data/lib/brightbox-cli/vendor/fog/lib/fog/bin.rb +2 -0
  107. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/aws.rb +9 -1
  108. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/voxel.rb +1 -1
  109. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server.rb +1 -0
  110. data/lib/brightbox-cli/vendor/fog/lib/fog/compute.rb +6 -0
  111. data/lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb +11 -0
  112. data/lib/brightbox-cli/vendor/fog/lib/fog/core.rb +0 -1
  113. data/lib/brightbox-cli/vendor/fog/lib/fog/core/connection.rb +0 -1
  114. data/lib/brightbox-cli/vendor/fog/lib/fog/core/errors.rb +5 -0
  115. data/lib/brightbox-cli/vendor/fog/lib/fog/core/scp.rb +18 -2
  116. data/lib/brightbox-cli/vendor/fog/lib/fog/core/wait_for.rb +1 -1
  117. data/lib/brightbox-cli/vendor/fog/lib/fog/dnsmadeeasy/dns.rb +1 -1
  118. data/lib/brightbox-cli/vendor/fog/lib/fog/dynect/models/dns/records.rb +2 -2
  119. data/lib/brightbox-cli/vendor/fog/lib/fog/dynect/requests/dns/get_node_list.rb +2 -1
  120. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/compute.rb +1 -1
  121. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/add_backup_internet_service.rb +1 -1
  122. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/add_internet_service.rb +2 -2
  123. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/add_node.rb +1 -1
  124. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/clone_vapp.rb +1 -1
  125. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/configure_internet_service.rb +1 -1
  126. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/configure_network.rb +1 -1
  127. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/configure_network_ip.rb +1 -1
  128. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/configure_vapp.rb +1 -1
  129. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/instantiate_vapp_template.rb +1 -1
  130. data/lib/brightbox-cli/vendor/fog/lib/fog/libvirt/compute.rb +7 -3
  131. data/lib/brightbox-cli/vendor/fog/lib/fog/libvirt/models/compute/nodes.rb +1 -3
  132. data/lib/brightbox-cli/vendor/fog/lib/fog/libvirt/models/compute/server.rb +93 -99
  133. data/lib/brightbox-cli/vendor/fog/lib/fog/libvirt/models/compute/servers.rb +2 -1
  134. data/lib/brightbox-cli/vendor/fog/lib/fog/libvirt/models/compute/util.rb +1 -2
  135. data/lib/brightbox-cli/vendor/fog/lib/fog/providers.rb +2 -0
  136. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/dns.rb +10 -2
  137. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/load_balancers.rb +3 -0
  138. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/compute/flavor.rb +2 -0
  139. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/compute/server.rb +2 -2
  140. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/callback.rb +3 -1
  141. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/record.rb +4 -0
  142. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancer.rb +18 -8
  143. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/storage/directory.rb +5 -1
  144. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/create_image.rb +1 -3
  145. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/load_balancers/delete_nodes.rb +1 -2
  146. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/load_balancers/list_load_balancers.rb +8 -2
  147. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/compute.rb +1 -1
  148. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/compute.rb +91 -30
  149. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/catalog.rb +1 -1
  150. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/catalog_item.rb +1 -1
  151. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/catalogs.rb +5 -8
  152. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/ip.rb +2 -2
  153. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/network.rb +9 -51
  154. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/networks.rb +21 -7
  155. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/server.rb +38 -58
  156. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/servers.rb +12 -18
  157. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/task.rb +1 -1
  158. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/tasks.rb +1 -3
  159. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/vdc.rb +14 -29
  160. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/vdcs.rb +6 -11
  161. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/requests/compute/clone_vapp.rb +1 -1
  162. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/requests/compute/configure_network.rb +1 -1
  163. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/requests/compute/configure_network_ip.rb +1 -1
  164. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/requests/compute/configure_vapp.rb +1 -1
  165. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/requests/compute/configure_vm.rb +1 -1
  166. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/requests/compute/instantiate_vapp_template.rb +1 -1
  167. data/lib/brightbox-cli/vendor/fog/lib/fog/vcloud/requests/compute/login.rb +8 -4
  168. data/lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/compute.rb +4 -0
  169. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/compute.rb +1 -0
  170. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/models/compute/server.rb +7 -1
  171. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +86 -86
  172. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/vm_clone.rb +43 -8
  173. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/models/dns/record.rb +7 -5
  174. data/lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/update_host.rb +2 -2
  175. data/lib/brightbox-cli/vendor/fog/spec/ecloud/spec_helper.rb +1 -1
  176. data/lib/brightbox-cli/vendor/fog/tests/aws/models/elb/model_tests.rb +15 -6
  177. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/instance_tests.rb +37 -0
  178. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/security_group_tests.rb +6 -4
  179. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/elb/helper.rb +33 -0
  180. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/elb/listener_tests.rb +22 -4
  181. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/elb/policy_tests.rb +13 -0
  182. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/access_key_tests.rb +2 -7
  183. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/group_tests.rb +1 -4
  184. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_policy_tests.rb +4 -11
  185. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb +19 -12
  186. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/rds/helper.rb +38 -3
  187. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/rds/instance_tests.rb +3 -1
  188. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/bucket_tests.rb +66 -1
  189. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/account_tests.rb +3 -3
  190. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/api_client_tests.rb +6 -6
  191. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/cloud_ip_tests.rb +15 -9
  192. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/helper.rb +6 -2
  193. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/image_tests.rb +2 -2
  194. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/interface_tests.rb +1 -1
  195. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/load_balancer_tests.rb +9 -9
  196. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_group_tests.rb +8 -8
  197. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_tests.rb +17 -13
  198. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_type_tests.rb +2 -2
  199. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/user_tests.rb +3 -3
  200. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/zone_tests.rb +2 -2
  201. data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/helper.rb +87 -64
  202. data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/ip_tests.rb +1 -1
  203. data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/server_tests.rb +4 -4
  204. data/lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper.rb +1 -1
  205. data/lib/brightbox-cli/vendor/fog/tests/helpers/mock_helper.rb +2 -0
  206. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/dns_tests.rb +4 -2
  207. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/load_balancers/helper.rb +27 -11
  208. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/load_balancers/load_balancer_tests.rb +4 -1
  209. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/load_balancers/node_tests.rb +24 -25
  210. data/lib/brightbox-cli/vendor/fog/tests/slicehost/requests/compute/slice_tests.rb +2 -2
  211. data/lib/brightbox-cli/vendor/fog/tests/storm_on_demand/requests/compute/server_tests.rb +3 -3
  212. data/lib/brightbox-cli/vendor/fog/tests/vcloud/models/compute/servers_tests.rb +18 -90
  213. data/lib/brightbox-cli/vendor/fog/tests/vsphere/requests/compute/vm_clone_tests.rb +16 -4
  214. data/lib/brightbox-cli/vendor/fog/tests/vsphere/requests/compute/vm_power_on_tests.rb +1 -1
  215. data/lib/brightbox-cli/version.rb +1 -1
  216. data/spec/cloud_ips_spec.rb +1 -1
  217. data/spec/fixtures/vcr_cassettes/list_cloud_ip.yml +58 -26
  218. data/spec/fixtures/vcr_cassettes/server_show.yml +143 -102
  219. data/spec/servers_spec.rb +3 -2
  220. data/spec/spec_helper.rb +4 -0
  221. metadata +128 -213
  222. data/lib/brightbox-cli/vendor/fog/tests/rackspace/models/access_list_tests.rb +0 -12
  223. data/lib/brightbox-cli/vendor/fog/tests/rackspace/models/access_lists_tests.rb +0 -12
  224. data/lib/brightbox-cli/vendor/fog/tests/rackspace/models/load_balancer_tests.rb +0 -116
  225. data/lib/brightbox-cli/vendor/fog/tests/rackspace/models/load_balancers_tests.rb +0 -19
  226. data/lib/brightbox-cli/vendor/fog/tests/rackspace/models/node_tests.rb +0 -19
  227. data/lib/brightbox-cli/vendor/fog/tests/rackspace/models/nodes_tests.rb +0 -12
  228. data/lib/brightbox-cli/vendor/fog/tests/rackspace/models/virtual_ip_tests.rb +0 -16
  229. data/lib/brightbox-cli/vendor/fog/tests/rackspace/models/virtual_ips_tests.rb +0 -12
@@ -6,7 +6,7 @@ module Fog
6
6
 
7
7
  def validate_network_ip_data(network_ip_data)
8
8
  valid_opts = [:id, :href, :name, :status, :server, :rnat]
9
- unless valid_opts.all? { |opt| network_ip_data.keys.include?(opt) }
9
+ unless valid_opts.all? { |opt| network_ip_data.has_key?(opt) }
10
10
  raise ArgumentError.new("Required data missing: #{(valid_opts - network_ip_data.keys).map(&:inspect).join(", ")}")
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Fog
6
6
 
7
7
  def validate_vapp_data(vapp_data)
8
8
  valid_opts = [:name, :cpus, :memory, :disks]
9
- unless valid_opts.all? { |opt| vapp_data.keys.include?(opt) }
9
+ unless valid_opts.all? { |opt| vapp_data.has_key?(opt) }
10
10
  raise ArgumentError.new("Required Vapp data missing: #{(valid_opts - vapp_data.keys).map(&:inspect).join(", ")}")
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Fog
6
6
 
7
7
  def validate_instantiate_vapp_template_options(catalog_item_uri, options)
8
8
  valid_opts = [:name, :vdc_uri, :network_uri, :cpus, :memory, :row, :group]
9
- unless valid_opts.all? { |opt| options.keys.include?(opt) }
9
+ unless valid_opts.all? { |opt| options.has_key?(opt) }
10
10
  raise ArgumentError.new("Required data missing: #{(valid_opts - options.keys).map(&:inspect).join(", ")}")
11
11
  end
12
12
 
@@ -8,6 +8,8 @@ module Fog
8
8
  class Libvirt < Fog::Service
9
9
 
10
10
  requires :libvirt_uri
11
+ recognizes :libvirt_username, :libvirt_password
12
+ recognizes :libvirt_ip_command
11
13
 
12
14
  model_path 'fog/libvirt/models/compute'
13
15
  model :server
@@ -60,7 +62,7 @@ module Fog
60
62
  end
61
63
 
62
64
  rescue ::Libvirt::ConnectionError
63
- raise Fog::Errors::Error.new("Error making a connection to libvirt URI #{@uri.uri}:\n#{$!}")
65
+ raise Fog::Errors::Error.new("Error making a connection to libvirt URI #{uri.uri}:\n#{$!}")
64
66
  end
65
67
 
66
68
  end
@@ -84,10 +86,12 @@ module Fog
84
86
  end
85
87
  end
86
88
  end
87
- newuri=uri+append
88
- return newuri
89
+ uri+append
89
90
  end
90
91
 
92
+ def respond_to?(method, *)
93
+ super or @connection.respond_to? method
94
+ end
91
95
 
92
96
  # hack to provide 'requests'
93
97
  def method_missing(method_sym, *arguments, &block)
@@ -26,10 +26,8 @@ module Fog
26
26
  node_info[param]=nil
27
27
  end
28
28
  end
29
- node_info[:uri]=connection.connection.uri
29
+ node_info[:uri]=connection.uri
30
30
  data << { :raw => node_info }
31
- require 'pp'
32
- pp node_info
33
31
  load(data)
34
32
  end
35
33
 
@@ -48,100 +48,73 @@ module Fog
48
48
  # @returns server/domain created
49
49
  def initialize(attributes={} )
50
50
 
51
- self.xml ||= nil unless attributes[:xml]
52
- self.persistent ||=true unless attributes[:persistent]
53
- self.cpus ||=1 unless attributes[:cpus]
54
- self.memory_size ||=256 *1024 unless attributes[:memory_size]
55
- self.name ||="fog-#{SecureRandom.random_number*10E14.to_i.round}" unless attributes[:name]
56
-
57
- self.os_type ||="hvm" unless attributes[:os_type]
58
- self.arch ||="x86_64" unless attributes[:arch]
59
-
60
- self.domain_type ||="kvm" unless attributes[:domain_type]
61
-
62
- self.iso_file ||=nil unless attributes[:iso_file]
63
- self.iso_dir ||="/var/lib/libvirt/images" unless attributes[:iso_dir]
64
-
65
- self.volume_format_type ||=nil unless attributes[:volume_format_type]
66
- self.volume_capacity ||=nil unless attributes[:volume_capacity]
67
- self.volume_allocation ||=nil unless attributes[:volume_allocation]
68
-
69
- self.volume_name ||=nil unless attributes[:volume_name]
70
- self.volume_pool_name ||=nil unless attributes[:volume_pool_name]
71
- self.volume_template_name ||=nil unless attributes[:volume_template_name]
72
-
73
- self.network_interface_type ||="nat" unless attributes[:network_interface_type]
74
- self.network_nat_network ||="default" unless attributes[:network_nat_network]
75
- self.network_bridge_name ||="br0" unless attributes[:network_bridge_name]
51
+ # setup all attributes.
52
+ defaults.merge(attributes).each do |k,v|
53
+ eval("self.#{k}= v") if self.respond_to?("#{k}=")
54
+ end
76
55
 
77
56
  super
78
57
  end
79
58
 
59
+ def new?
60
+ uuid.nil?
61
+ end
62
+
80
63
  def save
81
64
 
82
- raise Fog::Errors::Error.new('Resaving an existing server may create a duplicate') if uuid
65
+ raise Fog::Errors::Error.new('Resaving an existing server may create a duplicate') unless new?
83
66
 
84
67
  validate_template_options
85
68
 
86
- xml=xml_from_template if xml.nil?
69
+ xml ||= xml_from_template
87
70
 
88
71
  create_or_clone_volume
89
72
 
90
- xml=xml_from_template
73
+ xml = xml_from_template
91
74
 
92
75
  # We either now have xml provided by the user or generated by the template
93
76
  begin
94
- if !xml.nil?
95
- domain=nil
96
- if self.persistent
97
- domain=connection.raw.define_domain_xml(xml)
98
- else
99
- domain=connection.raw.create_domain_xml(xml)
100
- end
101
- self.raw=domain
77
+ if xml
78
+ self.raw = persistent ? connection.raw.define_domain_xml(xml) : connection.raw.create_domain_xml(xml)
102
79
  end
103
80
  rescue
104
81
  raise Fog::Errors::Error.new("Error saving the server: #{$!}")
105
82
  end
106
83
  end
107
84
 
85
+ #TODO move all of this to the volume class
108
86
  def create_or_clone_volume
109
87
 
110
- volume_options=Hash.new
88
+ volume_options = Hash.new
111
89
 
112
- unless self.volume_name.nil?
113
- volume_options[:name]=self.volume_name
114
- else
115
- extension = self.volume_format_type.nil? ? "img" : self.volume_format_type
116
- volume_name = "#{self.name}.#{extension}"
117
- volume_options[:name]=volume_name
118
- end
90
+ volume_options[:name] = volume_name || default_volume_name
119
91
 
120
92
  # Check if a disk template was specified
121
93
  unless self.volume_template_name.nil?
122
94
 
123
- template_volumes=connection.volumes.all(:name => self.volume_template_name)
95
+ template_volumes = connection.volumes.all(:name => self.volume_template_name)
124
96
 
125
- raise Fog::Errors::Error.new("Template #{self.volume_template_name} not found") unless template_volumes.length==1
97
+ raise Fog::Errors::Error.new("Template #{self.volume_template_name} not found") unless template_volumes.empty?
126
98
 
127
- orig_volume=template_volumes.first
128
- self.volume_format_type=orig_volume.format_type unless self.volume_format_type
129
- volume=orig_volume.clone("#{volume_options[:name]}")
99
+ orig_volume = template_volumes.first
100
+ volume = orig_volume.clone("#{volume_options[:name]}")
130
101
 
102
+ # if we cloned it, it has the original volume type.
103
+ self.volume_format_type = orig_volume.format_type
131
104
  # This gets passed to the domain to know the path of the disk
132
- self.volume_path=volume.path
105
+ self.volume_path = volume.path
133
106
 
134
107
  else
135
108
  # If no template volume was given, let's create our own volume
136
109
 
137
- volume_options[:format_type]=self.volume_format_type unless self.volume_format_type.nil?
138
- volume_options[:capacity]=self.volume_capacity unless self.volume_capacity.nil?
139
- volume_options[:allocation]=self.volume_allocation unless self.volume_allocation.nil?
110
+ volume_options[:format_type] = self.volume_format_type if volume_format_type
111
+ volume_options[:capacity] = self.volume_capacity if volume_capacity
112
+ volume_options[:allocation] = self.volume_allocation if volume_allocation
140
113
 
141
114
  begin
142
- volume=connection.volumes.create(volume_options)
143
- self.volume_path=volume.path
144
- self.volume_format_type=volume.format_type unless self.volume_format_type
115
+ volume = connection.volumes.create(volume_options)
116
+ self.volume_path = volume.path
117
+ self.volume_format_type ||= volume.format_type
145
118
  rescue
146
119
  raise Fog::Errors::Error.new("Error creating the volume : #{$!}")
147
120
  end
@@ -158,27 +131,27 @@ module Fog
158
131
  def xml_from_template
159
132
 
160
133
  template_options={
161
- :cpus => self.cpus,
162
- :memory_size => self.memory_size,
163
- :domain_type => self.domain_type,
164
- :name => self.name,
165
- :iso_file => self.iso_file,
166
- :iso_dir => self.iso_dir,
167
- :os_type => self.os_type,
168
- :arch => self.arch,
169
- :volume_path => self.volume_path,
170
- :volume_format_type => self.volume_format_type,
171
- :network_interface_type => self.network_interface_type,
172
- :network_nat_network => self.network_nat_network,
173
- :network_bridge_name => self.network_bridge_name
134
+ :cpus => cpus,
135
+ :memory_size => memory_size,
136
+ :domain_type => domain_type,
137
+ :name => name,
138
+ :iso_file => iso_file,
139
+ :iso_dir => iso_dir,
140
+ :os_type => os_type,
141
+ :arch => arch,
142
+ :volume_path => volume_path,
143
+ :volume_format_type => volume_format_type,
144
+ :network_interface_type => network_interface_type,
145
+ :network_nat_network => network_nat_network,
146
+ :network_bridge_name => network_bridge_name
174
147
  }
175
- vars = ErbBinding.new(template_options)
176
- template_path=File.join(File.dirname(__FILE__),"templates","server.xml.erb")
177
- template=File.open(template_path).readlines.join
178
- erb = ERB.new(template)
179
- vars_binding = vars.send(:get_binding)
180
- result=erb.result(vars_binding)
181
- return result
148
+ vars = ErbBinding.new(template_options)
149
+ template_path = File.join(File.dirname(__FILE__),"templates","server.xml.erb")
150
+ template = File.open(template_path).readlines.join
151
+ erb = ERB.new(template)
152
+ vars_binding = vars.send(:get_binding)
153
+
154
+ erb.result(vars_binding)
182
155
  end
183
156
 
184
157
  def username
@@ -202,10 +175,14 @@ module Fog
202
175
  # In fog a destroy means the remove of a machine
203
176
  def destroy(options={ :destroy_volumes => false})
204
177
  requires :raw
205
- if @raw.active?
206
- @raw.destroy
207
- end
178
+ poweroff unless stopped?
179
+ #TODO: add handling of failure
208
180
  @raw.undefine
181
+
182
+ if options[:destroy_volumes]
183
+ # volumes.all filters do not handle nil keys well
184
+ connection.volumes.all(:path => disk_path).each { |vol| vol.destroy}
185
+ end
209
186
  end
210
187
 
211
188
  def reboot
@@ -215,7 +192,7 @@ module Fog
215
192
 
216
193
  # Alias for poweroff
217
194
  def halt
218
- poweroff
195
+ poweroff
219
196
  end
220
197
 
221
198
  # In libvirt a destroy means a hard power-off of the domain
@@ -250,7 +227,10 @@ module Fog
250
227
  when 5 then "shutoff"
251
228
  when 6 then "crashed"
252
229
  end
253
- return state
230
+ end
231
+
232
+ def stopped?
233
+ state == "shutoff"
254
234
  end
255
235
 
256
236
  def ready?
@@ -259,20 +239,15 @@ module Fog
259
239
 
260
240
  def stop
261
241
  requires :raw
262
-
263
242
  @raw.shutdown
264
243
  end
265
244
 
266
- #def xml_desc
267
- #requires :raw
268
- #raw.xml_desc
269
- #end
270
-
271
245
  # This retrieves the ip address of the mac address
272
246
  # It returns an array of public and private ip addresses
273
247
  # Currently only one ip address is returned, but in the future this could be multiple
274
248
  # if the server has multiple network interface
275
249
  #
250
+ #TODO: move this into the util class
276
251
  def addresses(options={})
277
252
  mac=self.mac
278
253
 
@@ -282,7 +257,7 @@ module Fog
282
257
  ip_command_global=@connection.ip_command.nil? ? 'grep $mac /var/log/arpwatch.log|sed -e "s/new station//"|sed -e "s/changed ethernet address//g" |sed -e "s/reused old ethernet //" |tail -1 |cut -d ":" -f 4-| cut -d " " -f 3' : @connection.ip_command
283
258
  ip_command_local=options[:ip_command].nil? ? ip_command_global : options[:ip_command]
284
259
 
285
- ip_command="mac=#{mac}; "+ip_command_local
260
+ ip_command="mac=#{mac}; server_name=#{name}; "+ip_command_local
286
261
 
287
262
  ip_address=nil
288
263
 
@@ -480,21 +455,20 @@ module Fog
480
455
  # Retrieves the mac address from parsing the XML of the domain
481
456
  def mac
482
457
  mac = document("domain/devices/interface/mac", "address")
483
- return mac
484
458
  end
485
459
 
486
460
  def vnc_port
487
-
488
461
  port = document("domain/devices/graphics[@type='vnc']", "port")
489
- return port
490
462
  end
491
463
 
464
+ def disk_path
465
+ document("domain/devices/disk/source", "file")
466
+ rescue
467
+ []
468
+ end
492
469
 
493
470
  private
494
-
495
- def raw
496
- @raw
497
- end
471
+ attr_reader :raw
498
472
 
499
473
  def raw=(new_raw)
500
474
  @raw = new_raw
@@ -516,13 +490,33 @@ module Fog
516
490
  merge_attributes(raw_attributes)
517
491
  end
518
492
 
493
+ def randomized_name
494
+ "fog-#{SecureRandom.random_number*10E14.to_i.round}"
495
+ end
519
496
 
520
- # finds a value from xml
521
- def document path, attribute=nil
522
- xml = REXML::Document.new(self.xml)
523
- attribute.nil? ? xml.elements[path].text : xml.elements[path].attributes[attribute]
497
+ def default_iso_dir
498
+ "/var/lib/libvirt/images"
524
499
  end
525
500
 
501
+ def default_volume_name
502
+ "#{name}.#{volume_format_type || 'img'}"
503
+ end
504
+
505
+ def defaults
506
+ {
507
+ :persistent => true,
508
+ :cpus => 1,
509
+ :memory_size => 256 *1024,
510
+ :name => randomized_name,
511
+ :os_type => "hvm",
512
+ :arch => "x86_64",
513
+ :domain_type => "kvm",
514
+ :iso_dir => default_iso_dir ,
515
+ :network_interface_type => "nat",
516
+ :network_nat_network => "default",
517
+ :network_bridge_name => "br0"
518
+ }
519
+ end
526
520
 
527
521
  end
528
522
 
@@ -44,7 +44,8 @@ module Fog
44
44
  end
45
45
 
46
46
  def get(uuid)
47
- self.all(:uuid => uuid).first
47
+ vm = all(:uuid => uuid)
48
+ vm.first if vm
48
49
  end
49
50
 
50
51
  def bootstrap(new_attributes = {})
@@ -9,7 +9,7 @@ module Fog
9
9
  # finds a value from xml
10
10
  def document path, attribute=nil
11
11
  return nil if new?
12
- xml = REXML::Document.new(@xml_desc)
12
+ xml = REXML::Document.new(self.xml)
13
13
  attribute.nil? ? xml.elements[path].text : xml.elements[path].attributes[attribute]
14
14
  end
15
15
 
@@ -19,7 +19,6 @@ module Fog
19
19
  end
20
20
  end
21
21
 
22
-
23
22
  end
24
23
  end
25
24
  end
@@ -1,6 +1,8 @@
1
1
  require 'fog/aws'
2
2
  require 'fog/bluebox'
3
3
  require 'fog/brightbox'
4
+ require 'fog/cloudstack'
5
+ require 'fog/clodo'
4
6
  require 'fog/dnsimple'
5
7
  require 'fog/dnsmadeeasy'
6
8
  require 'fog/dynect'
@@ -5,12 +5,20 @@ module Fog
5
5
  module DNS
6
6
  class Rackspace < Fog::Service
7
7
 
8
+ class CallbackError < Fog::Errors::Error
9
+ attr_reader :response, :message, :details
10
+ def initialize(response)
11
+ @response = response
12
+ @message = response.body['error']['message']
13
+ @details = response.body['error']['details']
14
+ end
15
+ end
16
+
8
17
  US_ENDPOINT = 'https://dns.api.rackspacecloud.com/v1.0'
9
18
  UK_ENDPOINT = 'https://lon.dns.api.rackspacecloud.com/v1.0'
10
19
 
11
20
  requires :rackspace_api_key, :rackspace_username
12
- recognizes :rackspace_auth_url
13
- recognizes :rackspace_auth_token
21
+ recognizes :rackspace_auth_url, :rackspace_auth_token, :rackspace_dns_endpoint
14
22
 
15
23
  model_path 'fog/rackspace/models/dns'
16
24
  model :record