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
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,175 @@
1
+ # Getting Involved
2
+
3
+ New contributors are always welcome, and when in doubt please ask questions!
4
+ We strive to be an open and welcoming community. Please be nice to one another.
5
+
6
+ We recommend heading over to fog's [CONTRIBUTING](https://github.com/fog/fog/blob/master/CONTRIBUTING.md)
7
+ and having a look around as well. It has information and context about the state of the `fog` project as a whole.
8
+
9
+ ### Coding
10
+
11
+ * Pick a task:
12
+ * Offer feedback on open [pull requests](https://github.com/fog/fog-google/pulls).
13
+ * Review open [issues](https://github.com/fog/fog-google/issues) for things to help on,
14
+ especially the ones [tagged "help wanted"](https://github.com/fog/fog-google/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
15
+ * [Create an issue](https://github.com/fog/fog-google/issues/new) to start a discussion on additions or features.
16
+ * Fork the project, add your changes and tests to cover them in a topic branch.
17
+ * [Fork](https://github.com/fog/fog-google/fork)
18
+ * Create your feature branch (`git checkout -b my-new-feature`)
19
+ * Commit your changes (`git commit -am 'Add some feature'`)
20
+ * Push to the branch (`git push origin my-new-feature`)
21
+ * Create a new pull request
22
+ * Commit your changes and rebase against `fog/fog-google` to ensure everything is up to date.
23
+ * [Submit a pull request](https://github.com/fog/fog-google/compare/)
24
+
25
+ ### Non-Coding
26
+
27
+ * Offer feedback or triage [open issues](https://github.com/fog/fog-google/issues).
28
+ * Improve documentation. See project's [inch tracker](https://inch-ci.org/github/fog/fog-google.svg?branch=master)
29
+ for ideas for where to get started.
30
+ * Organize or volunteer at events.
31
+
32
+ ## Contributing Code
33
+
34
+ This document is very much a work in progress. Sorry about that.
35
+
36
+ It's worth noting that, if you're looking through the code, and you'd like to know the history of a line,
37
+ you may not find it in the history of this repository, since most of the code was extracted from [fog/fog](https://github.com/fog/fog).
38
+ So, you can look at the history from commit [fog/fog#c596e](https://github.com/fog/fog/tree/c596e710952aa9c90713da3fbfb3027db0608413)
39
+ backward for more information.
40
+
41
+ ### Development environment
42
+
43
+ If you're going to be doing any kind of modifications, we highly recommend using [rbenv](https://github.com/sstephenson/rbenv),
44
+ [ruby-build](https://github.com/sstephenson/ruby-build), (don't forget the [dependencies](https://github.com/sstephenson/ruby-build/wiki#suggested-build-environment)!)
45
+ and [bundler](http://bundler.io/).
46
+
47
+ Once you've got that all installed, run
48
+
49
+ ```shell
50
+ $ bundle install
51
+ ```
52
+
53
+ to install the required gems. You might have to [fight a bit](http://www.nokogiri.org/tutorials/installing_nokogiri.html)
54
+ to get Nokogiri installed.
55
+
56
+ Then, you should be ready to go! If you'd like to drop into an interactive shell, configured with your `:default` credential, use
57
+
58
+ ```shell
59
+ $ rake console
60
+ ```
61
+
62
+ ### Documentation
63
+
64
+ Code should be documented using [YARDoc](https://yardoc.org/) syntax.
65
+ We use [inch](https://github.com/rrrene/inch) to keep track of overall doc
66
+ coverage and [inch-ci](https://inch-ci.org/) to keep track of changes over time.
67
+
68
+ You can view a doc coverage report by running:
69
+ ```
70
+ $ inch
71
+ ```
72
+
73
+ Or view suggestions on a specific method:
74
+ ```
75
+ $ inch show Fog::Compute::Google::Server#set_metadata
76
+ ```
77
+
78
+ ### Testing
79
+
80
+ This module is tested with [Minitest](https://github.com/seattlerb/minitest).
81
+
82
+ #### Integration tests
83
+
84
+ Live integration tests can be found in `test/integration/`.
85
+
86
+ Most of the library functionality is currently covered with them. To simplify things for contributors we have a
87
+ CI system that runs all integration tests in parallel against all pull requests marked with `integrate` label
88
+ that anyone in `fog-google` team can set. Read [CI section](https://github.com/fog/fog-google/blob/master/CONTRIBUTING.md#continuous-integration)
89
+ for more info.
90
+
91
+ After completing the installation in the README, (including setting up your credentials and keys,)
92
+ make sure you have a `:test` credential in `~/.fog`, something like:
93
+
94
+ ```
95
+ test:
96
+ google_project: my-project
97
+ google_json_key_location: /path/to/my-project-xxxxxxxxxxxxx.json
98
+ ```
99
+
100
+ Then you can run all the live tests:
101
+
102
+ ```shell
103
+ $ bundle exec rake test
104
+ ```
105
+
106
+ or just one API:
107
+
108
+ ```
109
+ $ bundle exec rake test:compute
110
+ ```
111
+ (See `rake -T` for all available tasks)
112
+
113
+ or just one test:
114
+
115
+ ```shell
116
+ $ bundle exec rake test TESTOPTS="--name=TestServers#test_bootstrap_ssh_destroy"
117
+ ```
118
+
119
+ or a series of tests by name:
120
+
121
+ ```
122
+ $ bundle exec rake test TESTOPTS="--name=/test_nil_get/"
123
+ ```
124
+
125
+ #### Unit tests
126
+
127
+ Some basic sanity checking and logic verification is done via unit tests located in `test/unit`.
128
+ They automatically run against every pull request via [Travis CI](http://travis-ci.org/).
129
+
130
+ You can run unit tests like so:
131
+
132
+ ```
133
+ $ rake test:unit
134
+ ```
135
+
136
+ We're in progress of extending the library with more unit tests and contributions along that front are very welcome.
137
+
138
+ #### The transition from `shindo` to Minitest
139
+
140
+ Previously, [shindo](https://github.com/geemus/shindo) was the primary testing framework.
141
+ We've moved away from it, and to Minitest, but some artifacts may remain.
142
+
143
+ For more information on transition, read [#50](https://github.com/fog/fog-google/issues/50).
144
+
145
+ #### Continuous integration
146
+
147
+ Currently Google maintains a [Concourse CI](https://concourse-ci.org/) server, running a pipeline defined in `ci` folder.
148
+ It automatically runs all integration tests against every pull-request marked with `integration` label.
149
+
150
+ For more information on the pipeline please refer to the [ci README](https://github.com/fog/fog-google/blob/master/ci/README.md).
151
+
152
+ #### Some notes about the tests as they stand
153
+
154
+ The live integration tests for resources, (servers, disks, etc.,) have a few components:
155
+
156
+ - The `TestCollection` **mixin module** lives in `test/helpers/test_collection.rb`
157
+ and contains the standard tests to run for all resources, (e.g. `test_lifecycle`).
158
+ It also calls `cleanup` on the resource's factory during teardown, to make sure
159
+ that resources are getting destroyed before the next test run.
160
+ - The **factory**, (e.g. `ServersFactory`, in `test/integration/factories/servers_factory.rb`,)
161
+ automates the creation of resources and/or supplies parameters for explicit
162
+ creation of resources. For example, `ServersFactory` initializes a `DisksFactory`
163
+ to supply disks in order to create servers, and implements the `params` method
164
+ so that tests can create servers with unique names, correct zones and machine
165
+ types, and automatically-created disks. `ServersFactory` inherits the `create`
166
+ method from `CollectionFactory`, which allows tests to create servers on-demand.
167
+ - The **main test**, (e.g. `TestServers`, in `test/integration/compute/test_servers.rb`,)
168
+ is the test that actually runs. It mixes in the `TestCollection` module in
169
+ order to run the tests in that module, it supplies the `setup` method in which
170
+ it initializes a `ServersFactory`, and it includes any other tests specific to
171
+ this collection, (e.g. `test_bootstrap_ssh_destroy`).
172
+
173
+ If you want to create another resource, you should add live integration tests;
174
+ all you need to do is create a factory in `test/integration/factories/my_resource_factory.rb`
175
+ and a main test in `test/integration/compute/test_my_resource.rb` that mixes in `TestCollection`.
data/CONTRIBUTORS.md ADDED
@@ -0,0 +1,95 @@
1
+ With also previous help from unnamed Google employees and [Fog contributors](https://github.com/fog/fog/blob/master/CONTRIBUTORS.md)
2
+
3
+ * Akshay Moghe <amoghe@maginatics.com>
4
+ * Alessio Caiazza <acaiazza@gitlab.com>
5
+ * Alex Coomans <alex@alexcoomans.com>
6
+ * Alexander Kolesen <akolesen@iron.io>
7
+ * Alexander Lomov <lomov.as@gmail.com>
8
+ * Alexander Stuart-Kregor <easkay@me.com>
9
+ * Andrew Leonard <andy@hurricane-ridge.com>
10
+ * Antonio <0x414f@gmail.com>
11
+ * Ariel Zavala <arielo.zavala@gmail.com>
12
+ * Artem Yakimenko <temikus@google.com>
13
+ * Benson Kalahar <bensonk42@gmail.com>
14
+ * Bertrand Paquet <bertrand.paquet@gmail.com>
15
+ * Bob Lail and Luke Booth <pair=bob.lail+luke.booth@cphepdev.com>
16
+ * Brett Porter <brett@apache.org>
17
+ * Brian D. Burns <iosctr@gmail.com>
18
+ * Carlos Sanchez <csanchez@maestrodev.com>
19
+ * Chris Gianelloni <wolf31o2@gmail.com>
20
+ * Dan Prince <dprince@redhat.com>
21
+ * Daniel Broudy <broudy@google.com>
22
+ * Daniel van Gils <daniel@cloud66.com>
23
+ * David Salgado <david@digitalronin.com>
24
+ * Dawid Janczak <dawid.janczak@gmail.com>
25
+ * Dean Putney <dean@glowforge.com>
26
+ * Dean Putney <putney.dean@gmail.com>
27
+ * Dima <dima@cloud66.com>
28
+ * Doug Henderson <dhenderson@maestrodev.com>
29
+ * Emily Ye <emilyye@google.com>
30
+ * Eric Johnson <erjohnso@google.com>
31
+ * Ervin Weber <webervin@users.noreply.github.com>
32
+ * Ferran Rodenas <frodenas@gmail.com>
33
+ * Frederick Cheung <frederick.cheung@gmail.com>
34
+ * Imri Zvik <imrizvik@gmail.com>
35
+ * Isaac Hollander McCreery <ihmccreery@google.com>
36
+ * Isaac Hollander McCreery <ihmccreery@users.noreply.github.com>
37
+ * Jacob Mattingley <jem@ubalo.com>
38
+ * Jakob Krigovsky <jakob@krigovsky.com>
39
+ * James Herdman <james.herdman@me.com>
40
+ * Jared <j.schaber@innovati.ws>
41
+ * Jeffrey Dang <jcdang@gmail.com>
42
+ * Joe Selman <jsselman@google.com>
43
+ * Jonathan Yankovich <jonathan.yankovich@gmail.com>
44
+ * Julian Cheal <jcheal@redhat.com>
45
+ * Juris Galang <jurisgalang@gmail.com>
46
+ * Kyle Boutette <Everlag@users.noreply.github.com>
47
+ * Kyle Boutette <boutette@google.com>
48
+ * Lance Ivy <lance@cainlevy.net>
49
+ * Leila <leyla.myosotis@gmail.com>
50
+ * Leila-Kuntar <leyla.myosotis@gmail.com>
51
+ * Marcel Hild <hild@b4mad.net>
52
+ * Marcin Owsiany <porridge@google.com>
53
+ * Mark Huk <mark.guk.e@gmail.com>
54
+ * Martin Lazarov <martin@lazarov.bg>
55
+ * Matt Darby <matt.darby@rackspace.com>
56
+ * Matteo Monti <mmonti@gmail.com>
57
+ * Michael Elfassy <michaelelfassy@napps.ca>
58
+ * Miguel Martinez <miguel@bitnami.com>
59
+ * Misha Brukman <mbrukman@google.com>
60
+ * Myosotis <leyla.myosotis@gmail.com>
61
+ * Nat Welch <nat@natwelch.com>
62
+ * Nicolas Leger <nicolasleger@users.noreply.github.com>
63
+ * Paul Thornthwaite <paul@brightbox.co.uk>
64
+ * Paul Thornthwaite <tokengeek@gmail.com>
65
+ * Paulo Henrique Lopes Ribeiro <plribeiro3000@gmail.com>
66
+ * Paulo Henrique Lopes Ribeiro <plribeiro@zertico.com>
67
+ * Paulo Ribeiro <paulo@majority.co>
68
+ * Pradeep G <itsprdp@gmail.com>
69
+ * Rama McIntosh <rama@contix.com>
70
+ * Riccardo Carlesso <palladiusbonton@gmail.com>
71
+ * Riccardo Carlesso <riccardo.carlesso@gmail.com>
72
+ * Richard Wallace <rwallace@gmail.com>
73
+ * Romain Haenni <admin@zlabs.ch>
74
+ * Romain Vrignaud <rvrignaud@gmail.com>
75
+ * Sean Malloy <spinelli85@gmail.com>
76
+ * Shinya Maeda <shinya@gitlab.com>
77
+ * Stephen von Takach <steve@advancedcontrol.com.au>
78
+ * Tim Downey <tdowney@pivotal.io>
79
+ * Timur Alperovich <timur.alperovich@gmail.com>
80
+ * Tomas Coufal <tcoufal@redhat.com>
81
+ * Vadim Shaulski <sh.vadim@gmail.com>
82
+ * Wesley Beary <geemus@gmail.com>
83
+ * Zach Robinson <zrobinson@pivotal.io>
84
+ * althras <althras@gmail.com>
85
+ * ashmrtnz <ashmrtnz@google.com>
86
+ * canausa <tscanausa@gmail.com>
87
+ * geemus <geemus@gmail.com>
88
+ * jayhsu <jayhsu21@gmail.com>
89
+ * jordangbull <jordangbull@gmail.com>
90
+ * kbockmanrs <kevin@rightscale.com>
91
+ * leonidlm <leonidlm@gmail.com>
92
+ * lkuntar <leyla.myosotis@gmail.com>
93
+ * neillturner <neillwturner@gmail.com>
94
+ * scott rushforth <scott@spotman.net>
95
+ * snyquist2 <snyquist@google.com>
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Do not require development gems not needed in runtime
4
+ gem "codecov", :require => false
5
+ gem "inch", :require => false
6
+ gem "osrcry", :require => false
7
+ gem "rubocop", :require => false
8
+
9
+ # Debugger is specified here as it's not compatible with jRuby
10
+ gem "pry-byebug", :platforms => :ruby
11
+
12
+ # Specify your gem's dependencies in fog-google.gemspec
13
+ gemspec
data/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014-2018 [CONTRIBUTORS.md](https://github.com/fog/fog-google/blob/master/CONTRIBUTORS.md)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/MIGRATING.md ADDED
@@ -0,0 +1 @@
1
+ ## fog-google 1.0 -> 2.0:
data/README.md ADDED
@@ -0,0 +1,177 @@
1
+ # Fog::Google
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/fog-google.svg)](http://badge.fury.io/rb/fog-google) [![Build Status](https://travis-ci.org/fog/fog-google.svg?branch=master)](https://travis-ci.org/fog/fog-google) [![codecov](https://codecov.io/gh/fog/fog-google/branch/master/graph/badge.svg)](https://codecov.io/gh/fog/fog-google) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=fog/fog-google)](https://dependabot.com) [![Doc coverage](https://inch-ci.org/github/fog/fog-google.svg?branch=master)](https://inch-ci.org/github/fog/fog-google)
4
+
5
+ The main maintainers for the Google sections are @icco, @Temikus and @plribeiro3000. Please send pull requests to them.
6
+
7
+ ## Important notices
8
+
9
+ - As of **v1.0.0**, fog-google includes google-api-client as a dependency, there is no need to include it separately anymore.
10
+
11
+ - Fog-google is currently supported on Ruby 2.4+ See [supported ruby versions](#supported-ruby-versions) for more info.
12
+
13
+ See **[MIGRATING.md](MIGRATING.md)** for migration between major versions.
14
+
15
+ ## Storage
16
+
17
+ There are two ways to access [Google Cloud Storage](https://cloud.google.com/storage/). The old S3 API and the new JSON API. `Fog::Storage::Google` will automatically direct you to the appropriate API based on the credentials you provide it.
18
+
19
+ * The [XML API](https://cloud.google.com/storage/docs/xml-api-overview/) is almost identical to S3. Use [Google's interoperability keys](https://cloud.google.com/storage/docs/migrating#keys) to access it.
20
+ * The new [JSON API](https://cloud.google.com/storage/docs/json_api/) is faster and uses auth similarly to the rest of the Google Cloud APIs using a [service account private key](https://developers.google.com/identity/protocols/OAuth2ServiceAccount).
21
+
22
+ ## Compute
23
+
24
+ Google Compute Engine is a Virtual Machine hosting service. Currently it is built on version [v1](https://cloud.google.com/compute/docs/reference/v1/) of the GCE API.
25
+
26
+ As of 2017-12-15, we are still working on making Fog for Google Compute engine (`Fog::Compute::Google`) feature complete. If you are using Fog to interact with GCE, please keep Fog up to date and [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like.
27
+
28
+ ## SQL
29
+
30
+ Fog implements [v1beta4](https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/) of the Google Cloud SQL Admin API. As of 2017-11-06, Cloud SQL is mostly feature-complete. Please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like as we finish
31
+ adding remaining features.
32
+
33
+ ## DNS
34
+
35
+ Fog implements [v1](https://cloud.google.com/dns/api/v1/) of the Google Cloud DNS API. We are always looking for people to improve our code and test coverage, so please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like.
36
+
37
+ ## Monitoring
38
+
39
+ Fog implements [v3](https://cloud.google.com/monitoring/api/v3/) of the Google Cloud Monitoring API. As of 2017-10-05, we believe Fog for Google Cloud Monitoring is feature complete for metric-related resources and are working on supporting groups.
40
+
41
+ We are always looking for people to improve our code and test coverage, so please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like.
42
+
43
+ ## Pubsub
44
+
45
+ Fog mostly implements [v1](https://cloud.google.com/pubsub/docs/reference/rest/) of the Google Cloud Pub/Sub API; however some less common API methods are missing. Pull requests for additions would be greatly appreciated.
46
+
47
+ ## Installation
48
+
49
+ Add the following two lines to your application's `Gemfile`:
50
+
51
+ ```ruby
52
+ gem 'fog-google'
53
+ ```
54
+
55
+ And then execute:
56
+
57
+ ```shell
58
+ $ bundle
59
+ ```
60
+
61
+ Or install it yourself as:
62
+
63
+ ```shell
64
+ $ gem install fog-google
65
+ ```
66
+
67
+ ## Testing
68
+
69
+ Integration tests can be kicked off via following rake tasks.
70
+ **Important note:** As those tests are running against real API's YOU WILL BE BILLED.
71
+
72
+ ```
73
+ rake test # Run all integration tests
74
+ rake test:parallel # Run all integration tests in parallel
75
+
76
+ rake test:compute # Run Compute API tests
77
+ rake test:monitoring # Run Monitoring API tests
78
+ rake test:pubsub # Run PubSub API tests
79
+ rake test:sql # Run SQL API tests
80
+ rake test:storage # Run Storage API tests
81
+ ```
82
+
83
+ Since some resources can be expensive to test, we have a self-hosted CI server.
84
+ Due to security considerations a repo maintainer needs to add the label `integrate` to kick off the CI.
85
+
86
+ ## Setup
87
+
88
+ #### Credentials
89
+
90
+ Follow the [instructions to generate a private key](https://cloud.google.com/storage/docs/authentication#generating-a-private-key). A sample credentials file can be found in `.fog.example` in this directory:
91
+
92
+ ```
93
+ cat .fog.example >> ~/.fog # appends the sample configuration
94
+ vim ~/.fog # edit file with yout config
95
+ ```
96
+
97
+ As of `1.9.0` fog-google supports Google [application default credentials (ADC)](https://cloud.google.com/docs/authentication/production)
98
+ The auth method uses [Google::Auth.get_application_default](https://www.rubydoc.info/gems/googleauth/0.6.7/Google%2FAuth.get_application_default)
99
+ under the hood.
100
+
101
+ Example workflow for a GCE instance with [service account scopes](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances)
102
+ defined:
103
+
104
+ ```
105
+ > connection = Fog::Compute::Google.new(:google_project => "my-project", :google_application_default => true)
106
+ => #<Fog::Compute::Google::Real:32157700...
107
+ > connection.servers
108
+ => [ <Fog::Compute::Google::Server ... ]
109
+ ```
110
+
111
+ #### CarrierWave integration
112
+
113
+ It is common to integrate Fog with Carrierwave. Here's a minimal config that's commonly put in `config/initializers/carrierwave.rb`:
114
+
115
+ ```
116
+ CarrierWave.configure do |config|
117
+ config.fog_provider = 'fog/google'
118
+ config.fog_credentials = {
119
+ provider: 'Google',
120
+ google_project: Rails.application.secrets.google_cloud_storage_project_name,
121
+ google_json_key_string: Rails.application.secrets.google_cloud_storage_credential_content
122
+ # can optionally use google_json_key_location if using an actual file;
123
+ }
124
+ config.fog_directory = Rails.application.secrets.google_cloud_storage_bucket_name
125
+ end
126
+ ```
127
+
128
+ This needs a corresponding secret in `config/secrets.yml`, e.g.:
129
+
130
+ ```
131
+ development:
132
+ google_cloud_storage_project_name: your-project-name
133
+ google_cloud_storage_credential_content: '{
134
+ "type": "service_account",
135
+ "project_id": "your-project-name",
136
+ "private_key_id": "REDACTED",
137
+ "private_key": "-----BEGIN PRIVATE KEY-----REDACTED-----END PRIVATE KEY-----\n",
138
+ "client_email": "REDACTED@your-project-name.iam.gserviceaccount.com",
139
+ "client_id": "REDACTED",
140
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
141
+ "token_uri": "https://accounts.google.com/o/oauth2/token",
142
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
143
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/REDACTED%40your-project-name.iam.gserviceaccount.com"
144
+ }'
145
+ google_cloud_storage_bucket_name: your-bucket-name
146
+ ```
147
+
148
+ #### SSH-ing into instances
149
+
150
+ If you want to be able to bootstrap SSH-able instances, (using `servers.bootstrap`,) be sure you have a key in `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`
151
+
152
+ ## Quickstart
153
+
154
+ Once you've specified your credentials, you should be good to go!
155
+ ```
156
+ $ bundle exec pry
157
+ [1] pry(main)> require 'fog/google'
158
+ => true
159
+ [2] pry(main)> connection = Fog::Compute::Google.new
160
+ [3] pry(main)> connection.servers
161
+ => [ <Fog::Compute::Google::Server
162
+ name="xxxxxxx",
163
+ kind="compute#instance",
164
+ ```
165
+
166
+ ## Supported Ruby Versions
167
+
168
+ Fog-google is currently supported on Ruby 2.4+.
169
+
170
+ In general we support (and run our CI) for Ruby versions that are actively supported
171
+ by Ruby Core - that is, Ruby versions that are not end of life. Older versions of
172
+ Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/
173
+ for details about the Ruby support schedule.
174
+
175
+ ## Contributing
176
+
177
+ See `CONTRIBUTING.md` in this repository.