fog 1.24.0 → 1.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. checksums.yaml +5 -13
  2. data/CHANGELOG.md +184 -1
  3. data/CONTRIBUTORS.md +23 -0
  4. data/README.md +17 -9
  5. data/Rakefile +4 -0
  6. data/fog.gemspec +18 -6
  7. data/lib/fog.rb +1 -1
  8. data/lib/fog/aws/auto_scaling.rb +12 -12
  9. data/lib/fog/aws/beanstalk.rb +12 -10
  10. data/lib/fog/aws/cdn.rb +0 -1
  11. data/lib/fog/aws/cloud_formation.rb +13 -11
  12. data/lib/fog/aws/cloud_watch.rb +14 -11
  13. data/lib/fog/aws/compute.rb +19 -19
  14. data/lib/fog/aws/core.rb +21 -0
  15. data/lib/fog/aws/dns.rb +0 -1
  16. data/lib/fog/aws/elasticache.rb +13 -9
  17. data/lib/fog/aws/elb.rb +23 -14
  18. data/lib/fog/aws/emr.rb +11 -9
  19. data/lib/fog/aws/iam.rb +14 -11
  20. data/lib/fog/aws/models/compute/security_group.rb +41 -0
  21. data/lib/fog/aws/models/elb/load_balancer.rb +31 -0
  22. data/lib/fog/aws/models/glacier/archive.rb +3 -1
  23. data/lib/fog/aws/models/iam/role.rb +1 -1
  24. data/lib/fog/aws/models/iam/roles.rb +1 -1
  25. data/lib/fog/aws/models/storage/file.rb +1 -1
  26. data/lib/fog/aws/parsers/compute/describe_security_groups.rb +68 -53
  27. data/lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb +7 -0
  28. data/lib/fog/aws/parsers/elb/describe_tags.rb +26 -0
  29. data/lib/fog/aws/parsers/elb/tag_list_parser.rb +57 -0
  30. data/lib/fog/aws/parsers/storage/get_bucket_website.rb +5 -1
  31. data/lib/fog/aws/rds.rb +13 -11
  32. data/lib/fog/aws/region_methods.rb +1 -1
  33. data/lib/fog/aws/requests/dynamodb/put_item.rb +1 -1
  34. data/lib/fog/aws/requests/elb/add_tags.rb +46 -0
  35. data/lib/fog/aws/requests/elb/create_load_balancer.rb +4 -1
  36. data/lib/fog/aws/requests/elb/describe_load_balancer_attributes.rb +3 -0
  37. data/lib/fog/aws/requests/elb/describe_tags.rb +56 -0
  38. data/lib/fog/aws/requests/elb/modify_load_balancer_attributes.rb +9 -3
  39. data/lib/fog/aws/requests/elb/remove_tags.rb +46 -0
  40. data/lib/fog/aws/requests/storage/copy_object.rb +1 -1
  41. data/lib/fog/aws/requests/storage/delete_object.rb +4 -3
  42. data/lib/fog/aws/requests/storage/post_object_hidden_fields.rb +23 -5
  43. data/lib/fog/aws/requests/storage/post_object_restore.rb +1 -1
  44. data/lib/fog/aws/requests/storage/put_bucket_website.rb +46 -18
  45. data/lib/fog/aws/ses.rb +1 -2
  46. data/lib/fog/aws/signaturev4.rb +62 -15
  47. data/lib/fog/aws/simpledb.rb +0 -1
  48. data/lib/fog/aws/sns.rb +12 -9
  49. data/lib/fog/aws/sqs.rb +14 -10
  50. data/lib/fog/aws/storage.rb +102 -78
  51. data/lib/fog/aws/sts.rb +10 -9
  52. data/lib/fog/bare_metal_cloud/compute.rb +0 -1
  53. data/lib/fog/bin.rb +1 -0
  54. data/lib/fog/bin/brightbox.rb +3 -1
  55. data/lib/fog/bin/rackspace.rb +4 -0
  56. data/lib/fog/bluebox/models/compute/server.rb +1 -0
  57. data/lib/fog/cloudstack/models/compute/server.rb +12 -1
  58. data/lib/fog/cloudstack/models/compute/snapshots.rb +3 -2
  59. data/lib/fog/cloudstack/models/compute/volume.rb +5 -0
  60. data/lib/fog/cloudstack/models/compute/volumes.rb +3 -2
  61. data/lib/fog/core/parser.rb +2 -112
  62. data/lib/fog/dnsmadeeasy/dns.rb +0 -1
  63. data/lib/fog/dynect/core.rb +0 -1
  64. data/lib/fog/dynect/dns.rb +11 -3
  65. data/lib/fog/ecloud/compute.rb +0 -1
  66. data/lib/fog/ecloud/core.rb +1 -1
  67. data/lib/fog/fogdocker/compute.rb +4 -1
  68. data/lib/fog/fogdocker/core.rb +1 -7
  69. data/lib/fog/fogdocker/errors.rb +9 -0
  70. data/lib/fog/fogdocker/models/compute/images.rb +4 -0
  71. data/lib/fog/fogdocker/models/compute/server.rb +18 -1
  72. data/lib/fog/fogdocker/requests/compute/container_action.rb +53 -3
  73. data/lib/fog/fogdocker/requests/compute/container_get.rb +31 -12
  74. data/lib/fog/fogdocker/requests/compute/image_search.rb +29 -0
  75. data/lib/fog/google/dns.rb +46 -12
  76. data/lib/fog/google/examples/dns/project.rb +8 -0
  77. data/lib/fog/google/examples/dns/zones.rb +43 -0
  78. data/lib/fog/google/models/compute/images.rb +2 -1
  79. data/lib/fog/google/models/dns/change.rb +40 -0
  80. data/lib/fog/google/models/dns/changes.rb +52 -0
  81. data/lib/fog/google/models/dns/project.rb +75 -0
  82. data/lib/fog/google/models/dns/projects.rb +25 -0
  83. data/lib/fog/google/models/dns/record.rb +112 -0
  84. data/lib/fog/google/models/dns/records.rb +52 -0
  85. data/lib/fog/google/models/dns/zone.rb +74 -0
  86. data/lib/fog/google/models/dns/zones.rb +34 -0
  87. data/lib/fog/google/models/storage/file.rb +1 -1
  88. data/lib/fog/google/models/storage/files.rb +1 -5
  89. data/lib/fog/google/requests/dns/create_change.rb +64 -0
  90. data/lib/fog/google/requests/dns/create_managed_zone.rb +64 -31
  91. data/lib/fog/google/requests/dns/delete_managed_zone.rb +20 -24
  92. data/lib/fog/google/requests/dns/get_change.rb +42 -0
  93. data/lib/fog/google/requests/dns/get_managed_zone.rb +22 -16
  94. data/lib/fog/google/requests/dns/get_project.rb +42 -0
  95. data/lib/fog/google/requests/dns/list_changes.rb +41 -0
  96. data/lib/fog/google/requests/dns/list_managed_zones.rb +15 -10
  97. data/lib/fog/google/requests/dns/list_resource_record_sets.rb +50 -0
  98. data/lib/fog/google/storage.rb +0 -1
  99. data/lib/fog/hp/storage.rb +1 -1
  100. data/lib/fog/internet_archive/storage.rb +0 -1
  101. data/lib/fog/libvirt/models/compute/server.rb +17 -7
  102. data/lib/fog/opennebula/models/compute/flavor.rb +46 -8
  103. data/lib/fog/opennebula/models/compute/flavors.rb +7 -0
  104. data/lib/fog/opennebula/models/compute/interface.rb +1 -1
  105. data/lib/fog/opennebula/models/compute/network.rb +1 -0
  106. data/lib/fog/opennebula/models/compute/networks.rb +5 -1
  107. data/lib/fog/opennebula/requests/compute/list_networks.rb +34 -25
  108. data/lib/fog/opennebula/requests/compute/template_pool.rb +47 -5
  109. data/lib/fog/openstack/compute.rb +2 -2
  110. data/lib/fog/openstack/docs/storage.md +18 -0
  111. data/lib/fog/openstack/identity.rb +1 -1
  112. data/lib/fog/openstack/image.rb +1 -1
  113. data/lib/fog/openstack/metering.rb +1 -1
  114. data/lib/fog/openstack/models/compute/server.rb +1 -0
  115. data/lib/fog/openstack/models/storage/directory.rb +8 -2
  116. data/lib/fog/openstack/network.rb +1 -1
  117. data/lib/fog/openstack/orchestration.rb +1 -1
  118. data/lib/fog/openstack/requests/compute/create_security_group.rb +1 -1
  119. data/lib/fog/openstack/requests/storage/public_url.rb +28 -0
  120. data/lib/fog/openstack/requests/storage/put_container.rb +1 -0
  121. data/lib/fog/openstack/storage.rb +1 -0
  122. data/lib/fog/openstack/volume.rb +1 -1
  123. data/lib/fog/ovirt/compute.rb +1 -0
  124. data/lib/fog/ovirt/models/compute/server.rb +5 -0
  125. data/lib/fog/ovirt/requests/compute/update_volume.rb +39 -0
  126. data/lib/fog/rackspace.rb +1 -0
  127. data/lib/fog/rackspace/core.rb +1 -0
  128. data/lib/fog/rackspace/docs/networking.md +315 -0
  129. data/lib/fog/rackspace/mock_data.rb +1 -2
  130. data/lib/fog/rackspace/models/dns/zones.rb +2 -1
  131. data/lib/fog/rackspace/models/load_balancers/node.rb +7 -0
  132. data/lib/fog/rackspace/models/networking/network.rb +27 -0
  133. data/lib/fog/rackspace/models/networking/networks.rb +23 -0
  134. data/lib/fog/rackspace/models/networking/virtual_interface.rb +85 -0
  135. data/lib/fog/rackspace/models/networking/virtual_interfaces.rb +45 -0
  136. data/lib/fog/rackspace/models/queues/queue.rb +1 -1
  137. data/lib/fog/rackspace/networking.rb +192 -0
  138. data/lib/fog/rackspace/requests/load_balancers/create_node.rb +3 -0
  139. data/lib/fog/rackspace/requests/load_balancers/update_node.rb +3 -0
  140. data/lib/fog/rackspace/requests/networking/create_network.rb +36 -0
  141. data/lib/fog/rackspace/requests/networking/create_virtual_interface.rb +30 -0
  142. data/lib/fog/rackspace/requests/networking/delete_network.rb +21 -0
  143. data/lib/fog/rackspace/requests/networking/delete_virtual_interface.rb +23 -0
  144. data/lib/fog/rackspace/requests/networking/get_network.rb +21 -0
  145. data/lib/fog/rackspace/requests/networking/list_networks.rb +18 -0
  146. data/lib/fog/rackspace/requests/networking/list_virtual_interfaces.rb +22 -0
  147. data/lib/fog/vcloud/compute.rb +0 -1
  148. data/lib/fog/vcloud/core.rb +1 -0
  149. data/lib/fog/vcloud_director/compute.rb +1 -1
  150. data/lib/fog/version.rb +1 -1
  151. data/lib/fog/vsphere/compute.rb +38 -1
  152. data/lib/fog/vsphere/requests/compute/list_clusters.rb +31 -1
  153. data/lib/fog/vsphere/requests/compute/modify_vm_interface.rb +1 -1
  154. data/lib/fog/zerigo/dns.rb +0 -1
  155. data/lib/tasks/changelog_task.rb +1 -0
  156. data/tests/aws/models/elb/model_tests.rb +6 -0
  157. data/tests/aws/models/elb/tagging_tests.rb +15 -0
  158. data/tests/aws/models/iam/access_keys_tests.rb +1 -1
  159. data/tests/aws/models/iam/policies_tests.rb +2 -1
  160. data/tests/aws/models/iam/users_tests.rb +7 -4
  161. data/tests/aws/models/storage/url_tests.rb +5 -9
  162. data/tests/aws/requests/compute/tag_tests.rb +2 -0
  163. data/tests/aws/requests/elb/load_balancer_tests.rb +5 -1
  164. data/tests/aws/requests/storage/bucket_tests.rb +15 -1
  165. data/tests/aws/signaturev4_tests.rb +47 -0
  166. data/tests/bluebox/requests/compute/block_tests.rb +2 -1
  167. data/tests/compute/helper.rb +0 -10
  168. data/tests/compute/models/flavors_tests.rb +1 -1
  169. data/tests/fogdocker/compute_tests.rb +1 -1
  170. data/tests/fogdocker/models/compute/server_tests.rb +13 -3
  171. data/tests/fogdocker/requests/compute/container_action_tests.rb +19 -8
  172. data/tests/fogdocker/requests/compute/image_search_tests.rb +11 -0
  173. data/tests/google/models/dns/change_tests.rb +28 -0
  174. data/tests/google/models/dns/changes_tests.rb +36 -0
  175. data/tests/google/models/dns/projects_tests.rb +12 -0
  176. data/tests/google/models/dns/record_tests.rb +42 -0
  177. data/tests/google/models/dns/records_tests.rb +36 -0
  178. data/tests/google/models/dns/zone_tests.rb +28 -0
  179. data/tests/google/models/dns/zones_tests.rb +14 -0
  180. data/tests/google/requests/dns/change_tests.rb +86 -0
  181. data/tests/google/requests/dns/managed_zone_tests.rb +1 -1
  182. data/tests/google/requests/dns/project_tests.rb +29 -0
  183. data/tests/google/requests/dns/record_tests.rb +49 -0
  184. data/tests/helper.rb +1 -1
  185. data/tests/helpers/mock_helper.rb +2 -2
  186. data/tests/opennebula/models/compute/flavor_tests.rb +29 -0
  187. data/tests/opennebula/models/compute/flavors_tests.rb +17 -0
  188. data/tests/opennebula/models/compute/network_tests.rb +2 -2
  189. data/tests/opennebula/models/compute/networks_tests.rb +2 -0
  190. data/tests/openstack/requests/storage/object_tests.rb +10 -0
  191. data/tests/ovirt/compute_tests.rb +1 -1
  192. data/tests/ovirt/requests/compute/update_volume_tests.rb +20 -0
  193. data/tests/rackspace/models/networking/network_tests.rb +10 -0
  194. data/tests/rackspace/models/networking/networks_tests.rb +10 -0
  195. data/tests/rackspace/models/networking/virtual_interface_tests.rb +33 -0
  196. data/tests/rackspace/models/networking/virtual_interfaces_tests.rb +24 -0
  197. data/tests/rackspace/models/queues/queue_tests.rb +9 -0
  198. data/tests/rackspace/networking_tests.rb +118 -0
  199. data/tests/rackspace/requests/networking/network_tests.rb +49 -0
  200. data/tests/rackspace/requests/networking/virtual_interface_tests.rb +49 -0
  201. data/tests/vsphere/requests/compute/list_clusters_tests.rb +11 -0
  202. metadata +228 -180
  203. data/lib/fog/bin/terremark.rb +0 -29
  204. data/lib/fog/bin/vmfusion.rb +0 -58
  205. data/lib/fog/bin/voxel.rb +0 -29
  206. data/lib/fog/terremark.rb +0 -11
  207. data/lib/fog/terremark/models/shared/address.rb +0 -25
  208. data/lib/fog/terremark/models/shared/addresses.rb +0 -45
  209. data/lib/fog/terremark/models/shared/image.rb +0 -19
  210. data/lib/fog/terremark/models/shared/images.rb +0 -41
  211. data/lib/fog/terremark/models/shared/internetservice.rb +0 -66
  212. data/lib/fog/terremark/models/shared/internetservices.rb +0 -39
  213. data/lib/fog/terremark/models/shared/network.rb +0 -31
  214. data/lib/fog/terremark/models/shared/networks.rb +0 -48
  215. data/lib/fog/terremark/models/shared/nodeservice.rb +0 -50
  216. data/lib/fog/terremark/models/shared/nodeservices.rb +0 -29
  217. data/lib/fog/terremark/models/shared/server.rb +0 -210
  218. data/lib/fog/terremark/models/shared/servers.rb +0 -50
  219. data/lib/fog/terremark/models/shared/task.rb +0 -46
  220. data/lib/fog/terremark/models/shared/tasks.rb +0 -54
  221. data/lib/fog/terremark/models/shared/vdc.rb +0 -40
  222. data/lib/fog/terremark/models/shared/vdcs.rb +0 -48
  223. data/lib/fog/terremark/parser.rb +0 -18
  224. data/lib/fog/terremark/parsers/shared/get_catalog.rb +0 -33
  225. data/lib/fog/terremark/parsers/shared/get_catalog_item.rb +0 -32
  226. data/lib/fog/terremark/parsers/shared/get_internet_services.rb +0 -57
  227. data/lib/fog/terremark/parsers/shared/get_keys_list.rb +0 -39
  228. data/lib/fog/terremark/parsers/shared/get_network_ips.rb +0 -24
  229. data/lib/fog/terremark/parsers/shared/get_node_services.rb +0 -32
  230. data/lib/fog/terremark/parsers/shared/get_organization.rb +0 -50
  231. data/lib/fog/terremark/parsers/shared/get_organizations.rb +0 -31
  232. data/lib/fog/terremark/parsers/shared/get_public_ips.rb +0 -26
  233. data/lib/fog/terremark/parsers/shared/get_tasks_list.rb +0 -35
  234. data/lib/fog/terremark/parsers/shared/get_vapp_template.rb +0 -31
  235. data/lib/fog/terremark/parsers/shared/get_vdc.rb +0 -87
  236. data/lib/fog/terremark/parsers/shared/instantiate_vapp_template.rb +0 -26
  237. data/lib/fog/terremark/parsers/shared/internet_service.rb +0 -58
  238. data/lib/fog/terremark/parsers/shared/network.rb +0 -39
  239. data/lib/fog/terremark/parsers/shared/node_service.rb +0 -28
  240. data/lib/fog/terremark/parsers/shared/public_ip.rb +0 -22
  241. data/lib/fog/terremark/parsers/shared/task.rb +0 -25
  242. data/lib/fog/terremark/parsers/shared/vapp.rb +0 -61
  243. data/lib/fog/terremark/requests/shared/add_internet_service.rb +0 -54
  244. data/lib/fog/terremark/requests/shared/add_node_service.rb +0 -51
  245. data/lib/fog/terremark/requests/shared/configure_vapp.rb +0 -59
  246. data/lib/fog/terremark/requests/shared/create_internet_service.rb +0 -59
  247. data/lib/fog/terremark/requests/shared/delete_internet_service.rb +0 -21
  248. data/lib/fog/terremark/requests/shared/delete_node_service.rb +0 -21
  249. data/lib/fog/terremark/requests/shared/delete_public_ip.rb +0 -21
  250. data/lib/fog/terremark/requests/shared/delete_vapp.rb +0 -20
  251. data/lib/fog/terremark/requests/shared/deploy_vapp.rb +0 -33
  252. data/lib/fog/terremark/requests/shared/get_catalog.rb +0 -30
  253. data/lib/fog/terremark/requests/shared/get_catalog_item.rb +0 -33
  254. data/lib/fog/terremark/requests/shared/get_internet_services.rb +0 -34
  255. data/lib/fog/terremark/requests/shared/get_keys_list.rb +0 -34
  256. data/lib/fog/terremark/requests/shared/get_network.rb +0 -69
  257. data/lib/fog/terremark/requests/shared/get_network_ips.rb +0 -29
  258. data/lib/fog/terremark/requests/shared/get_node_services.rb +0 -29
  259. data/lib/fog/terremark/requests/shared/get_organization.rb +0 -82
  260. data/lib/fog/terremark/requests/shared/get_organizations.rb +0 -45
  261. data/lib/fog/terremark/requests/shared/get_public_ip.rb +0 -31
  262. data/lib/fog/terremark/requests/shared/get_public_ips.rb +0 -68
  263. data/lib/fog/terremark/requests/shared/get_task.rb +0 -37
  264. data/lib/fog/terremark/requests/shared/get_tasks_list.rb +0 -30
  265. data/lib/fog/terremark/requests/shared/get_vapp.rb +0 -40
  266. data/lib/fog/terremark/requests/shared/get_vapp_template.rb +0 -33
  267. data/lib/fog/terremark/requests/shared/get_vdc.rb +0 -121
  268. data/lib/fog/terremark/requests/shared/instantiate_vapp_template.rb +0 -79
  269. data/lib/fog/terremark/requests/shared/power_off.rb +0 -33
  270. data/lib/fog/terremark/requests/shared/power_on.rb +0 -33
  271. data/lib/fog/terremark/requests/shared/power_reset.rb +0 -33
  272. data/lib/fog/terremark/requests/shared/power_shutdown.rb +0 -22
  273. data/lib/fog/terremark/shared.rb +0 -304
  274. data/lib/fog/terremark/vcloud.rb +0 -129
  275. data/lib/fog/vmfusion.rb +0 -1
  276. data/lib/fog/vmfusion/compute.rb +0 -28
  277. data/lib/fog/vmfusion/core.rb +0 -9
  278. data/lib/fog/vmfusion/models/compute/server.rb +0 -256
  279. data/lib/fog/vmfusion/models/compute/servers.rb +0 -36
  280. data/lib/fog/voxel.rb +0 -1
  281. data/lib/fog/voxel/compute.rb +0 -122
  282. data/lib/fog/voxel/core.rb +0 -16
  283. data/lib/fog/voxel/models/compute/image.rb +0 -13
  284. data/lib/fog/voxel/models/compute/images.rb +0 -27
  285. data/lib/fog/voxel/models/compute/server.rb +0 -73
  286. data/lib/fog/voxel/models/compute/servers.rb +0 -29
  287. data/lib/fog/voxel/parsers/compute/basic.rb +0 -27
  288. data/lib/fog/voxel/parsers/compute/devices_list.rb +0 -107
  289. data/lib/fog/voxel/parsers/compute/images_list.rb +0 -55
  290. data/lib/fog/voxel/parsers/compute/voxcloud_create.rb +0 -36
  291. data/lib/fog/voxel/parsers/compute/voxcloud_delete.rb +0 -27
  292. data/lib/fog/voxel/parsers/compute/voxcloud_status.rb +0 -42
  293. data/lib/fog/voxel/requests/compute/devices_list.rb +0 -22
  294. data/lib/fog/voxel/requests/compute/devices_power.rb +0 -20
  295. data/lib/fog/voxel/requests/compute/images_list.rb +0 -29
  296. data/lib/fog/voxel/requests/compute/voxcloud_create.rb +0 -20
  297. data/lib/fog/voxel/requests/compute/voxcloud_delete.rb +0 -18
  298. data/lib/fog/voxel/requests/compute/voxcloud_status.rb +0 -22
  299. data/lib/fog/xml.rb +0 -4
  300. data/lib/fog/xml/connection.rb +0 -24
  301. data/lib/fog/xml/sax_parser_connection.rb +0 -45
  302. data/tests/core/connection_tests.rb +0 -26
  303. data/tests/voxel/requests/compute/image_tests.rb +0 -52
  304. data/tests/voxel/requests/compute/server_tests.rb +0 -123
