Permalink
Browse files

Merged in official fog v1.1.1

  • Loading branch information...
1 parent 75d6350 commit 6a5a8dc82fe1964b1929488a3e7957df5d5ce156 @galtenberg galtenberg committed Nov 22, 2011
Showing with 1,278 additions and 11,943 deletions.
  1. +0 −48 Gemfile.lock
  2. +12 −41 README.rdoc
  3. +326 −7 Rakefile
  4. +17 −8 benchs/parse_vs_push.rb
  5. +17 −9 bin/fog
  6. +6 −4 examples/dns_tests.rb
  7. +3 −1 examples/storage_tests.rb
  8. +17 −17 fog.gemspec
  9. +1 −2 lib/fog.rb
  10. +92 −11 lib/fog/aws/elb.rb
  11. +95 −19 lib/fog/aws/iam.rb
  12. +2 −2 lib/fog/aws/parsers/elb/create_load_balancer.rb
  13. +1 −1 lib/fog/aws/parsers/elb/delete_load_balancer.rb
  14. +2 −2 lib/fog/aws/parsers/elb/deregister_instances_from_load_balancer.rb
  15. +2 −2 lib/fog/aws/parsers/elb/describe_instance_health.rb
  16. +41 −18 lib/fog/aws/parsers/elb/describe_load_balancers.rb
  17. +2 −2 lib/fog/aws/parsers/elb/disable_availability_zones_for_load_balancer.rb
  18. +2 −2 lib/fog/aws/parsers/elb/enable_availability_zones_for_load_balancer.rb
  19. +2 −2 lib/fog/aws/parsers/elb/register_instances_with_load_balancer.rb
  20. +1 −1 lib/fog/aws/parsers/iam/basic.rb
  21. +2 −2 lib/fog/aws/parsers/iam/create_access_key.rb
  22. +2 −2 lib/fog/aws/parsers/iam/create_group.rb
  23. +2 −2 lib/fog/aws/parsers/iam/create_user.rb
  24. +2 −2 lib/fog/aws/parsers/iam/get_user.rb
  25. +3 −3 lib/fog/aws/parsers/iam/list_access_keys.rb
  26. +3 −3 lib/fog/aws/parsers/iam/list_groups.rb
  27. +3 −3 lib/fog/aws/parsers/iam/list_policies.rb
  28. +3 −3 lib/fog/aws/parsers/iam/list_users.rb
  29. +2 −2 lib/fog/aws/parsers/simpledb/basic.rb
  30. +4 −4 lib/fog/aws/parsers/simpledb/domain_metadata.rb
  31. +4 −4 lib/fog/aws/parsers/simpledb/get_attributes.rb
  32. +3 −3 lib/fog/aws/parsers/simpledb/list_domains.rb
  33. +5 −5 lib/fog/aws/parsers/simpledb/select.rb
  34. +59 −9 lib/fog/aws/requests/elb/create_load_balancer.rb
  35. +13 −4 lib/fog/aws/requests/elb/delete_load_balancer.rb
  36. +22 −6 lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb
  37. +31 −5 lib/fog/aws/requests/elb/describe_instance_health.rb
  38. +40 −14 lib/fog/aws/requests/elb/describe_load_balancers.rb
  39. +19 −6 lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb
  40. +19 −4 lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb
  41. +23 −6 lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb
  42. +0 −8 lib/fog/aws/requests/iam/add_user_to_group.rb
  43. +1 −9 lib/fog/aws/requests/iam/create_access_key.rb
  44. +0 −8 lib/fog/aws/requests/iam/create_group.rb
  45. +0 −8 lib/fog/aws/requests/iam/create_user.rb
  46. +0 −8 lib/fog/aws/requests/iam/delete_access_key.rb
  47. +0 −8 lib/fog/aws/requests/iam/delete_group.rb
  48. +0 −8 lib/fog/aws/requests/iam/delete_group_policy.rb
  49. +0 −8 lib/fog/aws/requests/iam/delete_user.rb
  50. +0 −8 lib/fog/aws/requests/iam/delete_user_policy.rb
  51. +0 −8 lib/fog/aws/requests/iam/get_user.rb
  52. +0 −8 lib/fog/aws/requests/iam/list_access_keys.rb
  53. +0 −8 lib/fog/aws/requests/iam/list_group_policies.rb
  54. +0 −8 lib/fog/aws/requests/iam/list_groups.rb
  55. +0 −8 lib/fog/aws/requests/iam/list_user_policies.rb
  56. +0 −8 lib/fog/aws/requests/iam/list_users.rb
  57. +1 −9 lib/fog/aws/requests/iam/put_group_policy.rb
  58. +1 −9 lib/fog/aws/requests/iam/put_user_policy.rb
  59. +0 −8 lib/fog/aws/requests/iam/remove_user_from_group.rb
  60. +0 −8 lib/fog/aws/requests/iam/update_access_key.rb
  61. +5 −5 lib/fog/aws/requests/simpledb/batch_put_attributes.rb
  62. +1 −1 lib/fog/aws/requests/simpledb/create_domain.rb
  63. +15 −5 lib/fog/aws/requests/simpledb/delete_attributes.rb
  64. +1 −1 lib/fog/aws/requests/simpledb/delete_domain.rb
  65. +1 −1 lib/fog/aws/requests/simpledb/domain_metadata.rb
  66. +33 −21 lib/fog/aws/requests/simpledb/get_attributes.rb
  67. +2 −2 lib/fog/aws/requests/simpledb/list_domains.rb
  68. +6 −6 lib/fog/aws/requests/simpledb/put_attributes.rb
  69. +11 −11 lib/fog/aws/requests/simpledb/select.rb
  70. +46 −18 lib/fog/aws/simpledb.rb
  71. +16 −23 lib/fog/bin.rb
  72. +50 −22 lib/fog/bin/aws.rb
  73. +10 −10 lib/fog/bin/bluebox.rb
  74. +7 −6 lib/fog/bin/brightbox.rb
  75. +5 −10 lib/fog/bin/go_grid.rb
  76. +4 −3 lib/fog/bin/google.rb
  77. +6 −10 lib/fog/bin/linode.rb
  78. +5 −10 lib/fog/bin/local.rb
  79. +5 −10 lib/fog/bin/new_servers.rb
  80. +17 −20 lib/fog/bin/rackspace.rb
  81. +8 −12 lib/fog/bin/slicehost.rb
  82. +0 −5 lib/fog/bin/terremark.rb
  83. +17 −46 lib/fog/bin/vcloud.rb
  84. +4 −3 lib/fog/bin/zerigo.rb
  85. +17 −9 lib/fog/cdn.rb
  86. +0 −115 lib/fog/cdn/aws.rb
  87. +0 −59 lib/fog/cdn/parsers/aws/distribution.rb
  88. +0 −61 lib/fog/cdn/parsers/aws/get_distribution_list.rb
  89. +0 −28 lib/fog/cdn/parsers/aws/post_invalidation.rb
  90. +0 −97 lib/fog/cdn/rackspace.rb
  91. +0 −36 lib/fog/cdn/requests/aws/delete_distribution.rb
  92. +0 −65 lib/fog/cdn/requests/aws/get_distribution.rb
  93. +0 −67 lib/fog/cdn/requests/aws/get_distribution_list.rb
  94. +0 −99 lib/fog/cdn/requests/aws/post_distribution.rb
  95. +0 −59 lib/fog/cdn/requests/aws/post_invalidation.rb
  96. +0 −102 lib/fog/cdn/requests/aws/put_distribution_config.rb
  97. +0 −39 lib/fog/cdn/requests/rackspace/get_containers.rb
  98. +0 −41 lib/fog/cdn/requests/rackspace/head_container.rb
  99. +0 −38 lib/fog/cdn/requests/rackspace/put_container.rb
  100. +78 −26 lib/fog/compute.rb
  101. +0 −273 lib/fog/compute/aws.rb
  102. +0 −104 lib/fog/compute/bluebox.rb
  103. +0 −159 lib/fog/compute/brightbox.rb
  104. +0 −118 lib/fog/compute/go_grid.rb
  105. +0 −100 lib/fog/compute/linode.rb
  106. +0 −69 lib/fog/compute/models/aws/address.rb
  107. +0 −100 lib/fog/compute/models/aws/addresses.rb
  108. +0 −21 lib/fog/compute/models/aws/flavor.rb
  109. +0 −166 lib/fog/compute/models/aws/flavors.rb
  110. +0 −43 lib/fog/compute/models/aws/image.rb
  111. +0 −62 lib/fog/compute/models/aws/images.rb
  112. +0 −44 lib/fog/compute/models/aws/key_pair.rb
  113. +0 −88 lib/fog/compute/models/aws/key_pairs.rb
  114. +0 −205 lib/fog/compute/models/aws/security_group.rb
  115. +0 −95 lib/fog/compute/models/aws/security_groups.rb
  116. +0 −209 lib/fog/compute/models/aws/server.rb
  117. +0 −158 lib/fog/compute/models/aws/servers.rb
  118. +0 −58 lib/fog/compute/models/aws/snapshot.rb
  119. +0 −52 lib/fog/compute/models/aws/snapshots.rb
  120. +0 −36 lib/fog/compute/models/aws/tag.rb
  121. +0 −34 lib/fog/compute/models/aws/tags.rb
  122. +0 −109 lib/fog/compute/models/aws/volume.rb
  123. +0 −121 lib/fog/compute/models/aws/volumes.rb
  124. +0 −45 lib/fog/compute/models/bluebox/flavor.rb
  125. +0 −28 lib/fog/compute/models/bluebox/flavors.rb
  126. +0 −19 lib/fog/compute/models/bluebox/image.rb
  127. +0 −28 lib/fog/compute/models/bluebox/images.rb
  128. +0 −123 lib/fog/compute/models/bluebox/server.rb
  129. +0 −36 lib/fog/compute/models/bluebox/servers.rb
  130. +0 −51 lib/fog/compute/models/brightbox/account.rb
  131. +0 −47 lib/fog/compute/models/brightbox/cloud_ip.rb
  132. +0 −34 lib/fog/compute/models/brightbox/cloud_ips.rb
  133. +0 −33 lib/fog/compute/models/brightbox/flavor.rb
  134. +0 −28 lib/fog/compute/models/brightbox/flavors.rb
  135. +0 −56 lib/fog/compute/models/brightbox/image.rb
  136. +0 −28 lib/fog/compute/models/brightbox/images.rb
  137. +0 −50 lib/fog/compute/models/brightbox/load_balancer.rb
  138. +0 −28 lib/fog/compute/models/brightbox/load_balancers.rb
  139. +0 −94 lib/fog/compute/models/brightbox/server.rb
  140. +0 −29 lib/fog/compute/models/brightbox/servers.rb
  141. +0 −39 lib/fog/compute/models/brightbox/user.rb
  142. +0 −29 lib/fog/compute/models/brightbox/users.rb
  143. +0 −21 lib/fog/compute/models/brightbox/zone.rb
  144. +0 −29 lib/fog/compute/models/brightbox/zones.rb
  145. +0 −60 lib/fog/compute/models/go_grid/image.rb
  146. +0 −33 lib/fog/compute/models/go_grid/images.rb
  147. +0 −56 lib/fog/compute/models/go_grid/server.rb
  148. +0 −35 lib/fog/compute/models/go_grid/servers.rb
  149. +0 −43 lib/fog/compute/models/rackspace/flavor.rb
  150. +0 −28 lib/fog/compute/models/rackspace/flavors.rb
  151. +0 −48 lib/fog/compute/models/rackspace/image.rb
  152. +0 −33 lib/fog/compute/models/rackspace/images.rb
  153. +0 −126 lib/fog/compute/models/rackspace/server.rb
  154. +0 −36 lib/fog/compute/models/rackspace/servers.rb
  155. +0 −45 lib/fog/compute/models/slicehost/flavor.rb
  156. +0 −28 lib/fog/compute/models/slicehost/flavors.rb
  157. +0 −17 lib/fog/compute/models/slicehost/image.rb
  158. +0 −27 lib/fog/compute/models/slicehost/images.rb
  159. +0 −109 lib/fog/compute/models/slicehost/server.rb
  160. +0 −38 lib/fog/compute/models/slicehost/servers.rb
  161. +0 −103 lib/fog/compute/new_servers.rb
  162. +0 −19 lib/fog/compute/parsers/aws/allocate_address.rb
  163. +0 −22 lib/fog/compute/parsers/aws/attach_volume.rb
  164. +0 −25 lib/fog/compute/parsers/aws/basic.rb
  165. +0 −20 lib/fog/compute/parsers/aws/create_image.rb
  166. +0 −20 lib/fog/compute/parsers/aws/create_key_pair.rb
  167. +0 −26 lib/fog/compute/parsers/aws/create_snapshot.rb
  168. +0 −24 lib/fog/compute/parsers/aws/create_volume.rb
  169. +0 −20 lib/fog/compute/parsers/aws/deregister_image.rb
  170. +0 −30 lib/fog/compute/parsers/aws/describe_addresses.rb
  171. +0 −32 lib/fog/compute/parsers/aws/describe_availability_zones.rb
  172. +0 −72 lib/fog/compute/parsers/aws/describe_images.rb
  173. +0 −119 lib/fog/compute/parsers/aws/describe_instances.rb
  174. +0 −30 lib/fog/compute/parsers/aws/describe_key_pairs.rb
  175. +0 −30 lib/fog/compute/parsers/aws/describe_regions.rb
  176. +0 −36 lib/fog/compute/parsers/aws/describe_reserved_instances.rb
  177. +0 −76 lib/fog/compute/parsers/aws/describe_security_groups.rb
  178. +0 −54 lib/fog/compute/parsers/aws/describe_snapshots.rb
  179. +0 −30 lib/fog/compute/parsers/aws/describe_tags.rb
  180. +0 −73 lib/fog/compute/parsers/aws/describe_volumes.rb
  181. +0 −22 lib/fog/compute/parsers/aws/detach_volume.rb
  182. +0 −32 lib/fog/compute/parsers/aws/get_console_output.rb
  183. +0 −20 lib/fog/compute/parsers/aws/import_key_pair.rb
  184. +0 −20 lib/fog/compute/parsers/aws/register_image.rb
  185. +0 −89 lib/fog/compute/parsers/aws/run_instances.rb
  186. +0 −41 lib/fog/compute/parsers/aws/start_stop_instances.rb
  187. +0 −55 lib/fog/compute/parsers/aws/terminate_instances.rb
  188. +0 −31 lib/fog/compute/parsers/slicehost/create_slice.rb
  189. +0 −32 lib/fog/compute/parsers/slicehost/get_backups.rb
  190. +0 −26 lib/fog/compute/parsers/slicehost/get_flavor.rb
  191. +0 −30 lib/fog/compute/parsers/slicehost/get_flavors.rb
  192. +0 −26 lib/fog/compute/parsers/slicehost/get_image.rb
  193. +0 −30 lib/fog/compute/parsers/slicehost/get_images.rb
  194. +0 −31 lib/fog/compute/parsers/slicehost/get_slice.rb
  195. +0 −35 lib/fog/compute/parsers/slicehost/get_slices.rb
  196. +0 −144 lib/fog/compute/rackspace.rb
  197. +0 −51 lib/fog/compute/requests/aws/allocate_address.rb
  198. +0 −57 lib/fog/compute/requests/aws/associate_address.rb
  199. +0 −81 lib/fog/compute/requests/aws/attach_volume.rb
  200. +0 −86 lib/fog/compute/requests/aws/authorize_security_group_ingress.rb
  201. +0 −64 lib/fog/compute/requests/aws/create_image.rb
  202. +0 −54 lib/fog/compute/requests/aws/create_key_pair.rb
  203. +0 −53 lib/fog/compute/requests/aws/create_security_group.rb
  204. +0 −71 lib/fog/compute/requests/aws/create_snapshot.rb
  205. +0 −78 lib/fog/compute/requests/aws/create_tags.rb
  206. +0 −74 lib/fog/compute/requests/aws/create_volume.rb
  207. +0 −43 lib/fog/compute/requests/aws/delete_key_pair.rb
  208. +0 −45 lib/fog/compute/requests/aws/delete_security_group.rb
  209. +0 −46 lib/fog/compute/requests/aws/delete_snapshot.rb
  210. +0 −45 lib/fog/compute/requests/aws/delete_tags.rb
  211. +0 −52 lib/fog/compute/requests/aws/delete_volume.rb
  212. +0 −51 lib/fog/compute/requests/aws/deregister_image.rb
  213. +0 −64 lib/fog/compute/requests/aws/describe_addresses.rb
  214. +0 −70 lib/fog/compute/requests/aws/describe_availability_zones.rb
  215. +0 −65 lib/fog/compute/requests/aws/describe_images.rb
  216. +0 −201 lib/fog/compute/requests/aws/describe_instances.rb
  217. +0 −66 lib/fog/compute/requests/aws/describe_key_pairs.rb
  218. +0 −66 lib/fog/compute/requests/aws/describe_regions.rb
  219. +0 −52 lib/fog/compute/requests/aws/describe_reserved_instances.rb
  220. +0 −95 lib/fog/compute/requests/aws/describe_security_groups.rb
  221. +0 −120 lib/fog/compute/requests/aws/describe_snapshots.rb
  222. +0 −42 lib/fog/compute/requests/aws/describe_tags.rb
  223. +0 −118 lib/fog/compute/requests/aws/describe_volumes.rb
  224. +0 −58 lib/fog/compute/requests/aws/detach_volume.rb
  225. +0 −52 lib/fog/compute/requests/aws/disassociate_address.rb
  226. +0 −52 lib/fog/compute/requests/aws/get_console_output.rb
  227. +0 −54 lib/fog/compute/requests/aws/import_key_pair.rb
  228. +0 −39 lib/fog/compute/requests/aws/modify_image_attributes.rb
  229. +0 −38 lib/fog/compute/requests/aws/modify_snapshot_attribute.rb
  230. +0 −50 lib/fog/compute/requests/aws/reboot_instances.rb
  231. +0 −89 lib/fog/compute/requests/aws/register_image.rb
  232. +0 −43 lib/fog/compute/requests/aws/release_address.rb
  233. +0 −74 lib/fog/compute/requests/aws/revoke_security_group_ingress.rb
  234. +0 −167 lib/fog/compute/requests/aws/run_instances.rb
  235. +0 −38 lib/fog/compute/requests/aws/start_instances.rb
  236. +0 −38 lib/fog/compute/requests/aws/stop_instances.rb
  237. +0 −94 lib/fog/compute/requests/aws/terminate_instances.rb
  238. +0 −41 lib/fog/compute/requests/bluebox/create_block.rb
  239. +0 −34 lib/fog/compute/requests/bluebox/destroy_block.rb
  240. +0 −34 lib/fog/compute/requests/bluebox/get_block.rb
  241. +0 −36 lib/fog/compute/requests/bluebox/get_blocks.rb
  242. +0 −34 lib/fog/compute/requests/bluebox/get_product.rb
  243. +0 −33 lib/fog/compute/requests/bluebox/get_products.rb
  244. +0 −34 lib/fog/compute/requests/bluebox/get_template.rb
  245. +0 −34 lib/fog/compute/requests/bluebox/get_templates.rb
  246. +0 −35 lib/fog/compute/requests/bluebox/reboot_block.rb
  247. +0 −28 lib/fog/compute/requests/brightbox/add_nodes_load_balancer.rb
  248. +0 −27 lib/fog/compute/requests/brightbox/create_api_client.rb
  249. +0 −27 lib/fog/compute/requests/brightbox/create_cloud_ip.rb
  250. +0 −27 lib/fog/compute/requests/brightbox/create_image.rb
  251. +0 −27 lib/fog/compute/requests/brightbox/create_load_balancer.rb
  252. +0 −27 lib/fog/compute/requests/brightbox/create_server.rb
  253. +0 −28 lib/fog/compute/requests/brightbox/destroy_api_client.rb
  254. +0 −28 lib/fog/compute/requests/brightbox/destroy_cloud_ip.rb
  255. +0 −28 lib/fog/compute/requests/brightbox/destroy_image.rb
  256. +0 −28 lib/fog/compute/requests/brightbox/destroy_load_balancer.rb
  257. +0 −28 lib/fog/compute/requests/brightbox/destroy_server.rb
  258. +0 −27 lib/fog/compute/requests/brightbox/get_account.rb
  259. +0 −28 lib/fog/compute/requests/brightbox/get_api_client.rb
  260. +0 −28 lib/fog/compute/requests/brightbox/get_cloud_ip.rb
  261. +0 −28 lib/fog/compute/requests/brightbox/get_image.rb
  262. +0 −28 lib/fog/compute/requests/brightbox/get_interface.rb
  263. +0 −28 lib/fog/compute/requests/brightbox/get_load_balancer.rb
  264. +0 −28 lib/fog/compute/requests/brightbox/get_server.rb
  265. +0 −28 lib/fog/compute/requests/brightbox/get_server_type.rb
  266. +0 −28 lib/fog/compute/requests/brightbox/get_user.rb
  267. +0 −28 lib/fog/compute/requests/brightbox/get_zone.rb
  268. +0 −27 lib/fog/compute/requests/brightbox/list_api_clients.rb
  269. +0 −27 lib/fog/compute/requests/brightbox/list_cloud_ips.rb
  270. +0 −27 lib/fog/compute/requests/brightbox/list_images.rb
  271. +0 −27 lib/fog/compute/requests/brightbox/list_load_balancers.rb
  272. +0 −27 lib/fog/compute/requests/brightbox/list_server_types.rb
  273. +0 −27 lib/fog/compute/requests/brightbox/list_servers.rb
  274. +0 −27 lib/fog/compute/requests/brightbox/list_users.rb
  275. +0 −27 lib/fog/compute/requests/brightbox/list_zones.rb
  276. +0 −28 lib/fog/compute/requests/brightbox/map_cloud_ip.rb
  277. +0 −28 lib/fog/compute/requests/brightbox/remove_nodes_load_balancer.rb
  278. +0 −27 lib/fog/compute/requests/brightbox/reset_ftp_password_account.rb
  279. +0 −27 lib/fog/compute/requests/brightbox/resize_server.rb
  280. +0 −28 lib/fog/compute/requests/brightbox/shutdown_server.rb
  281. +0 −28 lib/fog/compute/requests/brightbox/snapshot_server.rb
  282. +0 −28 lib/fog/compute/requests/brightbox/start_server.rb
  283. +0 −28 lib/fog/compute/requests/brightbox/stop_server.rb
  284. +0 −28 lib/fog/compute/requests/brightbox/unmap_cloud_ip.rb
  285. +0 −28 lib/fog/compute/requests/brightbox/update_account.rb
  286. +0 −29 lib/fog/compute/requests/brightbox/update_api_client.rb
  287. +0 −29 lib/fog/compute/requests/brightbox/update_image.rb
  288. +0 −29 lib/fog/compute/requests/brightbox/update_load_balancer.rb
  289. +0 −29 lib/fog/compute/requests/brightbox/update_server.rb
  290. +0 −29 lib/fog/compute/requests/brightbox/update_user.rb
  291. +0 −36 lib/fog/compute/requests/go_grid/common_lookup_list.rb
  292. +0 −41 lib/fog/compute/requests/go_grid/grid_image_get.rb
  293. +0 −44 lib/fog/compute/requests/go_grid/grid_image_list.rb
  294. +0 −38 lib/fog/compute/requests/go_grid/grid_ip_list.rb
  295. +0 −36 lib/fog/compute/requests/go_grid/grid_loadbalancer_list.rb
  296. +0 −44 lib/fog/compute/requests/go_grid/grid_server_add.rb
  297. +0 −33 lib/fog/compute/requests/go_grid/grid_server_delete.rb
  298. +0 −33 lib/fog/compute/requests/go_grid/grid_server_get.rb
  299. +0 −38 lib/fog/compute/requests/go_grid/grid_server_list.rb
  300. +0 −34 lib/fog/compute/requests/go_grid/grid_server_power.rb
