fog-google 1.10.0 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +5 -5
  2. data/.github/dependabot.yml +10 -0
  3. data/.github/workflows/ruby.yml +34 -0
  4. data/.github/workflows/stale.yml +23 -0
  5. data/.rubocop.yml +3 -3
  6. data/CHANGELOG.md +100 -1
  7. data/README.md +56 -10
  8. data/ci/docker-image/Dockerfile +3 -3
  9. data/fog-google.gemspec +4 -4
  10. data/lib/fog/compute/google.rb +0 -4
  11. data/lib/fog/compute/google/models/address.rb +1 -1
  12. data/lib/fog/compute/google/models/addresses.rb +6 -6
  13. data/lib/fog/compute/google/models/backend_service.rb +1 -1
  14. data/lib/fog/compute/google/models/disk.rb +3 -3
  15. data/lib/fog/compute/google/models/disk_types.rb +2 -2
  16. data/lib/fog/compute/google/models/disks.rb +2 -2
  17. data/lib/fog/compute/google/models/firewall.rb +2 -2
  18. data/lib/fog/compute/google/models/firewalls.rb +1 -1
  19. data/lib/fog/compute/google/models/forwarding_rules.rb +2 -2
  20. data/lib/fog/compute/google/models/global_addresses.rb +1 -1
  21. data/lib/fog/compute/google/models/global_forwarding_rules.rb +1 -1
  22. data/lib/fog/compute/google/models/http_health_check.rb +2 -2
  23. data/lib/fog/compute/google/models/instance_group_managers.rb +2 -2
  24. data/lib/fog/compute/google/models/machine_types.rb +2 -2
  25. data/lib/fog/compute/google/models/operations.rb +3 -3
  26. data/lib/fog/compute/google/models/server.rb +3 -3
  27. data/lib/fog/compute/google/models/servers.rb +3 -3
  28. data/lib/fog/compute/google/models/subnetworks.rb +2 -2
  29. data/lib/fog/compute/google/models/target_instances.rb +2 -2
  30. data/lib/fog/compute/google/models/target_pools.rb +2 -2
  31. data/lib/fog/compute/google/models/url_maps.rb +1 -1
  32. data/lib/fog/compute/google/requests/abandon_instances.rb +1 -1
  33. data/lib/fog/compute/google/requests/add_instance_group_instances.rb +3 -3
  34. data/lib/fog/compute/google/requests/add_server_access_config.rb +3 -3
  35. data/lib/fog/compute/google/requests/add_target_pool_health_checks.rb +2 -2
  36. data/lib/fog/compute/google/requests/add_target_pool_instances.rb +2 -2
  37. data/lib/fog/compute/google/requests/attach_disk.rb +1 -1
  38. data/lib/fog/compute/google/requests/create_disk_snapshot.rb +1 -1
  39. data/lib/fog/compute/google/requests/expand_subnetwork_ip_cidr_range.rb +1 -1
  40. data/lib/fog/compute/google/requests/get_backend_service_health.rb +1 -1
  41. data/lib/fog/compute/google/requests/get_server_serial_port_output.rb +2 -2
  42. data/lib/fog/compute/google/requests/get_target_pool_health.rb +1 -1
  43. data/lib/fog/compute/google/requests/insert_address.rb +2 -2
  44. data/lib/fog/compute/google/requests/insert_backend_service.rb +1 -1
  45. data/lib/fog/compute/google/requests/insert_disk.rb +1 -1
  46. data/lib/fog/compute/google/requests/insert_firewall.rb +1 -1
  47. data/lib/fog/compute/google/requests/insert_forwarding_rule.rb +1 -1
  48. data/lib/fog/compute/google/requests/insert_global_address.rb +1 -1
  49. data/lib/fog/compute/google/requests/insert_global_forwarding_rule.rb +1 -1
  50. data/lib/fog/compute/google/requests/insert_http_health_check.rb +1 -1
  51. data/lib/fog/compute/google/requests/insert_image.rb +1 -1
  52. data/lib/fog/compute/google/requests/insert_instance_group.rb +3 -3
  53. data/lib/fog/compute/google/requests/insert_instance_group_manager.rb +7 -7
  54. data/lib/fog/compute/google/requests/insert_instance_template.rb +3 -3
  55. data/lib/fog/compute/google/requests/insert_network.rb +1 -1
  56. data/lib/fog/compute/google/requests/insert_route.rb +10 -10
  57. data/lib/fog/compute/google/requests/insert_server.rb +12 -8
  58. data/lib/fog/compute/google/requests/insert_ssl_certificate.rb +4 -4
  59. data/lib/fog/compute/google/requests/insert_subnetwork.rb +1 -1
  60. data/lib/fog/compute/google/requests/insert_target_http_proxy.rb +3 -3
  61. data/lib/fog/compute/google/requests/insert_target_https_proxy.rb +4 -4
  62. data/lib/fog/compute/google/requests/insert_target_instance.rb +1 -1
  63. data/lib/fog/compute/google/requests/insert_target_pool.rb +1 -1
  64. data/lib/fog/compute/google/requests/insert_url_map.rb +1 -1
  65. data/lib/fog/compute/google/requests/invalidate_url_map_cache.rb +1 -1
  66. data/lib/fog/compute/google/requests/list_addresses.rb +4 -4
  67. data/lib/fog/compute/google/requests/list_aggregated_addresses.rb +1 -1
  68. data/lib/fog/compute/google/requests/list_aggregated_disk_types.rb +2 -2
  69. data/lib/fog/compute/google/requests/list_aggregated_disks.rb +2 -2
  70. data/lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb +2 -2
  71. data/lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb +4 -4
  72. data/lib/fog/compute/google/requests/list_aggregated_instance_groups.rb +1 -1
  73. data/lib/fog/compute/google/requests/list_aggregated_machine_types.rb +2 -2
  74. data/lib/fog/compute/google/requests/list_aggregated_servers.rb +2 -2
  75. data/lib/fog/compute/google/requests/list_aggregated_subnetworks.rb +4 -4
  76. data/lib/fog/compute/google/requests/list_aggregated_target_instances.rb +4 -4
  77. data/lib/fog/compute/google/requests/list_aggregated_target_pools.rb +4 -4
  78. data/lib/fog/compute/google/requests/list_disk_types.rb +2 -2
  79. data/lib/fog/compute/google/requests/list_disks.rb +2 -2
  80. data/lib/fog/compute/google/requests/list_firewalls.rb +4 -4
  81. data/lib/fog/compute/google/requests/list_forwarding_rules.rb +2 -2
  82. data/lib/fog/compute/google/requests/list_global_addresses.rb +5 -5
  83. data/lib/fog/compute/google/requests/list_global_forwarding_rules.rb +2 -2
  84. data/lib/fog/compute/google/requests/list_global_operations.rb +4 -4
  85. data/lib/fog/compute/google/requests/list_http_health_checks.rb +2 -2
  86. data/lib/fog/compute/google/requests/list_images.rb +2 -2
  87. data/lib/fog/compute/google/requests/list_instance_group_managers.rb +2 -2
  88. data/lib/fog/compute/google/requests/list_instance_templates.rb +4 -4
  89. data/lib/fog/compute/google/requests/list_machine_types.rb +4 -4
  90. data/lib/fog/compute/google/requests/list_networks.rb +4 -4
  91. data/lib/fog/compute/google/requests/list_subnetworks.rb +4 -4
  92. data/lib/fog/compute/google/requests/list_target_pools.rb +4 -4
  93. data/lib/fog/compute/google/requests/list_url_maps.rb +2 -2
  94. data/lib/fog/compute/google/requests/patch_firewall.rb +1 -1
  95. data/lib/fog/compute/google/requests/remove_instance_group_instances.rb +3 -3
  96. data/lib/fog/compute/google/requests/remove_target_pool_health_checks.rb +2 -2
  97. data/lib/fog/compute/google/requests/remove_target_pool_instance.rb +2 -2
  98. data/lib/fog/compute/google/requests/remove_target_pool_instances.rb +2 -2
  99. data/lib/fog/compute/google/requests/set_common_instance_metadata.rb +2 -2
  100. data/lib/fog/compute/google/requests/set_forwarding_rule_target.rb +1 -1
  101. data/lib/fog/compute/google/requests/set_global_forwarding_rule_target.rb +1 -1
  102. data/lib/fog/compute/google/requests/set_server_metadata.rb +3 -3
  103. data/lib/fog/compute/google/requests/set_server_tags.rb +2 -2
  104. data/lib/fog/compute/google/requests/set_snapshot_labels.rb +2 -2
  105. data/lib/fog/compute/google/requests/set_subnetwork_private_ip_google_access.rb +1 -1
  106. data/lib/fog/compute/google/requests/set_target_http_proxy_url_map.rb +1 -1
  107. data/lib/fog/compute/google/requests/set_target_https_proxy_ssl_certificates.rb +1 -1
  108. data/lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb +1 -1
  109. data/lib/fog/compute/google/requests/set_target_pool_backup.rb +2 -2
  110. data/lib/fog/compute/google/requests/update_firewall.rb +1 -1
  111. data/lib/fog/compute/google/requests/update_http_health_check.rb +1 -1
  112. data/lib/fog/compute/google/requests/update_url_map.rb +1 -1
  113. data/lib/fog/compute/google/requests/validate_url_map.rb +1 -1
  114. data/lib/fog/dns/google/requests/create_change.rb +2 -2
  115. data/lib/fog/google/models/sql/instance.rb +2 -2
  116. data/lib/fog/google/requests/monitoring/create_metric_descriptor.rb +8 -8
  117. data/lib/fog/google/requests/monitoring/create_timeseries.rb +1 -1
  118. data/lib/fog/google/requests/monitoring/list_timeseries.rb +1 -1
  119. data/lib/fog/google/requests/pubsub/acknowledge_subscription.rb +1 -1
  120. data/lib/fog/google/requests/pubsub/create_subscription.rb +3 -3
  121. data/lib/fog/google/requests/pubsub/pull_subscription.rb +5 -1
  122. data/lib/fog/google/requests/sql/clone_instance.rb +4 -4
  123. data/lib/fog/google/requests/sql/delete_user.rb +1 -1
  124. data/lib/fog/google/requests/sql/export_instance.rb +3 -3
  125. data/lib/fog/google/requests/sql/import_instance.rb +2 -2
  126. data/lib/fog/google/requests/sql/insert_backup_run.rb +1 -1
  127. data/lib/fog/google/requests/sql/insert_instance.rb +2 -2
  128. data/lib/fog/google/requests/sql/insert_ssl_cert.rb +1 -1
  129. data/lib/fog/google/requests/sql/insert_user.rb +1 -1
  130. data/lib/fog/google/requests/sql/restore_instance_backup.rb +4 -4
  131. data/lib/fog/google/requests/sql/update_instance.rb +2 -2
  132. data/lib/fog/google/shared.rb +10 -5
  133. data/lib/fog/google/version.rb +1 -1
  134. data/lib/fog/storage/google_json.rb +4 -0
  135. data/lib/fog/storage/google_json/mock.rb +6 -0
  136. data/lib/fog/storage/google_json/models/directories.rb +1 -1
  137. data/lib/fog/storage/google_json/models/directory.rb +1 -1
  138. data/lib/fog/storage/google_json/models/file.rb +1 -1
  139. data/lib/fog/storage/google_json/models/files.rb +1 -1
  140. data/lib/fog/storage/google_json/real.rb +106 -3
  141. data/lib/fog/storage/google_json/requests/copy_object.rb +12 -1
  142. data/lib/fog/storage/google_json/requests/get_object.rb +5 -3
  143. data/lib/fog/storage/google_json/requests/list_buckets.rb +4 -4
  144. data/lib/fog/storage/google_json/requests/list_objects.rb +1 -1
  145. data/lib/fog/storage/google_json/requests/put_bucket.rb +1 -1
  146. data/lib/fog/storage/google_json/requests/put_bucket_acl.rb +1 -1
  147. data/lib/fog/storage/google_json/requests/put_object.rb +1 -1
  148. data/lib/fog/storage/google_json/requests/put_object_acl.rb +1 -1
  149. data/lib/fog/storage/google_json/utils.rb +6 -2
  150. data/lib/fog/storage/google_xml/models/file.rb +2 -2
  151. data/lib/fog/storage/google_xml/requests/get_bucket.rb +0 -1
  152. data/lib/fog/storage/google_xml/requests/head_object.rb +7 -6
  153. data/tasks/changelog.rake +10 -1
  154. data/test/helpers/integration_test_helper.rb +15 -1
  155. data/test/integration/monitoring/test_metric_descriptors.rb +1 -1
  156. data/test/integration/monitoring/test_timeseries.rb +11 -25
  157. data/test/integration/pubsub/test_pubsub_models.rb +3 -3
  158. data/test/integration/pubsub/test_pubsub_requests.rb +2 -2
  159. data/test/integration/sql/test_certs.rb +0 -1
  160. data/test/integration/storage/test_objects.rb +36 -0
  161. data/test/unit/storage/test_common_xml_collections.rb +11 -0
  162. data/test/unit/storage/test_json_requests.rb +8 -0
  163. metadata +28 -13
  164. data/.travis.yml +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3563c5d9fb6cd9c28bd38b0b6c1ae1d619c33c81