@@ -179,7 +179,6 @@ module Fog
179
179
 
180
180
  def initialize(options = {})
181
181
  require 'builder'
182
- require 'fog/core/parser'
183
182
 
184
183
  @connections = {}
185
184
  @connection_options = options[:connection_options] || {}
@@ -1,4 +1,5 @@
1
1
  require 'fog/core'
2
+ require 'fog/xml'
2
3
 
3
4
  module Fog
4
5
  module Vcloud
@@ -487,7 +487,7 @@ module Fog
487
487
 
488
488
  def check_session_matches_credentials(session_org, session_user)
489
489
  fog_credential_org = @vcloud_director_username.split('@').last
490
- fog_credential_user = @vcloud_director_username.split('@')[0...-1].join
490
+ fog_credential_user = @vcloud_director_username.split('@')[0...-1].join('@')
491
491
 
492
492
  if session_org != fog_credential_org
493
493
  raise Fog::Errors::Error.new "FOG_CREDENTIAL specified is for vCloud organisation '#{fog_credential_org}' but " +
@@ -1,3 +1,3 @@
1
1
  module Fog
2
- VERSION = '1.24.0'
2
+ VERSION = '1.25.0'
3
3
  end
@@ -304,7 +304,44 @@ module Fog
304
304
  },
305
305
  :datacenters => {
306
306
  "Solutions" => {:name => "Solutions", :status => "grey"}
307
- }
307
+ },
308
+ :clusters =>
309
+ [{:id => "1d4d9a3f-e4e8-4c40-b7fc-263850068fa4",
310
+ :name => "Solutionscluster",
311
+ :num_host => "4",
312
+ :num_cpu_cores => "16",
313
+ :overall_status => "green",
314
+ :datacenter => "Solutions",
315
+ :klass => "RbVmomi::VIM::ComputeResource"
316
+ },
317
+ {:id => "e4195973-102b-4096-bbd6-5429ff0b35c9",
318
+ :name => "Problemscluster",
319
+ :num_host => "4",
320
+ :num_cpu_cores => "32",
321
+ :overall_status => "green",
322
+ :datacenter => "Solutions",
323
+ :klass => "RbVmomi::VIM::ComputeResource"
324
+ },
325
+ {
326
+ :klass => "RbVmomi::VIM::Folder",
327
+ :clusters => [{:id => "03616b8d-b707-41fd-b3b5-The first",
328
+ :name => "Problemscluster",
329
+ :num_host => "4",
330
+ :num_cpu_cores => "32",
331
+ :overall_status => "green",
332
+ :datacenter => "Solutions",
333
+ :klass => "RbVmomi::VIM::ComputeResource"
334
+ },
335
+ {:id => "03616b8d-b707-41fd-b3b5-the Second",
336
+ :name => "Lastcluster",
337
+ :num_host => "8",
338
+ :num_cpu_cores => "32",
339
+ :overall_status => "green",
340
+ :datacenter => "Solutions",
341
+ :klass => "RbVmomi::VIM::ComputeResource"}
342
+ ]
343
+ }
344
+ ]
308
345
  }
