fog-maestrodev 1.15.0.20130829165835 → 1.15.0.20130927082724

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +1 -0
  3. data/fog.gemspec +5 -2
  4. data/lib/fog.rb +1 -0
  5. data/lib/fog/atmos/models/storage/file.rb +2 -1
  6. data/lib/fog/aws.rb +4 -1
  7. data/lib/fog/aws/data_pipeline.rb +3 -0
  8. data/lib/fog/aws/elasticache.rb +2 -0
  9. data/lib/fog/aws/models/auto_scaling/group.rb +12 -12
  10. data/lib/fog/aws/models/compute/subnet.rb +3 -1
  11. data/lib/fog/aws/models/elasticache/cluster.rb +3 -1
  12. data/lib/fog/aws/parsers/redshift/cluster.rb +29 -0
  13. data/lib/fog/aws/parsers/redshift/cluster_parser.rb +144 -0
  14. data/lib/fog/aws/parsers/redshift/cluster_security_group_parser.rb +50 -0
  15. data/lib/fog/aws/parsers/redshift/cluster_snapshot.rb +32 -0
  16. data/lib/fog/aws/parsers/redshift/cluster_snapshot_parser.rb +66 -0
  17. data/lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb +51 -0
  18. data/lib/fog/aws/parsers/redshift/create_cluster_parameter_group.rb +30 -0
  19. data/lib/fog/aws/parsers/redshift/create_cluster_security_group.rb +31 -0
  20. data/lib/fog/aws/parsers/redshift/describe_cluster_parameter_groups.rb +41 -0
  21. data/lib/fog/aws/parsers/redshift/describe_cluster_parameters.rb +48 -0
  22. data/lib/fog/aws/parsers/redshift/describe_cluster_security_groups.rb +38 -0
  23. data/lib/fog/aws/parsers/redshift/describe_cluster_snapshots.rb +38 -0
  24. data/lib/fog/aws/parsers/redshift/describe_cluster_subnet_groups.rb +58 -0
  25. data/lib/fog/aws/parsers/redshift/describe_cluster_versions.rb +53 -0
  26. data/lib/fog/aws/parsers/redshift/describe_clusters.rb +30 -0
  27. data/lib/fog/aws/parsers/redshift/describe_default_cluster_parameters.rb +49 -0
  28. data/lib/fog/aws/parsers/redshift/describe_events.rb +44 -0
  29. data/lib/fog/aws/parsers/redshift/describe_orderable_cluster_options.rb +54 -0
  30. data/lib/fog/aws/parsers/redshift/describe_reserved_node_offerings.rb +64 -0
  31. data/lib/fog/aws/parsers/redshift/describe_reserved_nodes.rb +71 -0
  32. data/lib/fog/aws/parsers/redshift/describe_resize.rb +60 -0
  33. data/lib/fog/aws/parsers/redshift/purchase_reserved_node_offering.rb +58 -0
  34. data/lib/fog/aws/parsers/redshift/revoke_cluster_security_group_ingress.rb +31 -0
  35. data/lib/fog/aws/parsers/redshift/update_cluster_parameter_group_parser.rb +29 -0
  36. data/lib/fog/aws/parsers/sts/get_session_token.rb +1 -3
  37. data/lib/fog/aws/redshift.rb +126 -0
  38. data/lib/fog/aws/requests/compute/run_instances.rb +2 -0
  39. data/lib/fog/aws/requests/data_pipeline/delete_pipeline.rb +2 -3
  40. data/lib/fog/aws/requests/data_pipeline/describe_objects.rb +41 -0
  41. data/lib/fog/aws/requests/data_pipeline/get_pipeline_definition.rb +37 -0
  42. data/lib/fog/aws/requests/data_pipeline/query_objects.rb +41 -0
  43. data/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb +27 -2
  44. data/lib/fog/aws/requests/elasticache/create_cache_security_group.rb +23 -2
  45. data/lib/fog/aws/requests/elasticache/delete_cache_security_group.rb +10 -1
  46. data/lib/fog/aws/requests/elasticache/describe_cache_security_groups.rb +36 -2
  47. data/lib/fog/aws/requests/redshift/authorize_cluster_security_group_ingress.rb +56 -0
  48. data/lib/fog/aws/requests/redshift/authorize_snapshot_access.rb +43 -0
  49. data/lib/fog/aws/requests/redshift/copy_cluster_snapshot.rb +48 -0
  50. data/lib/fog/aws/requests/redshift/create_cluster.rb +151 -0
  51. data/lib/fog/aws/requests/redshift/create_cluster_parameter_group.rb +54 -0
  52. data/lib/fog/aws/requests/redshift/create_cluster_security_group.rb +42 -0
  53. data/lib/fog/aws/requests/redshift/create_cluster_snapshot.rb +44 -0
  54. data/lib/fog/aws/requests/redshift/create_cluster_subnet_group.rb +50 -0
  55. data/lib/fog/aws/requests/redshift/delete_cluster.rb +51 -0
  56. data/lib/fog/aws/requests/redshift/delete_cluster_parameter_group.rb +34 -0
  57. data/lib/fog/aws/requests/redshift/delete_cluster_security_group.rb +33 -0
  58. data/lib/fog/aws/requests/redshift/delete_cluster_snapshot.rb +44 -0
  59. data/lib/fog/aws/requests/redshift/delete_cluster_subnet_group.rb +38 -0
  60. data/lib/fog/aws/requests/redshift/describe_cluster_parameter_groups.rb +48 -0
  61. data/lib/fog/aws/requests/redshift/describe_cluster_parameters.rb +55 -0
  62. data/lib/fog/aws/requests/redshift/describe_cluster_security_groups.rb +50 -0
  63. data/lib/fog/aws/requests/redshift/describe_cluster_snapshots.rb +73 -0
  64. data/lib/fog/aws/requests/redshift/describe_cluster_subnet_groups.rb +47 -0
  65. data/lib/fog/aws/requests/redshift/describe_cluster_versions.rb +54 -0
  66. data/lib/fog/aws/requests/redshift/describe_clusters.rb +49 -0
  67. data/lib/fog/aws/requests/redshift/describe_default_cluster_parameters.rb +49 -0
  68. data/lib/fog/aws/requests/redshift/describe_events.rb +80 -0
  69. data/lib/fog/aws/requests/redshift/describe_orderable_cluster_options.rb +55 -0
  70. data/lib/fog/aws/requests/redshift/describe_reserved_node_offerings.rb +48 -0
  71. data/lib/fog/aws/requests/redshift/describe_reserved_nodes.rb +48 -0
  72. data/lib/fog/aws/requests/redshift/describe_resize.rb +39 -0
  73. data/lib/fog/aws/requests/redshift/modify_cluster.rb +111 -0
  74. data/lib/fog/aws/requests/redshift/modify_cluster_parameter_group.rb +44 -0
  75. data/lib/fog/aws/requests/redshift/modify_cluster_subnet_group.rb +50 -0
  76. data/lib/fog/aws/requests/redshift/purchase_reserved_node_offering.rb +41 -0
  77. data/lib/fog/aws/requests/redshift/reboot_cluster.rb +37 -0
  78. data/lib/fog/aws/requests/redshift/reset_cluster_parameter_group.rb +57 -0
  79. data/lib/fog/aws/requests/redshift/restore_from_cluster_snapshot.rb +77 -0
  80. data/lib/fog/aws/requests/redshift/revoke_cluster_security_group_ingress.rb +56 -0
  81. data/lib/fog/aws/requests/redshift/revoke_snapshot_access.rb +44 -0
  82. data/lib/fog/aws/requests/sts/get_federation_token.rb +42 -0
  83. data/lib/fog/bin.rb +1 -0
  84. data/lib/fog/bin/aws.rb +4 -0
  85. data/lib/fog/bin/openstack.rb +5 -0
  86. data/lib/fog/bin/rackspace.rb +4 -0
  87. data/lib/fog/bin/vcloud_director.rb +30 -0
  88. data/lib/fog/brightbox/requests/compute/update_server.rb +1 -0
  89. data/lib/fog/cloudsigma/compute.rb +5 -0
  90. data/lib/fog/cloudsigma/models/fwpolicies.rb +21 -0
  91. data/lib/fog/cloudsigma/models/fwpolicy.rb +21 -0
  92. data/lib/fog/cloudsigma/models/rule.rb +21 -0
  93. data/lib/fog/cloudsigma/requests/list_fwpolicies.rb +18 -0
  94. data/lib/fog/compute.rb +7 -4
  95. data/lib/fog/core.rb +1 -0
  96. data/lib/fog/core/errors.rb +3 -0
  97. data/lib/fog/dynect/dns.rb +3 -1
  98. data/lib/fog/dynect/models/dns/records.rb +32 -20
  99. data/lib/fog/dynect/requests/dns/get_all_records.rb +56 -0
  100. data/lib/fog/dynect/requests/dns/get_node_list.rb +1 -1
  101. data/lib/fog/dynect/requests/dns/put_record.rb +76 -0
  102. data/lib/fog/google/models/compute/flavors.rb +2 -2
  103. data/lib/fog/google/requests/compute/get_machine_type.rb +7 -2
  104. data/lib/fog/joyent/compute.rb +1 -1
  105. data/lib/fog/linode/models/compute/server.rb +1 -1
  106. data/lib/fog/local/models/storage/directories.rb +1 -1
  107. data/lib/fog/openstack.rb +1 -0
  108. data/lib/fog/openstack/models/compute/images.rb +10 -2
  109. data/lib/fog/openstack/models/compute/server.rb +2 -0
  110. data/lib/fog/openstack/models/orchestration/stack.rb +52 -0
  111. data/lib/fog/openstack/models/orchestration/stacks.rb +21 -0
  112. data/lib/fog/openstack/orchestration.rb +227 -0
  113. data/lib/fog/openstack/requests/compute/create_server.rb +36 -25
  114. data/lib/fog/openstack/requests/compute/list_images_detail.rb +4 -3
  115. data/lib/fog/openstack/requests/orchestration/create_stack.rb +55 -0
  116. data/lib/fog/openstack/requests/orchestration/delete_stack.rb +36 -0
  117. data/lib/fog/openstack/requests/orchestration/list_stacks.rb +48 -0
  118. data/lib/fog/openstack/requests/orchestration/update_stack.rb +41 -0
  119. data/lib/fog/openstack/requests/storage/get_object.rb +7 -7
  120. data/lib/fog/openstack/storage.rb +2 -2
  121. data/lib/fog/orchestration.rb +25 -0
  122. data/lib/fog/rackspace.rb +1 -0
  123. data/lib/fog/rackspace/auto_scale.rb +132 -0
  124. data/lib/fog/rackspace/block_storage.rb +2 -2
  125. data/lib/fog/rackspace/cdn.rb +23 -23
  126. data/lib/fog/rackspace/compute.rb +2 -2
  127. data/lib/fog/rackspace/compute_v2.rb +2 -2
  128. data/lib/fog/rackspace/databases.rb +2 -2
  129. data/lib/fog/rackspace/dns.rb +14 -16
  130. data/lib/fog/rackspace/examples/compute_v2/create_network.rb +81 -0
  131. data/lib/fog/rackspace/examples/compute_v2/delete_network.rb +78 -0
  132. data/lib/fog/rackspace/load_balancers.rb +2 -2
  133. data/lib/fog/rackspace/mock_data.rb +69 -4
  134. data/lib/fog/rackspace/models/auto_scale/group.rb +207 -0
  135. data/lib/fog/rackspace/models/auto_scale/group_config.rb +60 -0
  136. data/lib/fog/rackspace/models/auto_scale/groups.rb +46 -0
  137. data/lib/fog/rackspace/models/auto_scale/launch_config.rb +44 -0
  138. data/lib/fog/rackspace/models/auto_scale/policies.rb +65 -0
  139. data/lib/fog/rackspace/models/auto_scale/policy.rb +206 -0
  140. data/lib/fog/rackspace/models/auto_scale/webhook.rb +105 -0
  141. data/lib/fog/rackspace/models/auto_scale/webhooks.rb +64 -0
  142. data/lib/fog/rackspace/models/block_storage/volume.rb +2 -1
  143. data/lib/fog/rackspace/models/monitoring/notification.rb +42 -0
  144. data/lib/fog/rackspace/models/monitoring/notifications.rb +30 -0
  145. data/lib/fog/rackspace/monitoring.rb +21 -14
  146. data/lib/fog/rackspace/requests/auto_scale/create_group.rb +61 -0
  147. data/lib/fog/rackspace/requests/auto_scale/create_policy.rb +45 -0
  148. data/lib/fog/rackspace/requests/auto_scale/create_webhook.rb +57 -0
  149. data/lib/fog/rackspace/requests/auto_scale/delete_group.rb +23 -0
  150. data/lib/fog/rackspace/requests/auto_scale/delete_policy.rb +31 -0
  151. data/lib/fog/rackspace/requests/auto_scale/delete_webhook.rb +34 -0
  152. data/lib/fog/rackspace/requests/auto_scale/execute_anonymous_webhook.rb +22 -0
  153. data/lib/fog/rackspace/requests/auto_scale/execute_policy.rb +22 -0
  154. data/lib/fog/rackspace/requests/auto_scale/get_group.rb +29 -0
  155. data/lib/fog/rackspace/requests/auto_scale/get_group_config.rb +30 -0
  156. data/lib/fog/rackspace/requests/auto_scale/get_group_state.rb +62 -0
  157. data/lib/fog/rackspace/requests/auto_scale/get_launch_config.rb +30 -0
  158. data/lib/fog/rackspace/requests/auto_scale/get_policy.rb +35 -0
  159. data/lib/fog/rackspace/requests/auto_scale/get_webhook.rb +39 -0
  160. data/lib/fog/rackspace/requests/auto_scale/list_groups.rb +35 -0
  161. data/lib/fog/rackspace/requests/auto_scale/list_policies.rb +23 -0
  162. data/lib/fog/rackspace/requests/auto_scale/list_webhooks.rb +33 -0
  163. data/lib/fog/rackspace/requests/auto_scale/pause_group_state.rb +23 -0
  164. data/lib/fog/rackspace/requests/auto_scale/resume_group_state.rb +23 -0
  165. data/lib/fog/rackspace/requests/auto_scale/update_group_config.rb +39 -0
  166. data/lib/fog/rackspace/requests/auto_scale/update_launch_config.rb +36 -0
  167. data/lib/fog/rackspace/requests/auto_scale/update_policy.rb +33 -0
  168. data/lib/fog/rackspace/requests/auto_scale/update_webhook.rb +44 -0
  169. data/lib/fog/rackspace/requests/compute_v2/delete_server.rb +2 -2
  170. data/lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb +5 -6
  171. data/lib/fog/rackspace/requests/load_balancers/delete_load_balancer.rb +10 -0
  172. data/lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb +30 -0
  173. data/lib/fog/rackspace/requests/monitoring/create_agent_token.rb +31 -0
  174. data/lib/fog/rackspace/requests/monitoring/create_alarm.rb +32 -0
  175. data/lib/fog/rackspace/requests/monitoring/create_check.rb +31 -0
  176. data/lib/fog/rackspace/requests/monitoring/create_entity.rb +32 -0
  177. data/lib/fog/rackspace/requests/monitoring/create_notification.rb +18 -0
  178. data/lib/fog/rackspace/requests/monitoring/delete_agent_token.rb +32 -0
  179. data/lib/fog/rackspace/requests/monitoring/delete_alarm.rb +27 -0
  180. data/lib/fog/rackspace/requests/monitoring/delete_check.rb +26 -0
  181. data/lib/fog/rackspace/requests/monitoring/delete_entity.rb +27 -0
  182. data/lib/fog/rackspace/requests/monitoring/delete_notification.rb +16 -0
  183. data/lib/fog/rackspace/requests/monitoring/get_agent_token.rb +33 -0
  184. data/lib/fog/rackspace/requests/monitoring/get_alarm.rb +38 -0
  185. data/lib/fog/rackspace/requests/monitoring/get_check.rb +41 -0
  186. data/lib/fog/rackspace/requests/monitoring/get_entity.rb +30 -21
  187. data/lib/fog/rackspace/requests/monitoring/get_notification.rb +50 -0
  188. data/lib/fog/rackspace/requests/monitoring/list_agent_tokens.rb +39 -0
  189. data/lib/fog/rackspace/requests/monitoring/list_alarms.rb +50 -0
  190. data/lib/fog/rackspace/requests/monitoring/list_check_types.rb +72 -0
  191. data/lib/fog/rackspace/requests/monitoring/list_checks.rb +54 -0
  192. data/lib/fog/rackspace/requests/monitoring/list_data_points.rb +37 -0
  193. data/lib/fog/rackspace/requests/monitoring/list_entities.rb +53 -0
  194. data/lib/fog/rackspace/requests/monitoring/list_metrics.rb +65 -0
  195. data/lib/fog/rackspace/requests/monitoring/list_notification_plans.rb +55 -0
  196. data/lib/fog/rackspace/requests/monitoring/list_notifications.rb +67 -0
  197. data/lib/fog/rackspace/requests/monitoring/list_overview.rb +97 -1
  198. data/lib/fog/rackspace/requests/monitoring/update_alarm.rb +33 -2
  199. data/lib/fog/rackspace/requests/monitoring/update_check.rb +32 -2
  200. data/lib/fog/rackspace/requests/monitoring/update_entity.rb +33 -2
  201. data/lib/fog/rackspace/requests/monitoring/update_notification.rb +17 -0
  202. data/lib/fog/rackspace/requests/storage/get_object.rb +7 -9
  203. data/lib/fog/rackspace/service.rb +16 -8
  204. data/lib/fog/rackspace/storage.rb +2 -2
  205. data/lib/fog/vcloud_director.rb +11 -0
  206. data/lib/fog/vcloud_director/README.md +967 -0
  207. data/lib/fog/vcloud_director/compute.rb +398 -0
  208. data/lib/fog/vcloud_director/generators/compute/customization.rb +100 -0
  209. data/lib/fog/vcloud_director/generators/compute/disks.rb +175 -0
  210. data/lib/fog/vcloud_director/generators/compute/metadata.rb +105 -0
  211. data/lib/fog/vcloud_director/generators/compute/vm_network.rb +122 -0
  212. data/lib/fog/vcloud_director/models/compute/catalog.rb +25 -0
  213. data/lib/fog/vcloud_director/models/compute/catalog_item.rb +25 -0
  214. data/lib/fog/vcloud_director/models/compute/catalog_items.rb +32 -0
  215. data/lib/fog/vcloud_director/models/compute/catalogs.rb +32 -0
  216. data/lib/fog/vcloud_director/models/compute/disk.rb +51 -0
  217. data/lib/fog/vcloud_director/models/compute/disks.rb +40 -0
  218. data/lib/fog/vcloud_director/models/compute/network.rb +26 -0
  219. data/lib/fog/vcloud_director/models/compute/networks.rb +31 -0
  220. data/lib/fog/vcloud_director/models/compute/organization.rb +41 -0
  221. data/lib/fog/vcloud_director/models/compute/organizations.rb +30 -0
  222. data/lib/fog/vcloud_director/models/compute/tag.rb +36 -0
  223. data/lib/fog/vcloud_director/models/compute/tags.rb +51 -0
  224. data/lib/fog/vcloud_director/models/compute/task.rb +58 -0
  225. data/lib/fog/vcloud_director/models/compute/tasks.rb +31 -0
  226. data/lib/fog/vcloud_director/models/compute/vapp.rb +56 -0
  227. data/lib/fog/vcloud_director/models/compute/vapps.rb +34 -0
  228. data/lib/fog/vcloud_director/models/compute/vdc.rb +33 -0
  229. data/lib/fog/vcloud_director/models/compute/vdcs.rb +32 -0
  230. data/lib/fog/vcloud_director/models/compute/vm.rb +99 -0
  231. data/lib/fog/vcloud_director/models/compute/vm_customization.rb +40 -0
  232. data/lib/fog/vcloud_director/models/compute/vm_customizations.rb +16 -0
  233. data/lib/fog/vcloud_director/models/compute/vm_network.rb +30 -0
  234. data/lib/fog/vcloud_director/models/compute/vm_networks.rb +21 -0
  235. data/lib/fog/vcloud_director/models/compute/vms.rb +41 -0
  236. data/lib/fog/vcloud_director/parsers/compute/disks.rb +57 -0
  237. data/lib/fog/vcloud_director/parsers/compute/metadata.rb +66 -0
  238. data/lib/fog/vcloud_director/parsers/compute/network.rb +108 -0
  239. data/lib/fog/vcloud_director/parsers/compute/vm.rb +82 -0
  240. data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +56 -0
  241. data/lib/fog/vcloud_director/parsers/compute/vm_network.rb +111 -0
  242. data/lib/fog/vcloud_director/parsers/compute/vms.rb +96 -0
  243. data/lib/fog/vcloud_director/parsers/compute/vms_by_metadata.rb +41 -0
  244. data/lib/fog/vcloud_director/requests/compute/delete_metadata.rb +20 -0
  245. data/lib/fog/vcloud_director/requests/compute/delete_vapp.rb +20 -0
  246. data/lib/fog/vcloud_director/requests/compute/get_catalog.rb +18 -0
  247. data/lib/fog/vcloud_director/requests/compute/get_catalog_item.rb +18 -0
  248. data/lib/fog/vcloud_director/requests/compute/get_current_session.rb +75 -0
  249. data/lib/fog/vcloud_director/requests/compute/get_href.rb +19 -0
  250. data/lib/fog/vcloud_director/requests/compute/get_metadata.rb +20 -0
  251. data/lib/fog/vcloud_director/requests/compute/get_network.rb +21 -0
  252. data/lib/fog/vcloud_director/requests/compute/get_organization.rb +72 -0
  253. data/lib/fog/vcloud_director/requests/compute/get_organizations.rb +37 -0
  254. data/lib/fog/vcloud_director/requests/compute/get_request.rb +17 -0
  255. data/lib/fog/vcloud_director/requests/compute/get_supported_versions.rb +1160 -0
  256. data/lib/fog/vcloud_director/requests/compute/get_task.rb +18 -0
  257. data/lib/fog/vcloud_director/requests/compute/get_tasks_list.rb +18 -0
  258. data/lib/fog/vcloud_director/requests/compute/get_vapp.rb +18 -0
  259. data/lib/fog/vcloud_director/requests/compute/get_vapp_template.rb +18 -0
  260. data/lib/fog/vcloud_director/requests/compute/get_vdc.rb +154 -0
  261. data/lib/fog/vcloud_director/requests/compute/get_vm.rb +20 -0
  262. data/lib/fog/vcloud_director/requests/compute/get_vm_cpu.rb +18 -0
  263. data/lib/fog/vcloud_director/requests/compute/get_vm_customization.rb +20 -0
  264. data/lib/fog/vcloud_director/requests/compute/get_vm_disks.rb +20 -0
  265. data/lib/fog/vcloud_director/requests/compute/get_vm_memory.rb +18 -0
  266. data/lib/fog/vcloud_director/requests/compute/get_vm_network.rb +20 -0
  267. data/lib/fog/vcloud_director/requests/compute/get_vms.rb +20 -0
  268. data/lib/fog/vcloud_director/requests/compute/get_vms_by_metadata.rb +20 -0
  269. data/lib/fog/vcloud_director/requests/compute/helper.rb +93 -0
  270. data/lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb +124 -0
  271. data/lib/fog/vcloud_director/requests/compute/post_task_cancel.rb +25 -0
  272. data/lib/fog/vcloud_director/requests/compute/post_vapp_undeploy.rb +26 -0
  273. data/lib/fog/vcloud_director/requests/compute/post_vm_metadata.rb +29 -0
  274. data/lib/fog/vcloud_director/requests/compute/post_vm_poweroff.rb +18 -0
  275. data/lib/fog/vcloud_director/requests/compute/post_vm_poweron.rb +18 -0
  276. data/lib/fog/vcloud_director/requests/compute/put_metadata_value.rb +25 -0
  277. data/lib/fog/vcloud_director/requests/compute/put_vm_cpu.rb +34 -0
  278. data/lib/fog/vcloud_director/requests/compute/put_vm_customization.rb +24 -0
  279. data/lib/fog/vcloud_director/requests/compute/put_vm_disks.rb +25 -0
  280. data/lib/fog/vcloud_director/requests/compute/put_vm_memory.rb +34 -0
  281. data/lib/fog/vcloud_director/requests/compute/put_vm_network.rb +24 -0
  282. data/tests/aws/models/auto_scaling/groups_test.rb +5 -0
  283. data/tests/aws/models/compute/subnet_tests.rb +1 -1
  284. data/tests/aws/models/compute/subnets_tests.rb +1 -1
  285. data/tests/aws/requests/data_pipeline/helper.rb +38 -8
  286. data/tests/aws/requests/data_pipeline/pipeline_tests.rb +25 -1
  287. data/tests/aws/requests/elasticache/security_group_tests.rb +3 -2
  288. data/tests/aws/requests/redshift/cluster_parameter_group_tests.rb +77 -0
  289. data/tests/aws/requests/redshift/cluster_security_group_tests.rb +44 -0
  290. data/tests/aws/requests/redshift/cluster_snapshot_tests.rb +75 -0
  291. data/tests/aws/requests/redshift/cluster_tests.rb +82 -0
  292. data/tests/aws/requests/sts/get_federation_token_tests.rb +0 -1
  293. data/tests/aws/signed_params_tests.rb +12 -0
  294. data/tests/brightbox/compute/helper.rb +1 -0
  295. data/tests/brightbox/compute/schema.rb +696 -0
  296. data/tests/brightbox/requests/compute/account_tests.rb +7 -7
  297. data/tests/brightbox/requests/compute/api_client_tests.rb +6 -6
  298. data/tests/brightbox/requests/compute/application_test.rb +6 -6
  299. data/tests/brightbox/requests/compute/cloud_ip_tests.rb +7 -7
  300. data/tests/brightbox/requests/compute/firewall_policy_tests.rb +5 -5
  301. data/tests/brightbox/requests/compute/firewall_rule_tests.rb +4 -4
  302. data/tests/brightbox/requests/compute/helper.rb +0 -688
  303. data/tests/brightbox/requests/compute/image_tests.rb +2 -2
  304. data/tests/brightbox/requests/compute/interface_tests.rb +1 -1
  305. data/tests/brightbox/requests/compute/load_balancer_tests.rb +9 -9
  306. data/tests/brightbox/requests/compute/server_group_tests.rb +8 -8
  307. data/tests/brightbox/requests/compute/server_tests.rb +13 -10
  308. data/tests/brightbox/requests/compute/server_type_tests.rb +2 -2
  309. data/tests/brightbox/requests/compute/user_tests.rb +3 -3
  310. data/tests/brightbox/requests/compute/zone_tests.rb +2 -2
  311. data/tests/compute/helper.rb +3 -2
  312. data/tests/dynect/requests/dns/dns_tests.rb +29 -0
  313. data/tests/helpers/mock_helper.rb +3 -0
  314. data/tests/openstack/requests/compute/server_tests.rb +30 -0
  315. data/tests/openstack/requests/orchestration/stack_tests.rb +30 -0
  316. data/tests/rackspace/auto_scale_tests.rb +84 -0
  317. data/tests/rackspace/models/auto_scale/group.rb +19 -0
  318. data/tests/rackspace/models/auto_scale/groups.rb +13 -0
  319. data/tests/rackspace/models/auto_scale/policies.rb +23 -0
  320. data/tests/rackspace/models/auto_scale/policy.rb +29 -0
  321. data/tests/rackspace/models/auto_scale/webhook.rb +35 -0
  322. data/tests/rackspace/models/auto_scale/webhooks.rb +28 -0
  323. data/tests/rackspace/models/monitoring/notification_tests.rb +19 -0
  324. data/tests/rackspace/models/monitoring/notifications_tests.rb +10 -0
  325. data/tests/rackspace/requests/auto_scale/config_tests.rb +51 -0
  326. data/tests/rackspace/requests/auto_scale/group_tests.rb +38 -0
  327. data/tests/rackspace/requests/auto_scale/helper.rb +181 -0
  328. data/tests/rackspace/requests/auto_scale/policy_tests.rb +61 -0
  329. data/tests/rackspace/requests/auto_scale/webhook_tests.rb +49 -0
  330. data/tests/rackspace/requests/compute_v2/address_tests.rb +1 -1
  331. data/tests/rackspace/requests/monitoring/agent_tests.rb +0 -1
  332. data/tests/rackspace/requests/monitoring/alarm_tests.rb +3 -3
  333. data/tests/rackspace/requests/monitoring/check_tests.rb +0 -1
  334. data/tests/rackspace/requests/monitoring/entity_tests.rb +3 -12
  335. data/tests/rackspace/requests/monitoring/list_tests.rb +18 -6
  336. data/tests/rackspace/requests/monitoring/notification_tests.rb +46 -0
  337. data/tests/vcloud_director/models/compute/catalog_items_tests.rb +42 -0
  338. data/tests/vcloud_director/models/compute/catalogs_tests.rb +42 -0
  339. data/tests/vcloud_director/models/compute/helper.rb +67 -0
  340. data/tests/vcloud_director/models/compute/organizations_tests.rb +22 -0
  341. data/tests/vcloud_director/models/compute/vapp_life_cycle_tests.rb +98 -0
  342. data/tests/vcloud_director/models/compute/vapp_tests.rb +42 -0
  343. data/tests/vcloud_director/models/compute/vdcs_tests.rb +45 -0
  344. data/tests/vcloud_director/models/compute/vms_tests.rb +89 -0
  345. data/tests/vcloud_director/models/tools/reduced_vcr_requests.rb +27 -0
  346. data/tests/vcloud_director/requests/compute/organization_tests.rb +48 -0
  347. data/tests/vcloud_director/requests/compute/session_tests.rb +29 -0
  348. data/tests/vcloud_director/requests/compute/vdc_tests.rb +90 -0
  349. data/tests/vcloud_director/requests/compute/versions_tests.rb +28 -0
  350. metadata +342 -43
