fog 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (428) hide show
  1. data/Rakefile +7 -4
  2. data/bin/fog +4 -1
  3. data/changelog.txt +464 -0
  4. data/docs/index.markdown +2 -2
  5. data/fog.gemspec +11 -11
  6. data/lib/fog.rb +1 -1
  7. data/lib/fog/aws/auto_scaling.rb +221 -0
  8. data/lib/fog/aws/cloud_formation.rb +1 -1
  9. data/lib/fog/aws/cloud_watch.rb +110 -0
  10. data/lib/fog/aws/elb.rb +58 -26
  11. data/lib/fog/aws/iam.rb +65 -13
  12. data/lib/fog/aws/models/auto_scaling/activities.rb +30 -0
  13. data/lib/fog/aws/models/auto_scaling/activity.rb +29 -0
  14. data/lib/fog/aws/models/auto_scaling/configuration.rb +63 -0
  15. data/lib/fog/aws/models/auto_scaling/configurations.rb +35 -0
  16. data/lib/fog/aws/models/auto_scaling/group.rb +140 -0
  17. data/lib/fog/aws/models/auto_scaling/groups.rb +35 -0
  18. data/lib/fog/aws/models/auto_scaling/instance.rb +60 -0
  19. data/lib/fog/aws/models/auto_scaling/instances.rb +30 -0
  20. data/lib/fog/aws/models/cloud_watch/metric.rb +14 -0
  21. data/lib/fog/aws/models/cloud_watch/metric_statistic.rb +46 -0
  22. data/lib/fog/aws/models/cloud_watch/metric_statistics.rb +23 -0
  23. data/lib/fog/aws/models/cloud_watch/metrics.rb +32 -0
  24. data/lib/fog/aws/models/elb/listener.rb +6 -0
  25. data/lib/fog/aws/models/elb/listeners.rb +2 -2
  26. data/lib/fog/aws/models/elb/load_balancer.rb +8 -5
  27. data/lib/fog/aws/models/rds/server.rb +3 -1
  28. data/lib/fog/aws/parsers/auto_scaling/basic.rb +28 -0
  29. data/lib/fog/aws/parsers/auto_scaling/describe_adjustment_types.rb +39 -0
  30. data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_groups.rb +126 -0
  31. data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_instances.rb +43 -0
  32. data/lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb +94 -0
  33. data/lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb +66 -0
  34. data/lib/fog/aws/parsers/auto_scaling/describe_policies.rb +66 -0
  35. data/lib/fog/aws/parsers/auto_scaling/describe_scaling_activities.rb +47 -0
  36. data/lib/fog/aws/parsers/auto_scaling/describe_scaling_process_types.rb +39 -0
  37. data/lib/fog/aws/parsers/auto_scaling/describe_scheduled_actions.rb +46 -0
  38. data/lib/fog/aws/parsers/auto_scaling/put_scaling_policy.rb +30 -0
  39. data/lib/fog/aws/parsers/auto_scaling/terminate_instance_in_auto_scaling_group.rb +35 -0
  40. data/lib/fog/aws/parsers/cloud_watch/get_metric_statistics.rb +42 -0
  41. data/lib/fog/aws/parsers/cloud_watch/list_metrics.rb +58 -0
  42. data/lib/fog/aws/parsers/cloud_watch/put_metric_data.rb +26 -0
  43. data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +1 -1
  44. data/lib/fog/aws/parsers/iam/get_group_policy.rb +27 -0
  45. data/lib/fog/aws/parsers/iam/list_account_aliases.rb +28 -0
  46. data/lib/fog/aws/parsers/rds/db_engine_version_parser.rb +35 -0
  47. data/lib/fog/aws/parsers/rds/db_parser.rb +1 -1
  48. data/lib/fog/aws/parsers/rds/describe_db_engine_versions.rb +39 -0
  49. data/lib/fog/aws/parsers/rds/describe_db_reserved_instances.rb +43 -0
  50. data/lib/fog/aws/parsers/sns/add_permission.rb +24 -0
  51. data/lib/fog/aws/parsers/sns/confirm_subscription.rb +24 -0
  52. data/lib/fog/aws/parsers/sns/create_topic.rb +24 -0
  53. data/lib/fog/aws/parsers/sns/delete_topic.rb +24 -0
  54. data/lib/fog/aws/parsers/sns/get_topic_attributes.rb +32 -0
  55. data/lib/fog/aws/parsers/sns/list_subscriptions.rb +29 -0
  56. data/lib/fog/aws/parsers/sns/list_topics.rb +26 -0
  57. data/lib/fog/aws/parsers/sns/publish.rb +24 -0
  58. data/lib/fog/aws/parsers/sns/remove_permission.rb +24 -0
  59. data/lib/fog/aws/parsers/sns/set_topic_attributes.rb +24 -0
  60. data/lib/fog/aws/parsers/sns/subscribe.rb +24 -0
  61. data/lib/fog/aws/parsers/sns/unsubscribe.rb +24 -0
  62. data/lib/fog/aws/parsers/sqs/basic.rb +23 -0
  63. data/lib/fog/aws/parsers/sqs/create_queue.rb +26 -0
  64. data/lib/fog/aws/parsers/sqs/get_queue_attributes.rb +35 -0
  65. data/lib/fog/aws/parsers/sqs/list_queues.rb +25 -0
  66. data/lib/fog/aws/parsers/sqs/receive_message.rb +41 -0
  67. data/lib/fog/aws/parsers/sqs/send_message.rb +28 -0
  68. data/lib/fog/aws/rds.rb +3 -1
  69. data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +108 -0
  70. data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +105 -0
  71. data/lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb +45 -0
  72. data/lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb +48 -0
  73. data/lib/fog/aws/requests/auto_scaling/delete_policy.rb +47 -0
  74. data/lib/fog/aws/requests/auto_scaling/delete_scheduled_action.rb +48 -0
  75. data/lib/fog/aws/requests/auto_scaling/describe_adjustment_types.rb +52 -0
  76. data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb +128 -0
  77. data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb +96 -0
  78. data/lib/fog/aws/requests/auto_scaling/describe_launch_configurations.rb +108 -0
  79. data/lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb +60 -0
  80. data/lib/fog/aws/requests/auto_scaling/describe_policies.rb +85 -0
  81. data/lib/fog/aws/requests/auto_scaling/describe_scaling_activities.rb +88 -0
  82. data/lib/fog/aws/requests/auto_scaling/describe_scaling_process_types.rb +54 -0
  83. data/lib/fog/aws/requests/auto_scaling/describe_scheduled_actions.rb +83 -0
  84. data/lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb +56 -0
  85. data/lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb +66 -0
  86. data/lib/fog/aws/requests/auto_scaling/execute_policy.rb +50 -0
  87. data/lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb +66 -0
  88. data/lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb +57 -0
  89. data/lib/fog/aws/requests/auto_scaling/resume_processes.rb +50 -0
  90. data/lib/fog/aws/requests/auto_scaling/set_desired_capacity.rb +87 -0
  91. data/lib/fog/aws/requests/auto_scaling/set_instance_health.rb +55 -0
  92. data/lib/fog/aws/requests/auto_scaling/suspend_processes.rb +57 -0
  93. data/lib/fog/aws/requests/auto_scaling/terminate_instance_in_auto_scaling_group.rb +65 -0
  94. data/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +79 -0
  95. data/lib/fog/aws/requests/cloud_watch/get_metric_statistics.rb +48 -0
  96. data/lib/fog/aws/requests/cloud_watch/list_metrics.rb +38 -0
  97. data/lib/fog/aws/requests/cloud_watch/put_metric_data.rb +73 -0
  98. data/lib/fog/aws/requests/elb/configure_health_check.rb +24 -0
  99. data/lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb +21 -0
  100. data/lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb +21 -0
  101. data/lib/fog/aws/requests/elb/create_load_balancer.rb +55 -0
  102. data/lib/fog/aws/requests/elb/create_load_balancer_listeners.rb +28 -0
  103. data/lib/fog/aws/requests/elb/delete_load_balancer.rb +18 -0
  104. data/lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb +20 -1
  105. data/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb +23 -0
  106. data/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +21 -5
  107. data/lib/fog/aws/requests/elb/describe_instance_health.rb +35 -0
  108. data/lib/fog/aws/requests/elb/describe_load_balancers.rb +29 -0
  109. data/lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb +18 -5
  110. data/lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb +18 -3
  111. data/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +22 -5
  112. data/lib/fog/aws/requests/elb/set_load_balancer_listener_ssl_certificate.rb +40 -0
  113. data/lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb +37 -0
  114. data/lib/fog/aws/requests/iam/create_account_alias.rb +19 -0
  115. data/lib/fog/aws/requests/iam/delete_account_alias.rb +19 -0
  116. data/lib/fog/aws/requests/iam/delete_server_certificate.rb +14 -0
  117. data/lib/fog/aws/requests/iam/get_group_policy.rb +36 -0
  118. data/lib/fog/aws/requests/iam/get_server_certificate.rb +50 -0
  119. data/lib/fog/aws/requests/iam/list_account_aliases.rb +18 -0
  120. data/lib/fog/aws/requests/iam/list_server_certificates.rb +12 -0
  121. data/lib/fog/aws/requests/iam/put_group_policy.rb +1 -1
  122. data/lib/fog/aws/requests/iam/put_user_policy.rb +1 -1
  123. data/lib/fog/aws/requests/iam/upload_server_certificate.rb +53 -5
  124. data/lib/fog/aws/requests/rds/describe_db_engine_versions.rb +34 -0
  125. data/lib/fog/aws/requests/rds/describe_db_reserved_instances.rb +42 -0
  126. data/lib/fog/aws/requests/simpledb/get_attributes.rb +29 -17
  127. data/lib/fog/aws/requests/simpledb/select.rb +11 -3
  128. data/lib/fog/aws/requests/sns/add_permission.rb +26 -0
  129. data/lib/fog/aws/requests/sns/confirm_subscription.rb +33 -0
  130. data/lib/fog/aws/requests/sns/create_topic.rb +29 -0
  131. data/lib/fog/aws/requests/sns/delete_topic.rb +29 -0
  132. data/lib/fog/aws/requests/sns/get_topic_attributes.rb +29 -0
  133. data/lib/fog/aws/requests/sns/list_subscriptions.rb +29 -0
  134. data/lib/fog/aws/requests/sns/list_subscriptions_by_topic.rb +31 -0
  135. data/lib/fog/aws/requests/sns/list_topics.rb +29 -0
  136. data/lib/fog/aws/requests/sns/publish.rb +34 -0
  137. data/lib/fog/aws/requests/sns/remove_permission.rb +26 -0
  138. data/lib/fog/aws/requests/sns/set_topic_attributes.rb +33 -0
  139. data/lib/fog/aws/requests/sns/subscribe.rb +33 -0
  140. data/lib/fog/aws/requests/sns/unsubscribe.rb +29 -0
  141. data/lib/fog/aws/requests/sqs/change_message_visibility.rb +33 -0
  142. data/lib/fog/aws/requests/sqs/create_queue.rb +31 -0
  143. data/lib/fog/aws/requests/sqs/delete_message.rb +31 -0
  144. data/lib/fog/aws/requests/sqs/delete_queue.rb +29 -0
  145. data/lib/fog/aws/requests/sqs/get_queue_attributes.rb +31 -0
  146. data/lib/fog/aws/requests/sqs/list_queues.rb +28 -0
  147. data/lib/fog/aws/requests/sqs/receive_message.rb +34 -0
  148. data/lib/fog/aws/requests/sqs/send_message.rb +31 -0
  149. data/lib/fog/aws/requests/sqs/set_queue_attributes.rb +33 -0
  150. data/lib/fog/aws/sns.rb +112 -0
  151. data/lib/fog/aws/sqs.rb +115 -0
  152. data/lib/fog/bin.rb +1 -0
  153. data/lib/fog/bin/aws.rb +16 -0
  154. data/lib/fog/bin/brightbox.rb +1 -1
  155. data/lib/fog/bin/ninefold.rb +5 -0
  156. data/lib/fog/bin/vcloud.rb +30 -0
  157. data/lib/fog/bin/virtual_box.rb +5 -1
  158. data/lib/fog/cdn/rackspace.rb +16 -8
  159. data/lib/fog/compute.rb +4 -1
  160. data/lib/fog/compute/aws.rb +16 -4
  161. data/lib/fog/compute/bluebox.rb +2 -2
  162. data/lib/fog/compute/brightbox.rb +4 -4
  163. data/lib/fog/compute/go_grid.rb +2 -2
  164. data/lib/fog/compute/linode.rb +2 -2
  165. data/lib/fog/compute/models/aws/server.rb +17 -3
  166. data/lib/fog/compute/models/aws/spot_request.rb +93 -0
  167. data/lib/fog/compute/models/aws/spot_requests.rb +48 -0
  168. data/lib/fog/compute/models/aws/volume.rb +13 -13
  169. data/lib/fog/compute/models/bluebox/server.rb +4 -4
  170. data/lib/fog/compute/models/go_grid/server.rb +2 -2
  171. data/lib/fog/compute/models/ninefold/server.rb +18 -14
  172. data/lib/fog/compute/models/rackspace/flavor.rb +3 -2
  173. data/lib/fog/compute/models/rackspace/server.rb +2 -2
  174. data/lib/fog/compute/models/slicehost/server.rb +1 -1
  175. data/lib/fog/compute/models/vcloud/catalog.rb +22 -0
  176. data/lib/fog/compute/models/vcloud/catalog_item.rb +29 -0
  177. data/lib/fog/compute/models/vcloud/catalog_items.rb +32 -0
  178. data/lib/fog/compute/models/vcloud/catalogs.rb +39 -0
  179. data/lib/fog/compute/models/vcloud/ip.rb +42 -0
  180. data/lib/fog/compute/models/vcloud/ips.rb +33 -0
  181. data/lib/fog/compute/models/vcloud/network.rb +65 -0
  182. data/lib/fog/compute/models/vcloud/networks.rb +34 -0
  183. data/lib/fog/compute/models/vcloud/server.rb +291 -0
  184. data/lib/fog/compute/models/vcloud/servers.rb +58 -0
  185. data/lib/fog/compute/models/vcloud/task.rb +21 -0
  186. data/lib/fog/compute/models/vcloud/tasks.rb +32 -0
  187. data/lib/fog/compute/models/vcloud/vdc.rb +56 -0
  188. data/lib/fog/compute/models/vcloud/vdcs.rb +40 -0
  189. data/lib/fog/compute/models/virtual_box/server.rb +2 -2
  190. data/lib/fog/compute/ninefold.rb +3 -3
  191. data/lib/fog/compute/parsers/aws/cancel_spot_instance_requests.rb +30 -0
  192. data/lib/fog/compute/parsers/aws/describe_instances.rb +9 -4
  193. data/lib/fog/compute/parsers/aws/describe_placement_groups.rb +30 -0
  194. data/lib/fog/compute/parsers/aws/describe_reserved_instances.rb +1 -1
  195. data/lib/fog/compute/parsers/aws/describe_reserved_instances_offerings.rb +2 -2
  196. data/lib/fog/compute/parsers/aws/describe_spot_price_history.rb +34 -0
  197. data/lib/fog/compute/parsers/aws/purchase_reserved_instances_offering.rb +24 -0
  198. data/lib/fog/compute/parsers/aws/run_instances.rb +17 -16
  199. data/lib/fog/compute/parsers/aws/spot_datafeed_subscription.rb +29 -0
  200. data/lib/fog/compute/parsers/aws/spot_instance_requests.rb +67 -0
  201. data/lib/fog/compute/rackspace.rb +6 -5
  202. data/lib/fog/compute/requests/aws/cancel_spot_instance_requests.rb +34 -0
  203. data/lib/fog/compute/requests/aws/create_placement_group.rb +34 -0
  204. data/lib/fog/compute/requests/aws/create_spot_datafeed_subscription.rb +41 -0
  205. data/lib/fog/compute/requests/aws/delete_placement_group.rb +32 -0
  206. data/lib/fog/compute/requests/aws/delete_spot_datafeed_subscription.rb +28 -0
  207. data/lib/fog/compute/requests/aws/describe_placement_groups.rb +35 -0
  208. data/lib/fog/compute/requests/aws/describe_reserved_instances.rb +14 -0
  209. data/lib/fog/compute/requests/aws/describe_reserved_instances_offerings.rb +25 -0
  210. data/lib/fog/compute/requests/aws/describe_spot_datafeed_subscription.rb +35 -0
  211. data/lib/fog/compute/requests/aws/describe_spot_instance_requests.rb +47 -0
  212. data/lib/fog/compute/requests/aws/describe_spot_price_history.rb +37 -0
  213. data/lib/fog/compute/requests/aws/describe_volumes.rb +1 -1
  214. data/lib/fog/compute/requests/aws/purchase_reserved_instances_offering.rb +63 -0
  215. data/lib/fog/compute/requests/aws/request_spot_instances.rb +83 -0
  216. data/lib/fog/compute/requests/aws/run_instances.rb +2 -3
  217. data/lib/fog/compute/requests/brightbox/activate_console_server.rb +1 -1
  218. data/lib/fog/compute/requests/brightbox/add_listeners_load_balancer.rb +1 -1
  219. data/lib/fog/compute/requests/brightbox/add_nodes_load_balancer.rb +1 -1
  220. data/lib/fog/compute/requests/brightbox/create_api_client.rb +1 -1
  221. data/lib/fog/compute/requests/brightbox/create_cloud_ip.rb +1 -1
  222. data/lib/fog/compute/requests/brightbox/create_image.rb +1 -1
  223. data/lib/fog/compute/requests/brightbox/create_load_balancer.rb +1 -1
  224. data/lib/fog/compute/requests/brightbox/create_server.rb +1 -1
  225. data/lib/fog/compute/requests/brightbox/destroy_api_client.rb +1 -1
  226. data/lib/fog/compute/requests/brightbox/destroy_cloud_ip.rb +1 -1
  227. data/lib/fog/compute/requests/brightbox/destroy_image.rb +1 -1
  228. data/lib/fog/compute/requests/brightbox/destroy_load_balancer.rb +1 -1
  229. data/lib/fog/compute/requests/brightbox/destroy_server.rb +1 -1
  230. data/lib/fog/compute/requests/brightbox/get_account.rb +1 -1
  231. data/lib/fog/compute/requests/brightbox/get_api_client.rb +1 -1
  232. data/lib/fog/compute/requests/brightbox/get_cloud_ip.rb +1 -1
  233. data/lib/fog/compute/requests/brightbox/get_image.rb +1 -1
  234. data/lib/fog/compute/requests/brightbox/get_interface.rb +1 -1
  235. data/lib/fog/compute/requests/brightbox/get_load_balancer.rb +1 -1
  236. data/lib/fog/compute/requests/brightbox/get_server.rb +1 -1
  237. data/lib/fog/compute/requests/brightbox/get_server_type.rb +1 -1
  238. data/lib/fog/compute/requests/brightbox/get_user.rb +1 -1
  239. data/lib/fog/compute/requests/brightbox/get_zone.rb +1 -1
  240. data/lib/fog/compute/requests/brightbox/list_api_clients.rb +1 -1
  241. data/lib/fog/compute/requests/brightbox/list_cloud_ips.rb +1 -1
  242. data/lib/fog/compute/requests/brightbox/list_images.rb +1 -1
  243. data/lib/fog/compute/requests/brightbox/list_load_balancers.rb +1 -1
  244. data/lib/fog/compute/requests/brightbox/list_server_types.rb +1 -1
  245. data/lib/fog/compute/requests/brightbox/list_servers.rb +1 -1
  246. data/lib/fog/compute/requests/brightbox/list_users.rb +1 -1
  247. data/lib/fog/compute/requests/brightbox/list_zones.rb +1 -1
  248. data/lib/fog/compute/requests/brightbox/map_cloud_ip.rb +1 -1
  249. data/lib/fog/compute/requests/brightbox/remove_listeners_load_balancer.rb +1 -1
  250. data/lib/fog/compute/requests/brightbox/remove_nodes_load_balancer.rb +1 -1
  251. data/lib/fog/compute/requests/brightbox/reset_ftp_password_account.rb +1 -1
  252. data/lib/fog/compute/requests/brightbox/resize_server.rb +1 -1
  253. data/lib/fog/compute/requests/brightbox/shutdown_server.rb +1 -1
  254. data/lib/fog/compute/requests/brightbox/snapshot_server.rb +1 -1
  255. data/lib/fog/compute/requests/brightbox/start_server.rb +1 -1
  256. data/lib/fog/compute/requests/brightbox/stop_server.rb +1 -1
  257. data/lib/fog/compute/requests/brightbox/unmap_cloud_ip.rb +1 -1
  258. data/lib/fog/compute/requests/brightbox/update_account.rb +1 -1
  259. data/lib/fog/compute/requests/brightbox/update_api_client.rb +1 -1
  260. data/lib/fog/compute/requests/brightbox/update_image.rb +1 -1
  261. data/lib/fog/compute/requests/brightbox/update_load_balancer.rb +1 -1
  262. data/lib/fog/compute/requests/brightbox/update_server.rb +1 -1
  263. data/lib/fog/compute/requests/brightbox/update_user.rb +1 -1
  264. data/lib/fog/compute/requests/linode/linode_disk_createfromstackscript.rb +1 -1
  265. data/lib/fog/compute/requests/rackspace/create_image.rb +1 -1
  266. data/lib/fog/compute/requests/rackspace/create_server.rb +1 -1
  267. data/lib/fog/compute/requests/rackspace/server_action.rb +2 -2
  268. data/lib/fog/compute/requests/rackspace/update_server.rb +1 -1
  269. data/lib/fog/compute/requests/storm_on_demand/add_balancer_node.rb +1 -1
  270. data/lib/fog/compute/requests/storm_on_demand/clone_server.rb +1 -1
  271. data/lib/fog/compute/requests/storm_on_demand/create_server.rb +1 -1
  272. data/lib/fog/compute/requests/storm_on_demand/delete_server.rb +1 -1
  273. data/lib/fog/compute/requests/storm_on_demand/get_server.rb +1 -1
  274. data/lib/fog/compute/requests/storm_on_demand/get_stats.rb +1 -1
  275. data/lib/fog/compute/requests/storm_on_demand/list_balancers.rb +1 -1
  276. data/lib/fog/compute/requests/storm_on_demand/list_configs.rb +1 -1
  277. data/lib/fog/compute/requests/storm_on_demand/list_images.rb +1 -1
  278. data/lib/fog/compute/requests/storm_on_demand/list_private_ips.rb +1 -1
  279. data/lib/fog/compute/requests/storm_on_demand/list_servers.rb +1 -1
  280. data/lib/fog/compute/requests/storm_on_demand/list_templates.rb +1 -1
  281. data/lib/fog/compute/requests/storm_on_demand/reboot_server.rb +1 -1
  282. data/lib/fog/compute/requests/storm_on_demand/remove_balancer_node.rb +1 -1
  283. data/lib/fog/compute/requests/storm_on_demand/resize_server.rb +1 -1
  284. data/lib/fog/compute/requests/vcloud/clone_vapp.rb +40 -0
  285. data/lib/fog/compute/requests/vcloud/configure_network.rb +43 -0
  286. data/lib/fog/compute/requests/vcloud/configure_network_ip.rb +46 -0
  287. data/lib/fog/compute/requests/vcloud/configure_node.rb +38 -0
  288. data/lib/fog/compute/requests/vcloud/configure_vapp.rb +112 -0
  289. data/lib/fog/compute/requests/vcloud/configure_vm.rb +247 -0
  290. data/lib/fog/compute/requests/vcloud/configure_vm_disks.rb +100 -0
  291. data/lib/fog/compute/requests/vcloud/configure_vm_memory.rb +40 -0
  292. data/lib/fog/compute/requests/vcloud/configure_vm_name_description.rb +30 -0
  293. data/lib/fog/compute/requests/vcloud/delete_node.rb +10 -0
  294. data/lib/fog/compute/requests/vcloud/delete_vapp.rb +10 -0
  295. data/lib/fog/compute/requests/vcloud/get_catalog.rb +10 -0
  296. data/lib/fog/compute/requests/vcloud/get_catalog_item.rb +10 -0
  297. data/lib/fog/compute/requests/vcloud/get_customization_options.rb +10 -0
  298. data/lib/fog/compute/requests/vcloud/get_network.rb +10 -0
  299. data/lib/fog/compute/requests/vcloud/get_network_extensions.rb +11 -0
  300. data/lib/fog/compute/requests/vcloud/get_network_ip.rb +15 -0
  301. data/lib/fog/compute/requests/vcloud/get_network_ips.rb +15 -0
  302. data/lib/fog/compute/requests/vcloud/get_organization.rb +11 -0
  303. data/lib/fog/compute/requests/vcloud/get_task.rb +11 -0
  304. data/lib/fog/compute/requests/vcloud/get_task_list.rb +11 -0
  305. data/lib/fog/compute/requests/vcloud/get_vapp.rb +10 -0
  306. data/lib/fog/compute/requests/vcloud/get_vapp_template.rb +11 -0
  307. data/lib/fog/compute/requests/vcloud/get_vdc.rb +10 -0
  308. data/lib/fog/compute/requests/vcloud/get_vm_disks.rb +16 -0
  309. data/lib/fog/compute/requests/vcloud/get_vm_memory.rb +16 -0
  310. data/lib/fog/compute/requests/vcloud/instantiate_vapp_template.rb +83 -0
  311. data/lib/fog/compute/requests/vcloud/login.rb +23 -0
  312. data/lib/fog/compute/requests/vcloud/power_off.rb +10 -0
  313. data/lib/fog/compute/requests/vcloud/power_on.rb +11 -0
  314. data/lib/fog/compute/requests/vcloud/power_reset.rb +11 -0
  315. data/lib/fog/compute/requests/vcloud/power_shutdown.rb +11 -0
  316. data/lib/fog/compute/requests/vcloud/undeploy.rb +23 -0
  317. data/lib/fog/compute/storm_on_demand.rb +2 -2
  318. data/lib/fog/compute/vcloud.rb +310 -0
  319. data/lib/fog/core.rb +2 -1
  320. data/lib/fog/core/attributes.rb +23 -11
  321. data/lib/fog/core/collection.rb +7 -7
  322. data/lib/fog/core/credentials.rb +4 -2
  323. data/lib/fog/core/model.rb +4 -4
  324. data/lib/fog/core/time.rb +1 -2
  325. data/lib/fog/core/timeout.rb +11 -0
  326. data/lib/fog/core/wait_for.rb +2 -2
  327. data/lib/fog/dns/dnsimple.rb +2 -2
  328. data/lib/fog/dns/dnsmadeeasy.rb +2 -2
  329. data/lib/fog/dns/linode.rb +2 -2
  330. data/lib/fog/dns/requests/dnsimple/create_domain.rb +1 -1
  331. data/lib/fog/dns/requests/dnsimple/create_record.rb +1 -1
  332. data/lib/fog/dns/requests/dnsimple/update_record.rb +1 -1
  333. data/lib/fog/dns/requests/dnsmadeeasy/create_record.rb +1 -1
  334. data/lib/fog/dns/requests/dnsmadeeasy/create_secondary.rb +1 -1
  335. data/lib/fog/dns/requests/dnsmadeeasy/update_record.rb +1 -1
  336. data/lib/fog/dns/requests/dnsmadeeasy/update_secondary.rb +1 -1
  337. data/lib/fog/providers.rb +1 -0
  338. data/lib/fog/providers/aws.rb +15 -2
  339. data/lib/fog/providers/ninefold.rb +1 -0
  340. data/lib/fog/providers/rackspace.rb +4 -3
  341. data/lib/fog/providers/vcloud.rb +11 -0
  342. data/lib/fog/storage.rb +9 -6
  343. data/lib/fog/storage/aws.rb +18 -1
  344. data/lib/fog/storage/google.rb +19 -1
  345. data/lib/fog/storage/models/aws/file.rb +3 -3
  346. data/lib/fog/storage/models/aws/files.rb +9 -2
  347. data/lib/fog/storage/models/google/files.rb +9 -2
  348. data/lib/fog/storage/models/ninefold/directories.rb +48 -0
  349. data/lib/fog/storage/models/ninefold/directory.rb +53 -0
  350. data/lib/fog/storage/models/ninefold/file.rb +99 -0
  351. data/lib/fog/storage/models/ninefold/files.rb +72 -0
  352. data/lib/fog/storage/models/rackspace/directory.rb +7 -2
  353. data/lib/fog/storage/ninefold.rb +149 -0
  354. data/lib/fog/storage/rackspace.rb +8 -2
  355. data/lib/fog/storage/requests/aws/get_bucket_policy.rb +1 -1
  356. data/lib/fog/storage/requests/aws/get_object.rb +6 -2
  357. data/lib/fog/storage/requests/aws/get_object_http_url.rb +51 -0
  358. data/lib/fog/storage/requests/aws/get_object_https_url.rb +51 -0
  359. data/lib/fog/storage/requests/aws/get_object_url.rb +4 -24
  360. data/lib/fog/storage/requests/aws/post_object_hidden_fields.rb +1 -1
  361. data/lib/fog/storage/requests/aws/put_bucket_policy.rb +1 -1
  362. data/lib/fog/storage/requests/google/get_object_http_url.rb +51 -0
  363. data/lib/fog/storage/requests/google/get_object_https_url.rb +51 -0
  364. data/lib/fog/storage/requests/google/get_object_url.rb +8 -25
  365. data/lib/fog/storage/requests/ninefold/delete_namespace.rb +19 -0
  366. data/lib/fog/storage/requests/ninefold/get_namespace.rb +20 -0
  367. data/lib/fog/storage/requests/ninefold/post_namespace.rb +20 -0
  368. data/lib/fog/storage/requests/ninefold/put_namespace.rb +20 -0
  369. data/lib/fog/storage/requests/rackspace/put_object.rb +3 -0
  370. data/lib/fog/storage/requests/rackspace/put_object_manifest.rb +25 -0
  371. data/tests/aws/models/auto_scaling/activities_tests.rb +6 -0
  372. data/tests/aws/models/auto_scaling/configuration_test.rb +13 -0
  373. data/tests/aws/models/auto_scaling/configurations_tests.rb +11 -0
  374. data/tests/aws/models/auto_scaling/helper.rb +0 -0
  375. data/tests/aws/models/auto_scaling/instances_tests.rb +6 -0
  376. data/tests/aws/models/cloud_watch/metric_statistics_tests.rb +51 -0
  377. data/tests/aws/models/cloud_watch/metrics_tests.rb +17 -0
  378. data/tests/aws/{requests → models}/elb/model_tests.rb +82 -18
  379. data/tests/aws/models/rds/security_group_tests.rb +1 -1
  380. data/tests/aws/requests/auto_scaling/auto_scaling_tests.rb +80 -0
  381. data/tests/aws/requests/auto_scaling/helper.rb +185 -0
  382. data/tests/aws/requests/auto_scaling/model_tests.rb +235 -0
  383. data/tests/aws/requests/cloud_formation/stack_tests.rb +1 -1
  384. data/tests/aws/requests/cloud_watch/get_metric_statistics_tests.rb +28 -0
  385. data/tests/aws/requests/cloud_watch/list_metrics_test.rb +64 -0
  386. data/tests/aws/requests/cloud_watch/put_metric_data_tests.rb +36 -0
  387. data/tests/aws/requests/elb/listener_tests.rb +50 -0
  388. data/tests/aws/requests/elb/load_balancer_tests.rb +23 -44
  389. data/tests/aws/requests/elb/policy_tests.rb +41 -0
  390. data/tests/aws/requests/iam/helper.rb +29 -0
  391. data/tests/aws/requests/iam/login_profile_tests.rb +2 -2
  392. data/tests/aws/requests/iam/server_certificate_tests.rb +39 -6
  393. data/tests/aws/requests/rds/helper.rb +1 -0
  394. data/tests/aws/requests/simpledb/attributes_tests.rb +10 -15
  395. data/tests/aws/requests/sns/helper.rb +9 -0
  396. data/tests/aws/requests/sns/subscription_tests.rb +86 -0
  397. data/tests/aws/requests/sns/topic_tests.rb +50 -0
  398. data/tests/aws/requests/sqs/helper.rb +15 -0
  399. data/tests/aws/requests/sqs/message_tests.rb +57 -0
  400. data/tests/aws/requests/sqs/queue_tests.rb +55 -0
  401. data/tests/aws/signed_params_tests.rb +3 -1
  402. data/tests/compute/models/aws/volume_tests.rb +13 -0
  403. data/tests/compute/models/vcloud/helper.rb +25 -0
  404. data/tests/compute/models/vcloud/servers_tests.rb +95 -0
  405. data/tests/compute/requests/aws/address_tests.rb +1 -1
  406. data/tests/compute/requests/aws/instance_tests.rb +65 -4
  407. data/tests/compute/requests/aws/placement_group_tests.rb +48 -0
  408. data/tests/compute/requests/aws/spot_datafeed_subscription_tests.rb +47 -0
  409. data/tests/compute/requests/aws/spot_instance_tests.rb +53 -0
  410. data/tests/compute/requests/aws/spot_price_history_tests.rb +24 -0
  411. data/tests/compute/requests/aws/volume_tests.rb +4 -0
  412. data/tests/compute/requests/brightbox/helper.rb +2 -1
  413. data/tests/compute/requests/brightbox/interface_tests.rb +4 -4
  414. data/tests/compute/requests/ninefold/helper.rb +1 -1
  415. data/tests/compute/requests/vcloud/disk_configure_tests.rb +114 -0
  416. data/tests/compute/requests/voxel/server_tests.rb +2 -2
  417. data/tests/core/attribute_tests.rb +10 -1
  418. data/tests/core/credential_tests.rb +6 -0
  419. data/tests/core/timeout_tests.rb +10 -0
  420. data/tests/helpers/collection_helper.rb +4 -1
  421. data/tests/helpers/formats_helper.rb +1 -1
  422. data/tests/helpers/mock_helper.rb +5 -0
  423. data/tests/storage/helper.rb +4 -1
  424. data/tests/storage/models/ninefold/file_update_tests.rb +19 -0
  425. data/tests/storage/models/ninefold/nested_directories_tests.rb +23 -0
  426. data/tests/storage/requests/aws/multipart_upload_tests.rb +2 -5
  427. data/tests/storage/requests/rackspace/large_object_tests.rb +47 -0
  428. metadata +366 -105