4
- data.tar.gz: 41ecb920dbcb66a2f6aa13f6557ef2a044d26d80
2
+ SHA256:
3
+ metadata.gz: b08d74db716e12e161488ce7f6699d8ae3480eb9ec0c978d8eb9458fd6447b4f
4
+ data.tar.gz: f593447eed2cb01ea0f4d6a676d60c53749cac333809cef542ce1e5661c1e85f
5
5
  SHA512:
6
- metadata.gz: f4a9c9650d0824ad4dcd5389e63eb5c7e583d256c6c469481709cee80bd53f5fe168556e9e563a704878721ea733282c0af87fd24680c59513a6203d5026743c
7
- data.tar.gz: 2cc78e1c0731a87179ffb6179698e5fa5bd90635d141aec05d9c5faa1e7b18fe8e1123c5ded5f925f7065f5b3ae4893f8876f72c23b164ad1172953f5b74f829
6
+ metadata.gz: 2d34fa3e02b8f8dea154556f5b6ffe942f7dbeef630707730d88dc312f59ae644685d5f00aa319ebfd340d43334d796578e0e7649b1229bd3448eec7f4802c31
7
+ data.tar.gz: 3f7773d5d3ae3ad824f9a8a5dde09eb0727d0354bf995407628a62e58c1b5a8f5850f2a72e08ac7df95c0ee0a870f903b652eb2e8e19e49b34e4344064fe55b7
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "daily"
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "daily"
@@ -0,0 +1,34 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.5', '2.6', '2.7', '3.0', 'head']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2.3.4
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
+ - name: Install dependencies
32
+ run: bundle install
33
+ - name: Run tests
34
+ run: bundle exec rake
@@ -0,0 +1,23 @@
1
+ name: Mark stale issues and pull requests
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "30 1 * * *"
6
+
7
+ jobs:
8
+ stale:
9
+
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/stale@v3.0.18
14
+ with:
15
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
16
+ days-before-stale: 60
17
+ days-before-close: 7
18
+ exempt-issue-labels: 'pinned,security'
19
+ exempt-pr-labels: 'pinned,security'
20
+ stale-issue-message: 'This issue has been marked inactive and will be closed if no further activity occurs.'
21
+ stale-pr-message: 'This pr has been marked inactive and will be closed if no further activity occurs.'
22
+ stale-issue-label: 'no-issue-activity'
23
+ stale-pr-label: 'no-pr-activity'
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  # Fog custom enforced styles
2
- Metrics/LineLength:
2
+ Layout/LineLength:
3
3
  Enabled: false
