gitlab-fog-google 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (556) hide show
  1. checksums.yaml +7 -0
  2. data/.codecov.yml +2 -0
  3. data/.editorconfig +11 -0
  4. data/.fog.example +25 -0
  5. data/.gitignore +20 -0
  6. data/.gitlab-ci.yml +13 -0
  7. data/.hound.yml +2 -0
  8. data/.rubocop.yml +255 -0
  9. data/.ruby-gemset +1 -0
  10. data/.travis.yml +33 -0
  11. data/CHANGELOG.md +464 -0
  12. data/CONTRIBUTING.md +175 -0
  13. data/CONTRIBUTORS.md +95 -0
  14. data/Gemfile +13 -0
  15. data/LICENSE.md +20 -0
  16. data/MIGRATING.md +1 -0
  17. data/README.md +177 -0
  18. data/Rakefile +19 -0
  19. data/SECURITY.md +16 -0
  20. data/ci/.gitignore +1 -0
  21. data/ci/README.md +65 -0
  22. data/ci/build-head-pipeline.yml +173 -0
  23. data/ci/credentials.yml.template +28 -0
  24. data/ci/docker-image/Dockerfile +18 -0
  25. data/ci/integration-pipeline.yml +226 -0
  26. data/ci/pipeline-dev.yml +58 -0
  27. data/ci/tasks/run-int.sh +53 -0
  28. data/ci/tasks/run-int.yml +18 -0
  29. data/ci/tasks/utils.sh +10 -0
  30. data/examples/backend_services.rb +23 -0
  31. data/examples/bootstrap.rb +27 -0
  32. data/examples/create_instance.rb +73 -0
  33. data/examples/create_instance_with_attached_disk.rb +53 -0
  34. data/examples/dns/project.rb +7 -0
  35. data/examples/dns/zones.rb +43 -0
  36. data/examples/get_list_images.rb +42 -0
  37. data/examples/get_list_snapshots.rb +28 -0
  38. data/examples/image_create.rb +17 -0
  39. data/examples/l7_load_balance.rb +79 -0
  40. data/examples/load-balance.rb +116 -0
  41. data/examples/metadata.rb +40 -0
  42. data/examples/monitoring/metric_descriptors.rb +24 -0
  43. data/examples/monitoring/monitored_resource_descriptors.rb +24 -0
  44. data/examples/monitoring/timeseries_collection.rb +32 -0
  45. data/examples/network.rb +55 -0
  46. data/examples/precreated_client.rb +24 -0
  47. data/examples/pubsub/subscriptions.rb +54 -0
  48. data/examples/pubsub/topics.rb +33 -0
  49. data/examples/sql/flags.rb +11 -0
  50. data/examples/sql/instances.rb +38 -0
  51. data/examples/sql/operations.rb +24 -0
  52. data/examples/sql/ssl_certs.rb +32 -0
  53. data/examples/sql/tiers.rb +11 -0
  54. data/examples/storage.rb +49 -0
  55. data/examples/storage_json.rb +37 -0
  56. data/gitlab-fog-google.gemspec +44 -0
  57. data/lib/fog/bin/google.rb +97 -0
  58. data/lib/fog/compute/google.rb +304 -0
  59. data/lib/fog/compute/google/mock.rb +845 -0
  60. data/lib/fog/compute/google/models/address.rb +133 -0
  61. data/lib/fog/compute/google/models/addresses.rb +63 -0
  62. data/lib/fog/compute/google/models/backend_service.rb +86 -0
  63. data/lib/fog/compute/google/models/backend_services.rb +24 -0
  64. data/lib/fog/compute/google/models/disk.rb +155 -0
  65. data/lib/fog/compute/google/models/disk_type.rb +27 -0
  66. data/lib/fog/compute/google/models/disk_types.rb +42 -0
  67. data/lib/fog/compute/google/models/disks.rb +88 -0
  68. data/lib/fog/compute/google/models/firewall.rb +94 -0
  69. data/lib/fog/compute/google/models/firewalls.rb +24 -0
  70. data/lib/fog/compute/google/models/forwarding_rule.rb +79 -0
  71. data/lib/fog/compute/google/models/forwarding_rules.rb +44 -0
  72. data/lib/fog/compute/google/models/global_address.rb +58 -0
  73. data/lib/fog/compute/google/models/global_addresses.rb +46 -0
  74. data/lib/fog/compute/google/models/global_forwarding_rule.rb +78 -0
  75. data/lib/fog/compute/google/models/global_forwarding_rules.rb +24 -0
  76. data/lib/fog/compute/google/models/http_health_check.rb +104 -0
  77. data/lib/fog/compute/google/models/http_health_checks.rb +24 -0
  78. data/lib/fog/compute/google/models/image.rb +81 -0
  79. data/lib/fog/compute/google/models/images.rb +109 -0
  80. data/lib/fog/compute/google/models/instance_group.rb +90 -0
  81. data/lib/fog/compute/google/models/instance_group_manager.rb +51 -0
  82. data/lib/fog/compute/google/models/instance_group_managers.rb +45 -0
  83. data/lib/fog/compute/google/models/instance_groups.rb +63 -0
  84. data/lib/fog/compute/google/models/instance_template.rb +47 -0
  85. data/lib/fog/compute/google/models/instance_templates.rb +24 -0
  86. data/lib/fog/compute/google/models/machine_type.rb +23 -0
  87. data/lib/fog/compute/google/models/machine_types.rb +46 -0
  88. data/lib/fog/compute/google/models/network.rb +60 -0
  89. data/lib/fog/compute/google/models/networks.rb +24 -0
  90. data/lib/fog/compute/google/models/operation.rb +73 -0
  91. data/lib/fog/compute/google/models/operations.rb +45 -0
  92. data/lib/fog/compute/google/models/project.rb +28 -0
  93. data/lib/fog/compute/google/models/projects.rb +19 -0
  94. data/lib/fog/compute/google/models/region.rb +30 -0
  95. data/lib/fog/compute/google/models/regions.rb +24 -0
  96. data/lib/fog/compute/google/models/route.rb +49 -0
  97. data/lib/fog/compute/google/models/routes.rb +24 -0
  98. data/lib/fog/compute/google/models/server.rb +604 -0
  99. data/lib/fog/compute/google/models/servers.rb +120 -0
  100. data/lib/fog/compute/google/models/snapshot.rb +62 -0
  101. data/lib/fog/compute/google/models/snapshots.rb +32 -0
  102. data/lib/fog/compute/google/models/ssl_certificate.rb +42 -0
  103. data/lib/fog/compute/google/models/ssl_certificates.rb +24 -0
  104. data/lib/fog/compute/google/models/subnetwork.rb +83 -0
  105. data/lib/fog/compute/google/models/subnetworks.rb +43 -0
  106. data/lib/fog/compute/google/models/target_http_proxies.rb +24 -0
  107. data/lib/fog/compute/google/models/target_http_proxy.rb +73 -0
  108. data/lib/fog/compute/google/models/target_https_proxies.rb +24 -0
  109. data/lib/fog/compute/google/models/target_https_proxy.rb +105 -0
  110. data/lib/fog/compute/google/models/target_instance.rb +67 -0
  111. data/lib/fog/compute/google/models/target_instances.rb +46 -0
  112. data/lib/fog/compute/google/models/target_pool.rb +171 -0
  113. data/lib/fog/compute/google/models/target_pools.rb +43 -0
  114. data/lib/fog/compute/google/models/url_map.rb +121 -0
  115. data/lib/fog/compute/google/models/url_maps.rb +24 -0
  116. data/lib/fog/compute/google/models/zone.rb +25 -0
  117. data/lib/fog/compute/google/models/zones.rb +24 -0
  118. data/lib/fog/compute/google/real.rb +24 -0
  119. data/lib/fog/compute/google/requests/abandon_instances.rb +28 -0
  120. data/lib/fog/compute/google/requests/add_backend_service_backends.rb +19 -0
  121. data/lib/fog/compute/google/requests/add_instance_group_instances.rb +37 -0
  122. data/lib/fog/compute/google/requests/add_server_access_config.rb +32 -0
  123. data/lib/fog/compute/google/requests/add_target_pool_health_checks.rb +32 -0
  124. data/lib/fog/compute/google/requests/add_target_pool_instances.rb +30 -0
  125. data/lib/fog/compute/google/requests/attach_disk.rb +22 -0
  126. data/lib/fog/compute/google/requests/create_disk_snapshot.rb +24 -0
  127. data/lib/fog/compute/google/requests/delete_address.rb +24 -0
  128. data/lib/fog/compute/google/requests/delete_backend_service.rb +19 -0
  129. data/lib/fog/compute/google/requests/delete_disk.rb +25 -0
  130. data/lib/fog/compute/google/requests/delete_firewall.rb +19 -0
  131. data/lib/fog/compute/google/requests/delete_forwarding_rule.rb +20 -0
  132. data/lib/fog/compute/google/requests/delete_global_address.rb +19 -0
  133. data/lib/fog/compute/google/requests/delete_global_forwarding_rule.rb +19 -0
  134. data/lib/fog/compute/google/requests/delete_global_operation.rb +20 -0
  135. data/lib/fog/compute/google/requests/delete_http_health_check.rb +19 -0
  136. data/lib/fog/compute/google/requests/delete_image.rb +19 -0
  137. data/lib/fog/compute/google/requests/delete_instance_group.rb +19 -0
  138. data/lib/fog/compute/google/requests/delete_instance_group_manager.rb +19 -0
  139. data/lib/fog/compute/google/requests/delete_instance_template.rb +19 -0
  140. data/lib/fog/compute/google/requests/delete_network.rb +19 -0
  141. data/lib/fog/compute/google/requests/delete_region_operation.rb +22 -0
  142. data/lib/fog/compute/google/requests/delete_route.rb +23 -0
  143. data/lib/fog/compute/google/requests/delete_server.rb +19 -0
  144. data/lib/fog/compute/google/requests/delete_server_access_config.rb +22 -0
  145. data/lib/fog/compute/google/requests/delete_snapshot.rb +19 -0
  146. data/lib/fog/compute/google/requests/delete_ssl_certificate.rb +19 -0
  147. data/lib/fog/compute/google/requests/delete_subnetwork.rb +31 -0
  148. data/lib/fog/compute/google/requests/delete_target_http_proxy.rb +19 -0
  149. data/lib/fog/compute/google/requests/delete_target_https_proxy.rb +19 -0
  150. data/lib/fog/compute/google/requests/delete_target_instance.rb +20 -0
  151. data/lib/fog/compute/google/requests/delete_target_pool.rb +20 -0
  152. data/lib/fog/compute/google/requests/delete_url_map.rb +19 -0
  153. data/lib/fog/compute/google/requests/delete_zone_operation.rb +22 -0
  154. data/lib/fog/compute/google/requests/deprecate_image.rb +22 -0
  155. data/lib/fog/compute/google/requests/detach_disk.rb +20 -0
  156. data/lib/fog/compute/google/requests/expand_subnetwork_ip_cidr_range.rb +38 -0
  157. data/lib/fog/compute/google/requests/get_address.rb +24 -0
  158. data/lib/fog/compute/google/requests/get_backend_service.rb +19 -0
  159. data/lib/fog/compute/google/requests/get_backend_service_health.rb +24 -0
  160. data/lib/fog/compute/google/requests/get_disk.rb +24 -0
  161. data/lib/fog/compute/google/requests/get_disk_type.rb +19 -0
  162. data/lib/fog/compute/google/requests/get_firewall.rb +19 -0
  163. data/lib/fog/compute/google/requests/get_forwarding_rule.rb +22 -0
  164. data/lib/fog/compute/google/requests/get_global_address.rb +19 -0
  165. data/lib/fog/compute/google/requests/get_global_forwarding_rule.rb +19 -0
  166. data/lib/fog/compute/google/requests/get_global_operation.rb +23 -0
  167. data/lib/fog/compute/google/requests/get_http_health_check.rb +19 -0
  168. data/lib/fog/compute/google/requests/get_image.rb +20 -0
  169. data/lib/fog/compute/google/requests/get_image_from_family.rb +26 -0
  170. data/lib/fog/compute/google/requests/get_instance_group.rb +19 -0
  171. data/lib/fog/compute/google/requests/get_instance_group_manager.rb +19 -0
  172. data/lib/fog/compute/google/requests/get_instance_template.rb +19 -0
  173. data/lib/fog/compute/google/requests/get_machine_type.rb +20 -0
  174. data/lib/fog/compute/google/requests/get_network.rb +19 -0
  175. data/lib/fog/compute/google/requests/get_project.rb +19 -0
  176. data/lib/fog/compute/google/requests/get_region.rb +19 -0
  177. data/lib/fog/compute/google/requests/get_region_operation.rb +20 -0
  178. data/lib/fog/compute/google/requests/get_route.rb +22 -0
  179. data/lib/fog/compute/google/requests/get_server.rb +19 -0
  180. data/lib/fog/compute/google/requests/get_server_serial_port_output.rb +38 -0
  181. data/lib/fog/compute/google/requests/get_snapshot.rb +20 -0
  182. data/lib/fog/compute/google/requests/get_ssl_certificate.rb +19 -0
  183. data/lib/fog/compute/google/requests/get_subnetwork.rb +29 -0
  184. data/lib/fog/compute/google/requests/get_target_http_proxy.rb +19 -0
  185. data/lib/fog/compute/google/requests/get_target_https_proxy.rb +19 -0
  186. data/lib/fog/compute/google/requests/get_target_instance.rb +20 -0
  187. data/lib/fog/compute/google/requests/get_target_pool.rb +20 -0
  188. data/lib/fog/compute/google/requests/get_target_pool_health.rb +24 -0
  189. data/lib/fog/compute/google/requests/get_url_map.rb +19 -0
  190. data/lib/fog/compute/google/requests/get_zone.rb +19 -0
  191. data/lib/fog/compute/google/requests/get_zone_operation.rb +25 -0
  192. data/lib/fog/compute/google/requests/insert_address.rb +30 -0
  193. data/lib/fog/compute/google/requests/insert_backend_service.rb +23 -0
  194. data/lib/fog/compute/google/requests/insert_disk.rb +48 -0
  195. data/lib/fog/compute/google/requests/insert_firewall.rb +65 -0
  196. data/lib/fog/compute/google/requests/insert_forwarding_rule.rb +29 -0
  197. data/lib/fog/compute/google/requests/insert_global_address.rb +25 -0
  198. data/lib/fog/compute/google/requests/insert_global_forwarding_rule.rb +26 -0
  199. data/lib/fog/compute/google/requests/insert_http_health_check.rb +24 -0
  200. data/lib/fog/compute/google/requests/insert_image.rb +23 -0
  201. data/lib/fog/compute/google/requests/insert_instance_group.rb +37 -0
  202. data/lib/fog/compute/google/requests/insert_instance_group_manager.rb +31 -0
  203. data/lib/fog/compute/google/requests/insert_instance_template.rb +38 -0
  204. data/lib/fog/compute/google/requests/insert_network.rb +34 -0
  205. data/lib/fog/compute/google/requests/insert_route.rb +35 -0
  206. data/lib/fog/compute/google/requests/insert_server.rb +122 -0
  207. data/lib/fog/compute/google/requests/insert_ssl_certificate.rb +27 -0
  208. data/lib/fog/compute/google/requests/insert_subnetwork.rb +61 -0
  209. data/lib/fog/compute/google/requests/insert_target_http_proxy.rb +26 -0
  210. data/lib/fog/compute/google/requests/insert_target_https_proxy.rb +29 -0
  211. data/lib/fog/compute/google/requests/insert_target_instance.rb +25 -0
  212. data/lib/fog/compute/google/requests/insert_target_pool.rb +22 -0
  213. data/lib/fog/compute/google/requests/insert_url_map.rb +37 -0
  214. data/lib/fog/compute/google/requests/invalidate_url_map_cache.rb +24 -0
  215. data/lib/fog/compute/google/requests/list_addresses.rb +28 -0
  216. data/lib/fog/compute/google/requests/list_aggregated_addresses.rb +23 -0
  217. data/lib/fog/compute/google/requests/list_aggregated_disk_types.rb +24 -0
  218. data/lib/fog/compute/google/requests/list_aggregated_disks.rb +32 -0
  219. data/lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb +24 -0
  220. data/lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb +26 -0
  221. data/lib/fog/compute/google/requests/list_aggregated_instance_groups.rb +19 -0
  222. data/lib/fog/compute/google/requests/list_aggregated_machine_types.rb +24 -0
  223. data/lib/fog/compute/google/requests/list_aggregated_servers.rb +24 -0
  224. data/lib/fog/compute/google/requests/list_aggregated_subnetworks.rb +36 -0
  225. data/lib/fog/compute/google/requests/list_aggregated_target_instances.rb +26 -0
  226. data/lib/fog/compute/google/requests/list_aggregated_target_pools.rb +26 -0
  227. data/lib/fog/compute/google/requests/list_backend_services.rb +22 -0
  228. data/lib/fog/compute/google/requests/list_disk_types.rb +24 -0
  229. data/lib/fog/compute/google/requests/list_disks.rb +28 -0
  230. data/lib/fog/compute/google/requests/list_firewalls.rb +24 -0
  231. data/lib/fog/compute/google/requests/list_forwarding_rules.rb +25 -0
  232. data/lib/fog/compute/google/requests/list_global_addresses.rb +26 -0
  233. data/lib/fog/compute/google/requests/list_global_forwarding_rules.rb +24 -0
  234. data/lib/fog/compute/google/requests/list_global_operations.rb +27 -0
  235. data/lib/fog/compute/google/requests/list_http_health_checks.rb +24 -0
  236. data/lib/fog/compute/google/requests/list_images.rb +25 -0
  237. data/lib/fog/compute/google/requests/list_instance_group_instances.rb +21 -0
  238. data/lib/fog/compute/google/requests/list_instance_group_managers.rb +22 -0
  239. data/lib/fog/compute/google/requests/list_instance_groups.rb +19 -0
  240. data/lib/fog/compute/google/requests/list_instance_templates.rb +26 -0
  241. data/lib/fog/compute/google/requests/list_machine_types.rb +25 -0
  242. data/lib/fog/compute/google/requests/list_networks.rb +24 -0
  243. data/lib/fog/compute/google/requests/list_region_operations.rb +29 -0
  244. data/lib/fog/compute/google/requests/list_regions.rb +23 -0
  245. data/lib/fog/compute/google/requests/list_routes.rb +28 -0
  246. data/lib/fog/compute/google/requests/list_servers.rb +24 -0
  247. data/lib/fog/compute/google/requests/list_snapshots.rb +22 -0
  248. data/lib/fog/compute/google/requests/list_ssl_certificates.rb +26 -0
  249. data/lib/fog/compute/google/requests/list_subnetworks.rb +39 -0
  250. data/lib/fog/compute/google/requests/list_target_http_proxies.rb +25 -0
  251. data/lib/fog/compute/google/requests/list_target_https_proxies.rb +24 -0
  252. data/lib/fog/compute/google/requests/list_target_instances.rb +27 -0
  253. data/lib/fog/compute/google/requests/list_target_pools.rb +26 -0
  254. data/lib/fog/compute/google/requests/list_url_maps.rb +25 -0
  255. data/lib/fog/compute/google/requests/list_zone_operations.rb +28 -0
  256. data/lib/fog/compute/google/requests/list_zones.rb +26 -0
  257. data/lib/fog/compute/google/requests/patch_firewall.rb +27 -0
  258. data/lib/fog/compute/google/requests/patch_url_map.rb +21 -0
  259. data/lib/fog/compute/google/requests/recreate_instances.rb +28 -0
  260. data/lib/fog/compute/google/requests/remove_instance_group_instances.rb +37 -0
  261. data/lib/fog/compute/google/requests/remove_target_pool_health_checks.rb +30 -0
  262. data/lib/fog/compute/google/requests/remove_target_pool_instance.rb +30 -0
  263. data/lib/fog/compute/google/requests/remove_target_pool_instances.rb +30 -0
  264. data/lib/fog/compute/google/requests/reset_server.rb +19 -0
  265. data/lib/fog/compute/google/requests/reset_windows_password.rb +154 -0
  266. data/lib/fog/compute/google/requests/set_common_instance_metadata.rb +23 -0
  267. data/lib/fog/compute/google/requests/set_forwarding_rule_target.rb +23 -0
  268. data/lib/fog/compute/google/requests/set_global_forwarding_rule_target.rb +22 -0
  269. data/lib/fog/compute/google/requests/set_instance_template.rb +28 -0
  270. data/lib/fog/compute/google/requests/set_server_disk_auto_delete.rb +26 -0
  271. data/lib/fog/compute/google/requests/set_server_machine_type.rb +23 -0
  272. data/lib/fog/compute/google/requests/set_server_metadata.rb +39 -0
  273. data/lib/fog/compute/google/requests/set_server_scheduling.rb +24 -0
  274. data/lib/fog/compute/google/requests/set_server_tags.rb +25 -0
  275. data/lib/fog/compute/google/requests/set_snapshot_labels.rb +25 -0
  276. data/lib/fog/compute/google/requests/set_subnetwork_private_ip_google_access.rb +42 -0
  277. data/lib/fog/compute/google/requests/set_target_http_proxy_url_map.rb +24 -0
  278. data/lib/fog/compute/google/requests/set_target_https_proxy_ssl_certificates.rb +24 -0
  279. data/lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb +24 -0
  280. data/lib/fog/compute/google/requests/set_target_pool_backup.rb +31 -0
  281. data/lib/fog/compute/google/requests/start_server.rb +19 -0
  282. data/lib/fog/compute/google/requests/stop_server.rb +19 -0
  283. data/lib/fog/compute/google/requests/update_firewall.rb +49 -0
  284. data/lib/fog/compute/google/requests/update_http_health_check.rb +25 -0
  285. data/lib/fog/compute/google/requests/update_url_map.rb +28 -0
  286. data/lib/fog/compute/google/requests/validate_url_map.rb +24 -0
  287. data/lib/fog/dns/google.rb +67 -0
  288. data/lib/fog/dns/google/mock.rb +33 -0
  289. data/lib/fog/dns/google/models/change.rb +38 -0
  290. data/lib/fog/dns/google/models/changes.rb +50 -0
  291. data/lib/fog/dns/google/models/project.rb +73 -0
  292. data/lib/fog/dns/google/models/projects.rb +23 -0
  293. data/lib/fog/dns/google/models/record.rb +108 -0
  294. data/lib/fog/dns/google/models/records.rb +53 -0
  295. data/lib/fog/dns/google/models/zone.rb +72 -0
  296. data/lib/fog/dns/google/models/zones.rb +32 -0
  297. data/lib/fog/dns/google/real.rb +19 -0
  298. data/lib/fog/dns/google/requests/create_change.rb +29 -0
  299. data/lib/fog/dns/google/requests/create_managed_zone.rb +29 -0
  300. data/lib/fog/dns/google/requests/delete_managed_zone.rb +23 -0
  301. data/lib/fog/dns/google/requests/get_change.rb +23 -0
  302. data/lib/fog/dns/google/requests/get_managed_zone.rb +23 -0
  303. data/lib/fog/dns/google/requests/get_project.rb +24 -0
  304. data/lib/fog/dns/google/requests/list_changes.rb +30 -0
  305. data/lib/fog/dns/google/requests/list_managed_zones.rb +26 -0
  306. data/lib/fog/dns/google/requests/list_resource_record_sets.rb +30 -0
  307. data/lib/fog/google.rb +53 -0
  308. data/lib/fog/google/mock.rb +14 -0
  309. data/lib/fog/google/models/monitoring/metric_descriptor.rb +23 -0
  310. data/lib/fog/google/models/monitoring/metric_descriptors.rb +43 -0
  311. data/lib/fog/google/models/monitoring/monitored_resource_descriptor.rb +20 -0
  312. data/lib/fog/google/models/monitoring/monitored_resource_descriptors.rb +37 -0
  313. data/lib/fog/google/models/monitoring/timeseries.rb +19 -0
  314. data/lib/fog/google/models/monitoring/timeseries_collection.rb +48 -0
  315. data/lib/fog/google/models/pubsub/received_message.rb +40 -0
  316. data/lib/fog/google/models/pubsub/subscription.rb +86 -0
  317. data/lib/fog/google/models/pubsub/subscriptions.rb +33 -0
  318. data/lib/fog/google/models/pubsub/topic.rb +71 -0
  319. data/lib/fog/google/models/pubsub/topics.rb +32 -0
  320. data/lib/fog/google/models/sql/backup_run.rb +37 -0
  321. data/lib/fog/google/models/sql/backup_runs.rb +38 -0
  322. data/lib/fog/google/models/sql/flag.rb +23 -0
  323. data/lib/fog/google/models/sql/flags.rb +21 -0
  324. data/lib/fog/google/models/sql/instance.rb +339 -0
  325. data/lib/fog/google/models/sql/instances.rb +39 -0
  326. data/lib/fog/google/models/sql/operation.rb +67 -0
  327. data/lib/fog/google/models/sql/operations.rb +47 -0
  328. data/lib/fog/google/models/sql/ssl_cert.rb +77 -0
  329. data/lib/fog/google/models/sql/ssl_certs.rb +49 -0
  330. data/lib/fog/google/models/sql/tier.rb +20 -0
  331. data/lib/fog/google/models/sql/tiers.rb +21 -0
  332. data/lib/fog/google/models/sql/user.rb +52 -0
  333. data/lib/fog/google/models/sql/users.rb +21 -0
  334. data/lib/fog/google/monitoring.rb +60 -0
  335. data/lib/fog/google/monitoring/mock.rb +35 -0
  336. data/lib/fog/google/monitoring/real.rb +20 -0
  337. data/lib/fog/google/pubsub.rb +69 -0
  338. data/lib/fog/google/pubsub/mock.rb +34 -0
  339. data/lib/fog/google/pubsub/real.rb +21 -0
  340. data/lib/fog/google/requests/monitoring/create_metric_descriptor.rb +51 -0
  341. data/lib/fog/google/requests/monitoring/create_timeseries.rb +29 -0
  342. data/lib/fog/google/requests/monitoring/delete_metric_descriptor.rb +19 -0
  343. data/lib/fog/google/requests/monitoring/get_metric_descriptor.rb +19 -0
  344. data/lib/fog/google/requests/monitoring/get_monitored_resource_descriptor.rb +19 -0
  345. data/lib/fog/google/requests/monitoring/list_metric_descriptors.rb +26 -0
  346. data/lib/fog/google/requests/monitoring/list_monitored_resource_descriptors.rb +29 -0
  347. data/lib/fog/google/requests/monitoring/list_timeseries.rb +55 -0
  348. data/lib/fog/google/requests/pubsub/acknowledge_subscription.rb +29 -0
  349. data/lib/fog/google/requests/pubsub/create_subscription.rb +37 -0
  350. data/lib/fog/google/requests/pubsub/create_topic.rb +23 -0
  351. data/lib/fog/google/requests/pubsub/delete_subscription.rb +21 -0
  352. data/lib/fog/google/requests/pubsub/delete_topic.rb +21 -0
  353. data/lib/fog/google/requests/pubsub/get_subscription.rb +21 -0
  354. data/lib/fog/google/requests/pubsub/get_topic.rb +21 -0
  355. data/lib/fog/google/requests/pubsub/list_subscriptions.rb +29 -0
  356. data/lib/fog/google/requests/pubsub/list_topics.rb +29 -0
  357. data/lib/fog/google/requests/pubsub/publish_topic.rb +28 -0
  358. data/lib/fog/google/requests/pubsub/pull_subscription.rb +40 -0
  359. data/lib/fog/google/requests/sql/clone_instance.rb +42 -0
  360. data/lib/fog/google/requests/sql/delete_backup_run.rb +23 -0
  361. data/lib/fog/google/requests/sql/delete_instance.rb +24 -0
  362. data/lib/fog/google/requests/sql/delete_ssl_cert.rb +24 -0
  363. data/lib/fog/google/requests/sql/delete_user.rb +24 -0
  364. data/lib/fog/google/requests/sql/export_instance.rb +55 -0
  365. data/lib/fog/google/requests/sql/get_backup_run.rb +23 -0
  366. data/lib/fog/google/requests/sql/get_instance.rb +24 -0
  367. data/lib/fog/google/requests/sql/get_operation.rb +24 -0
  368. data/lib/fog/google/requests/sql/get_ssl_cert.rb +24 -0
  369. data/lib/fog/google/requests/sql/import_instance.rb +44 -0
  370. data/lib/fog/google/requests/sql/insert_backup_run.rb +28 -0
  371. data/lib/fog/google/requests/sql/insert_instance.rb +28 -0
  372. data/lib/fog/google/requests/sql/insert_ssl_cert.rb +30 -0
  373. data/lib/fog/google/requests/sql/insert_user.rb +25 -0
  374. data/lib/fog/google/requests/sql/list_backup_runs.rb +27 -0
  375. data/lib/fog/google/requests/sql/list_flags.rb +24 -0
  376. data/lib/fog/google/requests/sql/list_instances.rb +27 -0
  377. data/lib/fog/google/requests/sql/list_operations.rb +28 -0
  378. data/lib/fog/google/requests/sql/list_ssl_certs.rb +24 -0
  379. data/lib/fog/google/requests/sql/list_tiers.rb +24 -0
  380. data/lib/fog/google/requests/sql/list_users.rb +24 -0
  381. data/lib/fog/google/requests/sql/reset_instance_ssl_config.rb +26 -0
  382. data/lib/fog/google/requests/sql/restart_instance.rb +24 -0
  383. data/lib/fog/google/requests/sql/restore_instance_backup.rb +31 -0
  384. data/lib/fog/google/requests/sql/update_instance.rb +31 -0
  385. data/lib/fog/google/requests/sql/update_user.rb +27 -0
  386. data/lib/fog/google/shared.rb +253 -0
  387. data/lib/fog/google/sql.rb +104 -0
  388. data/lib/fog/google/sql/mock.rb +40 -0
  389. data/lib/fog/google/sql/real.rb +21 -0
  390. data/lib/fog/google/version.rb +5 -0
  391. data/lib/fog/parsers/storage/google.rb +15 -0
  392. data/lib/fog/parsers/storage/google/access_control_list.rb +44 -0
  393. data/lib/fog/parsers/storage/google/copy_object.rb +18 -0
  394. data/lib/fog/parsers/storage/google/get_bucket.rb +58 -0
  395. data/lib/fog/parsers/storage/google/get_bucket_logging.rb +36 -0
  396. data/lib/fog/parsers/storage/google/get_bucket_object_versions.rb +88 -0
  397. data/lib/fog/parsers/storage/google/get_bucket_versioning.rb +20 -0
  398. data/lib/fog/parsers/storage/google/get_request_payment.rb +16 -0
  399. data/lib/fog/parsers/storage/google/get_service.rb +28 -0
  400. data/lib/fog/storage/google.rb +20 -0
  401. data/lib/fog/storage/google_json.rb +74 -0
  402. data/lib/fog/storage/google_json/mock.rb +27 -0
  403. data/lib/fog/storage/google_json/models/directories.rb +41 -0
  404. data/lib/fog/storage/google_json/models/directory.rb +61 -0
  405. data/lib/fog/storage/google_json/models/file.rb +126 -0
  406. data/lib/fog/storage/google_json/models/files.rb +64 -0
  407. data/lib/fog/storage/google_json/real.rb +171 -0
  408. data/lib/fog/storage/google_json/requests/copy_object.rb +34 -0
  409. data/lib/fog/storage/google_json/requests/delete_bucket.rb +23 -0
  410. data/lib/fog/storage/google_json/requests/delete_object.rb +24 -0
  411. data/lib/fog/storage/google_json/requests/delete_object_url.rb +39 -0
  412. data/lib/fog/storage/google_json/requests/get_bucket.rb +43 -0
  413. data/lib/fog/storage/google_json/requests/get_bucket_acl.rb +32 -0
  414. data/lib/fog/storage/google_json/requests/get_object.rb +85 -0
  415. data/lib/fog/storage/google_json/requests/get_object_acl.rb +35 -0
  416. data/lib/fog/storage/google_json/requests/get_object_http_url.rb +32 -0
  417. data/lib/fog/storage/google_json/requests/get_object_https_url.rb +33 -0
  418. data/lib/fog/storage/google_json/requests/get_object_metadata.rb +32 -0
  419. data/lib/fog/storage/google_json/requests/get_object_url.rb +21 -0
  420. data/lib/fog/storage/google_json/requests/list_bucket_acl.rb +26 -0
  421. data/lib/fog/storage/google_json/requests/list_buckets.rb +30 -0
  422. data/lib/fog/storage/google_json/requests/list_object_acl.rb +29 -0
  423. data/lib/fog/storage/google_json/requests/list_objects.rb +48 -0
  424. data/lib/fog/storage/google_json/requests/put_bucket.rb +42 -0
  425. data/lib/fog/storage/google_json/requests/put_bucket_acl.rb +29 -0
  426. data/lib/fog/storage/google_json/requests/put_object.rb +102 -0
  427. data/lib/fog/storage/google_json/requests/put_object_acl.rb +35 -0
  428. data/lib/fog/storage/google_json/requests/put_object_url.rb +42 -0
  429. data/lib/fog/storage/google_json/utils.rb +40 -0
  430. data/lib/fog/storage/google_xml.rb +38 -0
  431. data/lib/fog/storage/google_xml/mock.rb +102 -0
  432. data/lib/fog/storage/google_xml/models/directories.rb +34 -0
  433. data/lib/fog/storage/google_xml/models/directory.rb +65 -0
  434. data/lib/fog/storage/google_xml/models/file.rb +130 -0
  435. data/lib/fog/storage/google_xml/models/files.rb +95 -0
  436. data/lib/fog/storage/google_xml/real.rb +108 -0
  437. data/lib/fog/storage/google_xml/requests/copy_object.rb +62 -0
  438. data/lib/fog/storage/google_xml/requests/delete_bucket.rb +39 -0
  439. data/lib/fog/storage/google_xml/requests/delete_object.rb +44 -0
  440. data/lib/fog/storage/google_xml/requests/delete_object_url.rb +42 -0
  441. data/lib/fog/storage/google_xml/requests/get_bucket.rb +95 -0
  442. data/lib/fog/storage/google_xml/requests/get_bucket_acl.rb +53 -0
  443. data/lib/fog/storage/google_xml/requests/get_object.rb +96 -0
  444. data/lib/fog/storage/google_xml/requests/get_object_acl.rb +62 -0
  445. data/lib/fog/storage/google_xml/requests/get_object_http_url.rb +37 -0
  446. data/lib/fog/storage/google_xml/requests/get_object_https_url.rb +37 -0
  447. data/lib/fog/storage/google_xml/requests/get_object_url.rb +31 -0
  448. data/lib/fog/storage/google_xml/requests/get_service.rb +44 -0
  449. data/lib/fog/storage/google_xml/requests/head_object.rb +55 -0
  450. data/lib/fog/storage/google_xml/requests/put_bucket.rb +71 -0
  451. data/lib/fog/storage/google_xml/requests/put_bucket_acl.rb +58 -0
  452. data/lib/fog/storage/google_xml/requests/put_object.rb +85 -0
  453. data/lib/fog/storage/google_xml/requests/put_object_acl.rb +58 -0
  454. data/lib/fog/storage/google_xml/requests/put_object_url.rb +42 -0
  455. data/lib/fog/storage/google_xml/utils.rb +83 -0
  456. data/tasks/bundler.rake +3 -0
  457. data/tasks/changelog.rake +39 -0
  458. data/tasks/console.rake +17 -0
  459. data/tasks/lint.rake +9 -0
  460. data/tasks/test.rake +115 -0
  461. data/test/helpers/client_helper.rb +63 -0
  462. data/test/helpers/integration_test_helper.rb +108 -0
  463. data/test/helpers/test_collection.rb +60 -0
  464. data/test/helpers/test_helper.rb +24 -0
  465. data/test/integration/compute/core_compute/test_client_options.rb +12 -0
  466. data/test/integration/compute/core_compute/test_coverage.rb +6 -0
  467. data/test/integration/compute/core_compute/test_disk_types.rb +43 -0
  468. data/test/integration/compute/core_compute/test_disks.rb +53 -0
  469. data/test/integration/compute/core_compute/test_images.rb +32 -0
  470. data/test/integration/compute/core_compute/test_machine_types.rb +55 -0
  471. data/test/integration/compute/core_compute/test_operations.rb +45 -0
  472. data/test/integration/compute/core_compute/test_projects.rb +19 -0
  473. data/test/integration/compute/core_compute/test_regions.rb +33 -0
  474. data/test/integration/compute/core_compute/test_servers.rb +149 -0
  475. data/test/integration/compute/core_compute/test_snapshots.rb +21 -0
  476. data/test/integration/compute/core_compute/test_zones.rb +35 -0
  477. data/test/integration/compute/core_networking/test_addresses.rb +107 -0
  478. data/test/integration/compute/core_networking/test_coverage.rb +6 -0
  479. data/test/integration/compute/core_networking/test_firewalls.rb +11 -0
  480. data/test/integration/compute/core_networking/test_networks.rb +41 -0
  481. data/test/integration/compute/core_networking/test_routes.rb +26 -0
  482. data/test/integration/compute/core_networking/test_subnetworks.rb +11 -0
  483. data/test/integration/compute/instance_groups/test_coverage.rb +6 -0
  484. data/test/integration/compute/instance_groups/test_instance_group_managers.rb +11 -0
  485. data/test/integration/compute/instance_groups/test_instance_groups.rb +11 -0
  486. data/test/integration/compute/instance_groups/test_instance_templates.rb +11 -0
  487. data/test/integration/compute/loadbalancing/test_backend_services.rb +11 -0
  488. data/test/integration/compute/loadbalancing/test_coverage.rb +6 -0
  489. data/test/integration/compute/loadbalancing/test_forwarding_rules.rb +11 -0
  490. data/test/integration/compute/loadbalancing/test_global_addresses.rb +11 -0
  491. data/test/integration/compute/loadbalancing/test_global_forwarding_rules.rb +11 -0
  492. data/test/integration/compute/loadbalancing/test_http_health_checks.rb +11 -0
  493. data/test/integration/compute/loadbalancing/test_ssl_certificates.rb +11 -0
  494. data/test/integration/compute/loadbalancing/test_target_http_proxies.rb +11 -0
  495. data/test/integration/compute/loadbalancing/test_target_https_proxies.rb +11 -0
  496. data/test/integration/compute/loadbalancing/test_target_instances.rb +11 -0
  497. data/test/integration/compute/loadbalancing/test_target_pools.rb +55 -0
  498. data/test/integration/compute/loadbalancing/test_url_maps.rb +11 -0
  499. data/test/integration/factories/addresses_factory.rb +20 -0
  500. data/test/integration/factories/backend_services_factory.rb +19 -0
  501. data/test/integration/factories/collection_factory.rb +52 -0
  502. data/test/integration/factories/disks_factory.rb +22 -0
  503. data/test/integration/factories/firewalls_factory.rb +13 -0
  504. data/test/integration/factories/forwarding_rules_factory.rb +25 -0
  505. data/test/integration/factories/global_addresses_factory.rb +15 -0
  506. data/test/integration/factories/global_forwarding_rules_factory.rb +20 -0
  507. data/test/integration/factories/http_health_checks_factory.rb +11 -0
  508. data/test/integration/factories/images_factory.rb +16 -0
  509. data/test/integration/factories/instance_group_manager_factory.rb +30 -0
  510. data/test/integration/factories/instance_groups_factory.rb +20 -0
  511. data/test/integration/factories/instance_template_factory.rb +24 -0
  512. data/test/integration/factories/networks_factory.rb +16 -0
  513. data/test/integration/factories/servers_factory.rb +30 -0
  514. data/test/integration/factories/sql_certs_factory.rb +20 -0
  515. data/test/integration/factories/sql_instances_factory.rb +19 -0
  516. data/test/integration/factories/sql_users_factory.rb +23 -0
  517. data/test/integration/factories/ssl_certificates_factory.rb +13 -0
  518. data/test/integration/factories/subnetworks_factory.rb +26 -0
  519. data/test/integration/factories/target_http_proxies_factory.rb +19 -0
  520. data/test/integration/factories/target_https_proxies_factory.rb +26 -0
  521. data/test/integration/factories/target_instances_factory.rb +24 -0
  522. data/test/integration/factories/target_pools_factory.rb +28 -0
  523. data/test/integration/factories/url_maps_factory.rb +19 -0
  524. data/test/integration/monitoring/test_coverage.rb +6 -0
  525. data/test/integration/monitoring/test_metric_descriptors.rb +131 -0
  526. data/test/integration/monitoring/test_monitored_resource_descriptors.rb +37 -0
  527. data/test/integration/monitoring/test_timeseries.rb +238 -0
  528. data/test/integration/pubsub/pubsub_shared.rb +75 -0
  529. data/test/integration/pubsub/test_coverage.rb +6 -0
  530. data/test/integration/pubsub/test_pubsub_models.rb +135 -0
  531. data/test/integration/pubsub/test_pubsub_requests.rb +105 -0
  532. data/test/integration/sql/test_certs.rb +50 -0
  533. data/test/integration/sql/test_common_flags.rb +31 -0
  534. data/test/integration/sql/test_common_tiers.rb +26 -0
  535. data/test/integration/sql/test_coverage.rb +6 -0
  536. data/test/integration/sql/test_instances.rb +101 -0
  537. data/test/integration/sql/test_users.rb +37 -0
  538. data/test/integration/storage/storage_shared.rb +96 -0
  539. data/test/integration/storage/test_buckets.rb +112 -0
  540. data/test/integration/storage/test_coverage.rb +6 -0
  541. data/test/integration/storage/test_directories.rb +67 -0
  542. data/test/integration/storage/test_files.rb +168 -0
  543. data/test/integration/storage/test_objects.rb +203 -0
  544. data/test/integration/test_authentication.rb +38 -0
  545. data/test/unit/compute/test_common_collections.rb +42 -0
  546. data/test/unit/compute/test_common_models.rb +35 -0
  547. data/test/unit/compute/test_server.rb +29 -0
  548. data/test/unit/dns/test_common_collections.rb +43 -0
  549. data/test/unit/monitoring/test_comon_collections.rb +44 -0
  550. data/test/unit/pubsub/test_common_collections.rb +35 -0
  551. data/test/unit/sql/test_common_collections.rb +46 -0
  552. data/test/unit/storage/test_common_json_collections.rb +38 -0
  553. data/test/unit/storage/test_common_xml_collections.rb +50 -0
  554. data/test/unit/storage/test_json_requests.rb +44 -0
  555. data/test/unit/storage/test_xml_requests.rb +60 -0
  556. metadata +897 -0
