fog 1.10.0 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (379) hide show
  1. data/benchs/load_times.rb +31 -0
  2. data/changelog.txt +320 -0
  3. data/fog.gemspec +3 -3
  4. data/lib/fog.rb +42 -15
  5. data/lib/fog/aws/auto_scaling.rb +1 -1
  6. data/lib/fog/aws/beanstalk.rb +1 -1
  7. data/lib/fog/aws/cloud_formation.rb +1 -1
  8. data/lib/fog/aws/compute.rb +1 -1
  9. data/lib/fog/aws/elasticache.rb +1 -1
  10. data/lib/fog/aws/elb.rb +1 -1
  11. data/lib/fog/aws/iam.rb +1 -1
  12. data/lib/fog/aws/models/beanstalk/environment.rb +6 -2
  13. data/lib/fog/aws/models/cdn/distributions.rb +2 -1
  14. data/lib/fog/aws/models/cdn/distributions_helper.rb +2 -1
  15. data/lib/fog/aws/models/cdn/streaming_distributions.rb +2 -1
  16. data/lib/fog/aws/models/compute/server.rb +1 -1
  17. data/lib/fog/aws/models/storage/directory.rb +1 -1
  18. data/lib/fog/aws/models/storage/file.rb +1 -1
  19. data/lib/fog/aws/parsers/beanstalk/describe_environment_resources.rb +11 -0
  20. data/lib/fog/aws/rds.rb +1 -1
  21. data/lib/fog/aws/requests/cdn/delete_distribution.rb +5 -7
  22. data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +5 -7
  23. data/lib/fog/aws/requests/cdn/get_distribution.rb +28 -31
  24. data/lib/fog/aws/requests/cdn/get_distribution_list.rb +29 -33
  25. data/lib/fog/aws/requests/cdn/get_invalidation.rb +15 -13
  26. data/lib/fog/aws/requests/cdn/get_invalidation_list.rb +15 -17
  27. data/lib/fog/aws/requests/cdn/get_streaming_distribution.rb +23 -26
  28. data/lib/fog/aws/requests/cdn/get_streaming_distribution_list.rb +29 -33
  29. data/lib/fog/aws/requests/cdn/post_distribution.rb +40 -42
  30. data/lib/fog/aws/requests/cdn/post_invalidation.rb +14 -18
  31. data/lib/fog/aws/requests/cdn/post_streaming_distribution.rb +28 -30
  32. data/lib/fog/aws/requests/cdn/put_distribution_config.rb +41 -43
  33. data/lib/fog/aws/requests/cdn/put_streaming_distribution_config.rb +31 -33
  34. data/lib/fog/aws/requests/cloud_formation/create_stack.rb +16 -20
  35. data/lib/fog/aws/requests/cloud_formation/delete_stack.rb +5 -8
  36. data/lib/fog/aws/requests/cloud_formation/describe_stack_events.rb +19 -22
  37. data/lib/fog/aws/requests/cloud_formation/describe_stack_resources.rb +18 -21
  38. data/lib/fog/aws/requests/cloud_formation/describe_stacks.rb +18 -21
  39. data/lib/fog/aws/requests/cloud_formation/get_template.rb +7 -10
  40. data/lib/fog/aws/requests/cloud_formation/update_stack.rb +12 -16
  41. data/lib/fog/aws/requests/cloud_formation/validate_template.rb +9 -12
  42. data/lib/fog/aws/requests/compute/associate_address.rb +13 -7
  43. data/lib/fog/aws/requests/compute/describe_reserved_instances_offerings.rb +16 -2
  44. data/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -2
  45. data/lib/fog/aws/requests/elb/create_load_balancer.rb +10 -0
  46. data/lib/fog/aws/requests/iam/update_server_certificate.rb +27 -0
  47. data/lib/fog/aws/requests/storage/get_object.rb +6 -2
  48. data/lib/fog/aws/storage.rb +6 -4
  49. data/lib/fog/aws/sts.rb +1 -1
  50. data/lib/fog/bin.rb +2 -0
  51. data/lib/fog/bin/digitalocean.rb +31 -0
  52. data/lib/fog/bin/riakcs.rb +27 -0
  53. data/lib/fog/cloudstack/compute.rb +3 -0
  54. data/lib/fog/cloudstack/models/compute/snapshot.rb +46 -0
  55. data/lib/fog/cloudstack/models/compute/snapshots.rb +25 -0
  56. data/lib/fog/cloudstack/requests/compute/create_snapshot.rb +24 -0
  57. data/lib/fog/compute.rb +3 -0
  58. data/lib/fog/compute/models/server.rb +6 -7
  59. data/lib/fog/core.rb +10 -5
  60. data/lib/fog/core/errors.rb +2 -0
  61. data/lib/fog/core/scp.rb +3 -3
  62. data/lib/fog/core/ssh.rb +1 -1
  63. data/lib/fog/digitalocean.rb +9 -0
  64. data/lib/fog/digitalocean/CHANGELOG.md +6 -0
  65. data/lib/fog/digitalocean/compute.rb +107 -0
  66. data/lib/fog/digitalocean/examples/getting_started.md +106 -0
  67. data/lib/fog/digitalocean/models/compute/flavor.rb +14 -0
  68. data/lib/fog/digitalocean/models/compute/flavors.rb +25 -0
  69. data/lib/fog/digitalocean/models/compute/image.rb +15 -0
  70. data/lib/fog/digitalocean/models/compute/images.rb +25 -0
  71. data/lib/fog/digitalocean/models/compute/region.rb +14 -0
  72. data/lib/fog/digitalocean/models/compute/regions.rb +25 -0
  73. data/lib/fog/digitalocean/models/compute/server.rb +150 -0
  74. data/lib/fog/digitalocean/models/compute/servers.rb +27 -0
  75. data/lib/fog/digitalocean/models/compute/ssh_key.rb +28 -0
  76. data/lib/fog/digitalocean/models/compute/ssh_keys.rb +27 -0
  77. data/lib/fog/digitalocean/requests/compute/create_server.rb +68 -0
  78. data/lib/fog/digitalocean/requests/compute/create_ssh_key.rb +38 -0
  79. data/lib/fog/digitalocean/requests/compute/destroy_server.rb +34 -0
  80. data/lib/fog/digitalocean/requests/compute/destroy_ssh_key.rb +37 -0
  81. data/lib/fog/digitalocean/requests/compute/get_server_details.rb +35 -0
  82. data/lib/fog/digitalocean/requests/compute/get_ssh_key.rb +39 -0
  83. data/lib/fog/digitalocean/requests/compute/list_flavors.rb +38 -0
  84. data/lib/fog/digitalocean/requests/compute/list_images.rb +49 -0
  85. data/lib/fog/digitalocean/requests/compute/list_regions.rb +34 -0
  86. data/lib/fog/digitalocean/requests/compute/list_servers.rb +31 -0
  87. data/lib/fog/digitalocean/requests/compute/list_ssh_keys.rb +31 -0
  88. data/lib/fog/digitalocean/requests/compute/power_cycle_server.rb +33 -0
  89. data/lib/fog/digitalocean/requests/compute/power_off_server.rb +33 -0
  90. data/lib/fog/digitalocean/requests/compute/power_on_server.rb +33 -0
  91. data/lib/fog/digitalocean/requests/compute/reboot_server.rb +33 -0
  92. data/lib/fog/digitalocean/requests/compute/shutdown_server.rb +36 -0
  93. data/lib/fog/dreamhost/CHANGELOG.md +8 -0
  94. data/lib/fog/glesys/models/compute/server.rb +3 -3
  95. data/lib/fog/google/storage.rb +1 -1
  96. data/lib/fog/hp.rb +1 -1
  97. data/lib/fog/hp/CHANGELOG.hp +12 -2
  98. data/lib/fog/hp/block_storage.rb +1 -0
  99. data/lib/fog/hp/cdn.rb +1 -0
  100. data/lib/fog/hp/compute.rb +1 -0
  101. data/lib/fog/hp/models/compute/server.rb +14 -8
  102. data/lib/fog/hp/models/storage/directories.rb +1 -1
  103. data/lib/fog/hp/models/storage/directory.rb +28 -3
  104. data/lib/fog/hp/models/storage/files.rb +1 -1
  105. data/lib/fog/hp/requests/compute/create_server.rb +4 -14
  106. data/lib/fog/hp/storage.rb +2 -0
  107. data/lib/fog/internet_archive.rb +3 -1
  108. data/lib/fog/internet_archive/models/storage/directory.rb +25 -42
  109. data/lib/fog/internet_archive/models/storage/file.rb +45 -64
  110. data/lib/fog/internet_archive/models/storage/ia_attributes.rb +39 -0
  111. data/lib/fog/internet_archive/requests/storage/delete_multiple_objects.rb +4 -78
  112. data/lib/fog/internet_archive/requests/storage/delete_object.rb +2 -70
  113. data/lib/fog/internet_archive/requests/storage/get_object.rb +1 -22
  114. data/lib/fog/internet_archive/requests/storage/get_object_acl.rb +0 -4
  115. data/lib/fog/internet_archive/requests/storage/get_service.rb +1 -2
  116. data/lib/fog/internet_archive/requests/storage/head_object.rb +0 -4
  117. data/lib/fog/internet_archive/requests/storage/post_object_hidden_fields.rb +1 -1
  118. data/lib/fog/internet_archive/requests/storage/put_object.rb +2 -17
  119. data/lib/fog/internet_archive/requests/storage/put_object_acl.rb +0 -5
  120. data/lib/fog/internet_archive/storage.rb +6 -18
  121. data/lib/fog/joyent.rb +2 -0
  122. data/lib/fog/libvirt/requests/compute/get_node_info.rb +1 -1
  123. data/lib/fog/openstack/CHANGELOG.md +47 -0
  124. data/lib/fog/openstack/examples/identity/basics.rb +69 -0
  125. data/lib/fog/openstack/examples/image/upload-test-image.rb +77 -0
  126. data/lib/fog/openstack/examples/network/network_subnets_routers.rb +63 -0
  127. data/lib/fog/openstack/examples/storage/set-account-quota.rb +66 -0
  128. data/lib/fog/openstack/image.rb +4 -0
  129. data/lib/fog/openstack/models/compute/server.rb +4 -2
  130. data/lib/fog/openstack/models/network/floating_ip.rb +2 -2
  131. data/lib/fog/openstack/models/network/floating_ips.rb +1 -1
  132. data/lib/fog/openstack/models/network/router.rb +56 -0
  133. data/lib/fog/openstack/models/network/routers.rb +34 -0
  134. data/lib/fog/openstack/network.rb +15 -2
  135. data/lib/fog/openstack/requests/compute/create_server.rb +11 -0
  136. data/lib/fog/openstack/requests/compute/rebuild_server.rb +9 -1
  137. data/lib/fog/openstack/requests/network/add_router_interface.rb +48 -0
  138. data/lib/fog/openstack/requests/network/create_network.rb +57 -2
  139. data/lib/fog/openstack/requests/network/create_router.rb +57 -0
  140. data/lib/fog/openstack/requests/network/delete_router.rb +30 -0
  141. data/lib/fog/openstack/requests/network/get_router.rb +32 -0
  142. data/lib/fog/openstack/requests/network/list_routers.rb +27 -0
  143. data/lib/fog/openstack/requests/network/remove_router_interface.rb +36 -0
  144. data/lib/fog/openstack/requests/network/update_router.rb +85 -0
  145. data/lib/fog/openstack/storage.rb +57 -0
  146. data/lib/fog/ovirt/compute.rb +4 -0
  147. data/lib/fog/ovirt/models/compute/quota.rb +21 -0
  148. data/lib/fog/ovirt/models/compute/quotas.rb +24 -0
  149. data/lib/fog/ovirt/models/compute/server.rb +2 -1
  150. data/lib/fog/ovirt/models/compute/volume.rb +1 -0
  151. data/lib/fog/ovirt/requests/compute/get_quota.rb +19 -0
  152. data/lib/fog/ovirt/requests/compute/list_quotas.rb +21 -0
  153. data/lib/fog/ovirt/requests/compute/mock_files/quotas.xml +7 -0
  154. data/lib/fog/rackspace.rb +11 -0
  155. data/lib/fog/rackspace/block_storage.rb +73 -20
  156. data/lib/fog/rackspace/cdn.rb +57 -19
  157. data/lib/fog/rackspace/compute.rb +53 -28
  158. data/lib/fog/rackspace/compute_v2.rb +99 -22
  159. data/lib/fog/rackspace/databases.rb +74 -18
  160. data/lib/fog/rackspace/dns.rb +55 -22
  161. data/lib/fog/rackspace/docs/block_storage.md +417 -0
  162. data/lib/fog/rackspace/docs/compute_v2.md +114 -55
  163. data/lib/fog/rackspace/docs/getting_started.md +20 -10
  164. data/lib/fog/rackspace/docs/storage.md +496 -0
  165. data/lib/fog/rackspace/examples/README.md +1 -1
  166. data/lib/fog/rackspace/examples/block_storage/create_snapshot.rb +118 -0
  167. data/lib/fog/rackspace/examples/block_storage/create_volume.rb +58 -0
  168. data/lib/fog/rackspace/examples/block_storage/delete_volume.rb +53 -0
  169. data/lib/fog/rackspace/examples/compute_v2/create_image.rb +2 -2
  170. data/lib/fog/rackspace/examples/compute_v2/create_server.rb +1 -1
  171. data/lib/fog/rackspace/examples/compute_v2/delete_image.rb +2 -2
  172. data/lib/fog/rackspace/examples/compute_v2/delete_server.rb +2 -2
  173. data/lib/fog/rackspace/examples/compute_v2/detach_volume.rb +4 -4
  174. data/lib/fog/rackspace/examples/compute_v2/resize_server.rb +2 -2
  175. data/lib/fog/rackspace/examples/compute_v2/server_attachments.rb +3 -3
  176. data/lib/fog/rackspace/examples/compute_v2/server_metadata.rb +2 -2
  177. data/lib/fog/rackspace/examples/storage/create_cdn_directory.rb +44 -0
  178. data/lib/fog/rackspace/examples/storage/create_private_directory.rb +46 -0
  179. data/lib/fog/rackspace/examples/storage/delete_directory.rb +62 -0
  180. data/lib/fog/rackspace/examples/storage/delete_file.rb +70 -0
  181. data/lib/fog/rackspace/examples/storage/download_file.rb +75 -0
  182. data/lib/fog/rackspace/examples/storage/lorem.txt +1 -0
  183. data/lib/fog/rackspace/examples/storage/storage_metadata.rb +82 -0
  184. data/lib/fog/rackspace/examples/storage/upload_file.rb +45 -0
  185. data/lib/fog/rackspace/identity.rb +10 -3
  186. data/lib/fog/rackspace/load_balancers.rb +76 -18
  187. data/lib/fog/rackspace/models/block_storage/snapshot.rb +42 -0
  188. data/lib/fog/rackspace/models/block_storage/snapshots.rb +15 -0
  189. data/lib/fog/rackspace/models/block_storage/volume.rb +65 -0
  190. data/lib/fog/rackspace/models/block_storage/volume_type.rb +6 -0
  191. data/lib/fog/rackspace/models/block_storage/volume_types.rb +15 -0
  192. data/lib/fog/rackspace/models/block_storage/volumes.rb +15 -0
  193. data/lib/fog/rackspace/models/compute_v2/attachment.rb +8 -0
  194. data/lib/fog/rackspace/models/compute_v2/attachments.rb +9 -1
  195. data/lib/fog/rackspace/models/compute_v2/flavors.rb +9 -1
  196. data/lib/fog/rackspace/models/compute_v2/image.rb +10 -2
  197. data/lib/fog/rackspace/models/compute_v2/images.rb +9 -1
  198. data/lib/fog/rackspace/models/compute_v2/meta_parent.rb +1 -1
  199. data/lib/fog/rackspace/models/compute_v2/metadata.rb +17 -5
  200. data/lib/fog/rackspace/models/compute_v2/metadatum.rb +8 -0
  201. data/lib/fog/rackspace/models/compute_v2/server.rb +72 -13
  202. data/lib/fog/rackspace/models/compute_v2/servers.rb +16 -2
  203. data/lib/fog/rackspace/models/dns/zones.rb +5 -9
  204. data/lib/fog/rackspace/models/identity/service_catalog.rb +83 -0
  205. data/lib/fog/rackspace/models/storage/account.rb +26 -0
  206. data/lib/fog/rackspace/models/storage/directories.rb +23 -3
  207. data/lib/fog/rackspace/models/storage/directory.rb +89 -5
  208. data/lib/fog/rackspace/models/storage/file.rb +112 -2
  209. data/lib/fog/rackspace/models/storage/files.rb +78 -0
  210. data/lib/fog/rackspace/models/storage/metadata.rb +28 -5
  211. data/lib/fog/rackspace/requests/block_storage/create_snapshot.rb +24 -0
  212. data/lib/fog/rackspace/requests/block_storage/create_volume.rb +29 -0
  213. data/lib/fog/rackspace/requests/block_storage/delete_snapshot.rb +10 -0
  214. data/lib/fog/rackspace/requests/block_storage/delete_volume.rb +11 -0
  215. data/lib/fog/rackspace/requests/block_storage/get_snapshot.rb +20 -0
  216. data/lib/fog/rackspace/requests/block_storage/get_volume.rb +24 -0
  217. data/lib/fog/rackspace/requests/block_storage/get_volume_type.rb +14 -0
  218. data/lib/fog/rackspace/requests/block_storage/list_snapshots.rb +17 -0
  219. data/lib/fog/rackspace/requests/block_storage/list_volume_types.rb +13 -0
  220. data/lib/fog/rackspace/requests/block_storage/list_volumes.rb +21 -0
  221. data/lib/fog/rackspace/requests/cdn/delete_object.rb +5 -1
  222. data/lib/fog/rackspace/requests/cdn/get_containers.rb +5 -0
  223. data/lib/fog/rackspace/requests/cdn/head_container.rb +5 -0
  224. data/lib/fog/rackspace/requests/cdn/post_container.rb +6 -1
  225. data/lib/fog/rackspace/requests/cdn/put_container.rb +6 -1
  226. data/lib/fog/rackspace/requests/compute_v2/attach_volume.rb +4 -0
  227. data/lib/fog/rackspace/requests/compute_v2/change_server_password.rb +4 -0
  228. data/lib/fog/rackspace/requests/compute_v2/confirm_resize_server.rb +5 -0
  229. data/lib/fog/rackspace/requests/compute_v2/create_image.rb +9 -4
  230. data/lib/fog/rackspace/requests/compute_v2/create_server.rb +9 -5
  231. data/lib/fog/rackspace/requests/compute_v2/delete_attachment.rb +5 -0
  232. data/lib/fog/rackspace/requests/compute_v2/delete_image.rb +5 -0
  233. data/lib/fog/rackspace/requests/compute_v2/delete_metadata_item.rb +5 -0
  234. data/lib/fog/rackspace/requests/compute_v2/delete_server.rb +5 -0
  235. data/lib/fog/rackspace/requests/compute_v2/get_attachment.rb +4 -0
  236. data/lib/fog/rackspace/requests/compute_v2/get_flavor.rb +4 -0
  237. data/lib/fog/rackspace/requests/compute_v2/get_image.rb +5 -1
  238. data/lib/fog/rackspace/requests/compute_v2/get_metadata_item.rb +4 -0
  239. data/lib/fog/rackspace/requests/compute_v2/get_server.rb +4 -0
  240. data/lib/fog/rackspace/requests/compute_v2/list_addresses.rb +4 -0
  241. data/lib/fog/rackspace/requests/compute_v2/list_addresses_by_network.rb +4 -0
  242. data/lib/fog/rackspace/requests/compute_v2/list_attachments.rb +4 -0
  243. data/lib/fog/rackspace/requests/compute_v2/list_flavors.rb +4 -0
  244. data/lib/fog/rackspace/requests/compute_v2/list_images.rb +4 -0
  245. data/lib/fog/rackspace/requests/compute_v2/list_metadata.rb +4 -0
  246. data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +4 -0
  247. data/lib/fog/rackspace/requests/compute_v2/reboot_server.rb +4 -0
  248. data/lib/fog/rackspace/requests/compute_v2/rebuild_server.rb +8 -4
  249. data/lib/fog/rackspace/requests/compute_v2/resize_server.rb +6 -1
  250. data/lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb +8 -3
  251. data/lib/fog/rackspace/requests/compute_v2/set_metadata.rb +4 -0
  252. data/lib/fog/rackspace/requests/compute_v2/set_metadata_item.rb +4 -0
  253. data/lib/fog/rackspace/requests/compute_v2/update_metadata.rb +4 -0
  254. data/lib/fog/rackspace/requests/compute_v2/update_server.rb +4 -0
  255. data/lib/fog/rackspace/requests/storage/copy_object.rb +4 -0
  256. data/lib/fog/rackspace/requests/storage/delete_container.rb +4 -1
  257. data/lib/fog/rackspace/requests/storage/delete_object.rb +4 -1
  258. data/lib/fog/rackspace/requests/storage/get_container.rb +4 -0
  259. data/lib/fog/rackspace/requests/storage/get_containers.rb +4 -0
  260. data/lib/fog/rackspace/requests/storage/get_object.rb +4 -1
  261. data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +7 -4
  262. data/lib/fog/rackspace/requests/storage/head_container.rb +4 -0
  263. data/lib/fog/rackspace/requests/storage/head_containers.rb +4 -0
  264. data/lib/fog/rackspace/requests/storage/head_object.rb +4 -1
  265. data/lib/fog/rackspace/requests/storage/post_set_meta_temp_url_key.rb +4 -1
  266. data/lib/fog/rackspace/requests/storage/put_container.rb +4 -1
  267. data/lib/fog/rackspace/requests/storage/put_object.rb +4 -1
  268. data/lib/fog/rackspace/requests/storage/put_object_manifest.rb +4 -1
  269. data/lib/fog/rackspace/service.rb +78 -0
  270. data/lib/fog/rackspace/storage.rb +62 -22
  271. data/lib/fog/riakcs.rb +122 -0
  272. data/lib/fog/riakcs/provisioning.rb +100 -0
  273. data/lib/fog/riakcs/requests/provisioning/create_user.rb +77 -0
  274. data/lib/fog/riakcs/requests/provisioning/disable_user.rb +23 -0
  275. data/lib/fog/riakcs/requests/provisioning/enable_user.rb +23 -0
  276. data/lib/fog/riakcs/requests/provisioning/get_user.rb +41 -0
  277. data/lib/fog/riakcs/requests/provisioning/list_users.rb +43 -0
  278. data/lib/fog/riakcs/requests/provisioning/regrant_secret.rb +23 -0
  279. data/lib/fog/riakcs/requests/provisioning/update_user.rb +23 -0
  280. data/lib/fog/riakcs/requests/usage/get_usage.rb +68 -0
  281. data/lib/fog/riakcs/usage.rb +66 -0
  282. data/lib/fog/vcloud/compute.rb +1 -1
  283. data/lib/fog/vcloud/models/compute/catalog_item.rb +8 -0
  284. data/lib/fog/vcloud/models/compute/server.rb +1 -0
  285. data/lib/fog/vcloud/requests/compute/configure_vm_network.rb +1 -2
  286. data/lib/fog/version.rb +1 -1
  287. data/lib/fog/vsphere/compute.rb +1 -1
  288. data/lib/fog/vsphere/models/compute/servers.rb +9 -9
  289. data/lib/fog/xenserver.rb +2 -0
  290. data/lib/fog/xenserver/CHANGELOG.md +7 -1
  291. data/lib/fog/xenserver/compute.rb +6 -0
  292. data/lib/fog/xenserver/examples/networks-and-vlans.rb +45 -0
  293. data/lib/fog/xenserver/models/compute/network.rb +33 -0
  294. data/lib/fog/xenserver/models/compute/vlan.rb +80 -0
  295. data/lib/fog/xenserver/models/compute/vlans.rb +39 -0
  296. data/lib/fog/xenserver/requests/compute/create_network.rb +42 -0
  297. data/lib/fog/xenserver/requests/compute/create_vlan.rb +35 -0
  298. data/lib/fog/xenserver/requests/compute/destroy_network.rb +33 -0
  299. data/lib/fog/xenserver/requests/compute/destroy_vlan.rb +32 -0
  300. data/lib/fog/zerigo/models/dns/records.rb +15 -12
  301. data/lib/tasks/changelog_task.rb +1 -0
  302. data/tests/aws/requests/compute/address_tests.rb +4 -0
  303. data/tests/aws/requests/iam/server_certificate_tests.rb +32 -0
  304. data/tests/cloudstack/compute/models/snapshot_tests.rb +34 -0
  305. data/tests/digitalocean/helper.rb +44 -0
  306. data/tests/digitalocean/models/compute/flavor_tests.rb +30 -0
  307. data/tests/digitalocean/models/compute/image_tests.rb +31 -0
  308. data/tests/digitalocean/models/compute/region_tests.rb +30 -0
  309. data/tests/digitalocean/models/compute/server_tests.rb +84 -0
  310. data/tests/digitalocean/models/compute/servers_tests.rb +35 -0
  311. data/tests/digitalocean/models/compute/ssh_key_tests.rb +40 -0
  312. data/tests/digitalocean/models/compute/ssh_keys_tests.rb +28 -0
  313. data/tests/digitalocean/requests/compute/create_server_tests.rb +28 -0
  314. data/tests/digitalocean/requests/compute/create_ssh_key_tests.rb +22 -0
  315. data/tests/digitalocean/requests/compute/destroy_server_tests.rb +15 -0
  316. data/tests/digitalocean/requests/compute/destroy_ssh_key_tests.rb +23 -0
  317. data/tests/digitalocean/requests/compute/get_server_details_tests.rb +13 -0
  318. data/tests/digitalocean/requests/compute/get_ssh_key_tests.rb +22 -0
  319. data/tests/digitalocean/requests/compute/list_flavors_tests.rb +23 -0
  320. data/tests/digitalocean/requests/compute/list_images_tests.rb +24 -0
  321. data/tests/digitalocean/requests/compute/list_regions_tests.rb +23 -0
  322. data/tests/digitalocean/requests/compute/list_servers_tests.rb +26 -0
  323. data/tests/digitalocean/requests/compute/list_ssh_keys_tests.rb +21 -0
  324. data/tests/digitalocean/requests/compute/power_cycle_server_tests.rb +20 -0
  325. data/tests/digitalocean/requests/compute/power_state_tests.rb +25 -0
  326. data/tests/digitalocean/requests/compute/reboot_server_tests.rb +14 -0
  327. data/tests/helpers/collection_helper.rb +36 -1
  328. data/tests/helpers/mock_helper.rb +2 -0
  329. data/tests/internet_archive/models/storage/directory_tests.rb +24 -32
  330. data/tests/internet_archive/models/storage/file_tests.rb +16 -35
  331. data/tests/internet_archive/models/storage/files_tests.rb +33 -31
  332. data/tests/internet_archive/models/storage/url_tests.rb +1 -1
  333. data/tests/internet_archive/requests/storage/bucket_tests.rb +34 -38
  334. data/tests/internet_archive/requests/storage/multipart_upload_tests.rb +1 -1
  335. data/tests/openstack/models/network/network_tests.rb +17 -0
  336. data/tests/openstack/models/network/router_tests.rb +38 -0
  337. data/tests/openstack/models/network/routers_tests.rb +21 -0
  338. data/tests/openstack/requests/network/network_tests.rb +61 -10
  339. data/tests/openstack/requests/network/router_tests.rb +75 -0
  340. data/tests/openstack/storage_tests.rb +19 -0
  341. data/tests/ovirt/requests/compute/list_quotas_tests.rb +12 -0
  342. data/tests/rackspace/block_storage_tests.rb +101 -0
  343. data/tests/rackspace/cdn_tests.rb +144 -52
  344. data/tests/rackspace/compute_tests.rb +88 -0
  345. data/tests/rackspace/compute_v2_tests.rb +101 -0
  346. data/tests/rackspace/databases_tests.rb +98 -0
  347. data/tests/rackspace/dns_tests.rb +82 -0
  348. data/tests/rackspace/load_balancer_tests.rb +99 -0
  349. data/tests/rackspace/models/compute_v2/image_tests.rb +51 -0
  350. data/tests/rackspace/models/compute_v2/server_tests.rb +51 -0
  351. data/tests/rackspace/models/identity/service_catalog_tests.rb +81 -0
  352. data/tests/rackspace/models/storage/file_tests.rb +10 -1
  353. data/tests/rackspace/rackspace_tests.rb +21 -0
  354. data/tests/rackspace/requests/compute_v2/metadata_tests.rb +2 -2
  355. data/tests/rackspace/requests/storage/object_tests.rb +2 -2
  356. data/tests/rackspace/storage_tests.rb +99 -3
  357. data/tests/riakcs/requests/provisioning/provisioning_tests.rb +174 -0
  358. data/tests/riakcs/requests/usage/usage_tests.rb +29 -0
  359. data/tests/xenserver/models/compute/network_tests.rb +18 -6
  360. data/tests/xenserver/models/compute/vlan_tests.rb +76 -0
  361. data/tests/xenserver/models/compute/vlans_tests.rb +36 -0
  362. data/tests/xenserver/requests/compute/create_network_tests.rb +20 -0
  363. data/tests/xenserver/requests/compute/create_vlan_tests.rb +36 -0
  364. data/tests/xenserver/requests/compute/destroy_network_tests.rb +13 -0
  365. data/tests/xenserver/requests/compute/destroy_vlan_tests.rb +36 -0
  366. metadata +178 -21
  367. data/lib/fog/internet_archive/models/storage/version.rb +0 -36
  368. data/lib/fog/internet_archive/models/storage/versions.rb +0 -38
  369. data/lib/fog/internet_archive/parsers/storage/get_bucket_object_versions.rb +0 -88
  370. data/lib/fog/internet_archive/parsers/storage/get_bucket_versioning.rb +0 -24
  371. data/lib/fog/internet_archive/requests/storage/get_bucket_object_versions.rb +0 -162
  372. data/lib/fog/internet_archive/requests/storage/get_bucket_versioning.rb +0 -69
  373. data/lib/fog/internet_archive/requests/storage/put_bucket_versioning.rb +0 -75
  374. data/lib/fog/openstack/README.identity.md +0 -69
  375. data/lib/fog/providers.rb +0 -34
  376. data/lib/fog/rackspace/examples/compute_v2/README.md +0 -47
  377. data/tests/internet_archive/models/storage/version_tests.rb +0 -52
  378. data/tests/internet_archive/models/storage/versions_tests.rb +0 -56
  379. data/tests/internet_archive/requests/storage/versioning_tests.rb +0 -258
