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
@@ -10,30 +10,25 @@ module Fog
10
10
 
11
11
  undef_method :create
12
12
 
13
+ attribute :href
14
+
13
15
  def all
14
- data = connection.get_organization(organization_uri).body[:Link].select { |link| link[:type] == "application/vnd.vmware.vcloud.vdc+xml" }
16
+ data = connection.get_organization(org_uri).links.select { |link| link[:type] == "application/vnd.vmware.vcloud.vdc+xml" }
15
17
  data.each { |link| link.delete_if { |key, value| [:rel].include?(key) } }
16
18
  load(data)
17
19
  end
18
20
 
19
21
  def get(uri)
20
- if data = connection.get_vdc(uri)
21
- new(data.body)
22
- end
22
+ connection.get_vdc(uri)
23
23
  rescue Fog::Errors::NotFound
24
24
  nil
25
25
  end
26
26
 
27
- def organization_uri
28
- @organization_uri ||= connection.default_organization_uri
29
- end
30
-
31
27
  private
32
28
 
33
- def organization_uri=(new_organization_uri)
34
- @organization_uri = new_organization_uri
29
+ def org_uri
30
+ self.href ||= connection.default_organization_uri
35
31
  end
36
-
37
32
  end
38
33
  end
39
34
  end
@@ -5,7 +5,7 @@ module Fog
5
5
 
6
6
  def validate_clone_vapp_options(options)
7
7
  valid_opts = [:name, :poweron]
8
- unless valid_opts.all? { |opt| options.keys.include?(opt) }
8
+ unless valid_opts.all? { |opt| options.has_key?(opt) }
9
9
  raise ArgumentError.new("Required data missing: #{(valid_opts - options.keys).map(&:inspect).join(", ")}")
10
10
  end
11
11
  end
@@ -5,7 +5,7 @@ module Fog
5
5
 
6
6
  def validate_network_data(network_data, configure=false)
7
7
  valid_opts = [:id, :href, :name, :address, :broadcast, :gateway]
8
- unless valid_opts.all? { |opt| network_data.keys.include?(opt) }
8
+ unless valid_opts.all? { |opt| network_data.has_key?(opt) }
9
9
  raise ArgumentError.new("Required data missing: #{(valid_opts - network_data.keys).map(&:inspect).join(", ")}")
10
10
  end
11
11
  end
@@ -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]
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
@@ -138,7 +138,7 @@ module Fog
138
138
 
139
139
  def validate_vm_data(vm_data)
140
140
  valid_opts = [:name, :cpus, :memory, :disks]
141
- unless valid_opts.all? { |opt| vm_data.keys.include?(opt) }
141
+ unless valid_opts.all? { |opt| vm_data.has_key?(opt) }
142
142
  raise ArgumentError.new("Required vm data missing: #{(valid_opts - vm_data.keys).map(&:inspect).join(", ")}")
143
143
  end
144
144
  end
@@ -7,7 +7,7 @@ module Fog
7
7
  def validate_instantiate_vapp_template_options options
8
8
  # :network_uri removed, if not specified will use template network config.
9
9
  valid_opts = [:catalog_item_uri, :name, :vdc_uri]
10
- unless valid_opts.all? { |opt| options.keys.include?(opt) }
10
+ unless valid_opts.all? { |opt| options.has_key?(opt) }
11
11
  raise ArgumentError.new("Required data missing: #{(valid_opts - options.keys).map(&:inspect).join(", ")}")
12
12
  end
13
13
 
@@ -6,14 +6,18 @@ module Fog
6
6
 
7
7
 
8
8
  def login
9
+ headers = { 'Authorization' => authorization_header }
10
+ uri = if version == '1.0'
11
+ "#{base_url}/login"
12
+ else
13
+ "#{base_path_url}/sessions"
14
+ end
9
15
  unauthenticated_request({
10
16
  :expects => 200,
11
- :headers => {
12
- 'Authorization' => authorization_header
13
- },
17
+ :headers => headers,
14
18
  :method => 'POST',
15
19
  :parse => true,
16
- :uri => "#{base_url}/login"
20
+ :uri => uri
17
21
  })