@@ -0,0 +1,845 @@
1
+ module Fog
2
+ module Compute
3
+ class Google
4
+ class Mock
5
+ include Fog::Google::Shared
6
+ attr_reader :extra_global_projects, :exclude_projects
7
+
8
+ def initialize(options)
9
+ shared_initialize(options[:google_project], GOOGLE_COMPUTE_API_VERSION, GOOGLE_COMPUTE_BASE_URL)
10
+ @extra_global_projects = options.fetch(:google_extra_global_projects, [])
11
+ @exclude_projects = options.fetch(:google_exclude_projects, [])
12
+ end
13
+
14
+ def self.data(api_version)
15
+ @data ||= Hash.new do |hash, key|
16
+ case key
17
+ when "debian-cloud"
18
+ hash[key] =
19
+ {
20
+ :images => {
21
+ "debian-8-jessie-v20161215" => {
22
+ "archiveSizeBytes" => "3436783050",
23
+ "creationTimestamp" => "2016-12-15T12 =>53 =>12.508-08 =>00",
24
+ "description" => "Debian, Debian GNU/Linux, 8 (jessie), amd64 built on 2016-12-15",
25
+ "diskSizeGb" => "10",
26
+ "family" => "debian-8",
27
+ "id" => "7187216073735715927",
28
+ "kind" => "compute#image",
29
+ "licenses" => [
30
+ "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/licenses/debian-8-jessie"
31
+ ],
32
+ "name" => "debian-8-jessie-v20161215",
33
+ "rawDisk" => {
34
+ "containerType" => "TAR",
35
+ "source" => ""
36
+ },
37
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-8-jessie-v20161215",
38
+ "sourceType" => "RAW",
39
+ "status" => "READY"
40
+ }
41
+ }
42
+ }
43
+ when "centos-cloud"
44
+ hash[key] =
45
+ {
46
+ :images => {
47
+ "centos-6-v20161212" => {
48
+ "archiveSizeBytes" => "3942360630",
49
+ "creationTimestamp" => "2016-12-14T10 =>30 =>52.053-08 =>00",
50
+ "description" => "CentOS, CentOS, 6, x86_64 built on 2016-12-12",
51
+ "diskSizeGb" => "10",
52
+ "family" => "centos-6",
53
+ "id" => "5262726857160929587",
54
+ "kind" => "compute#image",
55
+ "licenses" => [
56
+ "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/licenses/centos-6"
57
+ ],
58
+ "name" => "centos-6-v20161212",
59
+ "rawDisk" => {
60
+ "containerType" => "TAR",
61
+ "source" => ""
62
+ },
63
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/images/centos-6-v20161212",
64
+ "sourceType" => "RAW",
65
+ "status" => "READY"
66
+ },
67
+ "centos-7-v20161212" => {
68
+ "archiveSizeBytes" => "4491098988",
69
+ "creationTimestamp" => "2016-12-14T10 =>29 =>44.741-08 =>00",
70
+ "description" => "CentOS, CentOS, 7, x86_64 built on 2016-12-12",
71
+ "diskSizeGb" => "10",
72
+ "family" => "centos-7",
73
+ "id" => "8650499281020268919",
74
+ "kind" => "compute#image",
75
+ "licenses" => [
76
+ "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/licenses/centos-7"
77
+ ],
78
+ "name" => "centos-7-v20161212",
79
+ "rawDisk" => {
80
+ "containerType" => "TAR",
81
+ "source" => ""
82
+ },
83
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/images/centos-7-v20161212",
84
+ "sourceType" => "RAW",
85
+ "status" => "READY"
86
+ }
87
+ }
88
+ }
89
+ else
90
+ hash[key] =
91
+ {
92
+ :target_http_proxies => {
93
+ "test-target-http-proxy" => {
94
+ "kind" => "compute#targetHttpProxy",
95
+ "id" => "1361932147851415729",
96
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
97
+ "name" => "test-target-http-proxy",
98
+ "description" => "",
99
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/targetHttpProxies/test-target-http-proxy",
100
+ "urlMap" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/urlMaps/test-url-map"
101
+ }
102
+ },
103
+ :url_maps => {
104
+ "test-url-map" => {
105
+ "kind" => "compute#urlMap",
106
+ "id" => "1361932147851415729",
107
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
108
+ "name" => "test-url-map",
109
+ "description" => "",
110
+ "hostRules" => [],
111
+ "pathMatchers" => [],
112
+ "tests" => [],
113
+ "defaultService" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/backendServices/fog-backend-service-test",
114
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/urlMaps/test-url-map"
115
+ }
116
+ },
117
+ :target_pools => {
118
+ "test-target-pool" => {
119
+ "kind" => "compute#targetPool",
120
+ "id" => "1361932147851415729",
121
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1/targetPools/test-target-pool",
122
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
123
+ "name" => "test-target-pool",
124
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1",
125
+ "healthChecks" => ["https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/httpHealthChecks/test-check"],
126
+ "instances" => ["https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/us-central1-a/instances/test-instance"]
127
+ }
128
+ },
129
+
130
+ :http_health_checks => {
131
+ "test-http-health-check" => {
132
+ "checkIntervalSec" => 5,
133
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
134
+ "healthyThreshold" => 2,
135
+ "id" => "1361932147851415729",
136
+ "kind" => "compute#httphealthCheck",
137
+ "name" => "test-http-health-check",
138
+ "port" => 80,
139
+ "requestPath" => "/",
140
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/httpHealthChecks/test-http-health-check",
141
+ "timeoutSec" => 5,
142
+ "unhealthyThreshold" => 2
143
+ }
144
+ },
145
+ :global_forwarding_rules => {
146
+ "test-global-forwarding-rule" => {
147
+ "kind" => "compute#forwardingRule",
148
+ "id" => "1361932147851415729",
149
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
150
+ "name" => "test-global-forwarding-rule",
151
+ "IPAddress" => "107.178.255.155",
152
+ "IPProtocol" => "TCP",
153
+ "portRange" => "80-80",
154
+ "target" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/targetHttpProxies/proxy",
155
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/forwardngRules/test-global-forwarding-rule"
156
+ }
157
+ },
158
+ :forwarding_rules => {
159
+ "test-forwarding-rule" => {
160
+ "kind" => "compute#forwardingRule",
161
+ "id" => "1361932147851415729",
162
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
163
+ "name" => "test-forwarding-rule",
164
+ "IPAddress" => "107.178.255.155",
165
+ "IPProtocol" => "TCP",
166
+ "portRange" => "80-80",
167
+ "target" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1/targetPools/target_pool",
168
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1/forwardngRules/test-forwarding-rule",
169
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1"
170
+ }
171
+ },
172
+ :target_instances => {
173
+ "test-target-instance" => {
174
+ "kind" => "compute#targetInstance",
175
+ "name" => "test-target-instance",
176
+ "natPolicy" => "NO_NAT",
177
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/us-central1-a",
178
+ "instance" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/us-central1-a/instances/test-instance",
179
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/us-central1-a/targetInstances/test-target-instance",
180
+ "id" => "1361932147851415729",
181
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00"
182
+
183
+ }
184
+ },
185
+ :servers => {
186
+ "fog-1" => {
187
+ "kind" => "compute#instance",
188
+ "id" => "1361932147851415727",
189
+ "creationTimestamp" => "2013-09-26T04:55:43.881-07:00",
190
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
191
+ "status" => "RUNNING",
192
+ "name" => "fog-1380196541",
193
+ "tags" => { "fingerprint" => "42WmSpB8rSM=" },
194
+ "machineType" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/machineTypes/n1-standard-1",
195
+ "canIpForward" => false,
196
+ "networkInterfaces" => [
197
+ {
198
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/default",
199
+ "networkIP" => "10.240.121.54",
200
+ "name" => "nic0",
201
+ "accessConfigs" => [
202
+ {
203
+ "kind" => "compute#accessConfig",
204
+ "type" => "ONE_TO_ONE_NAT",
205
+ "name" => "External NAT",
206
+ "natIP" => "108.59.81.28"
207
+ }
208
+ ]
209
+ }
210
+ ],
211
+ "disks" => [
212
+ {
213
+ "kind" => "compute#attachedDisk",
214
+ "index" => 0,
215
+ "type" => "PERSISTENT",
216
+ "mode" => "READ_WRITE",
217
+ "source" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/disks/fog-1",
218
+ "deviceName" => "persistent-disk-0",
219
+ "boot" => true
220
+ }
221
+ ],
222
+ "metadata" => {
223
+ "kind" => "compute#metadata",
224
+ "fingerprint" => "5_hasd_gC3E=",
225
+ "items" => [
226
+ {
227
+ "key" => "ssh-keys",
228
+ "value" => "sysadmin:ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA1zc7mx+0H8Roywet/L0aVX6MUdkDfzd/17kZhprAbpUXYOILv9AG4lIzQk6xGxDIltghytjfVGme/4A42Sb0Z9LN0pxB4KnWTNoOSHPJtp6jbXpq6PdN9r3Z5NKQg0A/Tfw7gt2N0GDsj6vpK8VbHHdW78JAVUxql18ootJxjaksdocsiHNK8iA6/v9qiLRhX3fOgtK7KpxxdZxLRzFg9vkp8jcGISgpZt27kOgXWhR5YLhi8pRJookzphO5O4yhflgoHoAE65XkfrsRCe0HU5QTbY2jH88rBVkq0KVlZh/lEsuwfmG4d77kEqaCGGro+j1Wrvo2K3DSQ+rEcvPp2CYRUySjhaeLF18UzQLtxNeoN14QOYqlm9ITdkCnmq5w4Wn007MjSOFp8LEq2RekrnddGXjg1/vgmXtaVSGzJAlXwtVfZor3dTRmF0JCpr7DsiupBaDFtLUlGFFlSKmPDVMPOOB5wajexmcvSp2Vu4U3yP8Lai/9/ZxMdsGPhpdCsWVL83B5tF4oYj1HVIycbYIxIIfFqOxZcCru3CMfe9jmzKgKLv2UtkfOS8jpS/Os2gAiB3wPweH3agvtwYAYBVMDwt5cnrhgHYWoOz7ABD8KgmCrD7Y9HikiCqIUNkgUFd9YmjcYi5FkU5rFXIawN7efs341lsdf923lsdf923fs= johndoe@acme"
229
+ }
230
+ ]
231
+ },
232
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/instances/fog-1380196541"
233
+ }
234
+ },
235
+ :zones => {
236
+ "europe-west1-a" => {
237
+ "kind" => "compute#zone",
238
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/europe-west1-a",
239
+ "id" => "10419676573632995924",
240
+ "creationTimestamp" => "2013-09-26T02:56:13.115-07:00",
241
+ "name" => "europe-west1-a",
242
+ "description" => "europe-west1-a",
243
+ "status" => "UP",
244
+ "maintenanceWindows" => [
245
+ {
246
+ "name" => "2014-01-18-planned-outage",
247
+ "description" => "maintenance zone",
248
+ "beginTime" => "2014-01-18T12:00:00.000-08:00",
249
+ "endTime" => "2014-02-02T12:00:00.000-08:00"
250
+ }
251
+ ],
252
+ "quotas" => [
253
+ { "metric" => "INSTANCES", "limit" => 16.0, "usage" => 0.0 },
254
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 0.0 },
255
+ { "metric" => "DISKS", "limit" => 16.0, "usage" => 0.0 },
256
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 }
257
+ ],
258
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/europe-west1"
259
+ },
260
+ "us-central1-a" => {
261
+ "kind" => "compute#zone",
262
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
263
+ "id" => "6562457277909136262",
264
+ "creationTimestamp" => "2013-09-26T02:56:13.116-07:00",
265
+ "name" => "us-central1-a",
266
+ "description" => "us-central1-a",
267
+ "status" => "UP",
268
+ "maintenanceWindows" => nil,
269
+ "quotas" => [
270
+ { "metric" => "INSTANCES", "limit" => 16.0, "usage" => 1.0 },
271
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 1.0 },
272
+ { "metric" => "DISKS", "limit" => 16.0, "usage" => 0.0 },
273
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 }
274
+ ],
275
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1"
276
+ },
277
+ "us-central1-b" => {
278
+ "kind" => "compute#zone",
279
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-b",
280
+ "id" => "8701502109626061015",
281
+ "creationTimestamp" => "2013-09-26T02:56:13.124-07:00",
282
+ "name" => "us-central1-b",
283
+ "description" => "us-central1-b",
284
+ "status" => "UP",
285
+ "maintenanceWindows" => [{ "name" => "2013-10-26-planned-outage",
286
+ "description" => "maintenance zone",
287
+ "beginTime" => "2013-10-26T12:00:00.000-07:00",
288
+ "endTime" => "2013-11-10T12:00:00.000-08:00" }],
289
+ "quotas" => [
290
+ { "metric" => "INSTANCES", "limit" => 16.0, "usage" => 0.0 },
291
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 0.0 },
292
+ { "metric" => "DISKS", "limit" => 16.0, "usage" => 0.0 },
293
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 }
294
+ ],
295
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1"
296
+ },
297
+ "us-central2-a" => {
298
+ "kind" => "compute#zone",
299
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central2-a",
300
+ "id" => "13611654493253680292",
301
+ "creationTimestamp" => "2013-09-26T02:56:13.125-07:00",
302
+ "name" => "us-central2-a",
303
+ "description" => "us-central2-a",
304
+ "status" => "UP",
305
+ "maintenanceWindows" => [
306
+ {
307
+ "name" => "2013-10-12-planned-outage",
308
+ "description" => "maintenance zone",
309
+ "beginTime" => "2013-10-12T12:00:00.000-07:00",
310
+ "endTime" => "2013-10-27T12:00:00.000-07:00"
311
+ }
312
+ ],
313
+ "quotas" => [
314
+ { "metric" => "INSTANCES", "limit" => 16.0, "usage" => 0.0 },
315
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 0.0 },
316
+ { "metric" => "DISKS", "limit" => 16.0, "usage" => 0.0 },
317
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 }
318
+ ],
319
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central2"
320
+ }
321
+ },
322
+ :regions => {
323
+ "us-central1" => {
324
+ "creationTimestamp" => "2014-01-21T10:30:54.895-08:00",
325
+ "description" => "us-central1",
326
+ "id" => "18201118976141502843",
327
+ "kind" => "compute#region",
328
+ "name" => "us-central1",
329
+ "quotas" => [
330
+ { "metric" => "CPUS", "limit" => 1050.0, "usage" => 28.0 },
331
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 10_000.0, "usage" => 292.0 },
332
+ { "metric" => "STATIC_ADDRESSES", "limit" => 10.0, "usage" => 0.0 },
333
+ { "metric" => "IN_USE_ADDRESSES", "limit" => 1050.0, "usage" => 30.0 },
334
+ { "metric" => "SSD_TOTAL_GB", "limit" => 1024.0, "usage" => 0.0 }
335
+ ],
336
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1",
337
+ "status" => "UP",
338
+ "zones" => [
339
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
340
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-b",
341
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-f"
342
+ ]
343
+ },
344
+ "europe-west1" => {
345
+ "creationTimestamp" => "2014-01-21T10:30:54.891-08:00",
346
+ "description" => "europe-west1",
347
+ "id" => "18201118976141502843",
348
+ "kind" => "compute#region",
349
+ "name" => "europe-west1",
350
+ "quotas" => [
351
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 0.0 },
352
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 },
353
+ { "metric" => "STATIC_ADDRESSES", "limit" => 7.0, "usage" => 0.0 },
354
+ { "metric" => "IN_USE_ADDRESSES", "limit" => 23.0, "usage" => 0.0 },
355
+ { "metric" => "SSD_TOTAL_GB", "limit" => 1024.0, "usage" => 0.0 }
356
+ ],
357
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/erope-west1",
358
+ "status" => "UP",
359
+ "zones" => [
360
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/europe-west1-a",
361
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/europe-west1-b"
362
+ ]
363
+ },
364
+ "asia-east1" => {
365
+ "creationTimestamp" => "2014-01-21T10:30:54.895-08:00",
366
+ "description" => "asia-east1",
367
+ "id" => "18201118976141502843",
368
+ "kind" => "compute#region",
369
+ "name" => "asia-east1",
370
+ "quotas" => [
371
+ { "metric" => "CPUS", "limit" => 1050.0, "usage" => 28.0 },
372
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 10_000.0, "usage" => 292.0 },
373
+ { "metric" => "STATIC_ADDRESSES", "limit" => 10.0, "usage" => 0.0 },
374
+ { "metric" => "IN_USE_ADDRESSES", "limit" => 1050.0, "usage" => 30.0 },
375
+ { "metric" => "SSD_TOTAL_GB", "limit" => 1024.0, "usage" => 0.0 }
376
+ ],
377
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/asia-east1",
378
+ "status" => "UP",
379
+ "zones" => [
380
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/asia-east1-a",
381
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/asia-east1-b",
382
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/asia-east1-c"
383
+ ]
384
+ }
385
+ },
386
+
387
+ :machine_types => Hash.new do |machine_types_hash, zone|
388
+ machine_types_hash[zone] = {
389
+ "f1-micro" => {
390
+ "kind" => "compute#machineType",
391
+ "id" => "4618642685664990776",
392
+ "creationTimestamp" => "2013-04-25T13:32:49.088-07:00",
393
+ "name" => "f1-micro",
394
+ "description" => "1 vCPU (shared physical core) and 0.6 GB RAM",
395
+ "guestCpus" => 1,
396
+ "memoryMb" => 614,
397
+ "imageSpaceGb" => 0,
398
+ "maximumPersistentDisks" => 4,
399
+ "maximumPersistentDisksSizeGb" => "3072",
400
+ "zone" => zone,
401
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/f1-micro"
402
+ },
403
+ "g1-small" => {
404
+ "kind" => "compute#machineType",
405
+ "id" => "7224129552184485774",
406
+ "creationTimestamp" => "2013-04-25T13:32:45.550-07:00",
407
+ "name" => "g1-small",
408
+ "description" => "1 vCPU (shared physical core) and 1.7 GB RAM",
409
+ "guestCpus" => 1,
410
+ "memoryMb" => 1740,
411
+ "imageSpaceGb" => 0,
412
+ "maximumPersistentDisks" => 4,
413
+ "maximumPersistentDisksSizeGb" => "3072",
414
+ "zone" => zone,
415
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/g1-small"
416
+ },
417
+ "n1-highcpu-2" => {
418
+ "kind" => "compute#machineType",
419
+ "id" => "13043554592196512955",
420
+ "creationTimestamp" => "2012-11-16T11:46:10.572-08:00",
421
+ "name" => "n1-highcpu-2",
422
+ "description" => "2 vCPUs, 1.8 GB RAM",
423
+ "guestCpus" => 2,
424
+ "memoryMb" => 1843,
425
+ "imageSpaceGb" => 10,
426
+ "maximumPersistentDisks" => 16,
427
+ "maximumPersistentDisksSizeGb" => "10240",
428
+ "zone" => zone,
429
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-2"
430
+ },
431
+ "n1-highcpu-2-d" => {
432
+ "kind" => "compute#machineType",
433
+ "id" => "13043555176034896271",
434
+ "creationTimestamp" => "2012-11-16T11:47:07.825-08:00",
435
+ "name" => "n1-highcpu-2-d",
436
+ "description" => "2 vCPUs, 1.8 GB RAM, 1 scratch disk (870 GB)",
437
+ "guestCpus" => 2,
438
+ "memoryMb" => 1843,
439
+ "imageSpaceGb" => 10,
440
+ "scratchDisks" => [
441
+ {
442
+ "diskGb" => 870
443
+ }
444
+ ],
445
+ "maximumPersistentDisks" => 16,
446
+ "maximumPersistentDisksSizeGb" => "10240",
447
+ "zone" => zone,
448
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-2-d"
449
+ },
450
+ "n1-highcpu-4" => {
451
+ "kind" => "compute#machineType",
452
+ "id" => "13043555705736970382",
453
+ "creationTimestamp" => "2012-11-16T11:48:06.087-08:00",
454
+ "name" => "n1-highcpu-4",
455
+ "description" => "4 vCPUs, 3.6 GB RAM",
456
+ "guestCpus" => 4,
457
+ "memoryMb" => 3686,
458
+ "imageSpaceGb" => 10,
459
+ "maximumPersistentDisks" => 16,
460
+ "maximumPersistentDisksSizeGb" => "10240",
461
+ "zone" => zone,
462
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-4"
463
+ },
464
+ "n1-highcpu-4-d" => {
465
+ "kind" => "compute#machineType",
466
+ "id" => "13043556330284250611",
467
+ "creationTimestamp" => "2012-11-16T11:49:07.563-08:00",
468
+ "name" => "n1-highcpu-4-d",
469
+ "description" => "4 vCPUS, 3.6 GB RAM, 1 scratch disk (1770 GB)",
470
+ "guestCpus" => 4,
471
+ "memoryMb" => 3686,
472
+ "imageSpaceGb" => 10,
473
+ "scratchDisks" => [
474
+ {
475
+ "diskGb" => 1770
476
+ }
477
+ ],
478
+ "maximumPersistentDisks" => 16,
479
+ "maximumPersistentDisksSizeGb" => "10240",
480
+ "zone" => zone,
481
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-4-d"
482
+ },
483
+ "n1-highcpu-8" => {
484
+ "kind" => "compute#machineType",
485
+ "id" => "13043556949665240937",
486
+ "creationTimestamp" => "2012-11-16T11:50:15.128-08:00",
487
+ "name" => "n1-highcpu-8",
488
+ "description" => "8 vCPUs, 7.2 GB RAM",
489
+ "guestCpus" => 8,
490
+ "memoryMb" => 7373,
491
+ "imageSpaceGb" => 10,
492
+ "maximumPersistentDisks" => 16,
493
+ "maximumPersistentDisksSizeGb" => "10240",
494
+ "zone" => zone,
495
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-8"
496
+ },
497
+ "n1-highcpu-8-d" => {
498
+ "kind" => "compute#machineType",
499
+ "id" => "13043557458004959701",
500
+ "creationTimestamp" => "2012-11-16T11:51:04.549-08:00",
501
+ "name" => "n1-highcpu-8-d",
502
+ "description" => "8 vCPUS, 7.2 GB RAM, 2 scratch disks (1770 GB, 1770 GB)",
503
+ "guestCpus" => 8,
504
+ "memoryMb" => 7373,
505
+ "imageSpaceGb" => 10,
506
+ "scratchDisks" => [
507
+ {
508
+ "diskGb" => 1770
509
+ },
510
+ {
511
+ "diskGb" => 1770
512
+ }
513
+ ],
514
+ "maximumPersistentDisks" => 16,
515
+ "maximumPersistentDisksSizeGb" => "10240",
516
+ "zone" => zone,
517
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-8-d"
518
+ },
519
+ "n1-highmem-2" => {
520
+ "kind" => "compute#machineType",
521
+ "id" => "13043551079318055993",
522
+ "creationTimestamp" => "2012-11-16T11:40:06.129-08:00",
523
+ "name" => "n1-highmem-2",
524
+ "description" => "2 vCPUs, 13 GB RAM",
525
+ "guestCpus" => 2,
526
+ "memoryMb" => 13_312,
527
+ "imageSpaceGb" => 10,
528
+ "maximumPersistentDisks" => 16,
529
+ "maximumPersistentDisksSizeGb" => "10240",
530
+ "zone" => zone,
531
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-2"
532
+ },
533
+ "n1-highmem-2-d" => {
534
+ "kind" => "compute#machineType",
535
+ "id" => "13043551625558644085",
536
+ "creationTimestamp" => "2012-11-16T11:40:59.630-08:00",
537
+ "name" => "n1-highmem-2-d",
538
+ "description" => "2 vCPUs, 13 GB RAM, 1 scratch disk (870 GB)",
539
+ "guestCpus" => 2,
540
+ "memoryMb" => 13_312,
541
+ "imageSpaceGb" => 10,
542
+ "scratchDisks" => [
543
+ {
544
+ "diskGb" => 870
545
+ }
546
+ ],
547
+ "maximumPersistentDisks" => 16,
548
+ "maximumPersistentDisksSizeGb" => "10240",
549
+ "zone" => zone,
550
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-2-d"
551
+ },
552
+ "n1-highmem-4" => {
553
+ "kind" => "compute#machineType",
554
+ "id" => "13043552263604939569",
555
+ "creationTimestamp" => "2012-11-16T11:42:08.983-08:00",
556
+ "name" => "n1-highmem-4",
557
+ "description" => "4 vCPUs, 26 GB RAM",
558
+ "guestCpus" => 4,
559
+ "memoryMb" => 26_624,
560
+ "imageSpaceGb" => 10,
561
+ "maximumPersistentDisks" => 16,
562
+ "maximumPersistentDisksSizeGb" => "10240",
563
+ "zone" => zone,
564
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-4"
565
+ },
566
+ "n1-highmem-4-d" => {
567
+ "kind" => "compute#machineType",
568
+ "id" => "13043552953632709737",
569
+ "creationTimestamp" => "2012-11-16T11:43:17.400-08:00",
570
+ "name" => "n1-highmem-4-d",
571
+ "description" => "4 vCPUs, 26 GB RAM, 1 scratch disk (1770 GB)",
572
+ "guestCpus" => 4,
573
+ "memoryMb" => 26_624,
574
+ "imageSpaceGb" => 10,
575
+ "scratchDisks" => [
576
+ {
577
+ "diskGb" => 1770
578
+ }
579
+ ],
580
+ "maximumPersistentDisks" => 16,
581
+ "maximumPersistentDisksSizeGb" => "10240",
582
+ "zone" => zone,
583
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-4-d"
584
+ },
585
+ "n1-highmem-8" => {
586
+ "kind" => "compute#machineType",
587
+ "id" => "13043553584275586275",
588
+ "creationTimestamp" => "2012-11-16T11:44:25.985-08:00",
589
+ "name" => "n1-highmem-8",
590
+ "description" => "8 vCPUs, 52 GB RAM",
591
+ "guestCpus" => 8,
592
+ "memoryMb" => 53_248,
593
+ "imageSpaceGb" => 10,
594
+ "maximumPersistentDisks" => 16,
595
+ "maximumPersistentDisksSizeGb" => "10240",
596
+ "zone" => zone,
597
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-8"
598
+ },
599
+ "n1-highmem-8-d" => {
600
+ "kind" => "compute#machineType",
601
+ "id" => "13043554021673472746",
602
+ "creationTimestamp" => "2012-11-16T11:45:08.195-08:00",
603
+ "name" => "n1-highmem-8-d",
604
+ "description" => "8 vCPUs, 52 GB RAM, 2 scratch disks (1770 GB, 1770 GB)",
605
+ "guestCpus" => 8,
606
+ "memoryMb" => 53_248,
607
+ "imageSpaceGb" => 10,
608
+ "scratchDisks" => [
609
+ {
610
+ "diskGb" => 1770
611
+ },
612
+ {
613
+ "diskGb" => 1770
614
+ }
615
+ ],
616
+ "maximumPersistentDisks" => 16,
617
+ "maximumPersistentDisksSizeGb" => "10240",
618
+ "zone" => zone,
619
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-8-d"
620
+ },
621
+ "n1-standard-1" => {
622
+ "kind" => "compute#machineType",
623
+ "id" => "12907738072351752276",
624
+ "creationTimestamp" => "2012-06-07T13:48:14.670-07:00",
625
+ "name" => "n1-standard-1",
626
+ "description" => "1 vCPU, 3.75 GB RAM",
627
+ "guestCpus" => 1,
628
+ "memoryMb" => 3840,
629
+ "imageSpaceGb" => 10,
630
+ "maximumPersistentDisks" => 16,
631
+ "maximumPersistentDisksSizeGb" => "10240",
632
+ "zone" => zone,
633
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-1"
634
+ },
635
+ "n1-standard-1-d" => {
636
+ "kind" => "compute#machineType",
637
+ "id" => "12908559201265214706",
638
+ "creationTimestamp" => "2012-06-07T13:48:34.258-07:00",
639
+ "name" => "n1-standard-1-d",
640
+ "description" => "1 vCPU, 3.75 GB RAM, 1 scratch disk (420 GB)",
641
+ "guestCpus" => 1,
642
+ "memoryMb" => 3840,
643
+ "imageSpaceGb" => 10,
644
+ "scratchDisks" => [
645
+ {
646
+ "diskGb" => 420
647
+ }
648
+ ],
649
+ "maximumPersistentDisks" => 16,
650
+ "maximumPersistentDisksSizeGb" => "10240",
651
+ "zone" => zone,
652
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-1-d"
653
+ },
654
+ "n1-standard-2" => {
655
+ "kind" => "compute#machineType",
656
+ "id" => "12908559320241551184",
657
+ "creationTimestamp" => "2012-06-07T13:48:56.867-07:00",
658
+ "name" => "n1-standard-2",
659
+ "description" => "2 vCPUs, 7.5 GB RAM",
660
+ "guestCpus" => 2,
661
+ "memoryMb" => 7680,
662
+ "imageSpaceGb" => 10,
663
+ "maximumPersistentDisks" => 16,
664
+ "maximumPersistentDisksSizeGb" => "10240",
665
+ "zone" => zone,
666
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-2"
667
+ },
668
+ "n1-standard-2-d" => {
669
+ "kind" => "compute#machineType",
670
+ "id" => "12908559582417967837",
671
+ "creationTimestamp" => "2012-06-07T13:49:19.448-07:00",
672
+ "name" => "n1-standard-2-d",
673
+ "description" => "2 vCPUs, 7.5 GB RAM, 1 scratch disk (870 GB)",
674
+ "guestCpus" => 2,
675
+ "memoryMb" => 7680,
676
+ "imageSpaceGb" => 10,
677
+ "scratchDisks" => [
678
+ {
679
+ "diskGb" => 870
680
+ }
681
+ ],
682
+ "maximumPersistentDisks" => 16,
683
+ "maximumPersistentDisksSizeGb" => "10240",
684
+ "zone" => zone,
685
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-2-d"
686
+ },
687
+ "n1-standard-4" => {
688
+ "kind" => "compute#machineType",
689
+ "id" => "12908559692070444049",
690
+ "creationTimestamp" => "2012-06-07T13:49:40.050-07:00",
691
+ "name" => "n1-standard-4",
692
+ "description" => "4 vCPUs, 15 GB RAM",
693
+ "guestCpus" => 4,
694
+ "memoryMb" => 15_360,
695
+ "imageSpaceGb" => 10,
696
+ "maximumPersistentDisks" => 16,
697
+ "maximumPersistentDisksSizeGb" => "10240",
698
+ "zone" => zone,
699
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-4"
700
+ },
701
+ "n1-standard-4-d" => {
702
+ "kind" => "compute#machineType",
703
+ "id" => "12908559991903153608",
704
+ "creationTimestamp" => "2012-06-07T13:50:05.677-07:00",
705
+ "name" => "n1-standard-4-d",
706
+ "description" => "4 vCPUs, 15 GB RAM, 1 scratch disk (1770 GB)",
707
+ "guestCpus" => 4,
708
+ "memoryMb" => 15_360,
709
+ "imageSpaceGb" => 10,
710
+ "scratchDisks" => [
711
+ {
712
+ "diskGb" => 1770
713
+ }
714
+ ],
715
+ "maximumPersistentDisks" => 16,
716
+ "maximumPersistentDisksSizeGb" => "10240",
717
+ "zone" => zone,
718
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-4-d"
719
+ },
720
+ "n1-standard-8" => {
721
+ "kind" => "compute#machineType",
722
+ "id" => "12908560197989714867",
723
+ "creationTimestamp" => "2012-06-07T13:50:42.334-07:00",
724
+ "name" => "n1-standard-8",
725
+ "description" => "8 vCPUs, 30 GB RAM",
726
+ "guestCpus" => 8,
727
+ "memoryMb" => 30_720,
728
+ "imageSpaceGb" => 10,
729
+ "maximumPersistentDisks" => 16,
730
+ "maximumPersistentDisksSizeGb" => "10240",
731
+ "zone" => zone,
732
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-8"
733
+ },
734
+ "n1-standard-8-d" => {
735
+ "kind" => "compute#machineType",
736
+ "id" => "12908560709887590691",
737
+ "creationTimestamp" => "2012-06-07T13:51:19.936-07:00",
738
+ "name" => "n1-standard-8-d",
739
+ "description" => "8 vCPUs, 30 GB RAM, 2 scratch disks (1770 GB, 1770 GB)",
740
+ "guestCpus" => 8,
741
+ "memoryMb" => 30_720,
742
+ "imageSpaceGb" => 10,
743
+ "scratchDisks" => [
744
+ {
745
+ "diskGb" => 1770
746
+ },
747
+ {
748
+ "diskGb" => 1770
749
+ }
750
+ ],
751
+ "maximumPersistentDisks" => 16,
752
+ "maximumPersistentDisksSizeGb" => "10240",
753
+ "zone" => zone,
754
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-8-d"
755
+ }
756
+ }
757
+ end,
758
+ :images => {},
759
+ :disks => {
760
+ "fog-1" => {
761
+ "kind" => "compute#disk",
762
+ "id" => "3338131294770784461",
763
+ "creationTimestamp" => "2013-12-18T19:47:10.583-08:00",
764
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
765
+ "status" => "READY",
766
+ "name" => "fog-1",
767
+ "sizeGb" => "10",
768
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/disks/fog-1",
769
+ "sourceImage" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-7-wheezy-v20131120",
770
+ "sourceImageId" => "17312518942796567788",
771
+ "type" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/diskTypes/pd-standard"
772
+ },
773
+ "fog-2" => {
774
+ "kind" => "compute#disk",
775
+ "id" => "3338131294770784462",
776
+ "creationTimestamp" => "2013-12-18T19:47:10.583-08:00",
777
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
778
+ "status" => "READY",
779
+ "name" => "fog-2",
780
+ "sizeGb" => "10",
781
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/disks/fog-1",
782
+ "type" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/diskTypes/pd-ssd"
783
+ }
784
+ },
785
+ :subnetworks => {
786
+ "fog-1" => {
787
+ "kind" => "compute#subnetwork",
788
+ "id" => "6680781458098159920",
789
+ "creationTimestamp" => "2016-03-19T19:13:51.613-07:00",
790
+ "gatewayAddress" => "10.1.0.1",
791
+ "name" => "fog-1",
792
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/fog-example",
793
+ "ipCidrRange" => "10.1.0.0/20",
794
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1",
795
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1/subnetworks/fog-1"
796
+ },
797
+ "fog-2" => {
798
+ "kind" => "compute#subnetwork",
799
+ "id" => "6680781458098159921",
800
+ "creationTimestamp" => "2016-03-19T19:13:51.613-07:00",
801
+ "gatewayAddress" => "10.1.16.1",
802
+ "name" => "fog-2",
803
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/fog-example",
804
+ "ipCidrRange" => "10.1.16.0/20",
805
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/europe-west1",
806
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/europe-west1/subnetworks/fog-2"
807
+ },
808
+ "fog-3" => {
809
+ "kind" => "compute#subnetwork",
810
+ "id" => "6680781458098159923",
811
+ "creationTimestamp" => "2016-03-19T19:13:51.613-07:00",
812
+ "gatewayAddress" => "192.168.20.1",
813
+ "name" => "fog-3",
814
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/fog-elsewhere-example",
815
+ "ipCidrRange" => "192.168.20.0/20",
816
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1",
817
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1/subnetworks/fog-3"
818
+ }
819
+ },
820
+ :operations => {}
821
+ }
822
+ end
823
+ end
824
+ end
825
+
826
+ def self.reset
827
+ @data = nil
828
+ end
829
+
830
+ def data(project = @project)
831
+ self.class.data(api_version)[project]
832
+ end
833
+
834
+ def reset_data
835
+ # not particularly useful because it deletes zones
836
+ self.class.data(api_version).delete(@project)
837
+ end
838
+
839
+ def random_operation
840
+ "operation-#{Fog::Mock.random_numbers(13)}-#{Fog::Mock.random_hex(13)}-#{Fog::Mock.random_hex(8)}"
841
+ end
842
+ end
843
+ end
844
+ end
845
+ end