@@ -301,7 +301,7 @@ module Fog
301
301
 
302
302
  # Use this to set the Authorization header for login
303
303
  def authorization_header
304
- "Basic #{Base64.encode64("#{@username}:#{@password}").chomp!}"
304
+ "Basic #{Base64.encode64("#{@username}:#{@password}").delete("\r\n")}"
305
305
  end
306
306
 
307
307
  # Actually do the request
@@ -23,6 +23,14 @@ module Fog
23
23
  end
24
24
  end
25
25
 
26
+ def password_enabled?
27
+ load_unless_loaded!
28
+ customization_options = service.get_vapp_template(self.entity[:href]).body[:Children][:Vm][:GuestCustomizationSection]
29
+ return false if customization_options[:AdminPasswordEnabled] == "false"
30
+ return true if customization_options[:AdminPasswordEnabled] == "true" \
31
+ and customization_options[:AdminPasswordAuto] == "false" \
32
+ and ( options[:password].nil? or options[:password].empty? )
33
+ end
26
34
  end
27
35
  end
28
36
  end
@@ -261,6 +261,7 @@ module Fog
261
261
  @update_password = nil
262
262
  @update_cpu_value = nil
263
263
  @update_memory_value = nil
264
+ @update_network = nil
264
265
  @name_changed = false