18
22
  end
19
23
 
@@ -34,6 +34,10 @@ module Fog
34
34
  @connection = ::VirtualBox::Global.global.lib.virtualbox
35
35
  end
36
36
 
37
+ def respond_to?(method, *)
38
+ super or @connection.respond_to? method
39
+ end
40
+
37
41
  # hack to provide 'requests'
38
42
  def method_missing(method_sym, *arguments, &block)
39
43
  if @connection.respond_to?(method_sym)
@@ -20,6 +20,7 @@ module Fog
20
20
  request :vm_power_on
21
21
  request :vm_reboot
22
22
  request :vm_clone
23
+ request :vm_create
23
24
  request :vm_destroy
24
25
  request :datacenters
25
26
 
@@ -56,7 +56,13 @@ module Fog
56
56
  requires :instance_uuid
57
57
  connection.vm_destroy('instance_uuid' => instance_uuid)
58
58
  end
59
-
59
+ def create(options ={})
60
+ requires :name, :path
61
+ new_vm = self.class.new(create_results['vm_attributes'])
62
+ new_vm.collection = self.collection
63
+ new_vm.connection = self.connection
64
+ new_vm
65
+ end
60
66
  def clone(options = {})
61
67
  requires :name, :path
62
68
  # Convert symbols to strings
@@ -26,7 +26,7 @@ module Fog
26
26
  # If the first path element contains "vm" this denotes the vmFolder
27
27
  # and needs to be shifted out since each DC contains only one
28
28
  # vmFolder
29
- path_elements.shift if path_elements[0] = 'vm'
29
+ path_elements.shift if path_elements[0] == 'vm'
30
30
  # Make sure @datacenters is populated (the keys are DataCenter instances)
31
31
  self.datacenters.include? dc_name or raise ArgumentError, "Could not find a Datacenter named #{dc_name}"
32
32
  # Get the datacenter managed object
@@ -138,93 +138,93 @@ module Fog
138
138
  case options['instance_uuid']
139
139
  when nil
140
140
  rval = YAML.load <<-'ENDvmLISTING'