@@ -0,0 +1,235 @@
1
+ Shindo.tests('AWS::AutoScaling | model_tests', ['aws', 'auto_scaling']) do
2
+
3
+ tests('success') do
4
+ pending if Fog.mocking?
5
+
6
+ lc = nil
7
+ lc_id = 'fog-model-lc'
8
+
9
+ tests('configurations') do
10
+ tests('getting a missing configuration') do
11
+ returns(nil) { AWS[:auto_scaling].configurations.get('fog-no-such-lc') }
12
+ end
13
+
14
+ tests('create configuration') do
15
+ lc = AWS[:auto_scaling].configurations.create(:id => lc_id, :image_id => 'ami-8c1fece5', :instance_type => 't1.micro')
16
+ #tests("dns names is set").returns(true) { lc.dns_name.is_a?(String) }
17
+ tests("created_at is set").returns(true) { Time === lc.created_at }
18
+ #tests("policies is empty").returns([]) { lc.policies }
19
+ end
20
+
21
+ tests('all configurations') do
22
+ lc_ids = AWS[:auto_scaling].configurations.all.map{|e| e.id}
23
+ tests("contains lc").returns(true) { lc_ids.include? lc_id }
24
+ end
25
+
26
+ tests('get configuration') do
27
+ lc2 = AWS[:auto_scaling].configurations.get(lc_id)
28
+ tests('ids match').returns(lc_id) { lc2.id }
29
+ end
30
+
31
+ tests('creating a duplicate configuration') do
32
+ raises(Fog::AWS::AutoScaling::IdentifierTaken) do
33
+ AWS[:auto_scaling].configurations.create(:id => lc_id, :image_id => 'ami-8c1fece5', :instance_type => 't1.micro')
34
+ end
35
+ end
36
+ end
37
+
38
+ tests('groups') do
39
+ tests('getting a missing group') do
40
+ returns(nil) { AWS[:auto_scaling].groups.get('fog-no-such-asg') }
41
+ end
42
+
43
+ asg = nil
44
+ asg_id = 'fog-model-asg'
45
+
46
+ tests('create') do
47
+ asg = AWS[:auto_scaling].groups.create(:id => asg_id, :availability_zones => ['us-east-1d'], :launch_configuration_name => lc_id)
48
+ #tests("dns names is set").returns(true) { asg.dns_name.is_a?(String) }
49
+ tests("created_at is set").returns(true) { Time === asg.created_at }
50
+ #tests("policies is empty").returns([]) { asg.policies }
51
+ end
52
+
53
+ tests('all') do
54
+ asg_ids = AWS[:auto_scaling].groups.all.map{|e| e.id}
55
+ tests("contains asg").returns(true) { asg_ids.include? asg_id }
56
+ end
57
+
58
+ tests('get') do
59
+ asg2 = AWS[:auto_scaling].groups.get(asg_id)
60
+ tests('ids match').returns(asg_id) { asg2.id }
61
+ end
62
+
63
+ tests('suspend processes') do
64
+ asg.suspend_processes()
65
+ #tests('processes suspended').returns([]) { asg.suspended_processes }
66
+ end
67
+
68
+ tests('resume processes') do
69
+ asg.resume_processes()
70
+ tests('no processes suspended').returns([]) { asg.suspended_processes }
71
+ end
72
+
73
+ tests('creating a duplicate group') do
74
+ raises(Fog::AWS::AutoScaling::IdentifierTaken) do
75
+ AWS[:auto_scaling].groups.create(:id => asg_id, :availability_zones => ['us-east-1d'], :launch_configuration_name => lc_id)
76
+ end
77
+ end
78
+
79
+ tests('destroy group') do
80
+ asg.destroy
81
+ asg = nil
82
+ end
83
+
84
+ #tests('registering an invalid instance') do
85
+ # raises(Fog::AWS::AutoScaling::InvalidInstance) { asg.register_instances('i-00000000') }
86
+ #end
87
+
88
+ #tests('deregistering an invalid instance') do
89
+ # raises(Fog::AWS::AutoScaling::InvalidInstance) { asg.deregister_instances('i-00000000') }
90
+ #end
91
+ end
92
+
93
+ tests('configurations') do
94
+ tests('destroy configuration') do
95
+ lc.destroy
96
+ lc = nil
97
+ end
98
+ end
99
+
100
+ #server = AWS[:compute].servers.create
101
+ #tests('register instance') do
102
+ # begin
103
+ # elb.register_instances(server.id)
104
+ # rescue Fog::AWS::ELB::InvalidInstance
105
+ # # It may take a moment for a newly created instances to be visible to ELB requests
106
+ # raise if @retried_registered_instance
107
+ # @retried_registered_instance = true
108
+ # sleep 1
109
+ # retry
110
+ # end
111
+ #
112
+ # returns([server.id]) { elb.instances }
113
+ #end
114
+
115
+ #tests('instance_health') do
116
+ # returns('OutOfService') do
117
+ # elb.instance_health.detect{|hash| hash['InstanceId'] == server.id}['State']
118
+ # end
119
+ #
120
+ # returns([server.id]) { elb.instances_out_of_service }
121
+ #end
122
+
123
+ #tests('deregister instance') do
124
+ # elb.deregister_instances(server.id)
125
+ # returns([]) { elb.instances }
126
+ #end
127
+ #server.destroy
128
+
129
+ #tests('disable_availability_zones') do
130
+ # elb.disable_availability_zones(%w{us-east-1c us-east-1d})
131
+ # returns(%w{us-east-1a us-east-1b}) { elb.availability_zones.sort }
132
+ #end
133
+
134
+ #tests('enable_availability_zones') do
135
+ # elb.enable_availability_zones(%w{us-east-1c us-east-1d})
136
+ # returns(%w{us-east-1a us-east-1b us-east-1c us-east-1d}) { elb.availability_zones.sort }
137
+ #end
138
+
139
+ #tests('default health check') do
140
+ # default_health_check = {
141
+ # "HealthyThreshold"=>10,
142
+ # "Timeout"=>5,
143
+ # "UnhealthyThreshold"=>2,
144
+ # "Interval"=>30,
145
+ # "Target"=>"TCP:80"
146
+ # }
147
+ # returns(default_health_check) { elb.health_check }
148
+ #end
149
+
150
+ #tests('configure_health_check') do
151
+ # new_health_check = {
152
+ # "HealthyThreshold"=>5,
153
+ # "Timeout"=>10,
154
+ # "UnhealthyThreshold"=>3,
155
+ # "Interval"=>15,
156
+ # "Target"=>"HTTP:80/index.html"
157
+ # }
158
+ # elb.configure_health_check(new_health_check)
159
+ # returns(new_health_check) { elb.health_check }
160
+ #end
161
+
162
+ #tests('listeners') do
163
+ # default_listener_description = [{"Listener"=>{"InstancePort"=>80, "Protocol"=>"HTTP", "LoadBalancerPort"=>80}, "PolicyNames"=>[]}]
164
+ # tests('default') do
165
+ # returns(1) { elb.listeners.size }
166
+ #
167
+ # listener = elb.listeners.first
168
+ # returns([80,80,'HTTP', []]) { [listener.instance_port, listener.lb_port, listener.protocol, listener.policy_names] }
169
+ #
170
+ # end
171
+ #
172
+ # tests('#get') do
173
+ # returns(80) { elb.listeners.get(80).lb_port }
174
+ # end
175
+ #
176
+ # tests('create') do
177
+ # new_listener = { 'InstancePort' => 443, 'LoadBalancerPort' => 443, 'Protocol' => 'TCP'}
178
+ # elb.listeners.create(:instance_port => 443, :lb_port => 443, :protocol => 'TCP')
179
+ # returns(2) { elb.listeners.size }
180
+ # returns(443) { elb.listeners.get(443).lb_port }
181
+ # end
182
+ #
183
+ # tests('destroy') do
184
+ # elb.listeners.get(443).destroy
185
+ # returns(nil) { elb.listeners.get(443) }
186
+ # end
187
+ #end
188
+
189
+ #tests('policies') do
190
+ # app_policy_id = 'my-app-policy'
191
+ #
192
+ # tests 'are empty' do
193
+ # returns([]) { elb.policies.to_a }
194
+ # end
195
+ #
196
+ # tests('#all') do
197
+ # returns([]) { elb.policies.all.to_a }
198
+ # end
199
+ #
200
+ # tests('create app policy') do
201
+ # elb.policies.create(:id => app_policy_id, :cookie => 'my-app-cookie', :cookie_stickiness => :app)
202
+ # returns(app_policy_id) { elb.policies.first.id }
203
+ # end
204
+ #
205
+ # tests('get policy') do
206
+ # returns(app_policy_id) { elb.policies.get(app_policy_id).id }
207
+ # end
208
+ #
209
+ # tests('destroy app policy') do
210
+ # elb.policies.first.destroy
211
+ # returns([]) { elb.policies.to_a }
212
+ # end
213
+ #
214
+ # lb_policy_id = 'my-lb-policy'
215
+ # tests('create lb policy') do
216
+ # elb.policies.create(:id => lb_policy_id, :expiration => 600, :cookie_stickiness => :lb)
217
+ # returns(lb_policy_id) { elb.policies.first.id }
218
+ # end
219
+ #
220
+ # tests('setting a listener policy') do
221
+ # elb.set_listener_policy(80, lb_policy_id)
222
+ # returns([lb_policy_id]) { elb.listeners.get(80).policy_names }
223
+ # end
224
+ #
225
+ # tests('unsetting a listener policy') do
226
+ # elb.unset_listener_policy(80)
227
+ # returns([]) { elb.listeners.get(80).policy_names }
228
+ # end
229
+ #
230
+ # tests('a malformed policy') do
231
+ # raises(ArgumentError) { elb.policies.create(:id => 'foo', :cookie_stickiness => 'invalid stickiness') }
232
+ # end
233
+ #end
234
+ end
235
+ end
@@ -85,7 +85,7 @@ Shindo.tests('AWS::CloudFormation | stack requests', ['aws', 'cloudformation'])
85
85
 