4
4
 
5
5
  Style/ConditionalAssignment:
@@ -94,7 +94,7 @@ Naming/PredicateName:
94
94
  - is_
95
95
  - has_
96
96
  - have_
97
- NamePrefixBlacklist:
97
+ ForbiddenPrefixes:
98
98
  - is_
99
99
  Exclude:
100
100
  - spec/**/*
@@ -246,7 +246,7 @@ Style/WhenThen:
246
246
  Lint/EachWithObjectArgument:
247
247
  Description: Check for immutable argument given to each_with_object.
248
248
  Enabled: true
249
- Lint/HandleExceptions:
249
+ Lint/SuppressedException:
250
250
  Description: Don't suppress exception.
251
251
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
252
252
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -6,6 +6,105 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
6
6
 
7
7
  ## Next
8
8
 
9
+ ## 1.14.0
10
+
11
+ ### User-facing
12
+
13
+ #### Added
14
+
15
+ - \#520 Support passing object properties to #copy_object [mshibuya]
16
+
17
+ #### Fixed
18
+
19
+ - \#530 Unescape slashes in urls [krokodaxl]
20
+
21
+ - \#528 Fix Ruby 3.0 kwargs error in `#copy_object` [deeeki]
22
+
23
+ - \#521 Unlink file temp file immediately [stanhu]
24
+
25
+ - \#527 \#523 Fix Ruby 3.0 kwargs failures [stanhu]
26
+
27
+ ### Development changes
28
+
29
+ #### Fixed
30
+
31
+ - \#525 - Bump actions/checkout from 2 to 2.3.4
32
+
33
+ - \#524 - Bump actions/stale from 3 to 3.0.18
34
+
35
+
36
+ ## 1.13.0
37
+
38
+ ### User-facing
39
+
40
+ ### Fixed
41
+
42
+ fix deprecated URI.escape usage to support Ruby 3.0
43
+ fix apply_client_options def to support Ruby 3.0
44
+
45
+ ### Development Changes
46
+
47
+ Add github actions config and dependabot
48
+ Drop travis usage
49
+
50
+ ### Added
51
+
52
+ ## 1.12.1
53
+
54
+ ### User-facing
55
+
56
+ #### Fixed
57
+
58
+ \#513 - support passing other request options `StorageJSON#copy_object` [yosiat]
59
+
60
+ ### Development changes
61
+
62
+ #### Added
63
+
64
+ \#514 - Update .travis.yml to support PPC architecture testing [nageshlop]
65
+
66
+
67
+ ## 1.12.0
68
+
69
+ ### User-facing
70
+
71
+ #### Added
72
+
73
+ - \#509 Add ShieldedInstanceConfig support to `Server#insert` [lcy0321]
74
+
75
+ #### Fixed
76
+
77
+ - \#508 Fix GoogleXML::File#save incorrectly passing body to headers [stanhu]
78
+
79
+ - \#506 Add Trufferuby head to CI [gogainda]
80
+
81
+ ### Development changes
82
+
83
+ #### Fixed
84
+
85
+ - \#510 Upgrade CI docker image to Ubuntu 18.04 [temikus]
86
+
87
+
88
+ ## 1.11.0
89
+
90
+ ### User-facing
91
+
92
+ #### Added
93
+
94
+ - \#503 - Add fallback URL signing mechanism via IAM SignBlob API [temikus]
95
+
96
+ #### Fixed
97
+
98
+ - \#498 Add `:idempotent` flag to Fog::Storage::GoogleXML::Real#head_object, fixing
99
+ `Excon::Error::Socket: end of file reached (EOFError)` in certain scenarios, see \#416 [temikus]
100
+ - \#500 Set default options automatically if missing in `Pubsub#pull_subscription`
101
+
102
+ ### Development changes
103
+
104
+ #### Fixed
105
+
106
+ - \#501 DRY'ed up the retry methods in monitoring tests [temikus]
107
+ - \#500 Cleanup unneeded constants in Server model, fix flaky PubSub tests [temikus]
9
108
 