141
- ---
142
- virtual_machines:
143
- - name: centos56gm
144
- hypervisor: gunab.puppetlabs.lan
145
- tools_version: guestToolsCurrent
146
- ipaddress:
147
- mo_ref: vm-698
148
- power_state: poweredOff
149
- uuid: 42322347-d791-cd34-80b9-e25fe28ad37c
150
- is_a_template: true
151
- id: 50323f93-6835-1178-8b8f-9e2109890e1a
152
- tools_state: toolsNotRunning
153
- connection_state: connected
154
- instance_uuid: 50323f93-6835-1178-8b8f-9e2109890e1a
155
- hostname:
156
- mac_addresses:
157
- Network adapter 1: 00:50:56:b2:00:a1
158
- operatingsystem:
159
- - name: centos56gm2
160
- hypervisor: gunab.puppetlabs.lan
161
- tools_version: guestToolsCurrent
162
- ipaddress:
163
- mo_ref: vm-640
164
- power_state: poweredOff
165
- uuid: 564ddcbe-853a-d29a-b329-a0a3693a004d
166
- is_a_template: true
167
- id: 5257dee8-050c-cbcd-ae25-db0e582ab530
168
- tools_state: toolsNotRunning
169
- connection_state: connected
170
- instance_uuid: 5257dee8-050c-cbcd-ae25-db0e582ab530
171
- hostname:
172
- mac_addresses:
173
- Network adapter 1: 00:0c:29:3a:00:4d
174
- operatingsystem:
175
- - name: dashboard_gm
176
- hypervisor: gunab.puppetlabs.lan
177
- tools_version: guestToolsCurrent
178
- ipaddress: 192.168.100.184
179
- mo_ref: vm-669
180
- power_state: poweredOn
181
- uuid: 564d3f91-3452-a509-a678-1246f7897979
182
- is_a_template: false
183
- id: 5032739c-c871-c0d2-034f-9700a0b5383e
184
- tools_state: toolsOk
185
- connection_state: connected
186
- instance_uuid: 5032739c-c871-c0d2-034f-9700a0b5383e
187
- hostname: compliance.puppetlabs.vm
188
- mac_addresses:
189
- Network adapter 1: 00:50:56:b2:00:96
190
- operatingsystem: Red Hat Enterprise Linux 6 (64-bit)
191
- - name: jefftest
192
- hypervisor: gunab.puppetlabs.lan
193
- tools_version: guestToolsCurrent
194
- ipaddress: 192.168.100.187
195
- mo_ref: vm-715
196
- power_state: poweredOn
197
- uuid: 42329da7-e8ab-29ec-1892-d6a4a964912a
198
- is_a_template: false
199
- id: 5032c8a5-9c5e-ba7a-3804-832a03e16381
200
- tools_state: toolsOk
201
- connection_state: connected
202
- instance_uuid: 5032c8a5-9c5e-ba7a-3804-832a03e16381
203
- hostname: centos56gm.localdomain
204
- mac_addresses:
205
- Network adapter 1: 00:50:56:b2:00:af
206
- operatingsystem: CentOS 4/5 (32-bit)
207
- ENDvmLISTING
141
+ ---
142
+ virtual_machines:
143
+ - name: centos56gm
144
+ hypervisor: gunab.puppetlabs.lan
145
+ tools_version: guestToolsCurrent
146
+ ipaddress:
147
+ mo_ref: vm-698
148
+ power_state: poweredOff
149
+ uuid: 42322347-d791-cd34-80b9-e25fe28ad37c
150
+ is_a_template: true
151
+ id: 50323f93-6835-1178-8b8f-9e2109890e1a
152
+ tools_state: toolsNotRunning
153
+ connection_state: connected
154
+ instance_uuid: 50323f93-6835-1178-8b8f-9e2109890e1a
155
+ hostname:
156
+ mac_addresses:
157
+ Network adapter 1: 00:50:56:b2:00:a1
158
+ operatingsystem:
159
+ - name: centos56gm2
160
+ hypervisor: gunab.puppetlabs.lan
161
+ tools_version: guestToolsCurrent
162
+ ipaddress:
163
+ mo_ref: vm-640
164
+ power_state: poweredOff
165
+ uuid: 564ddcbe-853a-d29a-b329-a0a3693a004d
166
+ is_a_template: true
167
+ id: 5257dee8-050c-cbcd-ae25-db0e582ab530
168
+ tools_state: toolsNotRunning
169
+ connection_state: connected
170
+ instance_uuid: 5257dee8-050c-cbcd-ae25-db0e582ab530
171
+ hostname:
172
+ mac_addresses:
173
+ Network adapter 1: 00:0c:29:3a:00:4d
174
+ operatingsystem:
175
+ - name: dashboard_gm
176
+ hypervisor: gunab.puppetlabs.lan
177
+ tools_version: guestToolsCurrent
178
+ ipaddress: 192.168.100.184
179
+ mo_ref: vm-669
180
+ power_state: poweredOn
181
+ uuid: 564d3f91-3452-a509-a678-1246f7897979
182
+ is_a_template: false
183
+ id: 5032739c-c871-c0d2-034f-9700a0b5383e
184
+ tools_state: toolsOk
185
+ connection_state: connected
186
+ instance_uuid: 5032739c-c871-c0d2-034f-9700a0b5383e
187
+ hostname: compliance.puppetlabs.vm
188
+ mac_addresses:
189
+ Network adapter 1: 00:50:56:b2:00:96
190
+ operatingsystem: Red Hat Enterprise Linux 6 (64-bit)
191
+ - name: jefftest
192
+ hypervisor: gunab.puppetlabs.lan
193
+ tools_version: guestToolsCurrent
194
+ ipaddress: 192.168.100.187
195
+ mo_ref: vm-715
196
+ power_state: poweredOn
197
+ uuid: 42329da7-e8ab-29ec-1892-d6a4a964912a
198
+ is_a_template: false
199
+ id: 5032c8a5-9c5e-ba7a-3804-832a03e16381
200
+ tools_state: toolsOk
201
+ connection_state: connected
202
+ instance_uuid: 5032c8a5-9c5e-ba7a-3804-832a03e16381
203
+ hostname: centos56gm.localdomain
204
+ mac_addresses:
205
+ Network adapter 1: 00:50:56:b2:00:af
206
+ operatingsystem: CentOS 4/5 (32-bit)
207
+ ENDvmLISTING
208
208
  when '5032c8a5-9c5e-ba7a-3804-832a03e16381'