@@ -0,0 +1,22 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
+
3
+ VCR.use_cassette(File.basename(__FILE__)) do
4
+
5
+ Shindo.tests("Compute::VcloudDirector | organizations", ['vclouddirector', 'all']) do
6
+ organizations = vcloud_director.organizations
7
+ tests("#There is at least one organization").returns(true) { organizations.size >= 1 }
8
+
9
+ org = organizations.first
10
+
11
+ tests("Compute::VcloudDirector | organization") do
12
+ tests("#name").returns(String) { org.name.class }
13
+ tests("#type").returns("application/vnd.vmware.vcloud.org+xml") { org.type }
14
+ end
15
+
16
+ tests("Compute::VcloudDirector | organization", ['get']) do
17
+ tests("#get_by_name").returns(org.name) { organizations.get_by_name(org.name).name }
18
+ tests("#get").returns(org.id) { organizations.get(org.id).id }
19
+ end
20
+ end
21
+
22
+ end
@@ -0,0 +1,98 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
+
3
+
4
+ VAPP_NAME = "shindo07"
5
+ NETWORK_NAME = "DevOps - Dev Network Connection"
6
+ NETWORK_MODE = "POOL"
7
+ CATALOG_NAME = "Public VM Templates"
8
+ CATALOG_ITEM_NAME = "DEVWEB"
9
+ TAGS = { :company => "acme", :environment => "testing" }
10
+
11
+
12
+ VCR.use_cassette(File.basename(__FILE__)) do
13
+
14
+ Shindo.tests("Compute::VcloudDirector | vapp", ['vclouddirector', 'creation']) do
15
+ pending if Fog.mocking?
16
+ pending # FIXME: vCloud environment needs to be set up in advance
17
+ tests("#it creates a vApp from a catalog item").returns(true){ the_catalog_item.instantiate(VAPP_NAME, { :network_id => the_network.id, :network_name => NETWORK_NAME}) }
18
+ vapp = vapps.get_by_name(VAPP_NAME)
19
+ tests("#Finds the just created vApp").returns(VAPP_NAME) { vapp.name }
20
+ tests("#it has one vm").returns(1) { vapp.vms.size}
21
+ tests("Compute::VcloudDirector | vm", ['configuration']) do
22
+ vm = vapp.vms.first
23
+ tests("Compute::VcloudDirector | vm", ['network']) do
24
+ network = vm.network
25
+ network.network = NETWORK_NAME
26
+ network.is_connected = true
27
+ network.ip_address_allocation_mode = NETWORK_MODE
28
+ tests("save network changes").returns(true){ network.save }
29
+ network.reload
30
+ tests("#network").returns(NETWORK_NAME) { network.network }
31
+ tests("#is_connected").returns(true) { network.is_connected }
32
+ tests("#ip_address_allocation_mode").returns(NETWORK_MODE) { network.ip_address_allocation_mode }
33
+ end
34
+
35
+ tests("Compute::VcloudDirector | vm", ['customization']) do
36
+ customization = vm.customization
37
+ customization.script = 'this is the user data'
38
+ customization.enabled = true
39
+ tests("save customization changes").returns(true){ customization.save }
40
+ tests("#script").returns('this is the user data') { customization.script }
41
+ tests("#enabled").returns(true) { customization.enabled }
42
+ end
43
+
44
+ tests("Compute::VcloudDirector | vm", ['doble the disk size']) do
45
+ disk = vm.disks.get_by_name('Hard disk 1')
46
+ tests("#disk_size").returns(Fixnum) { disk.capacity.class}
47
+ new_size = disk.capacity * 2
48
+ disk.capacity = new_size
49
+ disk.reload
50
+ tests("#disk_size is now doubled").returns(new_size) { disk.capacity }
51
+ end
52
+
53
+ tests("Compute::VcloudDirector | vm", ['add a new disk']) do
54
+ tests("hard disk 2 doesn't exist").returns(nil) { vm.disks.get_by_name('Hard disk 2') }
55
+ tests("#create").returns(true) { vm.disks.create(1024) }
56
+ tests("hard disk 2 exists").returns(1024) { vm.disks.get_by_name('Hard disk 2').capacity }
57
+ tests("delete disk 2").returns(true) { vm.disks.get_by_name('Hard disk 2').destroy }
58
+ tests("hard disk 2 doesn't exist anymore").returns(nil) { vm.disks.get_by_name('Hard disk 2') }
59
+ end
60
+
61
+ tests("Compute::VcloudDirector | vm", ['doble the memory size']) do
62
+ tests("#memory").returns(Fixnum) { vm.memory.class}
63
+ new_size = vm.memory * 2
64
+ vm.memory = new_size
65
+ vm.reload
66
+ tests("#memory is now doubled").returns(new_size) { vm.memory }
67
+ end
68
+
69
+ tests("Compute::VcloudDirector | vm", ['doble the cpu size']) do
70
+ tests("#cpu").returns(Fixnum) { vm.cpu.class}
71
+ new_size = vm.cpu * 2
72
+ vm.cpu = new_size
73
+ vm.reload
74
+ tests("#memory is now doubled").returns(new_size) { vm.cpu }
75
+ end
76
+
77
+ tests("Compute::VcloudDirector | vm", ['tags']) do
78
+ TAGS.each_pair do |k,v|
79
+ tests('create tag').returns(true) {vm.tags.create(k, v)}
80
+ end
81
+ tests('there are two tags').returns(2){ vm.tags.size }
82
+ tests('#get_by_name').returns("acme"){ vm.tags.get_by_name('company').value }
83
+ tests('#get_by_name').returns("testing"){ vm.tags.get_by_name('environment').value }
84
+ tests('delete company').returns(true){ vm.tags.get_by_name('company').destroy }
85
+ tests("company doesn't exists anymore").returns(nil){ vm.tags.get_by_name('company') }
86
+ tests('there is only one tag').returns(1){ vm.tags.size }
87
+ end
88
+
89
+ tests("Compute::VcloudDirector | vm", ['power on']) do
90
+ tests('#vm is off').returns("off"){ vm.status }
91
+ tests('#power_on').returns(true){ vm.power_on }
92
+ vm.reload
93
+ tests('#vm is on').returns("on"){ vm.status }
94
+ end
95
+
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,42 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
+
3
+ VCR.use_cassette(File.basename(__FILE__)) do
4
+
5
+ Shindo.tests("Compute::VcloudDirector | vapps", ['vclouddirector', 'all']) do
6
+ pending if Fog.mocking?
7
+ tests("#There is more than one vapp").returns(true){ vdc.vapps.size >= 1 }
8
+
9
+ vapps = vdc.vapps
10
+ vapp = vapps.first
11
+
12
+ tests("Compute::VcloudDirector | vapp") do
13
+ tests("#id").returns(String){ vapp.id.class }
14
+ tests("#name").returns(String){ vapp.name.class }
15
+ tests("#href").returns(String){ vapp.href.class }
16
+ tests("#type").returns("application/vnd.vmware.vcloud.vApp+xml"){ vapp.type }
17
+ end
18
+
19
+ tests("Compute::VcloudDirector | vapp", ['lazy load attrs']) do
20
+ vapp.lazy_load_attrs.each do |lazy_attr|
21
+ tests("##{lazy_attr} is not loaded yet").returns(NonLoaded) { vapp.attributes[lazy_attr] }
22
+ end
23
+ end
24
+
25
+ tests("Compute::VcloudDirector | vapp", ['load on demand']) do
26
+ tests("#description is not loaded yet").returns(NonLoaded) { vapp.attributes[:description] }
27
+ tests("#description is loaded on demand").returns(String) { vapp.description.class }
28
+ tests("#description is now loaded").returns(true) { vapp.attributes[:description] != NonLoaded }
29
+ end
30
+
31
+ tests("Compute::VcloudDirector | vapp", ['lazy load attrs']) do
32
+ vapp.lazy_load_attrs.each do |lazy_attr|
33
+ tests("##{lazy_attr} is now loaded").returns(true) { vapp.attributes[lazy_attr] != NonLoaded }
34
+ end
35
+ end
36
+
37
+ tests("Compute::VcloudDirector | vapp", ['get']) do
38
+ tests("#get_by_name").returns(vapp.name) { vapps.get_by_name(vapp.name).name }
39
+ tests("#get").returns(vapp.id) { vapps.get(vapp.id).id }
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,45 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
+
3
+ VCR.use_cassette(File.basename(__FILE__)) do
4
+
5
+ Shindo.tests("Compute::VcloudDirector | vdcs", ['vclouddirector', 'all']) do
6
+ pending if Fog.mocking?
7
+ tests("#There is one or more vdc").returns(true){ organization.vdcs.size >= 1 }
8
+
9
+ vdcs = organization.vdcs
10
+ vdc = vdcs.first
11
+
12
+ tests("Compute::VcloudDirector | vdc") do
13
+ tests("#id").returns(String) { vdc.id.class }
14
+ tests("#name").returns(String) { vdc.name.class }
15
+ tests("#href").returns(String) { vdc.href.class }
16
+ tests("#type").returns("application/vnd.vmware.vcloud.vdc+xml") { vdc.type }
17
+ end
18
+
19
+ tests("Compute::VcloudDirector | vdc", ['lazy load attrs']) do
20
+ vdc.lazy_load_attrs.each do |lazy_attr|
21
+ tests("##{lazy_attr} is not loaded yet").returns(NonLoaded) { vdc.attributes[lazy_attr] }
22
+ end
23
+ end
24
+
25
+ tests("Compute::VcloudDirector | vdc", ['load on demand']) do
26
+ tests("#description is not loaded yet").returns(NonLoaded) { vdc.attributes[:description] }
27
+ tests("#description is loaded on demand").returns(String) { vdc.description.class }
28
+ tests("#description is now loaded").returns(true) { vdc.attributes[:description] != NonLoaded }
29
+ end
30
+
31
+ tests("Compute::VcloudDirector | vdc", ['lazy load attrs']) do
32
+ lazy_attrs = vdc.lazy_load_attrs
33
+ lazy_attrs.delete(:storage_capacity) if vcloud_director.api_version.to_f >= 5.1
34
+ lazy_attrs.each do |lazy_attr|
35
+ tests("##{lazy_attr} is now loaded").returns(true) { vdc.attributes[lazy_attr] != NonLoaded }
36
+ end
37
+ end
38
+
39
+ tests("Compute::VcloudDirector | vdc", ['get']) do
40
+ tests("#get_by_name").returns(vdc.name) { vdcs.get_by_name(vdc.name).name }
41
+ tests("#get").returns(vdc.id) { vdcs.get(vdc.id).id }
42
+ end
43
+ end
44
+
45
+ end
@@ -0,0 +1,89 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
+
3
+ VCR.use_cassette(File.basename(__FILE__)) do
4
+
5
+ Shindo.tests("Compute::VcloudDirector | vms", ['vclouddirector', 'all']) do
6
+ pending if Fog.mocking?
7
+ vapp = vapps.detect {|v| v.vms.size >= 1}
8
+
9
+ tests("#There is more than one vm").returns(true){ vapp.vms.size >= 1 }
10
+
11
+ vms = vapp.vms
12
+ vm = vms.first
13
+
14
+ tests("Compute::VcloudDirector | vm") do
15
+ tests("#model").returns(Fog::Compute::VcloudDirector::Vm){vm.class}
16
+ tests("#id").returns(String){ vm.id.class }
17
+ tests("#name").returns(String){ vm.name.class }
18
+ tests("#href").returns(String){ vm.href.class }
19
+ tests("#type").returns("application/vnd.vmware.vcloud.vm+xml"){ vm.type }
20
+ tests("#vapp_id").returns(String){ vm.vapp_id.class }
21
+ tests("#status").returns(String){ vm.status.class }
22
+ tests("#operating_system").returns(String){ vm.operating_system.class }
23
+ tests("#ip_address").returns(String){ vm.ip_address.class }
24
+ tests("#cpu").returns(Fixnum){ vm.cpu.class }
25
+ tests("#memory").returns(Fixnum){ vm.memory.class }
26
+ tests("#hard_disks").returns(Array){ vm.hard_disks.class }
27
+ end
28
+
29
+ tests("Compute::VcloudDirector | vm", ['get']) do
30
+ tests("#get_by_name").returns(vm.name) { vms.get_by_name(vm.name).name }
31
+ tests("#get").returns(vm.id) { vms.get(vm.id).id }
32
+ end
33
+
34
+ tests("Compute::VcloudDirector | vm | disks") do
35
+ tests("#collection").returns(Fog::Compute::VcloudDirector::Disks){ vm.disks.class }
36
+ tests("#get_by_name").returns(Fog::Compute::VcloudDirector::Disk) { vm.disks.get_by_name("Hard disk 1").class }
37
+
38
+ hard_disk = vm.disks.get_by_name("Hard disk 1")
39
+ tests("#id").returns(2000){ hard_disk.id }
40
+ tests("#name").returns("Hard disk 1"){ hard_disk.name }
41
+ tests("#description").returns("Hard disk"){ hard_disk.description }
42
+ tests("#resource_type").returns(17){ hard_disk.resource_type }
43
+ tests("#address_on_parent").returns(0){ hard_disk.address_on_parent }
44
+ tests("#parent").returns(2){ hard_disk.parent }
45
+ tests("#capacity").returns(Fixnum){ hard_disk.capacity.class }
46
+ tests("#bus_sub_type").returns(String){ hard_disk.bus_sub_type.class }
47
+ tests("#bus_type").returns(6){ hard_disk.bus_type }
48
+ end
49
+
50
+ tests("Compute::VcloudDirector | vm | customization") do
51
+ customization = vm.customization
52
+ tests("#model").returns(Fog::Compute::VcloudDirector::VmCustomization){customization.class}
53
+ tests("#id").returns(String){ customization.id.class }
54
+ tests("#href").returns(String){ customization.href.class }
55
+ tests("#type").returns("application/vnd.vmware.vcloud.guestCustomizationSection+xml"){ customization.type }
56
+ tests("#virtual_machine_id").returns(String){ customization.virtual_machine_id.class }
57
+ tests("#computer_name").returns(String){ customization.computer_name.class }
58
+ tests("#enabled").returns(true){ boolean? customization.enabled }
59
+ tests("#change_sid").returns(true){ boolean? customization.change_sid }
60
+ tests("#join_domain_enabled").returns(true){ boolean? customization.join_domain_enabled }
61
+ tests("#use_org_settings").returns(true){ boolean? customization.use_org_settings }
62
+ tests("#admin_password_enabled").returns(true){ boolean? customization.admin_password_enabled }
63
+ tests("#reset_password_required").returns(true){ boolean? customization.reset_password_required }
64
+ end
65
+
66
+ tests("Compute::VcloudDirector | vm | network") do
67
+ network = vm.network
68
+ tests("#model").returns(Fog::Compute::VcloudDirector::VmNetwork){network.class}
69
+ tests("#id").returns(String){ network.id.class }
70
+ tests("#href").returns(String){ network.href.class }
71
+ tests("#type").returns("application/vnd.vmware.vcloud.networkConnectionSection+xml"){ network.type }
72
+ tests("#info").returns(String){ network.info.class }
73
+ tests("#primary_network_connection_index").returns(Fixnum){ network.primary_network_connection_index.class }
74
+ tests("#network").returns(String){ network.network.class }
75
+ tests("#network_connection_index").returns(Fixnum){ network.network_connection_index.class }
76
+ tests("#mac_address").returns(String){ network.mac_address.class }
77
+ tests("#ip_address_allocation_mode").returns(String){ network.ip_address_allocation_mode.class }
78
+ tests("#needs_customization").returns(true){ boolean? network.needs_customization }
79
+ tests("#is_connected").returns(true){ boolean? network.is_connected }
80
+ end
81
+
82
+ tests("Compute::VcloudDirector | vm | tags") do
83
+ tags = vm.tags
84
+ tests("#collection").returns(Fog::Compute::VcloudDirector::Tags){ tags.class }
85
+ end
86
+
87
+
88
+ end
89
+ end
@@ -0,0 +1,27 @@
1
+ #!/usr/local/bin/ruby
2
+
3
+ # TO FIX: it reduces the number of requests but it make the tests to faile
4
+ require 'yaml'
5
+ PATH = ARGV.shift
6
+ vcr_cassete = YAML.load_file(PATH)
7
+
8
+ @num_request = 0
9
+ @pending_requests = {}
10
+
11
+ reduced_requests = vcr_cassete["http_interactions"].reject do |i|
12
+ @num_request += 1
13
+ if i["response"]["body"]["string"] =~ /running/ && i["response"]["headers"]["Content-Type"].to_s == 'application/vnd.vmware.vcloud.task+xml;version=1.5'
14
+ @pending_requests[@num_request]=true
15
+ @pending_requests[@num_request] && @pending_requests[@num_request-1] && @pending_requests[@num_request-2]
16
+ else
17
+ @pending_requests[@num_request]=false
18
+ end
19
+ end
20
+
21
+ cleaned = vcr_cassete["http_interactions"].size - reduced_requests.size
22
+ puts "cleaned: #{cleaned} requests"
23
+
24
+ vcr_cassete["http_interactions"] = reduced_requests
25
+
26
+ File.open(PATH, 'w') {|f| f.write(vcr_cassete.to_yaml) }
27
+
@@ -0,0 +1,48 @@
1
+ Shindo.tests('Compute::VcloudDirector | organization requests', ['vclouddirector']) do
2
+
3
+ ORG_LIST_FORMAT = {
4
+ :xmlns => 'http://www.vmware.com/vcloud/v1.5',
5
+ :xmlns_xsi => 'http://www.w3.org/2001/XMLSchema-instance',
6
+ :type => 'application/vnd.vmware.vcloud.orgList+xml',
7
+ :href => String,
8
+ :xsi_schemaLocation => String,
9
+ :Org => [{
10
+ :type => 'application/vnd.vmware.vcloud.org+xml',
11
+ :name => String,
12
+ :href => String
13
+ }]
14
+ }
15
+
16
+ ORG_FORMAT = {
17
+ :xmlns => 'http://www.vmware.com/vcloud/v1.5',
18
+ :xmlns_xsi => 'http://www.w3.org/2001/XMLSchema-instance',
19
+ :name => String,
20
+ :id => String,
21
+ :type => 'application/vnd.vmware.vcloud.org+xml',
22
+ :href => String,
23
+ :xsi_schemaLocation => String,
24
+ :Link => [{
25
+ :rel => String,
26
+ :type => String,
27
+ # :name => String, -- not always true
28
+ :href => String,
29
+ }],
30
+ :Description => String,
31
+ :FullName => String
32
+ }
33
+
34
+ @service = Fog::Compute::VcloudDirector.new
35
+
36
+ tests('#get_organizations').formats(ORG_LIST_FORMAT) do
37
+ @org_list = @service.get_organizations.body
38
+ @org_list[:Org] = [@org_list[:Org]] if @org_list[:Org].is_a?(Hash)
39
+ @org_list
40
+ end
41
+
42
+ tests('#get_organization').formats(ORG_FORMAT) do
43
+ org = @org_list[:Org].detect {|o| o[:name] == @service.org_name}
44
+ org_uuid = org[:href].split('/').last
45
+ @service.get_organization(org_uuid).body
46
+ end
47
+
48
+ end
@@ -0,0 +1,29 @@
1
+ Shindo.tests('Compute::VcloudDirector | session requests', ['vclouddirector']) do
2
+
3
+ SESSION_FORMAT = {
4
+ :xmlns => 'http://www.vmware.com/vcloud/v1.5',
5
+ :xmlns_xsi => 'http://www.w3.org/2001/XMLSchema-instance',
6
+ :user => String,
7
+ :org => String,
8
+ :type => 'application/vnd.vmware.vcloud.session+xml',
9
+ :href => String,
10
+ :xsi_schemaLocation => String,
11
+ :Link => [{
12
+ :rel => String,
13
+ :type => String,
14
+ :href => String
15
+ }]
16
+ }
17
+
18
+ @service = Fog::Compute::VcloudDirector.new
19
+
20
+ tests('#post_login_sessions').formats(SESSION_FORMAT) do
21
+ pending
22
+ @service.login.body # calls post_login_sessions
23
+ end
24
+
25
+ tests('#get_current_session').formats(SESSION_FORMAT) do
26
+ @service.get_current_session.body
27
+ end
28
+
29
+ end
@@ -0,0 +1,90 @@
1
+ Shindo.tests('Compute::VcloudDirector | vdc requests', ['vclouddirector']) do
2
+
3
+ VDC_FORMAT = {
4
+ :xmlns => 'http://www.vmware.com/vcloud/v1.5',
5
+ :xmlns_xsi => 'http://www.w3.org/2001/XMLSchema-instance',
6
+ :status => String,
7
+ :name => String,
8
+ :id => String,
9
+ :type => 'application/vnd.vmware.vcloud.vdc+xml',
10
+ :href => String,
11
+ :xsi_schemaLocation => String,
12
+ :Link => [{
13
+ :rel => String,
14
+ :type => String,
15
+ :href => String
16
+ }],
17
+ :Description => String,
18
+ :AllocationModel => String,
19
+ :ComputeCapacity => {
20
+ :Cpu => {
21
+ :Units => String,
22
+ :Allocated => String,
23
+ :Limit => String,
24
+ :Reserved => String,
25
+ :Used => String,
26
+ :Overhead => String,
27
+ },
28
+ :Memory => {
29
+ :Units => String,
30
+ :Allocated => String,
31
+ :Limit => String,
32
+ :Reserved => String,
33
+ :Used => String,
34
+ :Overhead => String
35
+ }
36
+ },
37
+ :ResourceEntities => {
38
+ :ResourceEntity => [{
39
+ :type => String,
40
+ :name => String,
41
+ :href => String
42
+ }]
43
+ },
44
+ :AvailableNetworks => {
45
+ :Network => [{
46
+ :type => String,
47
+ :name => String,
48
+ :href => String
49
+ }]
50
+ },
51
+ :Capabilities => {
52
+ :SupportedHardwareVersions => {
53
+ :SupportedHardwareVersion => String,
54
+ }
55
+ },
56
+ :NicQuota => String,
57
+ :NetworkQuota => String,
58
+ :UsedNetworkCount => String,
59
+ :VmQuota => String,
60
+ :IsEnabled => String,
61
+ # TODO
62
+ #:VdcStorageProfiles => { # >= 5.1
63
+ # :VdcStorageProfile => [{
64
+ # :type => String,
65
+ # :name => String,
66
+ # :href => String
67
+ # }]
68
+ #}
69
+ }
70
+
71
+ @service = Fog::Compute::VcloudDirector.new
72
+
73
+ tests('#Get current organization') do
74
+ session = @service.get_current_session.body
75
+ org_href = session[:Link].detect {|l| l[:type] == 'application/vnd.vmware.vcloud.org+xml'}[:href]
76
+ @org = @service.get_organization(org_uuid = org_href.split('/')[-1]).body
77
+ end
78
+
79
+ tests('#get_vdc').formats(VDC_FORMAT) do
80
+ vdc_href = @org[:Link].detect {|l| l[:type] == 'application/vnd.vmware.vcloud.vdc+xml'}[:href]
81
+ vdc = @service.get_vdc(vdc_href.split('/')[-1]).body
82
+ vdc[:AvailableNetworks][:Network] = [vdc[:AvailableNetworks][:Network]] if vdc[:AvailableNetworks][:Network].is_a?(Hash)
83
+ vdc[:ResourceEntities][:ResourceEntity] = [vdc[:ResourceEntities][:ResourceEntity]] if vdc[:ResourceEntities][:ResourceEntity].is_a?(Hash)
84
+ if vdc.has_key?(:VdcStorageProfiles)
85
+ vdc[:VdcStorageProfiles][:VdcStorageProfile] = [vdc[:VdcStorageProfiles][:VdcStorageProfile]] if vdc[:VdcStorageProfiles][:VdcStorageProfile].is_a?(Hash)
86
+ end
87
+ vdc
88
+ end
89
+
90
+ end