10
109
  ## 1.10.0
11
110
 
@@ -390,4 +489,4 @@ We encourage people using 0.5.1 to upgrade.
390
489
 
391
490
  #### Added
392
491
 
393
- #### Fixed
492
+ #### Fixed
data/README.md CHANGED
@@ -1,6 +1,15 @@
1
+ # ⚠️ ATTENTION ⚠️ HELP NEEDED WITH CI
2
+
3
+ With both me and icco@ departing Google **fog-google no longer has a CI stack** as we don't have access to a sponsored GCP account anymore and I've been unsuccessful in finding someone who would volunteer to maintain this project or CI at the time of my departure.
4
+
5
+ There is no easy way to say this but we need help as costs of running a CI stack that touches almost all GCP resources is significant. We know there's a lot of companies out there that are using this lib, as well as tooling based on it so if you want to help us with running a CI stack or provide sponsorship for a GCP account - please contact me at code \<at\> temik.me
6
+
7
+ --
8
+ Artem (temikus@) - Lead maintainer
9
+
1
10
  # Fog::Google
2
11
 
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)
12
+ [![Gem Version](https://badge.fury.io/rb/fog-google.svg)](http://badge.fury.io/rb/fog-google) [![Build Status](https://github.com/fog/fog-google/actions/workflows/ruby.yml/badge.svg)](https://github.com/fog/fog-google/actions/workflows/ruby.yml) [![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
13
 
5
14
  The main maintainers for the Google sections are @icco, @Temikus and @plribeiro3000. Please send pull requests to them.
6
15
 
@@ -8,7 +17,7 @@ The main maintainers for the Google sections are @icco, @Temikus and @plribeiro3
8
17
 
9
18
  - As of **v1.0.0**, fog-google includes google-api-client as a dependency, there is no need to include it separately anymore.
10
19
 
11
- - Fog-google is currently supported on Ruby 2.3+ See [supported ruby versions](#supported-ruby-versions) for more info.
20
+ - Fog-google is currently supported on Ruby 2.4+ See [supported ruby versions](#supported-ruby-versions) for more info.
12
21
 
13
22
  See **[MIGRATING.md](MIGRATING.md)** for migration between major versions.
14
23
 
@@ -27,8 +36,8 @@ As of 2017-12-15, we are still working on making Fog for Google Compute engine (
27
36
 
28
37
  ## SQL
29
38
 
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.
39
+ 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
40
+ adding remaining features.
32
41
 
33
42
  ## DNS
34
43
 
@@ -36,8 +45,8 @@ Fog implements [v1](https://cloud.google.com/dns/api/v1/) of the Google Cloud DN
36
45
 
37
46
  ## Monitoring
38
47
 
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
-
48
+ 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.
49
+
41
50
  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
51
 
43
52
  ## Pubsub
@@ -94,12 +103,12 @@ cat .fog.example >> ~/.fog # appends the sample configuration
94
103
  vim ~/.fog # edit file with yout config
95
104
  ```
96
105
 
97
- As of `1.9.0` fog-google supports Google [application default credentials (ADC)](https://cloud.google.com/docs/authentication/production)
106
+ As of `1.9.0` fog-google supports Google [application default credentials (ADC)](https://cloud.google.com/docs/authentication/production)
98
107
  The auth method uses [Google::Auth.get_application_default](https://www.rubydoc.info/gems/googleauth/0.6.7/Google%2FAuth.get_application_default)
99
108
  under the hood.
100
109
 
101
110
  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:
111
+ defined:
103
112
 
104
113
  ```
105
114
  > connection = Fog::Compute::Google.new(:google_project => "my-project", :google_application_default => true)
@@ -108,6 +117,43 @@ defined:
108
117
  => [ <Fog::Compute::Google::Server ... ]
109
118
  ```
110
119
 
120
+ #### CarrierWave integration
121
+
122
+ It is common to integrate Fog with Carrierwave. Here's a minimal config that's commonly put in `config/initializers/carrierwave.rb`:
123
+
124
+ ```
125
+ CarrierWave.configure do |config|
126
+ config.fog_provider = 'fog/google'
127
+ config.fog_credentials = {
128
+ provider: 'Google',
129
+ google_project: Rails.application.secrets.google_cloud_storage_project_name,
130
+ google_json_key_string: Rails.application.secrets.google_cloud_storage_credential_content
131
+ # can optionally use google_json_key_location if using an actual file;
132
+ }
133
+ config.fog_directory = Rails.application.secrets.google_cloud_storage_bucket_name
134
+ end
135
+ ```
136
+
137
+ This needs a corresponding secret in `config/secrets.yml`, e.g.:
138
+
139
+ ```
140
+ development:
141
+ google_cloud_storage_project_name: your-project-name
142
+ google_cloud_storage_credential_content: '{
143
+ "type": "service_account",
144
+ "project_id": "your-project-name",
145
+ "private_key_id": "REDACTED",
146
+ "private_key": "-----BEGIN PRIVATE KEY-----REDACTED-----END PRIVATE KEY-----\n",
147
+ "client_email": "REDACTED@your-project-name.iam.gserviceaccount.com",
148
+ "client_id": "REDACTED",
149
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
150
+ "token_uri": "https://accounts.google.com/o/oauth2/token",
151
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
152
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/REDACTED%40your-project-name.iam.gserviceaccount.com"
153
+ }'
154
+ google_cloud_storage_bucket_name: your-bucket-name
155
+ ```
156
+
111
157
  #### SSH-ing into instances
112
158
 
113
159
  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`
@@ -128,10 +174,10 @@ $ bundle exec pry
128
174
 
129
175
  ## Supported Ruby Versions
130
176
 
131
- Fog-google is currently supported on Ruby 2.3+.
177
+ Fog-google is currently supported on Ruby 2.4+.
132
178
 
133
179
  In general we support (and run our CI) for Ruby versions that are actively supported
134
- by Ruby Core - that is, Ruby versions that are not end of life. Older versions of
180
+ by Ruby Core - that is, Ruby versions that are not end of life. Older versions of
135
181
  Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/
136
182
  for details about the Ruby support schedule.
137
183
 
@@ -1,6 +1,6 @@
1
- FROM ubuntu:16.04
1
+ FROM ubuntu:18.04
2
2
 
3
- # Packages
3
+ # Common dependencies for the CI env and gems with C extensions
4
4
  RUN DEBIAN_FRONTEND=noninteractive apt-get -y -qq update && apt-get -y -qq install \
5
5
  build-essential \
6
6
  curl \
@@ -12,7 +12,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y -qq update && apt-get -y -qq insta
12
12
  libxml2-dev \
13
13
  libxslt-dev
14
14
 
15
- # Ubuntu 16.04 will fetch us 2.3.x without any issues.
15
+ # Ubuntu 18.04 will fetch us Ruby 2.5.x
16
16
  RUN DEBIAN_FRONTEND=noninteractive apt-get -y -qq install ruby ruby-dev && apt-get clean
17
17
 
18
18
  RUN gem install bundler
data/fog-google.gemspec CHANGED
@@ -18,16 +18,16 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  # As of 0.1.1
21
- spec.required_ruby_version = "~> 2.0"
21
+ spec.required_ruby_version = ">= 2.0"
22
22
 
23
23
  # Locked until https://github.com/fog/fog-google/issues/417 is resolved
24
24
  spec.add_dependency "fog-core", "<= 2.1.0"
25
25
  spec.add_dependency "fog-json", "~> 1.2"
26
26
  spec.add_dependency "fog-xml", "~> 0.1.0"
27
27
 
28
- # Hard Requirement as of 1.0
29
- spec.add_dependency "google-api-client", ">= 0.32", "< 0.34"
30
-
28
+ spec.add_dependency "google-api-client", ">= 0.44.2", "< 0.51"
29
+ spec.add_dependency "google-cloud-env", "~> 1.2"
30
+
31
31
  # Debugger
32
32
  spec.add_development_dependency "pry"
33
33
 
@@ -27,10 +27,6 @@ module Fog
27
27
  https://www.googleapis.com/auth/ndev.cloudman
28
28
  https://www.googleapis.com/auth/cloud-platform).freeze
29
29
  GOOGLE_COMPUTE_DEFAULT_NETWORK = "default".freeze
30
- # TODO: Do we need those constants?
31
- RUNNING = "RUNNING".freeze
32
- PROVISIONING = "PROVISIONING".freeze
33
- STAGING = "STAGING".freeze
34
30
 
35
31
  request_path "fog/compute/google/requests"
36
32
  request :add_backend_service_backends
@@ -38,7 +38,7 @@ module Fog
38
38
 
39
39
  data = service.insert_address(identity, region, attributes)
40
40
  operation = Fog::Compute::Google::Operations
41
- .new(:service => service)
41
+ .new(service: service)
42
42
  .get(data.name, nil, data.region)
43
43
  operation.wait_for { ready? }
44
44
  reload
@@ -13,10 +13,10 @@ module Fog
13
13
  }
14
14
 
15
15
  if region
16
- data = service.list_addresses(region, opts).items || []
16
+ data = service.list_addresses(region, **opts).items || []
17
17
  else
18
18
  data = []
19
- service.list_aggregated_addresses(opts).items.each_value do |scoped_list|
19
+ service.list_aggregated_addresses(**opts).items.each_value do |scoped_list|
20
20
  data.concat(scoped_list.addresses) if scoped_list && scoped_list.addresses
21
21
  end
22
22
  end
@@ -28,8 +28,8 @@ module Fog
28
28
  address = service.get_address(identity, region).to_h
29
29
  return new(address)
30
30
  elsif identity
31
- response = all(:filter => "name eq #{identity}",
32
- :max_results => 1)
31
+ response = all(filter: "name eq #{identity}",
32
+ max_results: 1)
33
33
  address = response.first unless response.empty?
34
34
  return address
35
35
  end
@@ -39,7 +39,7 @@ module Fog
39
39
  end
40
40
 
41
41
  def get_by_ip_address(ip_address)
42
- addresses = service.list_aggregated_addresses(:filter => "address eq .*#{ip_address}").items
42
+ addresses = service.list_aggregated_addresses(filter: "address eq .*#{ip_address}").items
43
43
  address = addresses.each_value.select(&:addresses)
44
44
 
45
45
  return nil if address.empty?
@@ -47,7 +47,7 @@ module Fog
47
47
  end
48
48
 
49
49
  def get_by_name(ip_name)
50
- names = service.list_aggregated_addresses(:filter => "name eq .*#{ip_name}").items
50
+ names = service.list_aggregated_addresses(filter: "name eq .*#{ip_name}").items
51
51
  name = names.each_value.select(&:addresses)
52
52
 
53
53
  return nil if name.empty?
@@ -29,7 +29,7 @@ module Fog
29
29
  :timeout_sec => timeout_sec
30
30
  }
31
31
 
32
- data = service.insert_backend_service(name, options)
32
+ data = service.insert_backend_service(name, **options)
33
33
  operation = Fog::Compute::Google::Operations.new(:service => service).get(data.name)
34
34
  operation.wait_for { ready? }
35
35
  reload