209
209
  YAML.load <<-'5032c8a5-9c5e-ba7a-3804-832a03e16381'
210
- ---
211
- virtual_machines:
212
- - name: jefftest
213
- hypervisor: gunab.puppetlabs.lan
214
- tools_version: guestToolsCurrent
215
- ipaddress: 192.168.100.187
216
- mo_ref: vm-715
217
- power_state: poweredOn
218
- uuid: 42329da7-e8ab-29ec-1892-d6a4a964912a
219
- is_a_template: false
220
- id: 5032c8a5-9c5e-ba7a-3804-832a03e16381
221
- tools_state: toolsOk
222
- connection_state: connected
223
- instance_uuid: 5032c8a5-9c5e-ba7a-3804-832a03e16381
224
- hostname: centos56gm.localdomain
225
- mac_addresses:
226
- Network adapter 1: 00:50:56:b2:00:af
227
- operatingsystem: CentOS 4/5 (32-bit)
210
+ ---
211
+ virtual_machines:
212
+ - name: jefftest
213
+ hypervisor: gunab.puppetlabs.lan
214
+ tools_version: guestToolsCurrent
215
+ ipaddress: 192.168.100.187
216
+ mo_ref: vm-715
217
+ power_state: poweredOn
218
+ uuid: 42329da7-e8ab-29ec-1892-d6a4a964912a
219
+ is_a_template: false
220
+ id: 5032c8a5-9c5e-ba7a-3804-832a03e16381
221
+ tools_state: toolsOk
222
+ connection_state: connected
223
+ instance_uuid: 5032c8a5-9c5e-ba7a-3804-832a03e16381
224
+ hostname: centos56gm.localdomain
225
+ mac_addresses:
226
+ Network adapter 1: 00:50:56:b2:00:af
227
+ operatingsystem: CentOS 4/5 (32-bit)
228
228
  5032c8a5-9c5e-ba7a-3804-832a03e16381
229
229
  when 'does-not-exist-and-is-not-a-uuid', '50323f93-6835-1178-8b8f-9e2109890e1a'
230
230
  { 'virtual_machines' => [] }
@@ -5,7 +5,11 @@ module Fog
5
5
  module Shared
6
6
  private
7
7
  def vm_clone_check_options(options)
8
- options = { 'force' => false }.merge(options)
8
+ default_options = {
9
+ 'force' => false,
10
+ 'linked_clone' => false,
11
+ }
12
+ options = default_options.merge(options)
9
13
  required_options = %w{ path name }
10
14
  required_options.each do |param|
11
15
  raise ArgumentError, "#{required_options.join(', ')} are required" unless options.has_key? param
@@ -41,7 +45,7 @@ module Fog
41
45
  template_dc = path_elements.shift
42
46
  # If the first path element contains "vm" this denotes the vmFolder
43
47
  # and needs to be shifted out
44
- path_elements.shift if path_elements[0] = 'vm'
48
+ path_elements.shift if path_elements[0] == 'vm'
45
49
  # The template name. The remaining elements are the folders in the
46
50
  # datacenter.
47
51
  template_name = path_elements.pop