309
346
  end
310
347
  end
@@ -11,11 +11,22 @@ module Fog
11
11
  end
12
12
 
13
13
  def raw_clusters(datacenter)
14
- find_raw_datacenter(datacenter).hostFolder.childEntity.grep(RbVmomi::VIM::ClusterComputeResource)
14
+ folder ||= find_raw_datacenter(datacenter).hostFolder
15
+ @raw_clusters = get_raw_clusters_from_folder(folder)
15
16
  end
16
17
 
17
18
  protected
18
19
 
20
+ def get_raw_clusters_from_folder(folder)
21
+ folder.childEntity.map do |child_entity|
22
+ if child_entity.is_a? RbVmomi::VIM::ComputeResource
23
+ child_entity
24
+ elsif child_entity.is_a? RbVmomi::VIM::Folder
25
+ get_raw_clusters_from_folder(child_entity)
26
+ end
27
+ end.flatten
28
+ end
29
+
19
30
  def cluster_attributes cluster, datacenter_name
20
31
  {
21
32
  :id => managed_obj_id(cluster),
@@ -27,8 +38,27 @@ module Fog
27
38
  }
28
39
  end
29
40
  end
41
+
30
42
  class Mock
31
43
  def list_clusters(filters = { })
44
+ raw_clusters.map do |cluster|
45
+ cluster
46
+ end
47
+ end
48
+
49
+ def raw_clusters
50
+ folder = self.data[:clusters]
51
+ @raw_clusters = get_raw_clusters_from_folder(folder)
52
+ end
53
+
54
+ def get_raw_clusters_from_folder(folder)
55
+ folder.map do |child|
56
+ if child[:klass] == "RbVmomi::VIM::ComputeResource"
57
+ child
58
+ elsif child[:klass] == "RbVmomi::VIM::Folder"
59
+ get_raw_clusters_from_folder(child[:clusters])
60
+ end
61
+ end.flatten
32
62
  end