86
86
  unless Fog.mocking?
87
87
  @stack_name = 'fogstack' << Time.now.to_i.to_s
88
- @keypair = Compute[:aws].key_pairs.create(:name => 'cloudformation')
88
+ @keypair = Fog::Compute[:aws].key_pairs.create(:name => 'cloudformation')
89
89
  @template_url = 'https://s3.amazonaws.com/cloudformation-templates-us-east-1/EC2InstanceSample-1.0.0.template'
90
90
  end
91
91
 
@@ -0,0 +1,28 @@
1
+ Shindo.tests('AWS::CloudWatch | metric requests', ['aws', 'cloudwatch']) do
2
+ tests('success') do
3
+
4
+ @metrics_statistic_format = {
5
+ 'GetMetricStatisticsResult' => {
6
+ 'Label' => String,
7
+ 'Datapoints' => [{
8
+ "Timestamp" => Time,
9
+ 'Unit' => String,
10
+ 'Minimum' => Float,
11
+ 'Maximum' => Float,
12
+ 'Average' => Float,
13
+ 'Sum' => Float,
14
+ 'SampleCount' => Float
15
+ }],
16
+ },
17
+ 'ResponseMetadata' => {
18
+ 'RequestId' => String
19
+ }
20
+ }
21
+
22
+ tests("#get_metric_statistics").formats(@metrics_statistic_format) do
23
+ pending if Fog.mocking?
24
+ instanceId = 'i-420c352f'
25
+ AWS[:cloud_watch].get_metric_statistics({'Statistics' => ['Minimum','Maximum','Sum','SampleCount','Average'], 'StartTime' => (Time.now-600).iso8601, 'EndTime' => Time.now.iso8601, 'Period' => 60, 'MetricName' => 'DiskReadBytes', 'Namespace' => 'AWS/EC2', 'Dimensions' => [{'Name' => 'InstanceId', 'Value' => instanceId}]}).body
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,64 @@
1
+ Shindo.tests('AWS::CloudWatch | metric requests', ['aws', 'cloudwatch']) do
2
+
3
+ tests('success') do
4
+ @metrics_list_format = {
5
+ 'ListMetricsResult' => {
6
+ 'Metrics' =>
7
+ [{
8
+ 'Dimensions' =>
9
+ [{
10
+ 'Name' => String,
11
+ 'Value' => String
12
+ }],
13
+ "MetricName" => String,
14
+ "Namespace" => String
15
+ }],
16
+ 'NextToken' => Fog::Nullable::String,
17
+ },
18
+ 'ResponseMetadata' => {"RequestId"=> String},
19
+ }
20
+ @instanceId = 'i-2f3eab59'
21
+ @dimension_filtered_metrics_list_format = {
22
+ 'ListMetricsResult' => {
23
+ 'Metrics' =>
24
+ [{
25
+ 'Dimensions' =>
26
+ [{
27
+ 'Name' => 'InstanceId',
28
+ 'Value' => @instanceId
29
+ }],
30
+ "MetricName" => String,
31
+ "Namespace" => String
32
+ }],
33
+ 'NextToken' => Fog::Nullable::String,
34
+ },
35
+ 'ResponseMetadata' => {"RequestId"=> String},
36
+ }
37
+
38
+ tests("#list_metrics").formats(@metrics_list_format) do
39
+ pending if Fog.mocking?
40
+ AWS[:cloud_watch].list_metrics.body
41
+ end
42
+
43
+ tests("#dimension_filtered_list_metrics").formats(@dimension_filtered_metrics_list_format) do
44
+ pending if Fog.mocking?
45
+ AWS[:cloud_watch].list_metrics('Dimensions' => [{'Name' => 'InstanceId', 'Value' => @instanceId}]).body
46
+ end
47
+
48
+ tests("#metric_name_filtered_list_metrics").returns(true) do
49
+ pending if Fog.mocking?
50
+ metricName = "CPUUtilization"
51
+ AWS[:cloud_watch].list_metrics('MetricName' => metricName).body['ListMetricsResult']['Metrics'].all? do |metric|
52
+ metric['MetricName'] == metricName
53
+ end
54
+ end
55
+
56
+ tests("#namespace_filtered_list_metrics").returns(true) do
57
+ pending if Fog.mocking?
58
+ namespace = "AWS/EC2"
59
+ AWS[:cloud_watch].list_metrics('Namespace' => namespace).body['ListMetricsResult']['Metrics'].all? do |metric|
60
+ metric['Namespace'] == namespace
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,36 @@
1
+ Shindo.tests('AWS::CloudWatch | metric requests', ['aws', 'cloudwatch']) do
2
+ tests('success') do
3
+
4
+ namespace = 'Custom/Test'
5
+ @puts_format = {'ResponseMetadata' => {'RequestId' => String}}
6
+
7
+ tests('#puts_value').formats(@puts_format) do
8
+ pending if Fog.mocking?
9
+ AWS[:cloud_watch].put_metric_data(namespace, [{'MetricName' => 'RequestTest', 'Unit' => 'None', 'Value' => 1}]).body
10
+ end
11
+
12
+ tests('#puts_statistics_set').succeeds do
13
+ pending if Fog.mocking?
14
+ AWS[:cloud_watch].put_metric_data(namespace, [{'MetricName' => 'RequestTest', 'Unit' => 'None', 'StatisticValues' => {'Minimum' => 0, 'Maximum' => 9, 'Sum' => 45, 'SampleCount' => 10, 'Average' => 4.5}}]).body
15
+ end
16
+
17
+ tests('#puts with dimensions').succeeds do
18
+ pending if Fog.mocking?
19
+ dimensions = [{}]
20
+ AWS[:cloud_watch].put_metric_data(namespace, [{'MetricName' => 'RequestTest', 'Unit' => 'None', 'Value' => 1, 'Dimensions' => dimensions}]).body
21
+ end
22
+
23
+ tests('#puts more than one').succeeds do
24
+ pending if Fog.mocking?
25
+ datapoints = (0...3).collect do |i|
26
+ dp = {'MetricName' => "#{i}RequestTest", 'Unit' => 'None', 'Value' => i}
27
+ if i%2==0
28
+ dp['Dimensions'] = [{'Name' => 'Ruler', 'Value' => "measurement_#{i}"}]
29
+ end
30
+ dp
31
+ end
32
+ AWS[:cloud_watch].put_metric_data(namespace, datapoints).body
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,50 @@
1
+ Shindo.tests('AWS::ELB | listener_tests', ['aws', 'elb']) do
2
+ @load_balancer_id = 'fog-test-listener'
3
+ @key_name = 'fog-test'
4
+
5
+ tests('success') do
6
+ AWS[:elb].create_load_balancer(['us-east-1a'], @load_balancer_id, [{'LoadBalancerPort' => 80, 'InstancePort' => 80, 'Protocol' => 'HTTP'}])
7
+ @certificate = AWS[:iam].upload_server_certificate(AWS::IAM::SERVER_CERT_PUBLIC_KEY, AWS::IAM::SERVER_CERT_PRIVATE_KEY, @key_name).body['Certificate']
8
+
9
+ tests("#create_load_balancer_listeners").formats(AWS::ELB::Formats::BASIC) do
10
+ listeners = [
11
+ {'Protocol' => 'TCP', 'LoadBalancerPort' => 443, 'InstancePort' => 443, 'SSLCertificateId' => @certificate['Arn']},
12
+ {'Protocol' => 'HTTP', 'LoadBalancerPort' => 80, 'InstancePort' => 80}
13
+ ]
14
+ response = AWS[:elb].create_load_balancer_listeners(@load_balancer_id, listeners).body
15
+ response
16
+ end
17
+
18
+ tests("#delete_load_balancer_listeners").formats(AWS::ELB::Formats::BASIC) do
19
+ ports = [80, 443]
20
+ AWS[:elb].delete_load_balancer_listeners(@load_balancer_id, ports).body
21
+ end
22
+
23
+ tests("#create_load_balancer_listeners with non-existant SSL certificate") do
24
+ listeners = [
25
+ {'Protocol' => 'HTTPS', 'LoadBalancerPort' => 443, 'InstancePort' => 443, 'SSLCertificateId' => 'non-existant'},
26
+ ]
27
+ raises(Fog::AWS::IAM::NotFound) { AWS[:elb].create_load_balancer_listeners(@load_balancer_id, listeners) }
28
+ end
29
+
30
+ tests("#create_load_balancer_listeners with invalid SSL certificate").raises(Fog::AWS::IAM::NotFound) do
31
+ sleep 8 unless Fog.mocking?
32
+ listeners = [
33
+ {'Protocol' => 'HTTPS', 'LoadBalancerPort' => 443, 'InstancePort' => 443, 'SSLCertificateId' => "#{@certificate['Arn']}fake"},
34
+ ]
35
+ AWS[:elb].create_load_balancer_listeners(@load_balancer_id, listeners).body
36
+ end
37
+
38
+ # This is sort of fucked up, but it may or may not fail, thanks AWS
39
+ tests("#create_load_balancer_listeners with SSL certificate").formats(AWS::ELB::Formats::BASIC) do
40
+ sleep 8 unless Fog.mocking?
41
+ listeners = [
42
+ {'Protocol' => 'HTTPS', 'LoadBalancerPort' => 443, 'InstancePort' => 443, 'SSLCertificateId' => @certificate['Arn']},
43
+ ]
44
+ AWS[:elb].create_load_balancer_listeners(@load_balancer_id, listeners).body
45
+ end
46
+
47
+ AWS[:iam].delete_server_certificate(@key_name)
48
+ AWS[:elb].delete_load_balancer(@load_balancer_id)
49
+ end
50
+ end
@@ -1,12 +1,13 @@
1
1
  Shindo.tests('AWS::ELB | load_balancer_tests', ['aws', 'elb']) do