@@ -70,16 +74,47 @@ module Fog
70
74
  esx_host = vm_mob_ref.collect!('runtime.host')['runtime.host']
71
75
  # The parent of the ESX host itself is a ComputeResource which has a resourcePool
72
76
  resource_pool = esx_host.parent.resourcePool
73
-
74
- # Next, create a Relocation Spec instance
75
- relocation_spec = RbVmomi::VIM.VirtualMachineRelocateSpec(:pool => resource_pool,
76
- :transform => options['transform'] || 'sparse')
77
+ relocation_spec=nil
78
+ if ( options['linked_clone'] )
79
+ # cribbed heavily from the rbvmomi clone_vm.rb
80
+ # this chunk of code reconfigures the disk of the clone source to be read only,
81
+ # and then creates a delta disk on top of that, this is required by the API in order to create
82
+ # linked clondes
83
+ disks = vm_mob_ref.config.hardware.device.select do |vm_device|
84
+ vm_device.class == RbVmomi::VIM::VirtualDisk
85
+ end
86
+ disks.select{|vm_device| vm_device.backing.parent == nil}.each do |disk|
87
+ disk_spec = {
88
+ :deviceChange => [
89
+ {
90
+ :operation => :remove,
91
+ :device => disk
92
+ },
93
+ {
94
+ :operation => :add,
95
+ :fileOperation => :create,
96
+ :device => disk.dup.tap{|disk_backing|
97
+ disk_backing.backing = disk_backing.backing.dup;
98
+ disk_backing.backing.fileName = "[#{disk.backing.datastore.name}]";
99
+ disk_backing.backing.parent = disk.backing
100
+ }
101
+ },
102
+ ]
103
+ }
104
+ vm_mob_ref.ReconfigVM_Task(:spec => disk_spec).wait_for_completion
105
+ end
106
+ # Next, create a Relocation Spec instance
107
+ relocation_spec = RbVmomi::VIM.VirtualMachineRelocateSpec(:pool => resource_pool,
108
+ :diskMoveType => :moveChildMostDiskBacking)
109
+ else
110
+ relocation_spec = RbVmomi::VIM.VirtualMachineRelocateSpec(:pool => resource_pool,
111
+ :transform => options['transform'] || 'sparse')
112
+ end
77
113
  # And the clone specification
78
114
  clone_spec = RbVmomi::VIM.VirtualMachineCloneSpec(:location => relocation_spec,
79
115
  :powerOn => options['power_on'] || true,
80
116
  :template => false)
81
117
  task = vm_mob_ref.CloneVM_Task(:folder => vm_mob_ref.parent, :name => options['name'], :spec => clone_spec)
82
-
83
118
  # Waiting for the VM to complete allows us to get the VirtulMachine
84
119
  # object of the new machine when it's done. It is HIGHLY recommended
85
120
  # to set 'wait' => true if your app wants to wait. Otherwise, you're
@@ -126,7 +161,7 @@ module Fog
126
161
  end
127
162
  {
128
163
  'vm_ref' => 'vm-123',
129
- 'task_ref' => 'task-1234'
164
+ 'task_ref' => 'task-1234',
130
165
  }
131
166
  end
132
167
 
@@ -44,19 +44,21 @@ module Fog
44
44
  options[:notes] = description if description
45
45
  options[:priority] = priority if priority
46
46
  options[:ttl] = ttl if ttl
47
- data = unless identity
48
- connection.create_host(@zone.id, type, value, options)
49
- else
47
+
48
+ if identity
50
49
  options[:host_type] = type
51
50
  options[:data] = value
52
51
  connection.update_host(identity, options)
52
+ else
53
+ data = connection.create_host(@zone.id, type, value, options)
54
+ merge_attributes(data.body)
53
55
  end
54
- merge_attributes(data.body)
56
+
55
57
  true
56
58
  end
57
59
 
58
60
  private
59
-
61
+
60
62
  def zone=(new_zone)
61
63
  @zone = new_zone
62
64
  end