33
63
  end
34
64
  end
@@ -6,7 +6,7 @@ module Fog
6
6
  raise ArgumentError, "instance id is a required parameter" unless vmid
7
7
 
8
8
  interface = get_interface_from_options(vmid, options.merge(:server_id => vmid))
9
- vm_reconfig_hardware('instance_uuid' => vmid, 'hardware_spec' => {'deviceChange'=>[create_interface(interface)]})
9
+ vm_reconfig_hardware('instance_uuid' => vmid, 'hardware_spec' => {'deviceChange'=>[create_interface(interface, 0, :add, options)]})
10
10
  end
11
11
 
12
12
  def destroy_vm_interface(vmid, options = {})
@@ -67,7 +67,6 @@ module Fog
67
67
 
68
68
  class Real
69
69
  def initialize(options={})
70
- require 'fog/core/parser'
71
70
 
72
71
  @zerigo_email = options[:zerigo_email]
73
72
  @zerigo_token = options[:zerigo_token]
@@ -114,6 +114,7 @@ Watchers | #{watchers}
114
114
  'Decklin Foster',
115
115
  'Dylan Egan',
116
116
  'Erik Michaels-Ober',
117
+ 'Frederick Cheung',
117
118
  'geemus',
118
119
  'Henry Addison',
119
120
  'James Bence',