Sorry, we could not display the entire diff because too many files (822) changed.
View
48 Gemfile.lock
@@ -1,48 +0,0 @@
-PATH
- remote: .
- specs:
- fog (0.4.0)
- builder
- excon (>= 0.4.0)
- formatador (>= 0.0.16)
- json
- mime-types
- net-ssh (>= 2.0.23)
- nokogiri (>= 1.4.4)
- ruby-hmac
-
-GEM
- remote: http://rubygems.org/
- specs:
- builder (3.0.0)
- excon (0.4.0)
- formatador (0.0.16)
- gestalt (0.0.11)
- formatador (>= 0.0.12)
- json (1.4.6)
- mime-types (1.16)
- net-ssh (2.0.23)
- nokogiri (1.4.4)
- rake (0.8.7)
- rspec (1.3.1)
- ruby-hmac (0.4.0)
- shindo (0.1.12)
- formatador (>= 0.0.16)
- gestalt (>= 0.0.11)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- builder
- excon (>= 0.4.0)
- fog!
- formatador (>= 0.0.16)
- json
- mime-types
- net-ssh (>= 2.0.23)
- nokogiri (>= 1.4.4)
- rake
- rspec (= 1.3.1)
- ruby-hmac
- shindo (= 0.1.12)
View
53 README.rdoc
@@ -12,10 +12,10 @@ fog is the Ruby cloud computing library, top to bottom:
Now type 'fog' to try stuff, confident that fog will let you know what to do. Here is an example of wading through server creation for Amazon Elastic Compute Cloud:
- >> server = AWS.servers.create
+ >> server = Compute[:aws].servers.create
ArgumentError: image_id is required for this operation
- >> server = AWS.servers.create(:image_id => 'ami-5ee70037')
+ >> server = Compute[:aws].servers.create(:image_id => 'ami-5ee70037')
<Fog::AWS::EC2::Server [...]>
>> server.destroy # cleanup after yourself or regret it, trust me
@@ -26,7 +26,7 @@ Now type 'fog' to try stuff, confident that fog will let you know what to do. He
A high level interface to each cloud is provided through collections, such as `images` and `servers`.
You can see a list of available collections by calling `collections` on the connection object. You can try it out using the `fog` command:
- >> AWS.collections
+ >> Compute[:aws].collections
[:addresses, :directories, ..., :volumes, :zones]
Some collections are available across multiple providers:
@@ -84,14 +84,14 @@ You can see a list of available requests by calling #requests on the connection
For instance, ec2 provides methods related to reserved instances that don't have any models (yet). Here is how you can lookup your reserved instances:
$ fog
- >> AWS[:ec2].describe_reserved_instances
+ >> Compute[:aws].describe_reserved_instances
#<Excon::Response [...]>
It will return an {excon}[http://github.com/geemus/excon] response, which has `body`, `headers` and `status`. Both return nice hashes.
== Go forth and conquer
-Play around and use the console to explore or check out the {getting started guide}[http://wiki.github.com/geemus/fog/getting-started-with-fog] for more details. Once you are reading to start scripting fog, here is a quick hint on how to make connections without the command line thing to help you.
+Play around and use the console to explore or check out {fog.io}[http://fog.io] for more details and examples. Once you are ready to start scripting fog, here is a quick hint on how to make connections without the command line thing to help you.
# create a compute connection
compute = Fog::Compute.new(:provider => 'AWS', :aws_access_key_id => ACCESS_KEY_ID, :aws_secret_access_key => SECRET_ACCESS_KEY)
@@ -103,53 +103,24 @@ Play around and use the console to explore or check out the {getting started gui
geemus says: "That should give you everything you need to get started, but let me know if there is anything I can do to help!"
-== Providers
+== Contributing
-You should try out the (varying) support fog has for:
-* {AWS}[http://aws.amazon.com] [{Compute}[http://aws.amazon.com/ec2], {DNS}[http://aws.amazon.com/route53], {ELB}[http://aws.amazon.com/elasticloadbalancing], {Storage}[http://aws.amazon.com/s3], {SimpleDB}[http://aws.amazon.com/simpledb]]
-* <b><em>{Blue Box Group}[http://www.bluebox.net]</em></b> [{Compute}[http://www.bluebox.net/blocks]]
-* <b><em>{Brightbox}[http://www.brightbox.co.uk]</em></b> [{Compute}[http://beta.brightbox.com/]]
-* {Google}[http://www.google.com] [{Storage}[http://code.google.com/apis/storage]]
-* {Linode}[http://www.linode.com] [{DNS}[http://www.linode.com]]
-* Local [Storage]
-* {Rackspace}[http://www.rackspace.com] [{Compute}[http://www.rackspacecloud.com/cloud_hosting_products/servers], {Storage}[http://www.rackspacecloud.com/cloud_hosting_products/files]]
-* {Slicehost}[http://www.slicehost.com] [{Compute}[http://www.slicehost.com], {DNS}[http://www.slicehost.com]]
-* {Terremark}[http://www.terremark.com] [{vCloud Express}[http://vcloudexpress.terremark.com]]
-* {Zerigo}[http://www.zerigo.com] [{DNS}[http://www.zerigo.com/managed-dns]]
-
-There are also the basics of these providers (that could use your love):
-* <b><em>{GoGrid}[http://www.gogrid.com]</b></em> [{Compute}[http://www.gogrid.com]]
-* {Linode}[http://www.linode.com] [{Compute}[http://www.linode.com]]
-* {New Servers}[http://www.newservers.com] [{Compute}[http://www.newservers.com]]
-
-Special thanks to providers listed in <b><em>bold italics</em></b> for donating resources for fog tests!
+* Find something you would like to work on. For suggestions look for the `easy`, `medium` and `hard` tags in the {issues}[http://github.com/fog/fog/issues]
+* Fork the project and do your work in a topic branch.
+* Add shindo tests to prove your code works and run all the tests using `bundle exec rake`.
+* Rebase your branch against geemus/fog to make sure everything is up to date.
+* Commit your changes and send a pull request.
== Additional Resources
-Enjoy, and let me know what I can do to continue improving fog!
-
-* Follow {@fog}[http://twitter.com/fog] and/or {@geemus}[http://twitter.com/geemus] on Twitter
-* Discuss in irc on the {#ruby-fog}[irc://irc.freenode.net/ruby-fog] channel on Freenode
-* Discuss via email on the {mailing list}[http://groups.google.com/group/ruby-fog] (note: release notes appear on this list)
-* Report bugs or find stuff to work on in {issues}[http://github.com/geemus/fog/issues]
-* Learn about {contributing}[http://github.com/geemus/fog/wiki/contributor-guide] or find more info about the {Providers}[http://github.com/geemus/fog/wiki/Providers] (including some todo items)
-* See what already uses fog and add your own stuff to {the list}[http://wiki.github.com/geemus/fog/in-the-wild]
-* Check out blog posts and other mentions from elsewhere {press}[http://wiki.github.com/geemus/fog/press]
+{fog.io}[http://fog.io]
== Sponsorship
http://www.engineyard.com/images/logo.png
All new work on fog is sponsored by {Engine Yard}[http://engineyard.com]
-== T-Shirts
-
-Wonder how you can get a shirt? Look no further!
-
-* Blue shirts go to people who have contributed indirectly, where contribution is a judgement call on geemus's part (but he is a pretty nice guy).
-* Grey shirts and a follow from @fog go to people who have made it on to the {contributors list}[https://github.com/geemus/fog/contributors] by submitting code.
-* Black shirts go to people who have made it on to the {collaborators list}[https://github.com/api/v2/json/repos/show/geemus/fog/collaborators] by coercing geemus into adding them (geemus is currently the only member of this list).
-
== Copyright
(The MIT License)
View
333 Rakefile
@@ -1,6 +1,7 @@
require 'rubygems'
require 'bundler/setup'
require 'date'
+require File.dirname(__FILE__) + '/lib/fog'
#############################################################################
#
@@ -45,17 +46,79 @@ end
task :default => :test
+namespace :test do
+ task :dynect do
+ [false].each do |mock|
+ sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/dns/requests/dynect")
+ #sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/dns/models/")
+ end
+ end
+end
+
task :examples do
sh("export FOG_MOCK=false && bundle exec shindont examples")
# some don't provide mocks so we'll leave this out for now
# sh("export FOG_MOCK=true && bundle exec shindont examples")
end
-task :test => :examples do
- sh("export FOG_MOCK=true && bundle exec spec spec") &&
- sh("export FOG_MOCK=true && bundle exec shindont tests") &&
- sh("export FOG_MOCK=false && bundle exec spec spec") &&
- sh("export FOG_MOCK=false && bundle exec shindont tests")
+task :test do # => :examples do
+ Rake::Task[:mock_tests].invoke && Rake::Task[:examples].invoke && Rake::Task[:real_tests].invoke
+end
+
+def tests(mocked)
+ Formatador.display_line
+ sh("export FOG_MOCK=#{mocked} && bundle exec spec spec")
+ Formatador.display_line
+ start = Time.now.to_i
+ threads = []
+ Thread.main[:results] = []
+ Fog.providers.each do |provider|
+ threads << Thread.new do
+ Thread.main[:results] << {
+ :provider => provider,
+ :success => sh("export FOG_MOCK=#{mocked} && bundle exec shindont +#{provider.downcase}")
+ }
+ end
+ end
+ threads.each do |thread|
+ thread.join
+ end
+ Formatador.display_table(Thread.main[:results].sort {|x,y| x[:provider] <=> y[:provider]})
+ Formatador.display_line("[bold]FOG_MOCK=#{mocked}[/] tests completed in [bold]#{Time.now.to_i - start}[/] seconds")
+ Formatador.display_line
+end
+
+task :mock_tests do
+ tests(true)
+end
+
+task :real_tests do
+ tests(false)
+end
+
+task :nuke do
+ Fog.providers.each do |provider|
+ next if ['Vmfusion'].include?(provider)
+ begin
+ compute = Fog::Compute.new(:provider => provider)
+ for server in compute.servers
+ Formatador.display_line("[#{provider}] destroying server #{server.identity}")
+ server.destroy rescue nil
+ end
+ rescue
+ end
+ begin
+ dns = Fog::DNS.new(:provider => provider)
+ for zone in dns.zones
+ for record in zone.records
+ record.destroy rescue nil
+ end
+ Formatador.display_line("[#{provider}] destroying zone #{zone.identity}")
+ zone.destroy rescue nil
+ end
+ rescue
+ end
+ end
end
desc "Generate RCov test coverage and open in your browser"
@@ -66,8 +129,8 @@ task :coverage do
sh "open coverage/index.html"
end
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
+require 'rdoc/task'
+RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "#{name} #{version}"
rdoc.rdoc_files.include('README*')
@@ -96,6 +159,7 @@ task :release => :build do
sh "git push origin master"
sh "git push origin v#{version}"
sh "gem push pkg/#{name}-#{version}.gem"
+ Rake::Task[:docs].invoke
end
task :build => :gemspec do
@@ -130,3 +194,258 @@ task :validate do
exit!
end
end
+
+task :changelog do
+ timestamp = Time.now.utc.strftime('%m/%d/%Y')
+ sha = `git log | head -1`.split(' ').last
+ changelog = ["#{version} #{timestamp} #{sha}"]
+ changelog << ('=' * changelog[0].length)
+ changelog << ''
+
+ require 'multi_json'
+ github_repo_data = MultiJson.decode(Excon.get('http://github.com/api/v2/json/repos/show/fog/fog').body)
+ data = github_repo_data['repository'].reject {|key, value| !['forks', 'open_issues', 'watchers'].include?(key)}
+ github_collaborator_data = MultiJson.decode(Excon.get('http://github.com/api/v2/json/repos/show/fog/fog/collaborators').body)
+ data['collaborators'] = github_collaborator_data['collaborators'].length
+ rubygems_data = MultiJson.decode(Excon.get('https://rubygems.org/api/v1/gems/fog.json').body)
+ data['downloads'] = rubygems_data['downloads']
+ stats = []
+ for key in data.keys.sort
+ stats << "'#{key}' => #{data[key]}"
+ end
+ changelog << "Stats! { #{stats.join(', ')} }"
+ changelog << ''
+
+ last_sha = `cat changelog.txt | head -1`.split(' ').last
+ shortlog = `git shortlog #{last_sha}..HEAD`
+ changes = {}
+ committers = {}
+ for line in shortlog.split("\n")
+ if line =~ /^\S/
+ committer = line.split(' (', 2).first
+ committers[committer] = 0
+ elsif line =~ /^\s*((Merge.*)|(Release.*))?$/
+ # skip empty lines, Merge and Release commits
+ else
+ unless line[-1..-1] == '.'
+ line << '.'
+ end
+ line.lstrip!
+ line.gsub!(/^\[([^\]]*)\] /, '')
+ tag = $1 || 'misc'
+ changes[tag] ||= []
+ changes[tag] << (line << ' thanks ' << committer)
+ committers[committer] += 1
+ end
+ end
+
+ for committer, commits in committers.to_a.sort {|x,y| y[1] <=> x[1]}
+ if [
+ 'Aaron Suggs',
+ 'Brian Hartsock',
+ 'Christopher Oliver',
+ 'Dylan Egan',
+ 'geemus',
+ 'Henry Addison',
+ 'Lincoln Stoll',
+ 'Luqman Amjad',
+ 'Michael Zeng',
+ 'nightshade427',
+ 'Patrick Debois',
+ 'Wesley Beary'
+ ].include?(committer)
+ next
+ end
+ changelog << "MVP! #{committer}"
+ changelog << ''
+ break
+ end
+
+ for tag in changes.keys.sort
+ changelog << ('[' << tag << ']')
+ for commit in changes[tag]
+ changelog << (' ' << commit)
+ end
+ changelog << ''
+ end
+
+ old_changelog = File.read('changelog.txt')
+ File.open('changelog.txt', 'w') do |file|
+ file.write(changelog.join("\n"))
+ file.write("\n\n")
+ file.write(old_changelog)
+ end
+end
+
+task :docs do
+ Rake::Task[:supported_services_docs].invoke
+ Rake::Task[:upload_fog_io].invoke
+ Rake::Task[:upload_rdoc].invoke
+
+ # connect to storage provider
+ Fog.credential = :geemus
+ storage = Fog::Storage.new(:provider => 'AWS')
+ directory = storage.directories.new(:key => 'fog.io')
+ # write base index with redirect to new version
+ directory.files.create(
+ :body => redirecter('latest'),
+ :content_type => 'text/html',
+ :key => 'index.html',
+ :public => true
+ )
+
+ Formatador.display_line
+end
+
+task :supported_services_docs do
+ support, shared = {}, []
+ for key, values in Fog.services
+ unless values.length == 1
+ shared |= [key]
+ values.each do |value|
+ support[value] ||= {}
+ support[value][key] = '+'
+ end
+ else
+ value = values.first
+ support[value] ||= {}
+ support[value][:other] ||= []
+ support[value][:other] << key
+ end
+ end
+ shared.sort! {|x,y| x.to_s <=> y.to_s}
+ columns = [:provider] + shared + [:other]
+ data = []
+ for key in support.keys.sort {|x,y| x.to_s <=> y.to_s}
+ data << { :provider => key }.merge!(support[key])
+ end
+
+ table = ''
+ table << "<table border='1'>\n"
+
+ table << " <tr>"
+ for column in columns
+ table << "<th>#{column}</th>"
+ end
+ table << "</tr>\n"
+
+ for datum in data
+ table << " <tr>"
+ for column in columns
+ if value = datum[column]
+ case value
+ when Array
+ table << "<td>#{value.join(', ')}</td>"
+ when '+'
+ table << "<td style='text-align: center;'>#{value}</td>"
+ else
+ table << "<th>#{value}</th>"
+ end
+ else
+ table << "<td></td>"
+ end
+ end
+ table << "</tr>\n"
+ end
+
+ table << "</table>\n"
+
+ File.open('docs/about/supported_services.markdown', 'w') do |file|
+ file.puts <<-METADATA
+---
+layout: default
+title: Supported Services
+---
+
+METADATA
+ file.puts(table)
+ end
+end
+
+task :upload_fog_io do
+ # connect to storage provider
+ Fog.credential = :geemus
+ storage = Fog::Storage.new(:provider => 'AWS')
+ directory = storage.directories.new(:key => 'fog.io')
+
+ # build the docs locally
+ sh "jekyll docs docs/_site"
+
+ # write web page files to versioned 'folder'
+ for file_path in Dir.glob('docs/_site/**/*')
+ next if File.directory?(file_path)
+ file_name = file_path.gsub('docs/_site/', '')
+ key = '' << version << '/' << file_name
+ Formatador.redisplay(' ' * 128)
+ Formatador.redisplay("Uploading [bold]#{key}[/]")
+ if File.extname(file_name) == '.html'
+ # rewrite links with version
+ body = File.read(file_path)
+ body.gsub!(/vX.Y.Z/, 'v' << version)
+ body.gsub!(/='\//, %{='/} << version << '/')
+ body.gsub!(/="\//, %{="/} << version << '/')
+ content_type = 'text/html'
+ directory.files.create(
+ :body => redirecter(key),
+ :content_type => 'text/html',
+ :key => 'latest/' << file_name,
+ :public => true
+ )
+ else
+ body = File.open(file_path)
+ content_type = nil # leave it up to mime-types
+ end
+ directory.files.create(
+ :body => body,
+ :content_type => content_type,
+ :key => key,
+ :public => true
+ )
+ end
+ Formatador.redisplay(' ' * 128)
+ Formatador.redisplay("Uploaded docs/_site\n")
+end
+
+task :upload_rdoc do
+ # connect to storage provider
+ Fog.credential = :geemus
+ storage = Fog::Storage.new(:provider => 'AWS')
+ directory = storage.directories.new(:key => 'fog.io')
+
+ # write rdoc files to versioned 'folder'
+ Rake::Task[:rdoc].invoke
+ for file_path in Dir.glob('rdoc/**/*')
+ next if File.directory?(file_path)
+ file_name = file_path.gsub('rdoc/', '')
+ key = '' << version << '/rdoc/' << file_name
+ Formatador.redisplay(' ' * 128)
+ Formatador.redisplay("Uploading [bold]#{key}[/]")
+ directory.files.create(
+ :body => File.open(file_path),
+ :key => key,
+ :public => true
+ )
+ end
+ Formatador.redisplay(' ' * 128)
+ directory.files.create(
+ :body => redirecter("#{version}/rdoc/index.html"),
+ :content_type => 'text/html',
+ :key => 'latest/rdoc/index.html',
+ :public => true
+ )
+ Formatador.redisplay("Uploaded rdoc\n")
+end
+
+def redirecter(path)
+ redirecter = <<-HTML
+<!doctype html>
+<head>
+<title>fog</title>
+<meta http-equiv="REFRESH" content="0;url=http://fog.io/#{path}">
+</head>
+<body>
+ <a href="http://fog.io/#{path}">redirecting to lastest (#{path})</a>
+</body>
+</html>
+HTML
+end
View
25 benchs/parse_vs_push.rb
@@ -16,6 +16,7 @@ def reset
end
def characters(string)
+ @value ||= ''
@value << string.strip
end
@@ -29,10 +30,14 @@ def end_element(name)
@response[:items] << @item
@item = {}
when 'key'
- @item[:key] = @value
+ @item[:key] = value
end
end
+ def value
+ @value.dup
+ end
+
end
data = <<-DATA
@@ -43,18 +48,22 @@ def end_element(name)
</items>
DATA
-COUNT = 100
+COUNT = 10_000
Benchmark.bmbm(25) do |bench|
bench.report('parse') do
- parser = Parser.new
- Nokogiri::XML::SAX::Parser.new(parser).parse(data)
- parser.response
+ COUNT.times do
+ parser = Parser.new
+ Nokogiri::XML::SAX::Parser.new(parser).parse(data)
+ parser.response
+ end
end
bench.report('push') do
- parser = Parser.new
- Nokogiri::XML::SAX::PushParser.new(parser).write(data, true)
- parser.response
+ COUNT.times do
+ parser = Parser.new
+ Nokogiri::XML::SAX::PushParser.new(parser).write(data, true)
+ parser.response
+ end
end
end
View
26 bin/fog
@@ -4,13 +4,17 @@ require 'irb'
require 'yaml'
Fog.credential = ARGV.first ? ARGV.first.to_sym : nil
Fog.mock! if ENV['FOG_MOCK']
-unless Fog.credentials
- exit
+if Fog.credentials.empty?
+ begin
+ Fog::Errors.missing_credentials
+ rescue Fog::Errors::LoadError => error
+ abort error.message
+ end
end
require 'fog/bin'
-providers = Fog.providers.map{|provider| provider.to_s}
+providers = Fog.available_providers
providers = if providers.length > 1
providers[0...-1].join(', ') << ' and ' << providers[-1]
else
@@ -19,7 +23,10 @@ end
if ARGV.length > 1
- puts(instance_eval(ARGV[1..-1].join(' ')).to_json)
+ require 'multi_json'
+
+ result = instance_eval(ARGV[1..-1].join(' '))
+ puts(MultiJson.encode(result))
else
@@ -35,11 +42,12 @@ else
Formatador.display_line('Welcome to fog interactive!')
Formatador.display_line(":#{Fog.credential} provides #{providers}")
providers = Fog.providers
- Fog.modules.each do |_module_|
- if _module_.respond_to?(:startup_notice)
- _module_.send(:startup_notice)
- end
- end
+
+ # FIXME: hacks until we can `include Fog` in bin
+ CDN = Fog::CDN
+ Compute = Fog::Compute
+ DNS = Fog::DNS
+ Storage = Fog::Storage
catch(:IRB_EXIT) { @irb.eval_input }
View
10 examples/dns_tests.rb
@@ -4,11 +4,13 @@
require File.join(File.dirname(__FILE__), '..', 'lib', 'fog')
require File.join(File.dirname(__FILE__), '..', 'tests', 'helper')
-Shindo.tests('dns tests', 'dns') do
+Shindo.tests('dns examples', 'dns') do
# iterate over all the providers
Fog.providers.each do |provider|
+ provider = eval(provider) # convert from string to object
+
# skip if provider does not have storage
next unless provider.respond_to?(:services) && provider.services.include?(:dns)
@@ -33,9 +35,9 @@
# type is the type of record to create
tests('@record = @zone.records.create').succeeds do
@record = @zone.records.create(
- :ip => '1.2.3.4',
- :name => 'www.fogdnsexamples.com',
- :type => 'A'
+ :value => '1.2.3.4',
+ :name => 'www.fogdnsexamples.com',
+ :type => 'A'
)
end
View
4 examples/storage_tests.rb
@@ -4,11 +4,13 @@
require File.join(File.dirname(__FILE__), '..', 'lib', 'fog')
require File.join(File.dirname(__FILE__), '..', 'tests', 'helper')
-Shindo.tests('storage tests', 'storage') do
+Shindo.tests('storage examples', 'storage') do
# iterate over all the providers
Fog.providers.each do |provider|
+ provider = eval(provider) # convert from string to object
+
# skip if provider does not have storage
next unless provider.respond_to?(:services) && provider.services.include?(:storage)
View
34 fog.gemspec
@@ -1,39 +1,33 @@
Gem::Specification.new do |s|
s.specification_version = 2 if s.respond_to? :specification_version=
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.rubygems_version = '1.3.5'
## Leave these as is they will be modified for you by the rake gemspec task.
## If your rubyforge_project name is different, then edit it and comment out
## the sub! line in the Rakefile
s.name = 'fog'
- s.version = '0.4.0'
- s.date = '2011-01-05'
+ s.version = '1.1.1'
+ s.date = '2011-11-11'
s.rubyforge_project = 'fog'
## Make sure your summary is short. The description may be as long
## as you like.
s.summary = "brings clouds to you"
- s.description = "The Ruby cloud services library."
+ s.description = "The Ruby cloud services library. Supports all major cloud providers including AWS, Rackspace, Linode, Blue Box, StormOnDemand, and many others. Full support for most AWS services including EC2, S3, CloudWatch, SimpleDB, ELB, and RDS."
## List the primary authors. If there are a bunch of authors, it's probably
## better to set the email to an email list or something. If you don't have
## a custom homepage, consider using your GitHub URL or the like.
s.authors = ["geemus (Wesley Beary)"]
s.email = 'geemus@gmail.com'
- s.homepage = 'http://github.com/geemus/fog'
-
- ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
- ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
- s.require_paths = %w[lib]
+ s.homepage = 'http://github.com/fog/fog'
## This sections is only necessary if you have C extensions.
# s.require_paths << 'ext'
# s.extensions = %w[ext/extconf.rb]
## If your gem includes any executables, list them here.
s.executables = ["fog"]
- s.default_executable = 'fog'
## Specify any RDoc options here. You'll want to add your README and
## LICENSE files to the extra_rdoc_files list.
@@ -43,19 +37,25 @@ Gem::Specification.new do |s|
## List your runtime dependencies here. Runtime dependencies are those
## that are needed for an end user to actually USE your code.
s.add_dependency('builder')
- s.add_dependency('excon', '>=0.4.0')
- s.add_dependency('formatador', '>=0.0.16')
- s.add_dependency('json')
+ s.add_dependency('excon', '~>0.7.4')
+ s.add_dependency('formatador', '~>0.2.0')
+ s.add_dependency('multi_json', '~>1.0.3')
s.add_dependency('mime-types')
- s.add_dependency('net-ssh', '>=2.0.23')
- s.add_dependency('nokogiri', '>=1.4.4')
+ s.add_dependency('net-scp', '~>1.0.4')
+ s.add_dependency('net-ssh', '>=2.1.3')
+ s.add_dependency('nokogiri', '~>1.5.0')
s.add_dependency('ruby-hmac')
## List your development dependencies here. Development dependencies are
## those that are only needed during development
+ s.add_development_dependency('jekyll')
s.add_development_dependency('rake')
- s.add_development_dependency('rspec', '1.3.1')
- s.add_development_dependency('shindo', '0.1.12')
+ s.add_development_dependency('rbvmomi')
+ s.add_development_dependency('rdoc')
+ s.add_development_dependency('rspec', '~>1.3.1')
+ s.add_development_dependency('shindo', '~>0.3.4')
+ s.add_development_dependency('virtualbox', '~>0.9.1')
+# s.add_development_dependency('ruby-libvirt','~>0.4.0')
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {spec,tests}/*`.split("\n")
View
3 lib/fog.rb
@@ -3,15 +3,14 @@
module Fog
unless const_defined?(:VERSION)
- VERSION = '0.4.0'
+ VERSION = '1.1.1'
end
end
# FIXME: these should go away (force usage of Fog::[Compute, CDN, DNS, Storage] etc)
require 'fog/providers'
require 'fog/terremark'
-require 'fog/vcloud'
require 'fog/compute'
require 'fog/cdn'
View
103 lib/fog/aws/elb.rb
@@ -1,25 +1,81 @@
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 'aws'))
+
module Fog
module AWS
class ELB < Fog::Service
+ class IdentifierTaken < Fog::Errors::Error; end
+ class InvalidInstance < Fog::Errors::Error; end
+ class Throttled < Fog::Errors::Error; end
+
requires :aws_access_key_id, :aws_secret_access_key
recognizes :region, :host, :path, :port, :scheme, :persistent
request_path 'fog/aws/requests/elb'
+ request :configure_health_check
+ request :create_app_cookie_stickiness_policy
+ request :create_lb_cookie_stickiness_policy
request :create_load_balancer
+ request :create_load_balancer_listeners
request :delete_load_balancer
+ request :delete_load_balancer_listeners
+ request :delete_load_balancer_policy
request :deregister_instances_from_load_balancer
request :describe_instance_health
request :describe_load_balancers
request :disable_availability_zones_for_load_balancer
request :enable_availability_zones_for_load_balancer
request :register_instances_with_load_balancer
+ request :set_load_balancer_listener_ssl_certificate
+ request :set_load_balancer_policies_of_listener
+
+ model_path 'fog/aws/models/elb'
+ model :load_balancer
+ collection :load_balancers
+ model :policy
+ collection :policies
+ model :listener
+ collection :listeners
class Mock
+ def self.data
+ @data ||= Hash.new do |hash, region|
+ owner_id = Fog::AWS::Mock.owner_id
+ hash[region] = Hash.new do |region_hash, key|
+ region_hash[key] = {
+ :owner_id => owner_id,
+ :load_balancers => {}
+ }
+ end
+ end
+ end
+
+ def self.dns_name(name, region)
+ "#{name}-#{Fog::Mock.random_hex(8)}.#{region}.elb.amazonaws.com"
+ end
+
+ def self.reset
+ @data = nil
+ end
+
def initialize(options={})
+ @aws_access_key_id = options[:aws_access_key_id]
+
+ @region = options[:region] || 'us-east-1'
+
+ unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region)
+ raise ArgumentError, "Unknown region: #{@region.inspect}"
+ end
+ end
+
+ def data
+ self.class.data[@region][@aws_access_key_id]
end
+ def reset_data
+ self.class.data[@region].delete(@aws_access_key_id)
+ end
end
class Real
@@ -38,16 +94,22 @@ class Real
#
# ==== Parameters
# * options<~Hash> - config arguments for connection. Defaults to {}.
- # * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1'i, 'ap-southeast-1']
+ # * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-northeast-1', 'ap-southeast-1']
#
# ==== Returns
# * ELB object with connection to AWS.
def initialize(options={})
+ require 'fog/core/parser'
+
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
+ @connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
+
options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region]
+ when 'ap-northeast-1'
+ 'elasticloadbalancing.ap-northeast-1.amazonaws.com'
when 'ap-southeast-1'
'elasticloadbalancing.ap-southeast-1.amazonaws.com'
when 'eu-west-1'
@@ -56,13 +118,16 @@ def initialize(options={})
'elasticloadbalancing.us-east-1.amazonaws.com'
when 'us-west-1'
'elasticloadbalancing.us-west-1.amazonaws.com'
+ when 'us-west-2'
+ 'elasticloadbalancing.us-west-2.amazonaws.com'
else
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end
- @path = options[:path] || '/'
- @port = options[:port] || 443
- @scheme = options[:scheme] || 'https'
- @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent])
+ @path = options[:path] || '/'
+ @persistent = options[:persistent] || false
+ @port = options[:port] || 443
+ @scheme = options[:scheme] || 'https'
+ @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end
def reload
@@ -75,16 +140,16 @@ def request(params)
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
- body = AWS.signed_params(
+ body = Fog::AWS.signed_params(
params,
{
:aws_access_key_id => @aws_access_key_id,
:hmac => @hmac,
:host => @host,
:path => @path,
:port => @port,
- :version => '2009-11-25'
- }
+ :version => '2011-04-05'
+ }
)
response = @connection.request({
@@ -96,10 +161,26 @@ def request(params)
:method => 'POST',
:parser => parser
})
-
- response
+ rescue Excon::Errors::HTTPStatusError => error
+ if match = error.message.match(/<Code>(.*)<\/Code>(?:.*<Message>(.*)<\/Message>)?/m)
+ case match[1]
+ when 'CertificateNotFound'
+ raise Fog::AWS::IAM::NotFound.slurp(error, match[2])
+ when 'LoadBalancerNotFound'
+ raise Fog::AWS::ELB::NotFound.slurp(error, match[2])
+ when 'DuplicateLoadBalancerName'
+ raise Fog::AWS::ELB::IdentifierTaken.slurp(error, match[2])
+ when 'InvalidInstance'
+ raise Fog::AWS::ELB::InvalidInstance.slurp(error, match[2])
+ when 'Throttling'
+ raise Fog::AWS::ELB::Throttled.slurp(error, match[2])
+ else
+ raise
+ end
+ else
+ raise
+ end
end
-
end
end
end
View
114 lib/fog/aws/iam.rb
@@ -1,36 +1,90 @@
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 'aws'))
+
module Fog
module AWS
class IAM < Fog::Service
+ class EntityAlreadyExists < Fog::AWS::IAM::Error; end
+ class KeyPairMismatch < Fog::AWS::IAM::Error; end
+ class LimitExceeded < Fog::AWS::IAM::Error; end
+ class MalformedCertificate < Fog::AWS::IAM::Error; end
+ class ValidationError < Fog::AWS::IAM::Error; end
+
requires :aws_access_key_id, :aws_secret_access_key
recognizes :host, :path, :port, :scheme, :persistent
request_path 'fog/aws/requests/iam'
request :add_user_to_group
request :create_access_key
+ request :create_account_alias
request :create_group
+ request :create_login_profile
request :create_user
request :delete_access_key
+ request :delete_account_alias
request :delete_group
request :delete_group_policy
+ request :delete_login_profile
+ request :delete_server_certificate
+ request :delete_signing_certificate
request :delete_user
request :delete_user_policy
+ request :get_group
+ request :get_group_policy
+ request :get_login_profile
+ request :get_server_certificate
request :get_user
+ request :get_user_policy
request :list_access_keys
- request :list_groups
+ request :list_account_aliases
request :list_group_policies
+ request :list_groups
+ request :list_groups_for_user
+ request :list_server_certificates
+ request :list_signing_certificates
request :list_user_policies
request :list_users
request :put_group_policy
request :put_user_policy
request :remove_user_from_group
request :update_access_key
+ request :update_group
+ request :update_login_profile
+ request :update_server_certificate
+ request :update_signing_certificate
+ request :update_user
+ request :upload_server_certificate
+ request :upload_signing_certificate
class Mock
+ def self.data
+ @data ||= Hash.new do |hash, key|
+ hash[key] = {
+ :owner_id => Fog::AWS::Mock.owner_id,
+ :server_certificates => {}
+ }
+ end
+ end
+
+ def self.reset
+ @data = nil
+ end
+
+ def self.server_certificate_id
+ Fog::Mock.random_hex(16)
+ end
def initialize(options={})
+ @aws_access_key_id = options[:aws_access_key_id]
+ end
+
+ def data
+ self.class.data[@aws_access_key_id]
end
+ def reset_data
+ self.class.data.delete(@aws_access_key_id)
+ end
end
class Real
@@ -53,15 +107,19 @@ class Real
# ==== Returns
# * IAM object with connection to AWS.
def initialize(options={})
- require 'json'
+ require 'fog/core/parser'
+ require 'multi_json'
+
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
+ @connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
- @host = options[:host] || 'iam.amazonaws.com'
- @path = options[:path] || '/'
- @port = options[:port] || 443
- @scheme = options[:scheme] || 'https'
- @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent])
+ @host = options[:host] || 'iam.amazonaws.com'
+ @path = options[:path] || '/'
+ @persistent = options[:persistent] || false
+ @port = options[:port] || 443
+ @scheme = options[:scheme] || 'https'
+ @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end
def reload
@@ -74,7 +132,7 @@ def request(params)
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
- body = AWS.signed_params(
+ body = Fog::AWS.signed_params(
params,
{
:aws_access_key_id => @aws_access_key_id,
@@ -86,17 +144,35 @@ def request(params)
}
)
- response = @connection.request({
- :body => body,
- :expects => 200,
- :idempotent => idempotent,
- :headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
- :host => @host,
- :method => 'POST',
- :parser => parser
- })
-
- response
+ begin
+ response = @connection.request({
+ :body => body,
+ :expects => 200,
+ :idempotent => idempotent,
+ :headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
+ :host => @host,
+ :method => 'POST',
+ :parser => parser
+ })
+
+ response
+ rescue Excon::Errors::HTTPStatusError => error
+ if match = error.message.match(/<Code>(.*)<\/Code>(?:.*<Message>(.*)<\/Message>)?/m)
+ case match[1]
+ when 'CertificateNotFound', 'NoSuchEntity'
+ raise Fog::AWS::IAM::NotFound.slurp(error, match[2])
+ when 'EntityAlreadyExists', 'KeyPairMismatch', 'LimitExceeded', 'MalformedCertificate', 'ValidationError'
+ raise Fog::AWS::IAM.const_get(match[1]).slurp(error, match[2])
+ else
+ raise Fog::AWS::IAM::Error.slurp(error, "#{match[1]} => #{match[2]}") if match[1]
+ raise
+ end
+ else
+ raise
+ end
+ end
+
+
end
end
View
4 lib/fog/aws/parsers/elb/create_load_balancer.rb
@@ -12,9 +12,9 @@ def reset
def end_element(name)
case name
when 'DNSName'
- @response['CreateLoadBalancerResult'][name] = @value
+ @response['CreateLoadBalancerResult'][name] = value
when 'RequestId'
- @response['ResponseMetadata'][name] = @value
+ @response['ResponseMetadata'][name] = value
end
end
View
2 lib/fog/aws/parsers/elb/delete_load_balancer.rb
@@ -12,7 +12,7 @@ def reset
def end_element(name)
case name
when 'RequestId'
- @response['ResponseMetadata'][name] = @value
+ @response['ResponseMetadata'][name] = value
end
end
View
4 lib/fog/aws/parsers/elb/deregister_instances_from_load_balancer.rb
@@ -12,9 +12,9 @@ def reset
def end_element(name)
case name
when 'InstanceId'
- @response['DeregisterInstancesFromLoadBalancerResult']['Instances'] << {name => @value}
+ @response['DeregisterInstancesFromLoadBalancerResult']['Instances'] << {name => value}
when 'RequestId'
- @response['ResponseMetadata'][name] = @value
+ @response['ResponseMetadata'][name] = value
end
end
View
4 lib/fog/aws/parsers/elb/describe_instance_health.rb
@@ -13,12 +13,12 @@ def reset
def end_element(name)
case name
when 'Description', 'State', 'InstanceId', 'ReasonCode'
- @instance_state[name] = @value
+ @instance_state[name] = value
when 'member'
@response['DescribeInstanceHealthResult']['InstanceStates'] << @instance_state
@instance_state = {}
when 'RequestId'
- @response['ResponseMetadata'][name] = @value
+ @response['ResponseMetadata'][name] = value
end
end
View
59 lib/fog/aws/parsers/elb/describe_load_balancers.rb
@@ -6,12 +6,25 @@ module ELB
class DescribeLoadBalancers < Fog::Parsers::Base
def reset
- @load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {} }
- @listener_description = { 'PolicyNames' => [], 'Listener' => {} }
+ reset_load_balancer
+ reset_listener_description
+ reset_policy
@results = { 'LoadBalancerDescriptions' => [] }
@response = { 'DescribeLoadBalancersResult' => {}, 'ResponseMetadata' => {} }
end
+ def reset_load_balancer
+ @load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {}, 'SourceSecurityGroup' => {} }
+ end
+
+ def reset_listener_description
+ @listener_description = { 'PolicyNames' => [], 'Listener' => {} }
+ end
+
+ def reset_policy
+ @policy = {}
+ end
+
def start_element(name, attrs = [])
super
case name
@@ -36,39 +49,41 @@ def end_element(name)
case name
when 'member'
if @in_policy_names
- @listener_description['PolicyNames'] << @value
+ @listener_description['PolicyNames'] << value
elsif @in_availability_zones
- @load_balancer['AvailabilityZones'] << @value
+ @load_balancer['AvailabilityZones'] << value
elsif @in_listeners
@load_balancer['ListenerDescriptions'] << @listener_description
- @listener_description = { 'PolicyNames' => [], 'Listener' => {} }
+ reset_listener_description
elsif @in_app_cookies
- @load_balancer['Policies']['AppCookieStickinessPolicies'] << @value
+ @load_balancer['Policies']['AppCookieStickinessPolicies'] << @policy
+ reset_policy
elsif @in_lb_cookies
- @load_balancer['Policies']['LBCookieStickinessPolicies'] << @value
+ @load_balancer['Policies']['LBCookieStickinessPolicies'] << @policy
+ reset_policy
elsif !@in_instances && !@in_policies
@results['LoadBalancerDescriptions'] << @load_balancer
- @load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {} }
+ reset_load_balancer
end
- when 'LoadBalancerName', 'DNSName'
- @load_balancer[name] = @value
+ when 'CanonicalHostedZoneName', 'CanonicalHostedZoneNameID', 'LoadBalancerName', 'DNSName'
+ @load_balancer[name] = value
when 'CreatedTime'
- @load_balancer[name] = Time.parse(@value)
+ @load_balancer[name] = Time.parse(value)
when 'ListenerDescriptions'
@in_listeners = false
when 'PolicyNames'
@in_policy_names = false
- when 'Protocol'
- @listener_description['Listener'][name] = @value
+ when 'Protocol', 'SSLCertificateId'
+ @listener_description['Listener'][name] = value
when 'LoadBalancerPort', 'InstancePort'
- @listener_description['Listener'][name] = @value.to_i
+ @listener_description['Listener'][name] = value.to_i
when 'Instances'
@in_instances = false
when 'InstanceId'
- @load_balancer['Instances'] << @value
+ @load_balancer['Instances'] << value
when 'AvailabilityZones'
@in_availability_zones = false
@@ -80,13 +95,21 @@ def end_element(name)
when 'LBCookieStickinessPolicies'
@in_lb_cookies = false
+ when 'OwnerAlias', 'GroupName'
+ @load_balancer['SourceSecurityGroup'][name] = value
+
when 'Interval', 'HealthyThreshold', 'Timeout', 'UnhealthyThreshold'
- @load_balancer['HealthCheck'][name] = @value.to_i
+ @load_balancer['HealthCheck'][name] = value.to_i
when 'Target'
- @load_balancer['HealthCheck'][name] = @value
+ @load_balancer['HealthCheck'][name] = value
+
+ when 'PolicyName', 'CookieName'
+ @policy[name] = value
+ when 'CookieExpirationPeriod'
+ @policy[name] = value.to_i
when 'RequestId'
- @response['ResponseMetadata'][name] = @value
+ @response['ResponseMetadata'][name] = value
when 'DescribeLoadBalancersResponse'
@response['DescribeLoadBalancersResult'] = @results
View
4 lib/fog/aws/parsers/elb/disable_availability_zones_for_load_balancer.rb
@@ -12,9 +12,9 @@ def reset
def end_element(name)
case name
when 'member'
- @response['DisableAvailabilityZonesForLoadBalancerResult']['AvailabilityZones'] << @value
+ @response['DisableAvailabilityZonesForLoadBalancerResult']['AvailabilityZones'] << value
when 'RequestId'
- @response['ResponseMetadata'][name] = @value
+ @response['ResponseMetadata'][name] = value
end
end
View
4 lib/fog/aws/parsers/elb/enable_availability_zones_for_load_balancer.rb
@@ -12,9 +12,9 @@ def reset
def end_element(name)
case name
when 'member'
- @response['EnableAvailabilityZonesForLoadBalancerResult']['AvailabilityZones'] << @value
+ @response['EnableAvailabilityZonesForLoadBalancerResult']['AvailabilityZones'] << value
when 'RequestId'
- @response['ResponseMetadata'][name] = @value
+ @response['ResponseMetadata'][name] = value
end
end
View
4 lib/fog/aws/parsers/elb/register_instances_with_load_balancer.rb
@@ -12,9 +12,9 @@ def reset
def end_element(name)
case name
when 'InstanceId'
- @response['RegisterInstancesWithLoadBalancerResult']['Instances'] << {name => @value}
+ @response['RegisterInstancesWithLoadBalancerResult']['Instances'] << {name => value}
when 'RequestId'
- @response['ResponseMetadata'][name] = @value
+ @response['ResponseMetadata'][name] = value
end
end
View
2 lib/fog/aws/parsers/iam/basic.rb
@@ -8,7 +8,7 @@ class Basic < Fog::Parsers::Base
def end_element(name)
case name
when 'RequestId'
- @response[name] = @value
+ @response[name] = value
end
end
View
4 lib/fog/aws/parsers/iam/create_access_key.rb
@@ -12,9 +12,9 @@ def reset
def end_element(name)
case name
when 'AccessKeyId', 'UserName', 'SecretAccessKey', 'Status'
- @response['AccessKey'][name] = @value
+ @response['AccessKey'][name] = value
when 'RequestId'
- @response[name] = @value
+ @response[name] = value
end
end
View
4 lib/fog/aws/parsers/iam/create_group.rb
@@ -12,9 +12,9 @@ def reset
def end_element(name)
case name
when 'Arn', 'GroupId', 'GroupName', 'Path'
- @response['Group'][name] = @value
+ @response['Group'][name] = value
when 'RequestId'
- @response[name] = @value
+ @response[name] = value
end
end
View
4 lib/fog/aws/parsers/iam/create_user.rb
@@ -12,9 +12,9 @@ def reset
def end_element(name)
case name
when 'Arn', 'UserId', 'UserName', 'Path'
- @response['User'][name] = @value
+ @response['User'][name] = value
when 'RequestId'
- @response[name] = @value
+ @response[name] = value
end
end
View
4 lib/fog/aws/parsers/iam/get_user.rb
@@ -13,9 +13,9 @@ def reset
def end_element(name)
case name
when 'Arn', 'UserId', 'UserName', 'Path'
- @response['User'][name] = @value
+ @response['User'][name] = value
when 'RequestId'
- @response[name] = @value
+ @response[name] = value
end
end
View
6 lib/fog/aws/parsers/iam/list_access_keys.rb
@@ -13,14 +13,14 @@ def reset
def end_element(name)
case name
when 'AccessKeyId', 'Status', 'Username'
- @access_key[name] = @value
+ @access_key[name] = value
when 'member'
@response['AccessKeys'] << @access_key
@access_key = {}
when 'IsTruncated'
- response[name] = (@value == 'true')
+ response[name] = (value == 'true')
when 'Marker', 'RequestId'
- response[name] = @value
+ response[name] = value
end
end
View
6 lib/fog/aws/parsers/iam/list_groups.rb
@@ -13,14 +13,14 @@ def reset
def end_element(name)