2
2
  @load_balancer_id = 'fog-test-elb'
3
+ @key_name = 'fog-test'
3
4
 
4
5
  tests('success') do
5
- pending if Fog.mocking?
6
+ @certificate = AWS[:iam].upload_server_certificate(AWS::IAM::SERVER_CERT_PUBLIC_KEY, AWS::IAM::SERVER_CERT_PRIVATE_KEY, @key_name).body['Certificate']
6
7
 
7
8
  tests("#create_load_balancer").formats(AWS::ELB::Formats::CREATE_LOAD_BALANCER) do
8
9
  zones = ['us-east-1a']
9
- listeners = [{'LoadBalancerPort' => 80, 'InstancePort' => 80, 'Protocol' => 'http'}]
10
+ listeners = [{'LoadBalancerPort' => 80, 'InstancePort' => 80, 'Protocol' => 'HTTP'}]
10
11
  AWS[:elb].create_load_balancer(zones, @load_balancer_id, listeners).body
11
12
  end
12
13
 
@@ -18,6 +19,19 @@ Shindo.tests('AWS::ELB | load_balancer_tests', ['aws', 'elb']) do
18
19
  raises(Fog::AWS::ELB::NotFound) { AWS[:elb].describe_load_balancers('none-such-lb') }
19
20
  end
