phpfog-fog 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (888) hide show
  1. data/.document +3 -0
  2. data/.gitignore +11 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +45 -0
  5. data/README.rdoc +176 -0
  6. data/Rakefile +132 -0
  7. data/benchs/fog_vs.rb +106 -0
  8. data/benchs/params.rb +43 -0
  9. data/benchs/parse_vs_push.rb +60 -0
  10. data/bin/fog +46 -0
  11. data/examples/dns_tests.rb +76 -0
  12. data/examples/storage_tests.rb +103 -0
  13. data/fog.gemspec +62 -0
  14. data/lib/fog/aws/elb.rb +106 -0
  15. data/lib/fog/aws/iam.rb +105 -0
  16. data/lib/fog/aws/parsers/elb/create_load_balancer.rb +26 -0
  17. data/lib/fog/aws/parsers/elb/delete_load_balancer.rb +24 -0
  18. data/lib/fog/aws/parsers/elb/deregister_instances_from_load_balancer.rb +26 -0
  19. data/lib/fog/aws/parsers/elb/describe_instance_health.rb +30 -0
  20. data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +101 -0
  21. data/lib/fog/aws/parsers/elb/disable_availability_zones_for_load_balancer.rb +26 -0
  22. data/lib/fog/aws/parsers/elb/enable_availability_zones_for_load_balancer.rb +26 -0
  23. data/lib/fog/aws/parsers/elb/register_instances_with_load_balancer.rb +26 -0
  24. data/lib/fog/aws/parsers/iam/basic.rb +19 -0
  25. data/lib/fog/aws/parsers/iam/create_access_key.rb +26 -0
  26. data/lib/fog/aws/parsers/iam/create_group.rb +26 -0
  27. data/lib/fog/aws/parsers/iam/create_user.rb +26 -0
  28. data/lib/fog/aws/parsers/iam/get_user.rb +27 -0
  29. data/lib/fog/aws/parsers/iam/list_access_keys.rb +32 -0
  30. data/lib/fog/aws/parsers/iam/list_groups.rb +32 -0
  31. data/lib/fog/aws/parsers/iam/list_policies.rb +28 -0
  32. data/lib/fog/aws/parsers/iam/list_users.rb +32 -0
  33. data/lib/fog/aws/parsers/ses/delete_verified_email_address.rb +24 -0
  34. data/lib/fog/aws/parsers/ses/get_send_quota.rb +26 -0
  35. data/lib/fog/aws/parsers/ses/get_send_statistics.rb +29 -0
  36. data/lib/fog/aws/parsers/ses/list_verified_email_addresses.rb +25 -0
  37. data/lib/fog/aws/parsers/ses/send_email.rb +26 -0
  38. data/lib/fog/aws/parsers/ses/send_raw_email.rb +26 -0
  39. data/lib/fog/aws/parsers/ses/verify_email_address.rb +24 -0
  40. data/lib/fog/aws/parsers/simpledb/basic.rb +31 -0
  41. data/lib/fog/aws/parsers/simpledb/domain_metadata.rb +32 -0
  42. data/lib/fog/aws/parsers/simpledb/get_attributes.rb +36 -0
  43. data/lib/fog/aws/parsers/simpledb/list_domains.rb +30 -0
  44. data/lib/fog/aws/parsers/simpledb/select.rb +41 -0
  45. data/lib/fog/aws/requests/elb/create_load_balancer.rb +59 -0
  46. data/lib/fog/aws/requests/elb/delete_load_balancer.rb +42 -0
  47. data/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +47 -0
  48. data/lib/fog/aws/requests/elb/describe_instance_health.rb +46 -0
  49. data/lib/fog/aws/requests/elb/describe_load_balancers.rb +59 -0
  50. data/lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb +46 -0
  51. data/lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb +46 -0
  52. data/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +47 -0
  53. data/lib/fog/aws/requests/iam/add_user_to_group.rb +42 -0
  54. data/lib/fog/aws/requests/iam/create_access_key.rb +45 -0
  55. data/lib/fog/aws/requests/iam/create_group.rb +47 -0
  56. data/lib/fog/aws/requests/iam/create_user.rb +47 -0
  57. data/lib/fog/aws/requests/iam/delete_access_key.rb +42 -0
  58. data/lib/fog/aws/requests/iam/delete_group.rb +40 -0
  59. data/lib/fog/aws/requests/iam/delete_group_policy.rb +42 -0
  60. data/lib/fog/aws/requests/iam/delete_user.rb +40 -0
  61. data/lib/fog/aws/requests/iam/delete_user_policy.rb +42 -0
  62. data/lib/fog/aws/requests/iam/get_user.rb +44 -0
  63. data/lib/fog/aws/requests/iam/list_access_keys.rb +48 -0
  64. data/lib/fog/aws/requests/iam/list_group_policies.rb +47 -0
  65. data/lib/fog/aws/requests/iam/list_groups.rb +50 -0
  66. data/lib/fog/aws/requests/iam/list_user_policies.rb +47 -0
  67. data/lib/fog/aws/requests/iam/list_users.rb +50 -0
  68. data/lib/fog/aws/requests/iam/put_group_policy.rb +44 -0
  69. data/lib/fog/aws/requests/iam/put_user_policy.rb +44 -0
  70. data/lib/fog/aws/requests/iam/remove_user_from_group.rb +42 -0
  71. data/lib/fog/aws/requests/iam/update_access_key.rb +44 -0
  72. data/lib/fog/aws/requests/ses/delete_verified_email_address.rb +38 -0
  73. data/lib/fog/aws/requests/ses/get_send_quota.rb +40 -0
  74. data/lib/fog/aws/requests/ses/get_send_statistics.rb +43 -0
  75. data/lib/fog/aws/requests/ses/list_verified_email_addresses.rb +38 -0
  76. data/lib/fog/aws/requests/ses/send_email.rb +58 -0
  77. data/lib/fog/aws/requests/ses/send_raw_email.rb +44 -0
  78. data/lib/fog/aws/requests/ses/verify_email_address.rb +38 -0
  79. data/lib/fog/aws/requests/simpledb/batch_put_attributes.rb +64 -0
  80. data/lib/fog/aws/requests/simpledb/create_domain.rb +44 -0
  81. data/lib/fog/aws/requests/simpledb/delete_attributes.rb +63 -0
  82. data/lib/fog/aws/requests/simpledb/delete_domain.rb +45 -0
  83. data/lib/fog/aws/requests/simpledb/domain_metadata.rb +76 -0
  84. data/lib/fog/aws/requests/simpledb/get_attributes.rb +72 -0
  85. data/lib/fog/aws/requests/simpledb/list_domains.rb +59 -0
  86. data/lib/fog/aws/requests/simpledb/put_attributes.rb +78 -0
  87. data/lib/fog/aws/requests/simpledb/select.rb +43 -0
  88. data/lib/fog/aws/ses.rb +99 -0
  89. data/lib/fog/aws/simpledb.rb +172 -0
  90. data/lib/fog/bin/aws.rb +71 -0
  91. data/lib/fog/bin/bluebox.rb +36 -0
  92. data/lib/fog/bin/brightbox.rb +34 -0
  93. data/lib/fog/bin/go_grid.rb +36 -0
  94. data/lib/fog/bin/google.rb +30 -0
  95. data/lib/fog/bin/linode.rb +40 -0
  96. data/lib/fog/bin/local.rb +36 -0
  97. data/lib/fog/bin/new_servers.rb +36 -0
  98. data/lib/fog/bin/rackspace.rb +52 -0
  99. data/lib/fog/bin/slicehost.rb +40 -0
  100. data/lib/fog/bin/terremark.rb +36 -0
  101. data/lib/fog/bin/terremark_ecloud.rb +28 -0
  102. data/lib/fog/bin/vcloud.rb +59 -0
  103. data/lib/fog/bin/zerigo.rb +30 -0
  104. data/lib/fog/bin.rb +89 -0
  105. data/lib/fog/cdn/aws.rb +115 -0
  106. data/lib/fog/cdn/parsers/aws/distribution.rb +59 -0
  107. data/lib/fog/cdn/parsers/aws/get_distribution_list.rb +61 -0
  108. data/lib/fog/cdn/parsers/aws/post_invalidation.rb +28 -0
  109. data/lib/fog/cdn/rackspace.rb +97 -0
  110. data/lib/fog/cdn/requests/aws/delete_distribution.rb +36 -0
  111. data/lib/fog/cdn/requests/aws/get_distribution.rb +65 -0
  112. data/lib/fog/cdn/requests/aws/get_distribution_list.rb +67 -0
  113. data/lib/fog/cdn/requests/aws/post_distribution.rb +99 -0
  114. data/lib/fog/cdn/requests/aws/post_invalidation.rb +59 -0
  115. data/lib/fog/cdn/requests/aws/put_distribution_config.rb +102 -0
  116. data/lib/fog/cdn/requests/rackspace/get_containers.rb +39 -0
  117. data/lib/fog/cdn/requests/rackspace/head_container.rb +41 -0
  118. data/lib/fog/cdn/requests/rackspace/put_container.rb +38 -0
  119. data/lib/fog/cdn.rb +19 -0
  120. data/lib/fog/compute/aws.rb +273 -0
  121. data/lib/fog/compute/bluebox.rb +104 -0
  122. data/lib/fog/compute/brightbox.rb +159 -0
  123. data/lib/fog/compute/go_grid.rb +118 -0
  124. data/lib/fog/compute/linode.rb +100 -0
  125. data/lib/fog/compute/models/aws/address.rb +69 -0
  126. data/lib/fog/compute/models/aws/addresses.rb +100 -0
  127. data/lib/fog/compute/models/aws/flavor.rb +21 -0
  128. data/lib/fog/compute/models/aws/flavors.rb +166 -0
  129. data/lib/fog/compute/models/aws/image.rb +43 -0
  130. data/lib/fog/compute/models/aws/images.rb +62 -0
  131. data/lib/fog/compute/models/aws/key_pair.rb +44 -0
  132. data/lib/fog/compute/models/aws/key_pairs.rb +88 -0
  133. data/lib/fog/compute/models/aws/security_group.rb +205 -0
  134. data/lib/fog/compute/models/aws/security_groups.rb +95 -0
  135. data/lib/fog/compute/models/aws/server.rb +212 -0
  136. data/lib/fog/compute/models/aws/servers.rb +158 -0
  137. data/lib/fog/compute/models/aws/snapshot.rb +58 -0
  138. data/lib/fog/compute/models/aws/snapshots.rb +52 -0
  139. data/lib/fog/compute/models/aws/tag.rb +36 -0
  140. data/lib/fog/compute/models/aws/tags.rb +34 -0
  141. data/lib/fog/compute/models/aws/volume.rb +109 -0
  142. data/lib/fog/compute/models/aws/volumes.rb +121 -0
  143. data/lib/fog/compute/models/bluebox/flavor.rb +45 -0
  144. data/lib/fog/compute/models/bluebox/flavors.rb +28 -0
  145. data/lib/fog/compute/models/bluebox/image.rb +19 -0
  146. data/lib/fog/compute/models/bluebox/images.rb +28 -0
  147. data/lib/fog/compute/models/bluebox/server.rb +126 -0
  148. data/lib/fog/compute/models/bluebox/servers.rb +36 -0
  149. data/lib/fog/compute/models/brightbox/account.rb +51 -0
  150. data/lib/fog/compute/models/brightbox/cloud_ip.rb +47 -0
  151. data/lib/fog/compute/models/brightbox/cloud_ips.rb +34 -0
  152. data/lib/fog/compute/models/brightbox/flavor.rb +33 -0
  153. data/lib/fog/compute/models/brightbox/flavors.rb +28 -0
  154. data/lib/fog/compute/models/brightbox/image.rb +56 -0
  155. data/lib/fog/compute/models/brightbox/images.rb +28 -0
  156. data/lib/fog/compute/models/brightbox/load_balancer.rb +50 -0
  157. data/lib/fog/compute/models/brightbox/load_balancers.rb +28 -0
  158. data/lib/fog/compute/models/brightbox/server.rb +94 -0
  159. data/lib/fog/compute/models/brightbox/servers.rb +29 -0
  160. data/lib/fog/compute/models/brightbox/user.rb +39 -0
  161. data/lib/fog/compute/models/brightbox/users.rb +29 -0
  162. data/lib/fog/compute/models/brightbox/zone.rb +21 -0
  163. data/lib/fog/compute/models/brightbox/zones.rb +29 -0
  164. data/lib/fog/compute/models/go_grid/image.rb +60 -0
  165. data/lib/fog/compute/models/go_grid/images.rb +33 -0
  166. data/lib/fog/compute/models/go_grid/server.rb +56 -0
  167. data/lib/fog/compute/models/go_grid/servers.rb +35 -0
  168. data/lib/fog/compute/models/rackspace/flavor.rb +43 -0
  169. data/lib/fog/compute/models/rackspace/flavors.rb +28 -0
  170. data/lib/fog/compute/models/rackspace/image.rb +48 -0
  171. data/lib/fog/compute/models/rackspace/images.rb +33 -0
  172. data/lib/fog/compute/models/rackspace/server.rb +129 -0
  173. data/lib/fog/compute/models/rackspace/servers.rb +36 -0
  174. data/lib/fog/compute/models/slicehost/flavor.rb +45 -0
  175. data/lib/fog/compute/models/slicehost/flavors.rb +28 -0
  176. data/lib/fog/compute/models/slicehost/image.rb +17 -0
  177. data/lib/fog/compute/models/slicehost/images.rb +27 -0
  178. data/lib/fog/compute/models/slicehost/server.rb +112 -0
  179. data/lib/fog/compute/models/slicehost/servers.rb +38 -0
  180. data/lib/fog/compute/new_servers.rb +103 -0
  181. data/lib/fog/compute/parsers/aws/allocate_address.rb +19 -0
  182. data/lib/fog/compute/parsers/aws/attach_volume.rb +22 -0
  183. data/lib/fog/compute/parsers/aws/basic.rb +25 -0
  184. data/lib/fog/compute/parsers/aws/create_image.rb +20 -0
  185. data/lib/fog/compute/parsers/aws/create_key_pair.rb +20 -0
  186. data/lib/fog/compute/parsers/aws/create_snapshot.rb +26 -0
  187. data/lib/fog/compute/parsers/aws/create_volume.rb +24 -0
  188. data/lib/fog/compute/parsers/aws/deregister_image.rb +20 -0
  189. data/lib/fog/compute/parsers/aws/describe_addresses.rb +30 -0
  190. data/lib/fog/compute/parsers/aws/describe_availability_zones.rb +32 -0
  191. data/lib/fog/compute/parsers/aws/describe_images.rb +72 -0
  192. data/lib/fog/compute/parsers/aws/describe_instances.rb +119 -0
  193. data/lib/fog/compute/parsers/aws/describe_key_pairs.rb +30 -0
  194. data/lib/fog/compute/parsers/aws/describe_regions.rb +30 -0
  195. data/lib/fog/compute/parsers/aws/describe_reserved_instances.rb +36 -0
  196. data/lib/fog/compute/parsers/aws/describe_security_groups.rb +76 -0
  197. data/lib/fog/compute/parsers/aws/describe_snapshots.rb +54 -0
  198. data/lib/fog/compute/parsers/aws/describe_tags.rb +30 -0
  199. data/lib/fog/compute/parsers/aws/describe_volumes.rb +73 -0
  200. data/lib/fog/compute/parsers/aws/detach_volume.rb +22 -0
  201. data/lib/fog/compute/parsers/aws/get_console_output.rb +32 -0
  202. data/lib/fog/compute/parsers/aws/import_key_pair.rb +20 -0
  203. data/lib/fog/compute/parsers/aws/register_image.rb +20 -0
  204. data/lib/fog/compute/parsers/aws/run_instances.rb +89 -0
  205. data/lib/fog/compute/parsers/aws/start_stop_instances.rb +41 -0
  206. data/lib/fog/compute/parsers/aws/terminate_instances.rb +55 -0
  207. data/lib/fog/compute/parsers/slicehost/create_slice.rb +31 -0
  208. data/lib/fog/compute/parsers/slicehost/get_backups.rb +32 -0
  209. data/lib/fog/compute/parsers/slicehost/get_flavor.rb +26 -0
  210. data/lib/fog/compute/parsers/slicehost/get_flavors.rb +30 -0
  211. data/lib/fog/compute/parsers/slicehost/get_image.rb +26 -0
  212. data/lib/fog/compute/parsers/slicehost/get_images.rb +30 -0
  213. data/lib/fog/compute/parsers/slicehost/get_slice.rb +31 -0
  214. data/lib/fog/compute/parsers/slicehost/get_slices.rb +35 -0
  215. data/lib/fog/compute/parsers/terremark_ecloud/get_catalog.rb +36 -0
  216. data/lib/fog/compute/parsers/terremark_ecloud/get_catalog_item.rb +43 -0
  217. data/lib/fog/compute/parsers/terremark_ecloud/get_ip_addresses.rb +27 -0
  218. data/lib/fog/compute/parsers/terremark_ecloud/get_network.rb +59 -0
  219. data/lib/fog/compute/parsers/terremark_ecloud/get_organization.rb +35 -0
  220. data/lib/fog/compute/parsers/terremark_ecloud/get_vdc.rb +110 -0
  221. data/lib/fog/compute/parsers/terremark_ecloud/get_versions.rb +28 -0
  222. data/lib/fog/compute/parsers/terremark_ecloud/login.rb +27 -0
  223. data/lib/fog/compute/rackspace.rb +144 -0
  224. data/lib/fog/compute/requests/aws/allocate_address.rb +51 -0
  225. data/lib/fog/compute/requests/aws/associate_address.rb +57 -0
  226. data/lib/fog/compute/requests/aws/attach_volume.rb +81 -0
  227. data/lib/fog/compute/requests/aws/authorize_security_group_ingress.rb +86 -0
  228. data/lib/fog/compute/requests/aws/create_image.rb +64 -0
  229. data/lib/fog/compute/requests/aws/create_key_pair.rb +54 -0
  230. data/lib/fog/compute/requests/aws/create_security_group.rb +53 -0
  231. data/lib/fog/compute/requests/aws/create_snapshot.rb +71 -0
  232. data/lib/fog/compute/requests/aws/create_tags.rb +78 -0
  233. data/lib/fog/compute/requests/aws/create_volume.rb +74 -0
  234. data/lib/fog/compute/requests/aws/delete_key_pair.rb +43 -0
  235. data/lib/fog/compute/requests/aws/delete_security_group.rb +45 -0
  236. data/lib/fog/compute/requests/aws/delete_snapshot.rb +46 -0
  237. data/lib/fog/compute/requests/aws/delete_tags.rb +45 -0
  238. data/lib/fog/compute/requests/aws/delete_volume.rb +52 -0
  239. data/lib/fog/compute/requests/aws/deregister_image.rb +51 -0
  240. data/lib/fog/compute/requests/aws/describe_addresses.rb +64 -0
  241. data/lib/fog/compute/requests/aws/describe_availability_zones.rb +70 -0
  242. data/lib/fog/compute/requests/aws/describe_images.rb +112 -0
  243. data/lib/fog/compute/requests/aws/describe_instances.rb +201 -0
  244. data/lib/fog/compute/requests/aws/describe_key_pairs.rb +66 -0
  245. data/lib/fog/compute/requests/aws/describe_regions.rb +66 -0
  246. data/lib/fog/compute/requests/aws/describe_reserved_instances.rb +52 -0
  247. data/lib/fog/compute/requests/aws/describe_security_groups.rb +95 -0
  248. data/lib/fog/compute/requests/aws/describe_snapshots.rb +120 -0
  249. data/lib/fog/compute/requests/aws/describe_tags.rb +42 -0
  250. data/lib/fog/compute/requests/aws/describe_volumes.rb +118 -0
  251. data/lib/fog/compute/requests/aws/detach_volume.rb +58 -0
  252. data/lib/fog/compute/requests/aws/disassociate_address.rb +52 -0
  253. data/lib/fog/compute/requests/aws/get_console_output.rb +52 -0
  254. data/lib/fog/compute/requests/aws/import_key_pair.rb +54 -0
  255. data/lib/fog/compute/requests/aws/modify_image_attributes.rb +39 -0
  256. data/lib/fog/compute/requests/aws/modify_snapshot_attribute.rb +38 -0
  257. data/lib/fog/compute/requests/aws/reboot_instances.rb +50 -0
  258. data/lib/fog/compute/requests/aws/register_image.rb +89 -0
  259. data/lib/fog/compute/requests/aws/release_address.rb +43 -0
  260. data/lib/fog/compute/requests/aws/revoke_security_group_ingress.rb +74 -0
  261. data/lib/fog/compute/requests/aws/run_instances.rb +167 -0
  262. data/lib/fog/compute/requests/aws/start_instances.rb +38 -0
  263. data/lib/fog/compute/requests/aws/stop_instances.rb +38 -0
  264. data/lib/fog/compute/requests/aws/terminate_instances.rb +94 -0
  265. data/lib/fog/compute/requests/bluebox/create_block.rb +41 -0
  266. data/lib/fog/compute/requests/bluebox/destroy_block.rb +34 -0
  267. data/lib/fog/compute/requests/bluebox/get_block.rb +34 -0
  268. data/lib/fog/compute/requests/bluebox/get_blocks.rb +36 -0
  269. data/lib/fog/compute/requests/bluebox/get_product.rb +34 -0
  270. data/lib/fog/compute/requests/bluebox/get_products.rb +33 -0
  271. data/lib/fog/compute/requests/bluebox/get_template.rb +34 -0
  272. data/lib/fog/compute/requests/bluebox/get_templates.rb +34 -0
  273. data/lib/fog/compute/requests/bluebox/reboot_block.rb +35 -0
  274. data/lib/fog/compute/requests/brightbox/add_nodes_load_balancer.rb +28 -0
  275. data/lib/fog/compute/requests/brightbox/create_api_client.rb +27 -0
  276. data/lib/fog/compute/requests/brightbox/create_cloud_ip.rb +27 -0
  277. data/lib/fog/compute/requests/brightbox/create_image.rb +27 -0
  278. data/lib/fog/compute/requests/brightbox/create_load_balancer.rb +27 -0
  279. data/lib/fog/compute/requests/brightbox/create_server.rb +27 -0
  280. data/lib/fog/compute/requests/brightbox/destroy_api_client.rb +28 -0
  281. data/lib/fog/compute/requests/brightbox/destroy_cloud_ip.rb +28 -0
  282. data/lib/fog/compute/requests/brightbox/destroy_image.rb +28 -0
  283. data/lib/fog/compute/requests/brightbox/destroy_load_balancer.rb +28 -0
  284. data/lib/fog/compute/requests/brightbox/destroy_server.rb +28 -0
  285. data/lib/fog/compute/requests/brightbox/get_account.rb +27 -0
  286. data/lib/fog/compute/requests/brightbox/get_api_client.rb +28 -0
  287. data/lib/fog/compute/requests/brightbox/get_cloud_ip.rb +28 -0
  288. data/lib/fog/compute/requests/brightbox/get_image.rb +28 -0
  289. data/lib/fog/compute/requests/brightbox/get_interface.rb +28 -0
  290. data/lib/fog/compute/requests/brightbox/get_load_balancer.rb +28 -0
  291. data/lib/fog/compute/requests/brightbox/get_server.rb +28 -0
  292. data/lib/fog/compute/requests/brightbox/get_server_type.rb +28 -0
  293. data/lib/fog/compute/requests/brightbox/get_user.rb +28 -0
  294. data/lib/fog/compute/requests/brightbox/get_zone.rb +28 -0
  295. data/lib/fog/compute/requests/brightbox/list_api_clients.rb +27 -0
  296. data/lib/fog/compute/requests/brightbox/list_cloud_ips.rb +27 -0
  297. data/lib/fog/compute/requests/brightbox/list_images.rb +27 -0
  298. data/lib/fog/compute/requests/brightbox/list_load_balancers.rb +27 -0
  299. data/lib/fog/compute/requests/brightbox/list_server_types.rb +27 -0
  300. data/lib/fog/compute/requests/brightbox/list_servers.rb +27 -0
  301. data/lib/fog/compute/requests/brightbox/list_users.rb +27 -0
  302. data/lib/fog/compute/requests/brightbox/list_zones.rb +27 -0
  303. data/lib/fog/compute/requests/brightbox/map_cloud_ip.rb +28 -0
  304. data/lib/fog/compute/requests/brightbox/remove_nodes_load_balancer.rb +28 -0
  305. data/lib/fog/compute/requests/brightbox/reset_ftp_password_account.rb +27 -0
  306. data/lib/fog/compute/requests/brightbox/resize_server.rb +27 -0
  307. data/lib/fog/compute/requests/brightbox/shutdown_server.rb +28 -0
  308. data/lib/fog/compute/requests/brightbox/snapshot_server.rb +28 -0
  309. data/lib/fog/compute/requests/brightbox/start_server.rb +28 -0
  310. data/lib/fog/compute/requests/brightbox/stop_server.rb +28 -0
  311. data/lib/fog/compute/requests/brightbox/unmap_cloud_ip.rb +28 -0
  312. data/lib/fog/compute/requests/brightbox/update_account.rb +28 -0
  313. data/lib/fog/compute/requests/brightbox/update_api_client.rb +29 -0
  314. data/lib/fog/compute/requests/brightbox/update_image.rb +29 -0
  315. data/lib/fog/compute/requests/brightbox/update_load_balancer.rb +29 -0
  316. data/lib/fog/compute/requests/brightbox/update_server.rb +29 -0
  317. data/lib/fog/compute/requests/brightbox/update_user.rb +29 -0
  318. data/lib/fog/compute/requests/go_grid/common_lookup_list.rb +36 -0
  319. data/lib/fog/compute/requests/go_grid/grid_image_get.rb +41 -0
  320. data/lib/fog/compute/requests/go_grid/grid_image_list.rb +44 -0
  321. data/lib/fog/compute/requests/go_grid/grid_ip_list.rb +38 -0
  322. data/lib/fog/compute/requests/go_grid/grid_loadbalancer_list.rb +36 -0
  323. data/lib/fog/compute/requests/go_grid/grid_server_add.rb +44 -0
  324. data/lib/fog/compute/requests/go_grid/grid_server_delete.rb +33 -0
  325. data/lib/fog/compute/requests/go_grid/grid_server_get.rb +33 -0
  326. data/lib/fog/compute/requests/go_grid/grid_server_list.rb +38 -0
  327. data/lib/fog/compute/requests/go_grid/grid_server_power.rb +34 -0
  328. data/lib/fog/compute/requests/linode/avail_datacenters.rb +31 -0
  329. data/lib/fog/compute/requests/linode/avail_distributions.rb +38 -0
  330. data/lib/fog/compute/requests/linode/avail_kernels.rb +36 -0
  331. data/lib/fog/compute/requests/linode/avail_linodeplans.rb +35 -0
  332. data/lib/fog/compute/requests/linode/avail_stackscripts.rb +37 -0
  333. data/lib/fog/compute/requests/linode/linode_create.rb +41 -0
  334. data/lib/fog/compute/requests/linode/linode_delete.rb +36 -0
  335. data/lib/fog/compute/requests/linode/linode_list.rb +38 -0
  336. data/lib/fog/compute/requests/linode/linode_reboot.rb +36 -0
  337. data/lib/fog/compute/requests/new_servers/add_server.rb +41 -0
  338. data/lib/fog/compute/requests/new_servers/cancel_server.rb +38 -0
  339. data/lib/fog/compute/requests/new_servers/get_server.rb +44 -0
  340. data/lib/fog/compute/requests/new_servers/list_images.rb +35 -0
  341. data/lib/fog/compute/requests/new_servers/list_plans.rb +38 -0
  342. data/lib/fog/compute/requests/new_servers/list_servers.rb +44 -0
  343. data/lib/fog/compute/requests/new_servers/reboot_server.rb +32 -0
  344. data/lib/fog/compute/requests/rackspace/confirm_resized_server.rb +34 -0
  345. data/lib/fog/compute/requests/rackspace/create_image.rb +62 -0
  346. data/lib/fog/compute/requests/rackspace/create_server.rb +94 -0
  347. data/lib/fog/compute/requests/rackspace/delete_image.rb +45 -0
  348. data/lib/fog/compute/requests/rackspace/delete_server.rb +43 -0
  349. data/lib/fog/compute/requests/rackspace/get_flavor_details.rb +52 -0
  350. data/lib/fog/compute/requests/rackspace/get_image_details.rb +35 -0
  351. data/lib/fog/compute/requests/rackspace/get_server_details.rb +52 -0
  352. data/lib/fog/compute/requests/rackspace/list_addresses.rb +43 -0
  353. data/lib/fog/compute/requests/rackspace/list_flavors.rb +45 -0
  354. data/lib/fog/compute/requests/rackspace/list_flavors_detail.rb +47 -0
  355. data/lib/fog/compute/requests/rackspace/list_images.rb +40 -0
  356. data/lib/fog/compute/requests/rackspace/list_images_detail.rb +49 -0
  357. data/lib/fog/compute/requests/rackspace/list_private_addresses.rb +41 -0
  358. data/lib/fog/compute/requests/rackspace/list_public_addresses.rb +41 -0
  359. data/lib/fog/compute/requests/rackspace/list_servers.rb +41 -0
  360. data/lib/fog/compute/requests/rackspace/list_servers_detail.rb +56 -0
  361. data/lib/fog/compute/requests/rackspace/reboot_server.rb +30 -0
  362. data/lib/fog/compute/requests/rackspace/resize_server.rb +39 -0
  363. data/lib/fog/compute/requests/rackspace/revert_resized_server.rb +35 -0
  364. data/lib/fog/compute/requests/rackspace/server_action.rb +33 -0
  365. data/lib/fog/compute/requests/rackspace/update_server.rb +45 -0
  366. data/lib/fog/compute/requests/slicehost/create_slice.rb +49 -0
  367. data/lib/fog/compute/requests/slicehost/delete_slice.rb +31 -0
  368. data/lib/fog/compute/requests/slicehost/get_backups.rb +37 -0
  369. data/lib/fog/compute/requests/slicehost/get_flavor.rb +40 -0
  370. data/lib/fog/compute/requests/slicehost/get_flavors.rb +37 -0
  371. data/lib/fog/compute/requests/slicehost/get_image.rb +38 -0
  372. data/lib/fog/compute/requests/slicehost/get_images.rb +35 -0
  373. data/lib/fog/compute/requests/slicehost/get_slice.rb +46 -0
  374. data/lib/fog/compute/requests/slicehost/get_slices.rb +43 -0
  375. data/lib/fog/compute/requests/slicehost/reboot_slice.rb +44 -0
  376. data/lib/fog/compute/requests/terremark_ecloud/get_catalog.rb +27 -0
  377. data/lib/fog/compute/requests/terremark_ecloud/get_catalog_item.rb +27 -0
  378. data/lib/fog/compute/requests/terremark_ecloud/get_ip_addresses.rb +27 -0
  379. data/lib/fog/compute/requests/terremark_ecloud/get_network.rb +27 -0
  380. data/lib/fog/compute/requests/terremark_ecloud/get_organization.rb +27 -0
  381. data/lib/fog/compute/requests/terremark_ecloud/get_vdc.rb +27 -0
  382. data/lib/fog/compute/requests/terremark_ecloud/get_versions.rb +32 -0
  383. data/lib/fog/compute/slicehost.rb +107 -0
  384. data/lib/fog/compute/terremark_ecloud.rb +109 -0
  385. data/lib/fog/compute.rb +40 -0
  386. data/lib/fog/core/attributes.rb +178 -0
  387. data/lib/fog/core/collection.rb +126 -0
  388. data/lib/fog/core/connection.rb +35 -0
  389. data/lib/fog/core/credentials.rb +88 -0
  390. data/lib/fog/core/deprecation.rb +23 -0
  391. data/lib/fog/core/errors.rb +20 -0
  392. data/lib/fog/core/hmac.rb +48 -0
  393. data/lib/fog/core/mock.rb +68 -0
  394. data/lib/fog/core/model.rb +56 -0
  395. data/lib/fog/core/parser.rb +97 -0
  396. data/lib/fog/core/provider.rb +14 -0
  397. data/lib/fog/core/service.rb +158 -0
  398. data/lib/fog/core/ssh.rb +120 -0
  399. data/lib/fog/core/time.rb +21 -0
  400. data/lib/fog/core/wait_for.rb +17 -0
  401. data/lib/fog/core.rb +31 -0
  402. data/lib/fog/dns/aws.rb +120 -0
  403. data/lib/fog/dns/linode.rb +99 -0
  404. data/lib/fog/dns/models/aws/record.rb +64 -0
  405. data/lib/fog/dns/models/aws/records.rb +49 -0
  406. data/lib/fog/dns/models/aws/zone.rb +53 -0
  407. data/lib/fog/dns/models/aws/zones.rb +33 -0
  408. data/lib/fog/dns/models/linode/record.rb +69 -0
  409. data/lib/fog/dns/models/linode/records.rb +37 -0
  410. data/lib/fog/dns/models/linode/zone.rb +84 -0
  411. data/lib/fog/dns/models/linode/zones.rb +29 -0
  412. data/lib/fog/dns/models/slicehost/record.rb +66 -0
  413. data/lib/fog/dns/models/slicehost/records.rb +36 -0
  414. data/lib/fog/dns/models/slicehost/zone.rb +69 -0
  415. data/lib/fog/dns/models/slicehost/zones.rb +28 -0
  416. data/lib/fog/dns/models/zerigo/record.rb +65 -0
  417. data/lib/fog/dns/models/zerigo/records.rb +41 -0
  418. data/lib/fog/dns/models/zerigo/zone.rb +88 -0
  419. data/lib/fog/dns/models/zerigo/zones.rb +30 -0
  420. data/lib/fog/dns/parsers/aws/change_resource_record_sets.rb +26 -0
  421. data/lib/fog/dns/parsers/aws/create_hosted_zone.rb +55 -0
  422. data/lib/fog/dns/parsers/aws/delete_hosted_zone.rb +25 -0
  423. data/lib/fog/dns/parsers/aws/get_change.rb +26 -0
  424. data/lib/fog/dns/parsers/aws/get_hosted_zone.rb +43 -0
  425. data/lib/fog/dns/parsers/aws/list_hosted_zones.rb +37 -0
  426. data/lib/fog/dns/parsers/aws/list_resource_record_sets.rb +46 -0
  427. data/lib/fog/dns/parsers/slicehost/create_record.rb +26 -0
  428. data/lib/fog/dns/parsers/slicehost/create_zone.rb +26 -0
  429. data/lib/fog/dns/parsers/slicehost/get_record.rb +26 -0
  430. data/lib/fog/dns/parsers/slicehost/get_records.rb +30 -0
  431. data/lib/fog/dns/parsers/slicehost/get_zone.rb +26 -0
  432. data/lib/fog/dns/parsers/slicehost/get_zones.rb +30 -0
  433. data/lib/fog/dns/parsers/zerigo/count_hosts.rb +24 -0
  434. data/lib/fog/dns/parsers/zerigo/count_zones.rb +24 -0
  435. data/lib/fog/dns/parsers/zerigo/create_host.rb +26 -0
  436. data/lib/fog/dns/parsers/zerigo/create_zone.rb +26 -0
  437. data/lib/fog/dns/parsers/zerigo/find_hosts.rb +30 -0
  438. data/lib/fog/dns/parsers/zerigo/get_host.rb +26 -0
  439. data/lib/fog/dns/parsers/zerigo/get_zone.rb +56 -0
  440. data/lib/fog/dns/parsers/zerigo/get_zone_stats.rb +26 -0
  441. data/lib/fog/dns/parsers/zerigo/list_hosts.rb +30 -0
  442. data/lib/fog/dns/parsers/zerigo/list_zones.rb +30 -0
  443. data/lib/fog/dns/requests/aws/change_resource_record_sets.rb +90 -0
  444. data/lib/fog/dns/requests/aws/create_hosted_zone.rb +68 -0
  445. data/lib/fog/dns/requests/aws/delete_hosted_zone.rb +48 -0
  446. data/lib/fog/dns/requests/aws/get_change.rb +47 -0
  447. data/lib/fog/dns/requests/aws/get_hosted_zone.rb +51 -0
  448. data/lib/fog/dns/requests/aws/list_hosted_zones.rb +63 -0
  449. data/lib/fog/dns/requests/aws/list_resource_record_sets.rb +68 -0
  450. data/lib/fog/dns/requests/linode/domain_create.rb +51 -0
  451. data/lib/fog/dns/requests/linode/domain_delete.rb +35 -0
  452. data/lib/fog/dns/requests/linode/domain_list.rb +50 -0
  453. data/lib/fog/dns/requests/linode/domain_resource_create.rb +52 -0
  454. data/lib/fog/dns/requests/linode/domain_resource_delete.rb +36 -0
  455. data/lib/fog/dns/requests/linode/domain_resource_list.rb +51 -0
  456. data/lib/fog/dns/requests/linode/domain_resource_update.rb +54 -0
  457. data/lib/fog/dns/requests/linode/domain_update.rb +48 -0
  458. data/lib/fog/dns/requests/slicehost/create_record.rb +60 -0
  459. data/lib/fog/dns/requests/slicehost/create_zone.rb +54 -0
  460. data/lib/fog/dns/requests/slicehost/delete_record.rb +31 -0
  461. data/lib/fog/dns/requests/slicehost/delete_zone.rb +31 -0
  462. data/lib/fog/dns/requests/slicehost/get_record.rb +40 -0
  463. data/lib/fog/dns/requests/slicehost/get_records.rb +41 -0
  464. data/lib/fog/dns/requests/slicehost/get_zone.rb +40 -0
  465. data/lib/fog/dns/requests/slicehost/get_zones.rb +38 -0
  466. data/lib/fog/dns/requests/zerigo/count_hosts.rb +36 -0
  467. data/lib/fog/dns/requests/zerigo/count_zones.rb +36 -0
  468. data/lib/fog/dns/requests/zerigo/create_host.rb +70 -0
  469. data/lib/fog/dns/requests/zerigo/create_zone.rb +97 -0
  470. data/lib/fog/dns/requests/zerigo/delete_host.rb +32 -0
  471. data/lib/fog/dns/requests/zerigo/delete_zone.rb +33 -0
  472. data/lib/fog/dns/requests/zerigo/find_hosts.rb +63 -0
  473. data/lib/fog/dns/requests/zerigo/get_host.rb +47 -0
  474. data/lib/fog/dns/requests/zerigo/get_zone.rb +57 -0
  475. data/lib/fog/dns/requests/zerigo/get_zone_stats.rb +44 -0
  476. data/lib/fog/dns/requests/zerigo/list_hosts.rb +48 -0
  477. data/lib/fog/dns/requests/zerigo/list_zones.rb +53 -0
  478. data/lib/fog/dns/requests/zerigo/update_host.rb +60 -0
  479. data/lib/fog/dns/requests/zerigo/update_zone.rb +78 -0
  480. data/lib/fog/dns/slicehost.rb +103 -0
  481. data/lib/fog/dns/zerigo.rb +113 -0
  482. data/lib/fog/dns.rb +25 -0
  483. data/lib/fog/providers/aws.rb +181 -0
  484. data/lib/fog/providers/bluebox.rb +19 -0
  485. data/lib/fog/providers/brightbox.rb +9 -0
  486. data/lib/fog/providers/go_grid.rb +19 -0
  487. data/lib/fog/providers/google.rb +26 -0
  488. data/lib/fog/providers/linode.rb +21 -0
  489. data/lib/fog/providers/local.rb +19 -0
  490. data/lib/fog/providers/new_servers.rb +22 -0
  491. data/lib/fog/providers/rackspace.rb +35 -0
  492. data/lib/fog/providers/slicehost.rb +23 -0
  493. data/lib/fog/providers/terremark_ecloud.rb +17 -0
  494. data/lib/fog/providers/zerigo.rb +14 -0
  495. data/lib/fog/providers.rb +12 -0
  496. data/lib/fog/storage/aws.rb +362 -0
  497. data/lib/fog/storage/google.rb +277 -0
  498. data/lib/fog/storage/local.rb +75 -0
  499. data/lib/fog/storage/models/aws/directories.rb +43 -0
  500. data/lib/fog/storage/models/aws/directory.rb +103 -0
  501. data/lib/fog/storage/models/aws/file.rb +147 -0
  502. data/lib/fog/storage/models/aws/files.rb +79 -0
  503. data/lib/fog/storage/models/google/directories.rb +43 -0
  504. data/lib/fog/storage/models/google/directory.rb +81 -0
  505. data/lib/fog/storage/models/google/file.rb +148 -0
  506. data/lib/fog/storage/models/google/files.rb +79 -0
  507. data/lib/fog/storage/models/local/directories.rb +33 -0
  508. data/lib/fog/storage/models/local/directory.rb +60 -0
  509. data/lib/fog/storage/models/local/file.rb +75 -0
  510. data/lib/fog/storage/models/local/files.rb +84 -0
  511. data/lib/fog/storage/models/rackspace/directories.rb +39 -0
  512. data/lib/fog/storage/models/rackspace/directory.rb +66 -0
  513. data/lib/fog/storage/models/rackspace/file.rb +80 -0
  514. data/lib/fog/storage/models/rackspace/files.rb +75 -0
  515. data/lib/fog/storage/parsers/aws/access_control_list.rb +46 -0
  516. data/lib/fog/storage/parsers/aws/complete_multipart_upload.rb +24 -0
  517. data/lib/fog/storage/parsers/aws/copy_object.rb +22 -0
  518. data/lib/fog/storage/parsers/aws/get_bucket.rb +62 -0
  519. data/lib/fog/storage/parsers/aws/get_bucket_location.rb +20 -0
  520. data/lib/fog/storage/parsers/aws/get_bucket_logging.rb +40 -0
  521. data/lib/fog/storage/parsers/aws/get_bucket_object_versions.rb +88 -0
  522. data/lib/fog/storage/parsers/aws/get_bucket_versioning.rb +24 -0
  523. data/lib/fog/storage/parsers/aws/get_request_payment.rb +20 -0
  524. data/lib/fog/storage/parsers/aws/get_service.rb +32 -0
  525. data/lib/fog/storage/parsers/aws/initiate_multipart_upload.rb +24 -0
  526. data/lib/fog/storage/parsers/aws/list_multipart_uploads.rb +56 -0
  527. data/lib/fog/storage/parsers/aws/list_parts.rb +40 -0
  528. data/lib/fog/storage/parsers/google/access_control_list.rb +48 -0
  529. data/lib/fog/storage/parsers/google/copy_object.rb +22 -0
  530. data/lib/fog/storage/parsers/google/get_bucket.rb +62 -0
  531. data/lib/fog/storage/parsers/google/get_bucket_logging.rb +40 -0
  532. data/lib/fog/storage/parsers/google/get_bucket_object_versions.rb +88 -0
  533. data/lib/fog/storage/parsers/google/get_bucket_versioning.rb +24 -0
  534. data/lib/fog/storage/parsers/google/get_request_payment.rb +20 -0
  535. data/lib/fog/storage/parsers/google/get_service.rb +32 -0
  536. data/lib/fog/storage/rackspace.rb +164 -0
  537. data/lib/fog/storage/requests/aws/abort_multipart_upload.rb +38 -0
  538. data/lib/fog/storage/requests/aws/complete_multipart_upload.rb +60 -0
  539. data/lib/fog/storage/requests/aws/copy_object.rb +75 -0
  540. data/lib/fog/storage/requests/aws/delete_bucket.rb +50 -0
  541. data/lib/fog/storage/requests/aws/delete_object.rb +49 -0
  542. data/lib/fog/storage/requests/aws/get_bucket.rb +111 -0
  543. data/lib/fog/storage/requests/aws/get_bucket_acl.rb +66 -0
  544. data/lib/fog/storage/requests/aws/get_bucket_location.rb +52 -0
  545. data/lib/fog/storage/requests/aws/get_bucket_logging.rb +58 -0
  546. data/lib/fog/storage/requests/aws/get_bucket_object_versions.rb +83 -0
  547. data/lib/fog/storage/requests/aws/get_bucket_versioning.rb +48 -0
  548. data/lib/fog/storage/requests/aws/get_object.rb +107 -0
  549. data/lib/fog/storage/requests/aws/get_object_acl.rb +77 -0
  550. data/lib/fog/storage/requests/aws/get_object_torrent.rb +58 -0
  551. data/lib/fog/storage/requests/aws/get_object_url.rb +57 -0
  552. data/lib/fog/storage/requests/aws/get_request_payment.rb +52 -0
  553. data/lib/fog/storage/requests/aws/get_service.rb +57 -0
  554. data/lib/fog/storage/requests/aws/head_object.rb +68 -0
  555. data/lib/fog/storage/requests/aws/initiate_multipart_upload.rb +55 -0
  556. data/lib/fog/storage/requests/aws/list_multipart_uploads.rb +68 -0
  557. data/lib/fog/storage/requests/aws/list_parts.rb +67 -0
  558. data/lib/fog/storage/requests/aws/post_object_hidden_fields.rb +50 -0
  559. data/lib/fog/storage/requests/aws/put_bucket.rb +77 -0
  560. data/lib/fog/storage/requests/aws/put_bucket_acl.rb +84 -0
  561. data/lib/fog/storage/requests/aws/put_bucket_logging.rb +91 -0
  562. data/lib/fog/storage/requests/aws/put_bucket_versioning.rb +44 -0
  563. data/lib/fog/storage/requests/aws/put_object.rb +91 -0
  564. data/lib/fog/storage/requests/aws/put_object_acl.rb +93 -0
  565. data/lib/fog/storage/requests/aws/put_object_url.rb +57 -0
  566. data/lib/fog/storage/requests/aws/put_request_payment.rb +51 -0
  567. data/lib/fog/storage/requests/aws/sync_clock.rb +28 -0
  568. data/lib/fog/storage/requests/aws/upload_part.rb +51 -0
  569. data/lib/fog/storage/requests/google/copy_object.rb +72 -0
  570. data/lib/fog/storage/requests/google/delete_bucket.rb +46 -0
  571. data/lib/fog/storage/requests/google/delete_object.rb +50 -0
  572. data/lib/fog/storage/requests/google/get_bucket.rb +111 -0
  573. data/lib/fog/storage/requests/google/get_bucket_acl.rb +63 -0
  574. data/lib/fog/storage/requests/google/get_object.rb +104 -0
  575. data/lib/fog/storage/requests/google/get_object_acl.rb +74 -0
  576. data/lib/fog/storage/requests/google/get_object_torrent.rb +55 -0
  577. data/lib/fog/storage/requests/google/get_object_url.rb +54 -0
  578. data/lib/fog/storage/requests/google/get_service.rb +53 -0
  579. data/lib/fog/storage/requests/google/head_object.rb +64 -0
  580. data/lib/fog/storage/requests/google/put_bucket.rb +75 -0
  581. data/lib/fog/storage/requests/google/put_bucket_acl.rb +81 -0
  582. data/lib/fog/storage/requests/google/put_object.rb +86 -0
  583. data/lib/fog/storage/requests/google/put_object_url.rb +54 -0
  584. data/lib/fog/storage/requests/rackspace/delete_container.rb +31 -0
  585. data/lib/fog/storage/requests/rackspace/delete_object.rb +32 -0
  586. data/lib/fog/storage/requests/rackspace/get_container.rb +52 -0
  587. data/lib/fog/storage/requests/rackspace/get_containers.rb +41 -0
  588. data/lib/fog/storage/requests/rackspace/get_object.rb +33 -0
  589. data/lib/fog/storage/requests/rackspace/head_container.rb +37 -0
  590. data/lib/fog/storage/requests/rackspace/head_containers.rb +34 -0
  591. data/lib/fog/storage/requests/rackspace/head_object.rb +32 -0
  592. data/lib/fog/storage/requests/rackspace/put_container.rb +31 -0
  593. data/lib/fog/storage/requests/rackspace/put_object.rb +35 -0
  594. data/lib/fog/storage.rb +25 -0
  595. data/lib/fog/terremark/ecloud.rb +73 -0
  596. data/lib/fog/terremark/models/shared/address.rb +29 -0
  597. data/lib/fog/terremark/models/shared/addresses.rb +49 -0
  598. data/lib/fog/terremark/models/shared/network.rb +35 -0
  599. data/lib/fog/terremark/models/shared/networks.rb +52 -0
  600. data/lib/fog/terremark/models/shared/server.rb +110 -0
  601. data/lib/fog/terremark/models/shared/servers.rb +55 -0
  602. data/lib/fog/terremark/models/shared/task.rb +50 -0
  603. data/lib/fog/terremark/models/shared/tasks.rb +58 -0
  604. data/lib/fog/terremark/models/shared/vdc.rb +39 -0
  605. data/lib/fog/terremark/models/shared/vdcs.rb +52 -0
  606. data/lib/fog/terremark/parser.rb +19 -0
  607. data/lib/fog/terremark/parsers/shared/get_catalog.rb +46 -0
  608. data/lib/fog/terremark/parsers/shared/get_catalog_item.rb +46 -0
  609. data/lib/fog/terremark/parsers/shared/get_internet_services.rb +60 -0
  610. data/lib/fog/terremark/parsers/shared/get_network_ips.rb +29 -0
  611. data/lib/fog/terremark/parsers/shared/get_node_services.rb +36 -0
  612. data/lib/fog/terremark/parsers/shared/get_organization.rb +52 -0
  613. data/lib/fog/terremark/parsers/shared/get_organizations.rb +32 -0
  614. data/lib/fog/terremark/parsers/shared/get_public_ips.rb +30 -0
  615. data/lib/fog/terremark/parsers/shared/get_tasks_list.rb +52 -0
  616. data/lib/fog/terremark/parsers/shared/get_vapp_template.rb +46 -0
  617. data/lib/fog/terremark/parsers/shared/get_vdc.rb +123 -0
  618. data/lib/fog/terremark/parsers/shared/instantiate_vapp_template.rb +41 -0
  619. data/lib/fog/terremark/parsers/shared/internet_service.rb +65 -0
  620. data/lib/fog/terremark/parsers/shared/network.rb +51 -0
  621. data/lib/fog/terremark/parsers/shared/node_service.rb +32 -0
  622. data/lib/fog/terremark/parsers/shared/public_ip.rb +26 -0
  623. data/lib/fog/terremark/parsers/shared/task.rb +40 -0
  624. data/lib/fog/terremark/parsers/shared/vapp.rb +77 -0
  625. data/lib/fog/terremark/requests/shared/add_internet_service.rb +63 -0
  626. data/lib/fog/terremark/requests/shared/add_node_service.rb +63 -0
  627. data/lib/fog/terremark/requests/shared/create_internet_service.rb +63 -0
  628. data/lib/fog/terremark/requests/shared/delete_internet_service.rb +30 -0
  629. data/lib/fog/terremark/requests/shared/delete_node_service.rb +30 -0
  630. data/lib/fog/terremark/requests/shared/delete_public_ip.rb +30 -0
  631. data/lib/fog/terremark/requests/shared/delete_vapp.rb +30 -0
  632. data/lib/fog/terremark/requests/shared/deploy_vapp.rb +43 -0
  633. data/lib/fog/terremark/requests/shared/get_catalog.rb +40 -0
  634. data/lib/fog/terremark/requests/shared/get_catalog_item.rb +43 -0
  635. data/lib/fog/terremark/requests/shared/get_internet_services.rb +43 -0
  636. data/lib/fog/terremark/requests/shared/get_network.rb +73 -0
  637. data/lib/fog/terremark/requests/shared/get_network_ips.rb +40 -0
  638. data/lib/fog/terremark/requests/shared/get_node_services.rb +38 -0
  639. data/lib/fog/terremark/requests/shared/get_organization.rb +86 -0
  640. data/lib/fog/terremark/requests/shared/get_organizations.rb +49 -0
  641. data/lib/fog/terremark/requests/shared/get_public_ip.rb +41 -0
  642. data/lib/fog/terremark/requests/shared/get_public_ips.rb +72 -0
  643. data/lib/fog/terremark/requests/shared/get_task.rb +47 -0
  644. data/lib/fog/terremark/requests/shared/get_tasks_list.rb +40 -0
  645. data/lib/fog/terremark/requests/shared/get_vapp.rb +50 -0
  646. data/lib/fog/terremark/requests/shared/get_vapp_template.rb +43 -0
  647. data/lib/fog/terremark/requests/shared/get_vdc.rb +125 -0
  648. data/lib/fog/terremark/requests/shared/instantiate_vapp_template.rb +79 -0
  649. data/lib/fog/terremark/requests/shared/power_off.rb +43 -0
  650. data/lib/fog/terremark/requests/shared/power_on.rb +43 -0
  651. data/lib/fog/terremark/requests/shared/power_reset.rb +43 -0
  652. data/lib/fog/terremark/requests/shared/power_shutdown.rb +32 -0
  653. data/lib/fog/terremark/shared.rb +289 -0
  654. data/lib/fog/terremark/vcloud.rb +117 -0
  655. data/lib/fog/terremark.rb +16 -0
  656. data/lib/fog/vcloud/collection.rb +30 -0
  657. data/lib/fog/vcloud/generators.rb +33 -0
  658. data/lib/fog/vcloud/mock_data_classes.rb +767 -0
  659. data/lib/fog/vcloud/model.rb +22 -0
  660. data/lib/fog/vcloud/models/vdc.rb +26 -0
  661. data/lib/fog/vcloud/models/vdcs.rb +35 -0
  662. data/lib/fog/vcloud/requests/get_network.rb +47 -0
  663. data/lib/fog/vcloud/requests/get_organization.rb +47 -0
  664. data/lib/fog/vcloud/requests/get_vdc.rb +82 -0
  665. data/lib/fog/vcloud/requests/get_versions.rb +34 -0
  666. data/lib/fog/vcloud/requests/login.rb +46 -0
  667. data/lib/fog/vcloud/terremark/ecloud/models/backup_internet_service.rb +60 -0
  668. data/lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb +36 -0
  669. data/lib/fog/vcloud/terremark/ecloud/models/catalog.rb +31 -0
  670. data/lib/fog/vcloud/terremark/ecloud/models/catalog_item.rb +31 -0
  671. data/lib/fog/vcloud/terremark/ecloud/models/firewall_acl.rb +28 -0
  672. data/lib/fog/vcloud/terremark/ecloud/models/firewall_acls.rb +34 -0
  673. data/lib/fog/vcloud/terremark/ecloud/models/internet_service.rb +99 -0
  674. data/lib/fog/vcloud/terremark/ecloud/models/internet_services.rb +36 -0
  675. data/lib/fog/vcloud/terremark/ecloud/models/ip.rb +51 -0
  676. data/lib/fog/vcloud/terremark/ecloud/models/ips.rb +35 -0
  677. data/lib/fog/vcloud/terremark/ecloud/models/network.rb +77 -0
  678. data/lib/fog/vcloud/terremark/ecloud/models/networks.rb +36 -0
  679. data/lib/fog/vcloud/terremark/ecloud/models/node.rb +47 -0
  680. data/lib/fog/vcloud/terremark/ecloud/models/nodes.rb +33 -0
  681. data/lib/fog/vcloud/terremark/ecloud/models/public_ip.rb +25 -0
  682. data/lib/fog/vcloud/terremark/ecloud/models/public_ips.rb +39 -0
  683. data/lib/fog/vcloud/terremark/ecloud/models/server.rb +211 -0
  684. data/lib/fog/vcloud/terremark/ecloud/models/servers.rb +57 -0
  685. data/lib/fog/vcloud/terremark/ecloud/models/task.rb +23 -0
  686. data/lib/fog/vcloud/terremark/ecloud/models/tasks.rb +33 -0
  687. data/lib/fog/vcloud/terremark/ecloud/models/vdc.rb +83 -0
  688. data/lib/fog/vcloud/terremark/ecloud/models/vdcs.rb +42 -0
  689. data/lib/fog/vcloud/terremark/ecloud/requests/add_backup_internet_service.rb +111 -0
  690. data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +140 -0
  691. data/lib/fog/vcloud/terremark/ecloud/requests/add_node.rb +64 -0
  692. data/lib/fog/vcloud/terremark/ecloud/requests/clone_vapp.rb +50 -0
  693. data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +110 -0
  694. data/lib/fog/vcloud/terremark/ecloud/requests/configure_network.rb +53 -0
  695. data/lib/fog/vcloud/terremark/ecloud/requests/configure_network_ip.rb +68 -0
  696. data/lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb +58 -0
  697. data/lib/fog/vcloud/terremark/ecloud/requests/configure_vapp.rb +147 -0
  698. data/lib/fog/vcloud/terremark/ecloud/requests/delete_internet_service.rb +25 -0
  699. data/lib/fog/vcloud/terremark/ecloud/requests/delete_node.rb +24 -0
  700. data/lib/fog/vcloud/terremark/ecloud/requests/delete_vapp.rb +32 -0
  701. data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb +46 -0
  702. data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb +49 -0
  703. data/lib/fog/vcloud/terremark/ecloud/requests/get_customization_options.rb +24 -0
  704. data/lib/fog/vcloud/terremark/ecloud/requests/get_firewall_acl.rb +18 -0
  705. data/lib/fog/vcloud/terremark/ecloud/requests/get_firewall_acls.rb +18 -0
  706. data/lib/fog/vcloud/terremark/ecloud/requests/get_internet_services.rb +84 -0
  707. data/lib/fog/vcloud/terremark/ecloud/requests/get_network.rb +47 -0
  708. data/lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb +35 -0
  709. data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ip.rb +45 -0
  710. data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ips.rb +37 -0
  711. data/lib/fog/vcloud/terremark/ecloud/requests/get_node.rb +42 -0
  712. data/lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb +43 -0
  713. data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb +36 -0
  714. data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ips.rb +41 -0
  715. data/lib/fog/vcloud/terremark/ecloud/requests/get_task.rb +18 -0
  716. data/lib/fog/vcloud/terremark/ecloud/requests/get_task_list.rb +19 -0
  717. data/lib/fog/vcloud/terremark/ecloud/requests/get_vapp.rb +101 -0
  718. data/lib/fog/vcloud/terremark/ecloud/requests/get_vapp_template.rb +18 -0
  719. data/lib/fog/vcloud/terremark/ecloud/requests/get_vdc.rb +87 -0
  720. data/lib/fog/vcloud/terremark/ecloud/requests/instantiate_vapp_template.rb +144 -0
  721. data/lib/fog/vcloud/terremark/ecloud/requests/power_off.rb +25 -0
  722. data/lib/fog/vcloud/terremark/ecloud/requests/power_on.rb +25 -0
  723. data/lib/fog/vcloud/terremark/ecloud/requests/power_reset.rb +18 -0
  724. data/lib/fog/vcloud/terremark/ecloud/requests/power_shutdown.rb +18 -0
  725. data/lib/fog/vcloud/terremark/ecloud.rb +187 -0
  726. data/lib/fog/vcloud/terremark/vcloud/requests/get_vdc.rb +57 -0
  727. data/lib/fog/vcloud/terremark/vcloud.rb +39 -0
  728. data/lib/fog/vcloud.rb +337 -0
  729. data/lib/fog.rb +19 -0
  730. data/spec/aws/models/compute/address_spec.rb +103 -0
  731. data/spec/aws/models/compute/addresses_spec.rb +70 -0
  732. data/spec/aws/models/compute/key_pair_spec.rb +86 -0
  733. data/spec/aws/models/compute/key_pairs_spec.rb +71 -0
  734. data/spec/aws/models/compute/security_group_spec.rb +88 -0
  735. data/spec/aws/models/compute/security_groups_spec.rb +71 -0
  736. data/spec/aws/models/compute/server_spec.rb +105 -0
  737. data/spec/aws/models/compute/snapshot_spec.rb +79 -0
  738. data/spec/aws/models/compute/snapshots_spec.rb +85 -0
  739. data/spec/aws/models/compute/volume_spec.rb +174 -0
  740. data/spec/aws/models/compute/volumes_spec.rb +71 -0
  741. data/spec/spec_helper.rb +13 -0
  742. data/spec/vcloud/bin_spec.rb +28 -0
  743. data/spec/vcloud/models/vdc_spec.rb +52 -0
  744. data/spec/vcloud/models/vdcs_spec.rb +1 -0
  745. data/spec/vcloud/requests/get_network_spec.rb +44 -0
  746. data/spec/vcloud/requests/get_organization_spec.rb +53 -0
  747. data/spec/vcloud/requests/get_vdc_spec.rb +63 -0
  748. data/spec/vcloud/requests/get_versions_spec.rb +54 -0
  749. data/spec/vcloud/requests/login_spec.rb +24 -0
  750. data/spec/vcloud/spec_helper.rb +398 -0
  751. data/spec/vcloud/terremark/ecloud/models/backup_internet_service_spec.rb +49 -0
  752. data/spec/vcloud/terremark/ecloud/models/backup_internet_services_spec.rb +29 -0
  753. data/spec/vcloud/terremark/ecloud/models/internet_service_spec.rb +81 -0
  754. data/spec/vcloud/terremark/ecloud/models/internet_services_spec.rb +29 -0
  755. data/spec/vcloud/terremark/ecloud/models/ip_spec.rb +33 -0
  756. data/spec/vcloud/terremark/ecloud/models/ips_spec.rb +28 -0
  757. data/spec/vcloud/terremark/ecloud/models/network_spec.rb +71 -0
  758. data/spec/vcloud/terremark/ecloud/models/networks_spec.rb +27 -0
  759. data/spec/vcloud/terremark/ecloud/models/node_spec.rb +38 -0
  760. data/spec/vcloud/terremark/ecloud/models/nodes_spec.rb +29 -0
  761. data/spec/vcloud/terremark/ecloud/models/public_ip_spec.rb +36 -0
  762. data/spec/vcloud/terremark/ecloud/models/public_ips_spec.rb +27 -0
  763. data/spec/vcloud/terremark/ecloud/models/server_spec.rb +62 -0
  764. data/spec/vcloud/terremark/ecloud/models/vdc_spec.rb +63 -0
  765. data/spec/vcloud/terremark/ecloud/models/vdcs_spec.rb +28 -0
  766. data/spec/vcloud/terremark/ecloud/requests/add_backup_internet_service_spec.rb +60 -0
  767. data/spec/vcloud/terremark/ecloud/requests/add_internet_service_spec.rb +65 -0
  768. data/spec/vcloud/terremark/ecloud/requests/add_node_spec.rb +56 -0
  769. data/spec/vcloud/terremark/ecloud/requests/configure_internet_service_spec.rb +61 -0
  770. data/spec/vcloud/terremark/ecloud/requests/configure_network_ip_spec.rb +55 -0
  771. data/spec/vcloud/terremark/ecloud/requests/configure_node_spec.rb +52 -0
  772. data/spec/vcloud/terremark/ecloud/requests/configure_vapp_spec.rb +71 -0
  773. data/spec/vcloud/terremark/ecloud/requests/delete_internet_service_spec.rb +34 -0
  774. data/spec/vcloud/terremark/ecloud/requests/delete_node_spec.rb +30 -0
  775. data/spec/vcloud/terremark/ecloud/requests/delete_vapp_spec.rb +92 -0
  776. data/spec/vcloud/terremark/ecloud/requests/get_catalog_item_spec.rb +63 -0
  777. data/spec/vcloud/terremark/ecloud/requests/get_catalog_spec.rb +44 -0
  778. data/spec/vcloud/terremark/ecloud/requests/get_customization_options_spec.rb +39 -0
  779. data/spec/vcloud/terremark/ecloud/requests/get_internet_services_spec.rb +150 -0
  780. data/spec/vcloud/terremark/ecloud/requests/get_network_ip_spec.rb +40 -0
  781. data/spec/vcloud/terremark/ecloud/requests/get_network_ips_spec.rb +59 -0
  782. data/spec/vcloud/terremark/ecloud/requests/get_network_spec.rb +49 -0
  783. data/spec/vcloud/terremark/ecloud/requests/get_node_spec.rb +41 -0
  784. data/spec/vcloud/terremark/ecloud/requests/get_nodes_spec.rb +58 -0
  785. data/spec/vcloud/terremark/ecloud/requests/get_public_ip_spec.rb +38 -0
  786. data/spec/vcloud/terremark/ecloud/requests/get_public_ips_spec.rb +52 -0
  787. data/spec/vcloud/terremark/ecloud/requests/get_vapp_spec.rb +126 -0
  788. data/spec/vcloud/terremark/ecloud/requests/get_vdc_spec.rb +113 -0
  789. data/spec/vcloud/terremark/ecloud/requests/instantiate_vapp_template_spec.rb +96 -0
  790. data/spec/vcloud/terremark/ecloud/requests/login_spec.rb +10 -0
  791. data/spec/vcloud/terremark/ecloud/requests/power_off_spec.rb +34 -0
  792. data/spec/vcloud/terremark/ecloud/requests/power_on_spec.rb +34 -0
  793. data/spec/vcloud/vcloud_spec.rb +18 -0
  794. data/tests/aws/requests/iam/access_key_tests.rb +60 -0
  795. data/tests/aws/requests/iam/group_policy_tests.rb +42 -0
  796. data/tests/aws/requests/iam/group_tests.rb +47 -0
  797. data/tests/aws/requests/iam/helper.rb +15 -0
  798. data/tests/aws/requests/iam/user_policy_tests.rb +42 -0
  799. data/tests/aws/requests/iam/user_tests.rb +65 -0
  800. data/tests/aws/requests/simpledb/attributes_tests.rb +75 -0
  801. data/tests/aws/requests/simpledb/domain_tests.rb +51 -0
  802. data/tests/aws/requests/simpledb/helper.rb +16 -0
  803. data/tests/compute/helper.rb +36 -0
  804. data/tests/compute/models/flavors_tests.rb +9 -0
  805. data/tests/compute/models/server_tests.rb +9 -0
  806. data/tests/compute/models/servers_tests.rb +9 -0
  807. data/tests/compute/requests/aws/address_tests.rb +76 -0
  808. data/tests/compute/requests/aws/availability_zone_tests.rb +25 -0
  809. data/tests/compute/requests/aws/helper.rb +20 -0
  810. data/tests/compute/requests/aws/image_tests.rb +37 -0
  811. data/tests/compute/requests/aws/instance_tests.rb +121 -0
  812. data/tests/compute/requests/aws/key_pair_tests.rb +63 -0
  813. data/tests/compute/requests/aws/region_tests.rb +23 -0
  814. data/tests/compute/requests/aws/security_group_tests.rb +124 -0
  815. data/tests/compute/requests/aws/snapshot_tests.rb +57 -0
  816. data/tests/compute/requests/aws/tag_tests.rb +49 -0
  817. data/tests/compute/requests/aws/volume_tests.rb +102 -0
  818. data/tests/compute/requests/bluebox/block_tests.rb +80 -0
  819. data/tests/compute/requests/bluebox/helper.rb +17 -0
  820. data/tests/compute/requests/bluebox/product_tests.rb +28 -0
  821. data/tests/compute/requests/bluebox/template_tests.rb +35 -0
  822. data/tests/compute/requests/brightbox/account_tests.rb +40 -0
  823. data/tests/compute/requests/brightbox/api_client_tests.rb +49 -0
  824. data/tests/compute/requests/brightbox/cloud_ip_tests.rb +71 -0
  825. data/tests/compute/requests/brightbox/helper.rb +418 -0
  826. data/tests/compute/requests/brightbox/image_tests.rb +57 -0
  827. data/tests/compute/requests/brightbox/interface_tests.rb +30 -0
  828. data/tests/compute/requests/brightbox/load_balancer_tests.rb +74 -0
  829. data/tests/compute/requests/brightbox/server_tests.rb +70 -0
  830. data/tests/compute/requests/brightbox/server_type_tests.rb +33 -0
  831. data/tests/compute/requests/brightbox/user_tests.rb +41 -0
  832. data/tests/compute/requests/brightbox/zone_tests.rb +33 -0
  833. data/tests/compute/requests/go_grid/image_tests.rb +0 -0
  834. data/tests/compute/requests/linode/datacenter_tests.rb +19 -0
  835. data/tests/compute/requests/linode/distribution_tests.rb +32 -0
  836. data/tests/compute/requests/linode/helper.rb +16 -0
  837. data/tests/compute/requests/linode/linode_tests.rb +85 -0
  838. data/tests/compute/requests/linode/linodeplans_tests.rb +39 -0
  839. data/tests/compute/requests/rackspace/address_tests.rb +40 -0
  840. data/tests/compute/requests/rackspace/flavor_tests.rb +38 -0
  841. data/tests/compute/requests/rackspace/helper.rb +16 -0
  842. data/tests/compute/requests/rackspace/image_tests.rb +68 -0
  843. data/tests/compute/requests/rackspace/resize_tests.rb +33 -0
  844. data/tests/compute/requests/rackspace/server_tests.rb +92 -0
  845. data/tests/compute/requests/slicehost/backup_tests.rb +18 -0
  846. data/tests/compute/requests/slicehost/flavor_tests.rb +33 -0
  847. data/tests/compute/requests/slicehost/image_tests.rb +31 -0
  848. data/tests/compute/requests/slicehost/slice_tests.rb +75 -0
  849. data/tests/compute/requests/terremark_ecloud/catalog_tests.rb +47 -0
  850. data/tests/compute/requests/terremark_ecloud/helper.rb +45 -0
  851. data/tests/compute/requests/terremark_ecloud/network_tests.rb +30 -0
  852. data/tests/compute/requests/terremark_ecloud/organization_tests.rb +23 -0
  853. data/tests/compute/requests/terremark_ecloud/vdc_tests.rb +60 -0
  854. data/tests/core/attribute_tests.rb +45 -0
  855. data/tests/dns/helper.rb +19 -0
  856. data/tests/dns/models/record_tests.rb +25 -0
  857. data/tests/dns/models/records_tests.rb +25 -0
  858. data/tests/dns/models/zone_tests.rb +13 -0
  859. data/tests/dns/models/zones_tests.rb +13 -0
  860. data/tests/dns/requests/aws/dns_tests.rb +276 -0
  861. data/tests/dns/requests/linode/dns_tests.rb +262 -0
  862. data/tests/dns/requests/slicehost/dns_tests.rb +279 -0
  863. data/tests/dns/requests/zerigo/dns_tests.rb +374 -0
  864. data/tests/helper.rb +17 -0
  865. data/tests/helpers/collection_helper.rb +51 -0
  866. data/tests/helpers/compute/flavors_helper.rb +34 -0
  867. data/tests/helpers/compute/server_helper.rb +19 -0
  868. data/tests/helpers/compute/servers_helper.rb +11 -0
  869. data/tests/helpers/formats_helper.rb +70 -0
  870. data/tests/helpers/formats_helper_tests.rb +43 -0
  871. data/tests/helpers/mock_helper.rb +33 -0
  872. data/tests/helpers/model_helper.rb +28 -0
  873. data/tests/helpers/responds_to_helper.rb +13 -0
  874. data/tests/helpers/succeeds_helper.rb +12 -0
  875. data/tests/lorem.txt +1 -0
  876. data/tests/storage/helper.rb +16 -0
  877. data/tests/storage/models/directories_tests.rb +13 -0
  878. data/tests/storage/models/directory_test.rb +24 -0
  879. data/tests/storage/models/file_tests.rb +41 -0
  880. data/tests/storage/models/files_tests.rb +26 -0
  881. data/tests/storage/requests/aws/bucket_tests.rb +104 -0
  882. data/tests/storage/requests/aws/multipart_upload_tests.rb +135 -0
  883. data/tests/storage/requests/aws/object_tests.rb +81 -0
  884. data/tests/storage/requests/google/bucket_tests.rb +79 -0
  885. data/tests/storage/requests/google/object_tests.rb +81 -0
  886. data/tests/storage/requests/rackspace/container_tests.rb +64 -0
  887. data/tests/storage/requests/rackspace/object_tests.rb +69 -0
  888. metadata +1275 -0