@@ -221,6 +221,12 @@ Shindo.tests('AWS::ELB | models', ['aws', 'elb']) do
221
221
  returns(true) {elb.cross_zone_load_balancing?}
222
222
  end
223
223
 
224
+ tests('idle_connection_settings') do
225
+ returns(60) { elb.connection_settings_idle_timeout }
226
+ elb.set_connection_settings_idle_timeout(180)
227
+ returns(180) { elb.connection_settings_idle_timeout }
228
+ end
229
+
224
230
  tests('default health check') do
225
231
  default_health_check = {
226
232
  "HealthyThreshold"=>10,
@@ -0,0 +1,15 @@
1
+ Shindo.tests("AWS::ELB | tagging", ['aws', 'elb']) do
2
+ @elb5 = Fog::AWS[:elb].load_balancers.create(:id => "fog-test-elb-tagging")
3
+ tags1 = {'key1' => 'val1'}
4
+ tags2 = {'key2' => 'val2'}
5
+
6
+ tests "add and remove tags from an ELB" do
7
+ returns({}) { @elb5.tags }
8
+ returns(tags1) { @elb5.add_tags tags1 }
9
+ returns(tags1.merge tags2) { @elb5.add_tags tags2 }
10
+ returns(tags2) { @elb5.remove_tags tags1.keys }
11
+ returns(tags2) { @elb5.tags }
12
+
13
+ @elb5.destroy
14
+ end
15
+ end
@@ -1,6 +1,5 @@
1
1
  Shindo.tests("Fog::Compute[:iam] | access_keys", ['aws','iam']) do
2
2
 
3
- Fog.mock!
4
3
  iam = Fog::AWS[:iam]
5
4
 
6
5
  @username = 'fake_user'
@@ -48,6 +47,7 @@ Shindo.tests("Fog::Compute[:iam] | access_keys", ['aws','iam']) do
48
47
  end
49
48
 
50
49
  # clean up
50
+ @user.access_keys.map(&:destroy)
51
51
  @user.destroy
52
52
 
53
53
  end
@@ -1,6 +1,5 @@
1
1
  Shindo.tests("Fog::Compute[:iam] | policies", ['aws','iam']) do
2
2
 
3
- Fog.mock!
4
3
  iam = Fog::AWS[:iam]
5
4
 
6
5
  @username = 'fake_user'
@@ -50,6 +49,8 @@ Shindo.tests("Fog::Compute[:iam] | policies", ['aws','iam']) do
50
49
  end
51
50
 
52
51
  # clean up
52
+ @user.access_keys.map(&:destroy)
53
+ @user.policies.map(&:destroy)
53
54
  @user.destroy
54
55
 
55
56
 
@@ -1,6 +1,5 @@
1
1
  Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do
2
2
 
3
- Fog.mock!
4
3
  @iam = Fog::AWS[:iam]
5
4
  @user_one_name = 'fake_user_one'
6
5
  @user_two_name = 'fake_user_two'
@@ -9,17 +8,21 @@ Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do
9
8
  @user_three_path = '/path/to/fake_user_three/'
10
9
  @user_four_name = 'fake_user_four'
11
10
 
11
+ def all_users
12
+ @iam.users.all.select{|user| user.id =~ /^fake_user/ }
13
+ end
14
+
12
15
  tests('#create').succeeds do
13
16
  @user_one = @iam.users.create(:id => @user_one_name)
14
17
  @user_one.id == @user_one_name
15
18
  end
16
19
 
17
20
  tests('#all','there is only one user').succeeds do
18
- @iam.users.size == 1
21
+ all_users.size == 1
19
22
  end
20
23
 
21
24
  tests('#all','the only user should match').succeeds do
22
- @iam.users.first.id == @user_one_name
25
+ all_users.first.id == @user_one_name
23
26
  end
24
27
 
25
28
  tests('#create','a second user').succeeds do
@@ -28,7 +31,7 @@ Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do
28
31
  end
29
32
 
30
33
  tests('#all','there are two users').succeeds do
31
- @iam.users.size == 2
34
+ all_users.size == 2
32
35
  end
33
36
 
34
37
  tests('#get','an existing user').succeeds do
@@ -2,7 +2,6 @@
2
2
 
3
3
  Shindo.tests('AWS | url', ["aws"]) do
4
4
 
5
- @expires = Time.utc(2013,1,1).utc.to_i
6
5
 
7
6
  @storage = Fog::Storage.new(
8
7
  :provider => 'AWS',
@@ -13,18 +12,15 @@ Shindo.tests('AWS | url', ["aws"]) do
13
12
 
14
13
  @file = @storage.directories.new(:key => 'fognonbucket').files.new(:key => 'test.txt')
15
14
 
16
- if Fog.mock?
17
- signature = Fog::Storage::AWS.new.signature(nil, nil)
18
- else
19
- signature = 'tajHIhKHAdFYsigmzybCpaq8N0Q%3D'
20
- end
21
-
15
+ now = Fog::Time.now
22
16
  if RUBY_VERSION > '1.8.7' # ruby 1.8.x doesn't provide hash ordering
23
17
  tests('#url w/ response-cache-control').returns(
24
- "https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&AWSAccessKeyId=123&Signature=#{signature}&Expires=1356998400"
18
+ "https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&X-Amz-Expires=500&X-Amz-Date=#{now.to_iso8601_basic}&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=123/#{now.utc.strftime('%Y%m%d')}/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature="
25
19
  ) do
26
- @file.url(@expires, :query => { 'response-cache-control' => 'No-cache' })
20
+
21
+ @file.url(Time.now + 500, :query => { 'response-cache-control' => 'No-cache' }).gsub(/(X-Amz-Signature=)[0-9a-f]+\z/,'\\1')
27
22
  end
28
23
  end
29
24
 
25
+
30
26
  end
@@ -1,4 +1,6 @@
1
1
  Shindo.tests('Fog::Compute[:aws] | tag requests', ['aws']) do
2
+ Fog::Compute::AWS::Mock.reset if Fog.mocking?
3
+
2
4
  @tags_format = {
3
5
  'tagSet' => [{
4
6
  'key' => String,
@@ -39,7 +39,8 @@ Shindo.tests('AWS::ELB | load_balancer_tests', ['aws', 'elb']) do
39
39
  tests("modify_load_balancer_attributes") do
40
40
  attributes = {
41
41
  'ConnectionDraining' => {'Enabled' => true, 'Timeout' => 600},
42
- 'CrossZoneLoadBalancing' => {'Enabled' => true}
42
+ 'CrossZoneLoadBalancing' => {'Enabled' => true},
43
+ 'ConnectionSettings' => {'IdleTimeout' => 180}
43
44
  }
44
45
  Fog::AWS[:elb].modify_load_balancer_attributes(@load_balancer_id, attributes).body
45
46
  response = Fog::AWS[:elb].describe_load_balancer_attributes(@load_balancer_id).
@@ -51,6 +52,9 @@ Shindo.tests('AWS::ELB | load_balancer_tests', ['aws', 'elb']) do
51
52
  tests("ConnectionDraining has a 600 second Timeout").returns(600) do
52
53
  response['ConnectionDraining']['Timeout']
53
54
  end
55
+ tests("ConnectionSettings has a 180 second IdleTimeout").returns(180) do
56
+ response['ConnectionSettings']['IdleTimeout']
57
+ end
54
58
  tests("CrossZoneLoadBalancing is enabled") do
55
59
  response['CrossZoneLoadBalancing']['Enabled'] == true
56
60
  end
@@ -68,7 +68,7 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', ["aws"]) do
68
68
 
69
69
  tests("#head_bucket('#{@aws_bucket_name}')").succeeds do
70
70
  Fog::Storage[:aws].head_bucket(@aws_bucket_name)
71
- end
71
+ end
72
72
 
73
73
  file.destroy
74
74
 
@@ -137,10 +137,19 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', ["aws"]) do
137
137
  Fog::Storage[:aws].put_request_payment(@aws_bucket_name, 'Requester')
138
138
  end
139
139
 
140
+ # This should show a warning, but work (second parameter is options hash for now)
140
141
  tests("#put_bucket_website('#{@aws_bucket_name}', 'index.html')").succeeds do
141
142
  Fog::Storage[:aws].put_bucket_website(@aws_bucket_name, 'index.html')
142
143
  end
143
144
 
145
+ tests("#put_bucket_website('#{@aws_bucket_name}', :IndexDocument => 'index.html')").succeeds do
146
+ Fog::Storage[:aws].put_bucket_website(@aws_bucket_name, :IndexDocument => 'index.html')
147
+ end
148
+
149
+ tests("#put_bucket_website('#{@aws_bucket_name}', :RedirectAllRequestsTo => 'redirect.example..com')").succeeds do
150
+ Fog::Storage[:aws].put_bucket_website(@aws_bucket_name, :RedirectAllRequestsTo => 'redirect.example.com')
151
+ end
152
+
144
153
  tests("#put_bucket_acl('#{@aws_bucket_name}', 'private')").succeeds do
145
154
  Fog::Storage[:aws].put_bucket_acl(@aws_bucket_name, 'private')
146
155
  end
@@ -358,6 +367,11 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', ["aws"]) do
358
367
  storage_eu_endpoint.put_bucket(@aws_bucket_name)
359
368
  end
360
369
  end
370
+
371
+ tests("#put_bucket_website('fognonbucket', :RedirectAllRequestsTo => 'redirect.example.com')").raises(Excon::Errors::NotFound) do
372
+ Fog::Storage[:aws].put_bucket_website('fognonbucket', :RedirectAllRequestsTo => 'redirect.example.com')
373
+ end
374
+
361
375
  end
362
376
 
363
377
  # don't keep the bucket around
@@ -37,5 +37,52 @@ Shindo.tests('AWS | signaturev4', ['aws']) do
37
37
  'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=content-type;date;host, Signature=b105eb10c6d318d2294de9d49dd8b031b55e3c3fe139f2e637da70511e9e7b71'
38
38
  end
39
39
  end
40
+
41
+ tests('get with relative path') do
42
+ returns(@signer.sign({:query => {}, :headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/foo/bar/../..'}, @now)) do
43
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=b27ccfbfa7df52a200ff74193ca6e32d4b48b8856fab7ebf1c595d0670a7e470'
44
+ end
45
+ end
46
+
47
+ tests('get with pointless .') do
48
+ returns(@signer.sign({:query => {}, :headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/./foo'}, @now)) do
49
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=910e4d6c9abafaf87898e1eb4c929135782ea25bb0279703146455745391e63a'
50
+ end
51
+ end
52
+
53
+ tests('get with repeated / ') do
54
+ returns(@signer.sign({:query => {}, :headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '//'}, @now)) do
55
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=b27ccfbfa7df52a200ff74193ca6e32d4b48b8856fab7ebf1c595d0670a7e470'
56
+ end
57
+ end
58
+
59
+ tests('get with repeated trailing / ') do
60
+ returns(@signer.sign({:query => {}, :headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '//foo//'}, @now)) do
61
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=b00392262853cfe3201e47ccf945601079e9b8a7f51ee4c3d9ee4f187aa9bf19'
62
+ end
63
+ end
64
+
65
+ tests('get signature as components') do
66
+ returns(@signer.signature_parameters({:query => {'a' => 'foo', 'b' => 'foo'}, :headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/'}, @now)) do
67
+ {
68
+ 'X-Amz-Algorithm' => 'AWS4-HMAC-SHA256',
69
+ 'X-Amz-Credential' => 'AKIDEXAMPLE/20110909/us-east-1/host/aws4_request',
70
+ 'X-Amz-SignedHeaders' => 'date;host',
71
+ 'X-Amz-Signature' => 'a6c6304682c74bcaebeeab2fdfb8041bbb39c6976300791a283057bccf333fb2'
72
+ }
73
+ end
74
+ end
75
+
76
+ tests("inject body sha") do
77
+ returns(@signer.signature_parameters({:query => {'a' => 'foo', 'b' => 'foo'}, :headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/'}, @now, 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD')) do
78
+ {
79
+ 'X-Amz-Algorithm' => 'AWS4-HMAC-SHA256',
80
+ 'X-Amz-Credential' => 'AKIDEXAMPLE/20110909/us-east-1/host/aws4_request',
81
+ 'X-Amz-SignedHeaders' => 'date;host',
82
+ 'X-Amz-Signature' => '22c32bb0d0b859b94839de4e9360bca1806e73d853f5f97ae0d849f0bdf42fb0'
83
+ }
84
+ end
85
+ end
86
+
40
87
  Fog::Time.now = ::Time.now
41
88
  end
@@ -11,7 +11,8 @@ Shindo.tests('Fog::Compute[:bluebox] | block requests', ['bluebox']) do
11
11
  'product' => {'cost' => String, 'description' => String, 'id' => String},
12
12
  'status' => String,
13
13
  'storage' => Integer,
14
- 'location_id' => String
14
+ 'location_id' => String,
15
+ 'vsh_id' => String
15
16
  }
16
17
 
17
18
  tests('success') do
@@ -129,16 +129,6 @@ def compute_providers
129
129
  :name => "fog_#{Time.now.to_i}"
130
130
  },
131
131
  :mocked => true
132
- },
133
- :voxel => {
134
- :server_attributes => {
135
- :name => "fog.#{Time.now.to_i}",
136
- :disk_size => 10,
137
- :processing_cores => 1,
138
- :image_id => 55, # image 55 = Ubuntu 10.04 (Lucid), 64-bit, base install
139
- :facility => "LDJ1"
140
- },
141
- :mocked => false
142
132
  }
143
133
  }
144
134
  end
@@ -1,6 +1,6 @@
1
1
  for provider, config in compute_providers
2
2
 
3
- next if [:glesys, :voxel, :ibm, :ecloud].include?(provider)
3
+ next if [:glesys, :ibm, :ecloud].include?(provider)
4
4
 
5
5
  Shindo.tests("Fog::Compute[:#{provider}] | flavors", [provider.to_s]) do
6
6