265
266
  @description_changed = nil
266
267
  end
@@ -19,11 +19,10 @@ module Fog
19
19
  </NetworkConnection>
20
20
  </NetworkConnectionSection>
21
21
  EOF
22
- print "Request: #{body}"
23
22
  request(
24
23
  :body => body,
25
24
  :expects => 202,
26
- :headers => {'Content-Type' => network_info[:"vcloud_type"] },
25
+ :headers => {'Content-Type' => network_info[:"type"] },
27
26
  :method => 'PUT',
28
27
  :uri => "#{edit_uri}",
29
28
  :parse => true
@@ -1,3 +1,3 @@
1
1
  module Fog
2
- VERSION = '1.10.0'
2
+ VERSION = '1.10.1'
3
3
  end
@@ -152,7 +152,7 @@ module Fog
152
152
 
153
153
  # returns vmware managed obj id string
154
154
  def managed_obj_id obj
155
- obj.to_s.match(/\("(\S+)"\)/)[1]
155
+ obj.to_s.match(/\("([^"]+)"\)/)[1]
156
156
  end
157
157
 
158
158
  end
@@ -17,13 +17,15 @@ module Fog
17
17
  # 'folder' => '/Datacenters/vm/Jeff/Templates' will be MUCH faster.
18
18
  # than simply listing everything.
19
19
  def all(filters = { })
20
- load service.list_virtual_machines(filters.merge(
21
- :datacenter => datacenter,
22
- :cluster => cluster,
23
- :network => network,
24
- :resource_pool => resource_pool,
25
- :folder => folder
26
- ))
20
+ f = {
21
+ :datacenter => datacenter,
22
+ :cluster => cluster,
23
+ :network => network,
24
+ :resource_pool => resource_pool,
25
+ :folder => folder
26
+ }.merge(filters)
27
+
28
+ load service.list_virtual_machines(f)
27
29
  end
28
30
 
29
31
  def get(id, datacenter = nil)
@@ -31,9 +33,7 @@ module Fog
31
33
  rescue Fog::Compute::Vsphere::NotFound
32
34
  nil
33
35
  end
34
-
35
36
  end
36
-
37
37
  end
38
38
  end
39
39
  end
@@ -1,3 +1,5 @@
1
+ require 'fog/core'
2
+
1
3
  module Fog
2
4
  module XenServer
3
5
 
@@ -1,4 +1,10 @@
1
- # 1.9.0 XX/XX/XXXX (XenServer ChangeLog)
1
+ # 1.11.0 2013/04/04
2
+
3
+ * It's now possible to manage XS/XCP VLANs and Networks
4
+
5
+ See https://github.com/fog/fog/blob/master/lib/fog/xenserver/examples/networks-and-vlans.rb
6
+
7
+ # 1.9.0 2013/01/19
2
8
 
3
9
  * Added missing HostCpu model
4
10
 
@@ -38,6 +38,8 @@ module Fog
38
38
  model :vbd_metrics
39
39
  model :host_metrics
40
40
  model :host_cpu
41
+ model :vlan
42
+ collection :vlans
41
43
 
42
44
  request_path 'fog/xenserver/requests/compute'
43
45
  request :create_server
@@ -68,6 +70,10 @@ module Fog
68
70
  request :disable_host
69
71
  request :enable_host
70
72
  request :shutdown_host
73
+ request :create_network
74
+ request :destroy_network
75
+ request :create_vlan
76
+ request :destroy_vlan
71
77
 
72
78
  class Real
73
79
 
@@ -0,0 +1,45 @@
1
+ require 'fog'
2
+
3
+ #
4
+ # Create the connection to the XenServer host
5
+ #
6
+ xenserver = Fog::Compute.new({
7
+ :provider => 'XenServer',
8
+ :xenserver_url => '1.2.3.4',
9
+ :xenserver_username => 'root',
10
+ :xenserver_password => 'secret',
11
+ })
12
+
13
+ # We have a bonded interface in XenServer, bond0 and
14
+ # we want to add the VLANs there.
15
+ # Note the VLAN ID -1, it is important since you
16
+ # will problably have many PIFs with device == bond0
17
+ # but we need the one without a proper VLAN ID
18
+ #
19
+ bondmaster_pif = xenserver.pifs.find do |pif|
20
+ pif.vlan == "-1" and pif.device == "bond0"
21
+ end
22
+
23
+ # Another valid way of finding a PIF, without bonding
24
+ # pif = xenserver.pifs.find { |pif| pif.physical and pif.device == 'eth0' }
25
+
26
+ # We want to create these new VLANs
27
+ vlans = [
28
+ { "name" => "VLAN 44", "vlanid" => 44},
29
+ { "name" => "VLAN 55", "vlanid" => 55}
30
+ ]
31
+
32
+
33
+ vlans.each do |vlan|
34
+ # Do not create duplicated networks
35
+ if xenserver.networks.find { |n| n.name == vlan['name'] }
36
+ puts "Network #{vlan['name']} available, skipping"
37
+ next
38
+ end
39
+
40
+ puts "Craeting Network #{vlan['name']}, VLAN ID #{vlan['vlanid']}"
41
+ network = xenserver.networks.create :name => vlan['name']
42
+ xenserver.vlans.create :tag => vlan['vlanid'],
43
+ :network => network,
44
+ :pif => bondmaster_pif
45
+ end
@@ -51,6 +51,39 @@ module Fog
51
51
  v
52
52
  end
53
53
 
54
+ # Creates a new network
55
+ #
56
+ # service = Fog::Compute[:xenserver]
57
+ #
58
+ # # create network 'foonet'
59
+ # net = service.networks.create :name => 'foonet',
60
+ # :description => 'test network'
61
+ #
62
+ # @returns [Boolean]
63
+ #
64
+ def save
65
+ requires :name
66
+ ref = service.create_network name, attributes
67
+ data = service.get_record ref, 'network'
68
+ merge_attributes data
69
+ true
70
+ end
71
+
72
+ # Destroys a network
73
+ #
74
+ # service = Fog::Compute[:xenserver]
75
+ #
76
+ # # find network 'foonet' and destroy it
77
+ # net = service.networks.find { |net| net.name == 'foonet' }
78
+ # net.destroy
79
+ #
80
+ # @returns [Boolean]
81
+ #
82
+ def destroy
83
+ requires :reference
84
+ service.destroy_network reference
85
+ true
86
+ end
54
87
  end
55
88
 
56
89
  end
@@ -0,0 +1,80 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class XenServer
6
+
7
+ class VLAN < Fog::Model
8
+ # API Reference here:
9
+ # @see http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VLAN
10
+
11
+ identity :reference
12
+
13
+ attribute :uuid
14
+ attribute :tag, :type => :integer
15
+ attribute :__untagged_pif, :aliases => :untagged_PIF
16
+ attribute :__tagged_pif, :aliases => :tagged_PIF
17
+
18
+ # @return [Fog::Compute::XenServer::PIF] interface on which traffic is tagged
19
+ #
20
+ # @see http://docs.vmd.citrix.com/XenServer/6.1.0/1.0/en_gb/api/?c=VLAN
21
+ #
22
+ def untagged_pif
23
+ service.pifs.get __untagged_pif
24
+ end
25
+
26
+ # @return [Fog::Compute::XenServer::PIF] interface on which traffic is untagged
27
+ #
28
+ # @see http://docs.vmd.citrix.com/XenServer/6.1.0/1.0/en_gb/api/?c=VLAN
29
+ #
30
+ def tagged_pif
31
+ service.pifs.get __tagged_pif
32
+ end
33
+
34
+ # Creates a new VLAN.
35
+ #
36
+ # service = Fog::Compute[:xenserver]
37
+ #
38
+ # # create a network 'foo-net'
39
+ # net = service.networks.create :name => 'foo-net'
40
+ #
41
+ # # get the eth0 physical interface where the
42
+ # # VLAN subinterface will be added
43
+ # pif = service.pifs.find { |p| p.device == 'eth0' and p.physical }
44
+ #
45
+ # Fog::Compute[:xenserver].vlans.create :tag => 123,
46
+ # :network => net,
47
+ # :pif => pif
48
+ def save
49
+ requires :tag
50
+ pif = attributes[:pif]
51
+ net = attributes[:network]
52
+ unless pif and net
53
+ raise Fog::Error.new 'save requires :pif and :network attributes'
54
+ end
55
+ ref = service.create_vlan attributes[:pif].reference,
56
+ tag,
57
+ attributes[:network].reference
58
+ data = service.get_record ref, 'VLAN'
59
+ merge_attributes data
60
+ true
61
+ end
62
+
63
+ # Destroys a VLAN.
64
+ #
65
+ # service = Fog::Compute[:xenserver]
66
+ #
67
+ # # Find VLAN 123 and destroy it
68
+ # (service.vlans.find { |v| v.tag == 123 }).destroy
69
+ #
70
+ def destroy
71
+ requires :reference
72
+ service.destroy_vlan reference
73
+ true
74
+ end
75
+
76
+ end
77
+
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,39 @@
1
+ require 'fog/core/collection'
2
+ require 'fog/xenserver/models/compute/vlan'
3
+
4
+ module Fog
5
+ module Compute
6
+ class XenServer
7
+
8
+ class Vlans < Fog::Collection
9
+
10
+ model Fog::Compute::XenServer::VLAN
11
+
12
+ # Return the list of VLANs available
13
+ #
14
+ # @return [Array] a list of Fog::Compute::XenServer::VLAN
15
+ #
16
+ def all(options = {})
17
+ data = service.get_records 'VLAN'
18
+ load(data)
19
+ end
20
+
21
+ # Retrieve a VLAN object by by reference.
22
+ #
23
+ # @return [Fog::Compute::XenServer::VLAN]
24
+ #
25
+ # Returns nil if not found
26
+ #
27
+ def get( ref )
28
+ if ref && obj = service.get_record( ref, 'VLAN' )
29
+ new(obj)
30
+ end
31
+ rescue Fog::XenServer::NotFound
32
+ nil
33
+ end
34
+
35
+ end
36
+
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,42 @@
1
+ module Fog
2
+ module Compute
3
+ class XenServer
4
+
5
+ class Real
6
+
7
+ # Create a Network
8
+ #
9
+ # @see http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=network
10
+ #
11
+ def create_network( name, config = {} )
12
+ config.reject! { |k,v| v.nil? }
13
+
14
+ default_config = {
15
+ :name_label => name,
16
+ # Description is mandatory in XenAPI but we default to empty
17
+ :name_description => config[:description] || '',
18
+ # Mandatory, but can be empty
19
+ :other_config => {}
20
+ }.merge config
21
+
22
+ @connection.request(
23
+ {
24
+ :parser => Fog::Parsers::XenServer::Base.new,
25
+ :method => 'network.create'
26
+ },
27
+ default_config
28
+ )
29
+ end
30
+ end
31
+
32
+ class Mock
33
+
34
+ def create_network( name, description = '', config = {} )
35
+ Fog::Mock.not_implemented
36
+ end
37
+
38
+ end
39
+
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,35 @@
1
+ module Fog
2
+ module Compute
3
+ class XenServer
4
+
5
+ class Real
6
+
7
+ #
8
+ # Create a VLAN
9
+ #
10
+ # @see http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=VLAN
11
+ #
12
+ def create_vlan( pif_ref, vlan_id, network_ref )
13
+ @connection.request(
14
+ {
15
+ :parser => Fog::Parsers::XenServer::Base.new,
16
+ :method => 'VLAN.create'
17
+ },
18
+ pif_ref,
19
+ vlan_id.to_s,
20
+ network_ref
21
+ )
22
+ end
23
+ end
24
+
25
+ class Mock
26
+
27
+ def create_vlan( pif_ref, vlan_id, network_ref )
28
+ Fog::Mock.not_implemented
29
+ end
30
+
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,33 @@
1
+ module Fog
2
+ module Compute
3
+ class XenServer
4
+
5
+ class Real
6
+
7
+ #
8
+ # Destroy a Network
9
+ #
10
+ # @see http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=network
11
+ #
12
+ def destroy_network( ref )
13
+ @connection.request(
14
+ {
15
+ :parser => Fog::Parsers::XenServer::Base.new,
16
+ :method => 'network.destroy'
17
+ },
18
+ ref
19
+ )
20
+ end
21
+
22
+ end
23
+
24
+ class Mock
25
+
26
+ def destroy_network( ref )
27
+ Fog::Mock.not_implemented
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end