@@ -0,0 +1,201 @@
1
+ module Fog
2
+ module AWS
3
+ class Compute
4
+ class Real
5
+
6
+ require 'fog/compute/parsers/aws/describe_instances'
7
+
8
+ # Describe all or specified instances
9
+ #
10
+ # ==== Parameters
11
+ # * filters<~Hash> - List of filters to limit results with
12
+ #
13
+ # ==== Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>:
16
+ # * 'requestId'<~String> - Id of request
17
+ # * 'reservationSet'<~Array>:
18
+ # * 'groupSet'<~Array> - Group names for reservation
19
+ # * 'ownerId'<~String> - AWS Access Key ID of reservation owner
20
+ # * 'reservationId'<~String> - Id of the reservation
21
+ # * 'instancesSet'<~Array>:
22
+ # * instance<~Hash>:
23
+ # * 'architecture'<~String> - architecture of image in [i386, x86_64]
24
+ # * 'amiLaunchIndex'<~Integer> - reference to instance in launch group
25
+ # * 'blockDeviceMapping'<~Array>
26
+ # * 'attachTime'<~Time> - time of volume attachment
27
+ # * 'deleteOnTermination'<~Boolean> - whether or not to delete volume on termination
28
+ # * 'deviceName'<~String> - specifies how volume is exposed to instance
29
+ # * 'status'<~String> - status of attached volume
30
+ # * 'volumeId'<~String> - Id of attached volume
31
+ # * 'dnsName'<~String> - public dns name, blank until instance is running
32
+ # * 'imageId'<~String> - image id of ami used to launch instance
33
+ # * 'instanceId'<~String> - id of the instance
34
+ # * 'instanceState'<~Hash>:
35
+ # * 'code'<~Integer> - current status code
36
+ # * 'name'<~String> - current status name
37
+ # * 'instanceType'<~String> - type of instance
38
+ # * 'ipAddress'<~String> - public ip address assigned to instance
39
+ # * 'kernelId'<~String> - id of kernel used to launch instance
40
+ # * 'keyName'<~String> - name of key used launch instances or blank
41
+ # * 'launchTime'<~Time> - time instance was launched
42
+ # * 'monitoring'<~Hash>:
43
+ # * 'state'<~Boolean - state of monitoring
44
+ # * 'placement'<~Hash>:
45
+ # * 'availabilityZone'<~String> - Availability zone of the instance
46
+ # * 'productCodes'<~Array> - Product codes for the instance
47
+ # * 'privateDnsName'<~String> - private dns name, blank until instance is running
48
+ # * 'privateIpAddress'<~String> - private ip address assigned to instance
49
+ # * 'rootDeviceName'<~String> - specifies how the root device is exposed to the instance
50
+ # * 'rootDeviceType'<~String> - root device type used by AMI in [ebs, instance-store]
51
+ # * 'ramdiskId'<~String> - Id of ramdisk used to launch instance
52
+ # * 'reason'<~String> - reason for most recent state transition, or blank
53
+ def describe_instances(filters = {})
54
+ unless filters.is_a?(Hash)
55
+ Formatador.display_line("[yellow][WARN] describe_instances with #{filters.class} param is deprecated, use describe_instances('instance-id' => []) instead[/] [light_black](#{caller.first})[/]")
56
+ filters = {'instance-id' => [*filters]}
57
+ end
58
+ params = AWS.indexed_filters(filters)
59
+
60
+ request({
61
+ 'Action' => 'DescribeInstances',
62
+ :idempotent => true,
63
+ :parser => Fog::Parsers::AWS::Compute::DescribeInstances.new
64
+ }.merge!(params))
65
+ end
66
+
67
+ end
68
+
69
+ class Mock
70
+
71
+ def describe_instances(filters = {})
72
+ unless filters.is_a?(Hash)
73
+ Formatador.display_line("[yellow][WARN] describe_instances with #{filters.class} param is deprecated, use describe_instances('instance-id' => []) instead[/] [light_black](#{caller.first})[/]")
74
+ filters = {'instance-id' => [*filters]}
75
+ end
76
+
77
+ if filters.keys.any? {|key| key =~ /^tag/}
78
+ Formatador.display_line("[yellow][WARN] describe_instances tag filters are not yet mocked[/] [light_black](#{caller.first})[/]")
79
+ Fog::Mock.not_implemented
80
+ end
81
+
82
+ response = Excon::Response.new
83
+
84
+ instance_set = @data[:instances].values
85
+
86
+ aliases = {
87
+ 'architecture' => 'architecture',
88
+ 'availability-zone' => 'availabilityZone',
89
+ 'client-token' => 'clientToken',
90
+ 'dns-token' => 'dnsName',
91
+ 'group-id' => 'groupId',
92
+ 'image-id' => 'imageId',
93
+ 'instance-id' => 'instanceId',
94
+ 'instance-lifecycle' => 'instanceLifecycle',
95
+ 'instance-type' => 'instanceType',
96
+ 'ip-address' => 'ipAddress',
97
+ 'kernel-id' => 'kernelId',
98
+ 'key-name' => 'key-name',
99
+ 'launch-index' => 'launchIndex',
100
+ 'launch-time' => 'launchTime',
101
+ 'monitoring-state' => 'monitoringState',
102
+ 'owner-id' => 'ownerId',
103
+ 'placement-group-name' => 'placementGroupName',
104
+ 'platform' => 'platform',
105
+ 'private-dns-name' => 'privateDnsName',
106
+ 'private-ip-address' => 'privateIpAddress',
107
+ 'product-code' => 'productCode',
108
+ 'ramdisk-id' => 'ramdiskId',
109
+ 'reason' => 'reason',
110
+ 'requester-id' => 'requesterId',
111
+ 'reservation-id' => 'reservationId',
112
+ 'root-device-name' => 'rootDeviceName',
113
+ 'root-device-type' => 'rootDeviceType',
114
+ 'spot-instance-request-id' => 'spotInstanceRequestId',
115
+ 'subnet-id' => 'subnetId',
116
+ 'virtualization-type' => 'virtualizationType',
117
+ 'vpc-id' => 'vpcId'
118
+ }
119
+ block_device_mapping_aliases = {
120
+ 'attach-time' => 'attachTime',
121
+ 'delete-on-termination' => 'deleteOnTermination',
122
+ 'device-name' => 'deviceName',
123
+ 'status' => 'status',
124
+ 'volume-id' => 'volumeId',
125
+ }
126
+ instance_state_aliases = {
127
+ 'code' => 'code',
128
+ 'name' => 'name'
129
+ }
130
+ state_reason_aliases = {
131
+ 'code' => 'code',
132
+ 'message' => 'message'
133
+ }
134
+ for filter_key, filter_value in filters
135
+ if block_device_mapping_key = filter_key.split('block-device-mapping.')[1]
136
+ aliased_key = block_device_mapping_aliases[block_device_mapping_key]
137
+ instance_set = instance_set.reject{|instance| !instance['blockDeviceMapping'].detect {|block_device_mapping| [*filter_value].include?(block_device_mapping[aliased_key])}}
138
+ elsif instance_state_key = filter_key.split('instance-state-')[1]
139
+ aliased_key = instance_state_aliases[instance_state_key]
140
+ instance_set = instance_set.reject{|instance| ![*filter_value].include?(instance['instanceState'][aliased_key])}
141
+ elsif state_reason_key = filter_key.split('state-reason-')[1]
142
+ aliased_key = state_reason_aliases[state_reason_key]
143
+ instance_set = instance_set.reject{|instance| ![*filter_value].include?(instance['stateReason'][aliased_key])}
144
+ else
145
+ aliased_key = aliases[filter_key]
146
+ instance_set = instance_set.reject {|instance| ![*filter_value].include?(instance[aliased_key])}
147
+ end
148
+ end
149
+
150
+ response.status = 200
151
+ reservation_set = {}
152
+
153
+ instance_set.each do |instance|
154
+ case instance['instanceState']['name']
155
+ when 'pending'
156
+ if Time.now - instance['launchTime'] > Fog::Mock.delay
157
+ instance['ipAddress'] = Fog::AWS::Mock.ip_address
158
+ instance['dnsName'] = Fog::AWS::Mock.dns_name_for(instance['ipAddress'])
159
+ instance['privateIpAddress'] = Fog::AWS::Mock.ip_address
160
+ instance['privateDnsName'] = Fog::AWS::Mock.private_dns_name_for(instance['privateIpAddress'])
161
+ instance['instanceState'] = { 'code' => 16, 'name' => 'running' }
162
+ end
163
+ when 'rebooting'
164
+ instance['instanceState'] = { 'code' => 16, 'name' => 'running' }
165
+ when 'shutting-down'
166
+ if Time.now - @data[:deleted_at][instance['instanceId']] > Fog::Mock.delay * 2
167
+ @data[:deleted_at].delete(instance['instanceId'])
168
+ @data[:instances].delete(instance['instanceId'])
169
+ elsif Time.now - @data[:deleted_at][instance['instanceId']] > Fog::Mock.delay
170
+ instance['instanceState'] = { 'code' => 48, 'name' => 'terminating' }
171
+ end
172
+ when 'terminating'
173
+ if Time.now - @data[:deleted_at][instance['instanceId']] > Fog::Mock.delay
174
+ @data[:deleted_at].delete(instance['instanceId'])
175
+ @data[:instances].delete(instance['instanceId'])
176
+ end
177
+ end
178
+
179
+ if @data[:instances][instance['instanceId']]
180
+
181
+ reservation_set[instance['reservationId']] ||= {
182
+ 'groupSet' => instance['groupSet'],
183
+ 'instancesSet' => [],
184
+ 'ownerId' => instance['ownerId'],
185
+ 'reservationId' => instance['reservationId']
186
+ }
187
+ reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'clientToken', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'ipAddress', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'privateIpAddress', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType', 'stateReason', 'tagSet'].include?(key)}
188
+ end
189
+ end
190
+
191
+ response.body = {
192
+ 'requestId' => Fog::AWS::Mock.request_id,
193
+ 'reservationSet' => reservation_set.values
194
+ }
195
+ response
196
+ end
197
+
198
+ end
199
+ end
200
+ end
201
+ end
@@ -0,0 +1,66 @@
1
+ module Fog
2
+ module AWS
3
+ class Compute
4
+ class Real
5
+
6
+ require 'fog/compute/parsers/aws/describe_key_pairs'
7
+
8
+ # Describe all or specified key pairs
9
+ #
10
+ # ==== Parameters
11
+ # * filters<~Hash> - List of filters to limit results with
12
+ #
13
+ # ==== Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>:
16
+ # * 'requestId'<~String> - Id of request
17
+ # * 'keySet'<~Array>:
18
+ # * 'keyName'<~String> - Name of key
19
+ # * 'keyFingerprint'<~String> - Fingerprint of key
20
+ def describe_key_pairs(filters = {})
21
+ unless filters.is_a?(Hash)
22
+ Formatador.display_line("[yellow][WARN] describe_key_pairs with #{filters.class} param is deprecated, use describe_key_pairs('key-name' => []) instead[/] [light_black](#{caller.first})[/]")
23
+ filters = {'key-name' => [*filters]}
24
+ end
25
+ params = AWS.indexed_filters(filters)
26
+ request({
27
+ 'Action' => 'DescribeKeyPairs',
28
+ :idempotent => true,
29
+ :parser => Fog::Parsers::AWS::Compute::DescribeKeyPairs.new
30
+ }.merge!(params))
31
+ end
32
+
33
+ end
34
+
35
+ class Mock
36
+
37
+ def describe_key_pairs(filters = {})
38
+ unless filters.is_a?(Hash)
39
+ Formatador.display_line("[yellow][WARN] describe_key_pairs with #{filters.class} param is deprecated, use describe_key_pairs('key-name' => []) instead[/] [light_black](#{caller.first})[/]")
40
+ filters = {'key-name' => [*filters]}
41
+ end
42
+
43
+ response = Excon::Response.new
44
+
45
+ key_set = @data[:key_pairs].values
46
+
47
+ aliases = {'fingerprint' => 'keyFingerprint', 'key-name' => 'keyName'}
48
+ for filter_key, filter_value in filters
49
+ aliased_key = aliases[filter_key]
50
+ key_set = key_set.reject{|key_pair| ![*filter_value].include?(key_pair[aliased_key])}
51
+ end
52
+
53
+ response.status = 200
54
+ response.body = {
55
+ 'requestId' => Fog::AWS::Mock.request_id,
56
+ 'keySet' => key_set.map do |key_pair|
57
+ key_pair.reject {|key,value| !['keyFingerprint', 'keyName'].include?(key)}
58
+ end
59
+ }
60
+ response
61
+ end
62
+
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,66 @@
1
+ module Fog
2
+ module AWS
3
+ class Compute
4
+ class Real
5
+
6
+ require 'fog/compute/parsers/aws/describe_regions'
7
+
8
+ # Describe all or specified regions
9
+ #
10
+ # ==== Params
11
+ # * filters<~Hash> - List of filters to limit results with
12
+ #
13
+ # ==== Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>:
16
+ # * 'requestId'<~String> - Id of request
17
+ # * 'regionInfo'<~Array>:
18
+ # * 'regionName'<~String> - Name of region
19
+ # * 'regionEndpoint'<~String> - Service endpoint for region
20
+ def describe_regions(filters = {})
21
+ unless filters.is_a?(Hash)
22
+ Formatador.display_line("[yellow][WARN] describe_regions with #{filters.class} param is deprecated, use describe_regions('region-name' => []) instead[/] [light_black](#{caller.first})[/]")
23
+ filters = {'region-name' => [*filters]}
24
+ end
25
+ params = AWS.indexed_filters(filters)
26
+ request({
27
+ 'Action' => 'DescribeRegions',
28
+ :idempotent => true,
29
+ :parser => Fog::Parsers::AWS::Compute::DescribeRegions.new
30
+ }.merge!(params))
31
+ end
32
+
33
+ end
34
+
35
+ class Mock
36
+
37
+ def describe_regions(filters = {})
38
+ unless filters.is_a?(Hash)
39
+ Formatador.display_line("[yellow][WARN] describe_regions with #{filters.class} param is deprecated, use describe_regions('region-name' => []) instead[/] [light_black](#{caller.first})[/]")
40
+ filters = {'region-name' => [*filters]}
41
+ end
42
+
43
+ response = Excon::Response.new
44
+ region_info = [
45
+ {"regionName"=>"eu-west-1", "regionEndpoint"=>"eu-west-1.ec2.amazonaws.com"},
46
+ {"regionName"=>"us-east-1", "regionEndpoint"=>"us-east-1.ec2.amazonaws.com"}
47
+ ]
48
+
49
+ aliases = {'region-name' => 'regionName', 'endpoint' => 'regionEndpoint'}
50
+ for filter_key, filter_value in filters
51
+ aliased_key = aliases[filter_key]
52
+ region_info = region_info.reject{|region| ![*filter_value].include?(region[aliased_key])}
53
+ end
54
+
55
+ response.status = 200
56
+ response.body = {
57
+ 'requestId' => Fog::AWS::Mock.request_id,
58
+ 'regionInfo' => region_info
59
+ }
60
+ response
61
+ end
62
+
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,52 @@
1
+ module Fog
2
+ module AWS
3
+ class Compute
4
+ class Real
5
+
6
+ require 'fog/compute/parsers/aws/describe_reserved_instances'
7
+
8
+ # Describe all or specified reserved instances
9
+ #
10
+ # ==== Parameters
11
+ # * filters<~Hash> - List of filters to limit results with
12
+ #
13
+ # ==== Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>:
16
+ # * 'requestId'<~String> - Id of request
17
+ # * 'reservedInstancesSet'<~Array>:
18
+ # * 'availabilityZone'<~String> - availability zone of the instance
19
+ # * 'duration'<~Integer> - duration of reservation, in seconds
20
+ # * 'fixedPrice'<~Float> - purchase price of reserved instance
21
+ # * 'instanceType'<~String> - type of instance
22
+ # * 'instanceCount'<~Integer> - number of reserved instances
23
+ # * 'productDescription'<~String> - reserved instance description
24
+ # * 'reservedInstancesId'<~String> - id of the instance
25
+ # * 'start'<~Time> - start time for reservation
26
+ # * 'state'<~String> - state of reserved instance purchase, in .[pending-payment, active, payment-failed, retired]
27
+ # * 'usagePrice"<~Float> - usage price of reserved instances, per hour
28
+ def describe_reserved_instances(filters = {})
29
+ unless filters.is_a?(Hash)
30
+ Formatador.display_line("[yellow][WARN] describe_reserved_instances with #{filters.class} param is deprecated, use describe_reserved_instances('reserved-instances-id' => []) instead[/] [light_black](#{caller.first})[/]")
31
+ filters = {'reserved-instances-id' => [*filters]}
32
+ end
33
+ params = AWS.indexed_filters(filters)
34
+ request({
35
+ 'Action' => 'DescribeReservedInstances',
36
+ :idempotent => true,
37
+ :parser => Fog::Parsers::AWS::Compute::DescribeReservedInstances.new
38
+ }.merge!(params))
39
+ end
40
+
41
+ end
42
+
43
+ class Mock
44
+
45
+ def describe_reserved_instances(filters = {})
46
+ Fog::Mock.not_implemented
47
+ end
48
+
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,95 @@
1
+ module Fog
2
+ module AWS
3
+ class Compute
4
+ class Real
5
+
6
+ require 'fog/compute/parsers/aws/describe_security_groups'
7
+
8
+ # Describe all or specified security groups
9
+ #
10
+ # ==== Parameters
11
+ # * filters<~Hash> - List of filters to limit results with
12
+ #
13
+ # === Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>:
16
+ # * 'requestId'<~String> - Id of request
17
+ # * 'securityGroupInfo'<~Array>:
18
+ # * 'groupDescription'<~String> - Description of security group
19
+ # * 'groupName'<~String> - Name of security group
20
+ # * 'ipPermissions'<~Array>:
21
+ # * 'fromPort'<~Integer> - Start of port range (or -1 for ICMP wildcard)
22
+ # * 'groups'<~Array>:
23
+ # * 'groupName'<~String> - Name of security group
24
+ # * 'userId'<~String> - AWS User Id of account
25
+ # * 'ipProtocol'<~String> - Ip protocol, must be in ['tcp', 'udp', 'icmp']
26
+ # * 'ipRanges'<~Array>:
27
+ # * 'cidrIp'<~String> - CIDR range
28
+ # * 'toPort'<~Integer> - End of port range (or -1 for ICMP wildcard)
29
+ # * 'ownerId'<~String> - AWS Access Key Id of the owner of the security group
30
+ def describe_security_groups(filters = {})
31
+ unless filters.is_a?(Hash)
32
+ Formatador.display_line("[yellow][WARN] describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead[/] [light_black](#{caller.first})[/]")
33
+ filters = {'group-name' => [*filters]}
34
+ end
35
+ params = AWS.indexed_filters(filters)
36
+ request({
37
+ 'Action' => 'DescribeSecurityGroups',
38
+ :idempotent => true,
39
+ :parser => Fog::Parsers::AWS::Compute::DescribeSecurityGroups.new
40
+ }.merge!(params))
41
+ end
42
+
43
+ end
44
+
45
+ class Mock
46
+
47
+ def describe_security_groups(filters = {})
48
+ unless filters.is_a?(Hash)
49
+ Formatador.display_line("[yellow][WARN] describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead[/] [light_black](#{caller.first})[/]")
50
+ filters = {'group-name' => [*filters]}
51
+ end
52
+
53
+ response = Excon::Response.new
54
+
55
+ security_group_info = @data[:security_groups].values
56
+
57
+ aliases = {
58
+ 'description' => 'groupDescription',
59
+ 'group-name' => 'groupName',
60
+ 'owner-id' => 'ownerId'
61
+ }
62
+ permission_aliases = {
63
+ 'cidr' => 'cidrIp',
64
+ 'from-port' => 'fromPort',
65
+ 'protocol' => 'ipProtocol',
66
+ 'to-port' => 'toPort'
67
+ }
68
+ for filter_key, filter_value in filters
69
+ if permission_key = filter_key.split('ip-permission.')[1]
70
+ if permission_key == 'group-name'
71
+ security_group_info = security_group_info.reject{|security_group| !security_group['ipPermissions']['groups'].detect {|group| [*filter_value].include?(group['groupName'])}}
72
+ elsif permission_key == 'user-id'
73
+ security_group_info = security_group_info.reject{|security_group| !security_group['ipPermissions']['groups'].detect {|group| [*filter_value].include?(group['userId'])}}
74
+ else
75
+ aliased_key = permission_aliases[filter_key]
76
+ security_group_info = security_group_info.reject{|security_group| !security_group['ipPermissions'].detect {|permission| [*filter_value].include?(permission[aliased_key])}}
77
+ end
78
+ else
79
+ aliased_key = aliases[filter_key]
80
+ security_group_info = security_group_info.reject{|security_group| ![*filter_value].include?(security_group[aliased_key])}
81
+ end
82
+ end
83
+
84
+ response.status = 200
85
+ response.body = {
86
+ 'requestId' => Fog::AWS::Mock.request_id,
87
+ 'securityGroupInfo' => security_group_info
88
+ }
89
+ response
90
+ end
91
+
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,120 @@
1
+ module Fog
2
+ module AWS
3
+ class Compute
4
+ class Real
5
+
6
+ require 'fog/compute/parsers/aws/describe_snapshots'
7
+
8
+ # Describe all or specified snapshots
9
+ #
10
+ # ==== Parameters
11
+ # * filters<~Hash> - List of filters to limit results with
12
+ # * options<~Hash>:
13
+ # * 'Owner'<~String> - Owner of snapshot in ['self', 'amazon', account_id]
14
+ # * 'RestorableBy'<~String> - Account id of user who can create volumes from this snapshot
15
+ #
16
+ # ==== Returns
17
+ # * response<~Excon::Response>:
18
+ # * body<~Hash>:
19
+ # * 'requestId'<~String> - Id of request
20
+ # * 'snapshotSet'<~Array>:
21
+ # * 'progress'<~String>: The percentage progress of the snapshot
22
+ # * 'snapshotId'<~String>: Id of the snapshot
23
+ # * 'startTime'<~Time>: Timestamp of when snapshot was initiated
24
+ # * 'status'<~String>: Snapshot state, in ['pending', 'completed']
25
+ # * 'volumeId'<~String>: Id of volume that snapshot contains
26
+ def describe_snapshots(filters = {}, options = {})
27
+ unless filters.is_a?(Hash)
28
+ Formatador.display_line("[yellow][WARN] describe_snapshots with #{filters.class} param is deprecated, use describe_snapshots('snapshot-id' => []) instead[/] [light_black](#{caller.first})[/]")
29
+ filters = {'snapshot-id' => [*filters]}
30
+ end
31
+ unless options.empty?
32
+ Formatador.display_line("[yellow][WARN] describe_snapshots with a second param is deprecated, use describe_snapshots(options) instead[/] [light_black](#{caller.first})[/]")
33
+ end
34
+
35
+ for key in ['ExecutableBy', 'ImageId', 'Owner', 'RestorableBy']
36
+ if filters.has_key?(key)
37
+ options[key] = filters.delete(key)
38
+ end
39
+ end
40
+ options['RestorableBy'] ||= 'self'
41
+ params = AWS.indexed_filters(filters).merge!(options)
42
+ request({
43
+ 'Action' => 'DescribeSnapshots',
44
+ :idempotent => true,
45
+ :parser => Fog::Parsers::AWS::Compute::DescribeSnapshots.new
46
+ }.merge!(params))
47
+ end
48
+
49
+ end
50
+
51
+ class Mock
52
+
53
+ def describe_snapshots(filters = {}, options = {})
54
+ unless filters.is_a?(Hash)
55
+ Formatador.display_line("[yellow][WARN] describe_snapshots with #{filters.class} param is deprecated, use describe_snapshots('snapshot-id' => []) instead[/] [light_black](#{caller.first})[/]")
56
+ filters = {'snapshot-id' => [*filters]}
57
+ end
58
+ unless options.empty?
59
+ Formatador.display_line("[yellow][WARN] describe_snapshots with a second param is deprecated, use describe_snapshots(options) instead[/] [light_black](#{caller.first})[/]")
60
+ end
61
+
62
+ if filters.keys.any? {|key| key =~ /^tag/}
63
+ Formatador.display_line("[yellow][WARN] describe_snapshots tag filters are not yet mocked[/] [light_black](#{caller.first})[/]")
64
+ Fog::Mock.not_implemented
65
+ end
66
+
67
+ response = Excon::Response.new
68
+
69
+ snapshot_set = @data[:snapshots].values
70
+
71
+ if filters.delete('owner-alias')
72
+ Formatador.display_line("[yellow][WARN] describe_snapshots with owner-alias is not mocked[/] [light_black](#{caller.first})[/]")
73
+ end
74
+ if filters.delete('RestorableBy')
75
+ Formatador.display_line("[yellow][WARN] describe_snapshots with RestorableBy is not mocked[/] [light_black](#{caller.first})[/]")
76
+ end
77
+
78
+ aliases = {
79
+ 'description' => 'description',
80
+ 'owner-id' => 'ownerId',
81
+ 'progress' => 'progress',
82
+ 'snapshot-id' => 'snapshotId',
83
+ 'start-time' => 'startTime',
84
+ 'status' => 'status',
85
+ 'volume-id' => 'volumeId',
86
+ 'volume-size' => 'volumeSize'
87
+ }
88
+ for filter_key, filter_value in filters
89
+ aliased_key = aliases[filter_key]
90
+ snapshot_set = snapshot_set.reject{|snapshot| ![*filter_value].include?(snapshot[aliased_key])}
91
+ end
92
+
93
+ snapshot_set.each do |snapshot|
94
+ case snapshot['status']
95
+ when 'in progress', 'pending'
96
+ if Time.now - snapshot['startTime'] > Fog::Mock.delay * 2
97
+ snapshot['progress'] = '100%'
98
+ snapshot['status'] = 'completed'
99
+ elsif Time.now - snapshot['startTime'] > Fog::Mock.delay
100
+ snapshot['progress'] = '50%'
101
+ snapshot['status'] = 'in progress'
102
+ else
103
+ snapshot['progress'] = '0%'
104
+ snapshot['status'] = 'in progress'
105
+ end
106
+ end
107
+ end
108
+
109
+ response.status = 200
110
+ response.body = {
111
+ 'requestId' => Fog::AWS::Mock.request_id,
112
+ 'snapshotSet' => snapshot_set
113
+ }
114
+ response
115
+ end
116
+
117
+ end
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,42 @@
1
+ module Fog
2
+ module AWS
3
+ class Compute
4
+ class Real
5
+
6
+ require 'fog/compute/parsers/aws/describe_tags'
7
+
8
+ # Describe all or specified tags
9
+ #
10
+ # ==== Parameters
11
+ # * filters<~Hash> - List of filters to limit results with
12
+ #
13
+ # === Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>:
16
+ # * 'requestId'<~String> - Id of request
17
+ # * 'tagSet'<~Array>:
18
+ # * 'resourceId'<~String> - id of resource tag belongs to
19
+ # * 'resourceType'<~String> - type of resource tag belongs to
20
+ # * 'key'<~String> - Tag's key
21
+ # * 'value'<~String> - Tag's value
22
+ def describe_tags(filters = {})
23
+ params = AWS.indexed_filters(filters)
24
+ request({
25
+ 'Action' => 'DescribeTags',
26
+ :idempotent => true,
27
+ :parser => Fog::Parsers::AWS::Compute::DescribeTags.new
28
+ }.merge!(params))
29
+ end
30
+
31
+ end
32
+
33
+ class Mock
34
+
35
+ def describe_tags(filters = {})
36
+ Fog::Mock.not_implemented
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end