20
21
 
22
+ tests("#describe_load_balancers with SSL listener") do
23
+ sleep 5 unless Fog.mocking?
24
+ listeners = [
25
+ {'Protocol' => 'HTTPS', 'LoadBalancerPort' => 443, 'InstancePort' => 443, 'SSLCertificateId' => @certificate['Arn']},
26
+ ]
27
+ AWS[:elb].create_load_balancer_listeners(@load_balancer_id, listeners)
28
+ response = AWS[:elb].describe_load_balancers(@load_balancer_id).body
29
+ tests("SSLCertificateId is set").returns(@certificate['Arn']) do
30
+ listeners = response["DescribeLoadBalancersResult"]["LoadBalancerDescriptions"].first["ListenerDescriptions"]
31
+ listeners.find {|l| l["Listener"]["Protocol"] == 'HTTPS' }["Listener"]["SSLCertificateId"]
32
+ end
33
+ end
34
+
21
35
  tests("#configure_health_check").formats(AWS::ELB::Formats::CONFIGURE_HEALTH_CHECK) do
22
36
  health_check = {
23
37
  'Target' => 'HTTP:80/index.html',
@@ -30,53 +44,18 @@ Shindo.tests('AWS::ELB | load_balancer_tests', ['aws', 'elb']) do
30
44
  AWS[:elb].configure_health_check(@load_balancer_id, health_check).body
31
45
  end
32
46
 
33
- tests("#create_app_cookie_stickiness_policy").formats(AWS::ELB::Formats::BASIC) do
34
- cookie, policy = 'fog-app-cookie', 'fog-app-policy'
35
- AWS[:elb].create_app_cookie_stickiness_policy(@load_balancer_id, policy, cookie).body
36
- end
37
-
38
- tests("#create_lb_cookie_stickiness_policy with expiry").formats(AWS::ELB::Formats::BASIC) do
39
- policy = 'fog-lb-expiry'
40
- expiry = 300
41
- AWS[:elb].create_lb_cookie_stickiness_policy(@load_balancer_id, policy, expiry).body
42
- end
43
-
44
- tests("#create_lb_cookie_stickiness_policy without expiry").formats(AWS::ELB::Formats::BASIC) do
45
- policy = 'fog-lb-no-expiry'
46
- AWS[:elb].create_lb_cookie_stickiness_policy(@load_balancer_id, policy).body
47
- end
48
-
49
- tests("#delete_load_balancer_policy").formats(AWS::ELB::Formats::BASIC) do
50
- policy = 'fog-lb-no-expiry'
51
- AWS[:elb].delete_load_balancer_policy(@load_balancer_id, policy).body
52
- end
53
-
54
- tests("#create_load_balancer_listeners").formats(AWS::ELB::Formats::BASIC) do
55
- listeners = [
56
- {'Protocol' => 'tcp', 'LoadBalancerPort' => 443, 'InstancePort' => 443},
57
- {'Protocol' => 'HTTP', 'LoadBalancerPort' => 80, 'InstancePort' => 80}
58
- ]
59
- AWS[:elb].create_load_balancer_listeners(@load_balancer_id, listeners).body
60
- end
61
-
62
- tests("#set_load_balancer_policies_of_listener adds policy").formats(AWS::ELB::Formats::BASIC) do
63
- port, policies = 80, ['fog-lb-expiry']
64
- body = AWS[:elb].set_load_balancer_policies_of_listener(@load_balancer_id, port, policies).body
65
- end
66
-
67
- tests("#set_load_balancer_policies_of_listener removes policy").formats(AWS::ELB::Formats::BASIC) do
68
- port = 80
69
- body = AWS[:elb].set_load_balancer_policies_of_listener(@load_balancer_id, port, []).body
47
+ tests("#delete_load_balancer").formats(AWS::ELB::Formats::DELETE_LOAD_BALANCER) do
48
+ AWS[:elb].delete_load_balancer(@load_balancer_id).body
70
49
  end
71
50
 
72
-
73
- tests("#delete_load_balancer_listeners").formats(AWS::ELB::Formats::BASIC) do
74
- ports = [80, 443]
75
- AWS[:elb].delete_load_balancer_listeners(@load_balancer_id, ports).body
51
+ tests("#delete_load_balancer when non existant").formats(AWS::ELB::Formats::DELETE_LOAD_BALANCER) do
52
+ AWS[:elb].delete_load_balancer('non-existant').body
76
53
  end
77
54
 
78
- tests("#delete_load_balancer").formats(AWS::ELB::Formats::DELETE_LOAD_BALANCER) do
55
+ tests("#delete_load_balancer when already deleted").formats(AWS::ELB::Formats::DELETE_LOAD_BALANCER) do
79
56
  AWS[:elb].delete_load_balancer(@load_balancer_id).body
80
57
  end
58
+
59
+ AWS[:iam].delete_server_certificate(@key_name)
81
60
  end
82
61
  end