fog-google 1.15.0 → 1.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/scripts/setup_creds.sh +10 -0
  3. data/.github/workflows/integration.yml +225 -0
  4. data/.github/workflows/stale.yml +1 -1
  5. data/.github/workflows/unit.yml +26 -0
  6. data/CHANGELOG.md +42 -0
  7. data/README.md +12 -11
  8. data/fog-google.gemspec +12 -4
  9. data/lib/fog/compute/google/models/address.rb +0 -0
  10. data/lib/fog/compute/google/models/addresses.rb +0 -0
  11. data/lib/fog/compute/google/models/images.rb +3 -2
  12. data/lib/fog/compute/google/models/network.rb +1 -1
  13. data/lib/fog/compute/google/models/region.rb +0 -0
  14. data/lib/fog/compute/google/models/regions.rb +0 -0
  15. data/lib/fog/compute/google/models/server.rb +7 -0
  16. data/lib/fog/compute/google/models/servers.rb +4 -1
  17. data/lib/fog/compute/google/models/subnetwork.rb +0 -0
  18. data/lib/fog/compute/google/requests/get_region.rb +0 -0
  19. data/lib/fog/compute/google/requests/insert_network.rb +1 -11
  20. data/lib/fog/compute/google/requests/insert_server.rb +4 -0
  21. data/lib/fog/google/version.rb +1 -1
  22. data/lib/fog/storage/google_json/models/file.rb +10 -1
  23. data/lib/fog/storage/google_json/models/files.rb +10 -4
  24. data/lib/fog/storage/google_json/real.rb +4 -4
  25. data/lib/fog/storage/google_json/requests/get_object_url.rb +2 -2
  26. data/test/helpers/integration_test_helper.rb +2 -2
  27. data/test/helpers/test_helper.rb +7 -3
  28. data/test/integration/compute/core_compute/test_servers.rb +2 -2
  29. data/test/integration/compute/core_networking/test_networks.rb +0 -11
  30. data/test/integration/factories/networks_factory.rb +4 -6
  31. metadata +101 -31
  32. data/.github/workflows/ruby.yml +0 -34
  33. data/ci/.gitignore +0 -1
  34. data/ci/README.md +0 -65
  35. data/ci/build-head-pipeline.yml +0 -173
  36. data/ci/credentials.yml.template +0 -28
  37. data/ci/docker-image/Dockerfile +0 -18
  38. data/ci/integration-pipeline.yml +0 -226
  39. data/ci/pipeline-dev.yml +0 -58
  40. data/ci/tasks/run-int.sh +0 -53
  41. data/ci/tasks/run-int.yml +0 -18
  42. data/ci/tasks/utils.sh +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6eea488c39dbca402a8a3a648ab1ebfbca31762c7b3f9d6828c3e2866b9e500
4
- data.tar.gz: ce03073c85ae8b82eb60c60f38e4ae400defd42964bf4eeb74e12dfc3f550732
3
+ metadata.gz: e0eab03e604eac8b6bdf3137112182390b85bb30d852c08b5b1eff9fdba7e6af
4
+ data.tar.gz: d7542b6ccf45457e634fb2857922d449d79394aad3b007702dce1a4030a9d507
5
5
  SHA512:
6
- metadata.gz: 1d53bdc28be406f9144ef15790f71dbece9444c44d06786ccf6a6aa35c7214bf5e5af28e26a45dbe7feef184c242c07cb90cc20dfadf869b79af6f9c330893a1
7
- data.tar.gz: 65a11e596a256e5d784ff63e0080615a5cfefc6d35628b77f131166ff00bc949858c96bed221ebef1860debe996bd7adf55cf0ffe2c3d4f065cd6f64d7bbf61c
6
+ metadata.gz: dd91f0458fa5834c7d01e9e8daa3709bf16006c4254b14b1c72809336a1bc952a05bfcd4873ca73cb1e2a2940409b915818be3bf449d39a43985218792d97915
7
+ data.tar.gz: 7e6bcb9b9737bd2ba5c7a074000cae77fb50d3ff92a5c3a8d5ab2cfccbbd6bfba025776874fd5e0862d4ef7489cd81826b7b443bf0f33dcda1d808c87b096a9d
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+
3
+ GOOGLE_PROJECT=$(curl "http://metadata.google.internal/computeMetadata/v1/project/project-id" -H "Metadata-Flavor: Google")
4
+
5
+ # fog needs the google project to be specified even if it uses application-default creds
6
+ cat >~/.fog <<EOL
7
+ test:
8
+ google_project: ${GOOGLE_PROJECT}
9
+ google_application_default: true
10
+ EOL
@@ -0,0 +1,225 @@
1
+ name: integration-tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+ types: [ assigned, opened, synchronize, reopened, labeled ]
9
+
10
+ jobs:
11
+ test-compute-core:
12
+ runs-on: self-hosted
13
+ strategy:
14
+ matrix:
15
+ ruby-version: [ '2.7', '3.0' ]
16
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
17
+ max-parallel: 1
18
+
19
+ steps:
20
+ - uses: actions/checkout@v2.4.0
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ env:
24
+ # Needs to be set up for self-hosted runners, see:
25
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
26
+ # Image used in runners: summerwind/actions-runner
27
+ ImageOS: ubuntu20
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: >-
35
+ ./.github/scripts/setup_creds.sh &&
36
+ bundle exec rake test:compute-core_compute
37
+
38
+ test-compute-networking:
39
+ runs-on: self-hosted
40
+ strategy:
41
+ matrix:
42
+ ruby-version: [ '2.7', '3.0' ]
43
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
44
+ max-parallel: 1
45
+
46
+ steps:
47
+ - uses: actions/checkout@v2.4.0
48
+ - name: Set up Ruby
49
+ uses: ruby/setup-ruby@v1
50
+ env:
51
+ # Needs to be set up for self-hosted runners, see:
52
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
53
+ # Image used in runners: summerwind/actions-runner
54
+ ImageOS: ubuntu20
55
+ with:
56
+ ruby-version: ${{ matrix.ruby-version }}
57
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
58
+ - name: Install dependencies
59
+ run: bundle install
60
+ - name: Run tests
61
+ run: >-
62
+ ./.github/scripts/setup_creds.sh &&
63
+ bundle exec rake test:compute-core_networking
64
+
65
+ test-compute-instance_groups:
66
+ runs-on: self-hosted
67
+ strategy:
68
+ matrix:
69
+ ruby-version: [ '2.7', '3.0' ]
70
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
71
+ max-parallel: 1
72
+
73
+ steps:
74
+ - uses: actions/checkout@v2.4.0
75
+ - name: Set up Ruby
76
+ uses: ruby/setup-ruby@v1
77
+ env:
78
+ # Needs to be set up for self-hosted runners, see:
79
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
80
+ # Image used in runners: summerwind/actions-runner
81
+ ImageOS: ubuntu20
82
+ with:
83
+ ruby-version: ${{ matrix.ruby-version }}
84
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
85
+ - name: Install dependencies
86
+ run: bundle install
87
+ - name: Run tests
88
+ run: >-
89
+ ./.github/scripts/setup_creds.sh &&
90
+ bundle exec rake test:compute-instance_groups
91
+
92
+ test-compute-loadbalancing:
93
+ runs-on: self-hosted
94
+ strategy:
95
+ matrix:
96
+ ruby-version: [ '2.7', '3.0' ]
97
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
98
+ max-parallel: 1
99
+
100
+ steps:
101
+ - uses: actions/checkout@v2.4.0
102
+ - name: Set up Ruby
103
+ uses: ruby/setup-ruby@v1
104
+ env:
105
+ # Needs to be set up for self-hosted runners, see:
106
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
107
+ # Image used in runners: summerwind/actions-runner
108
+ ImageOS: ubuntu20
109
+ with:
110
+ ruby-version: ${{ matrix.ruby-version }}
111
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
112
+ - name: Install dependencies
113
+ run: bundle install
114
+ - name: Run tests
115
+ run: >-
116
+ ./.github/scripts/setup_creds.sh &&
117
+ bundle exec rake test:compute-loadbalancing
118
+
119
+ test-monitoring:
120
+ runs-on: self-hosted
121
+ strategy:
122
+ matrix:
123
+ ruby-version: [ '2.7', '3.0' ]
124
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
125
+ max-parallel: 1
126
+
127
+ steps:
128
+ - uses: actions/checkout@v2.4.0
129
+ - name: Set up Ruby
130
+ uses: ruby/setup-ruby@v1
131
+ env:
132
+ # Needs to be set up for self-hosted runners, see:
133
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
134
+ # Image used in runners: summerwind/actions-runner
135
+ ImageOS: ubuntu20
136
+ with:
137
+ ruby-version: ${{ matrix.ruby-version }}
138
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
139
+ - name: Install dependencies
140
+ run: bundle install
141
+ - name: Run tests
142
+ run: >-
143
+ ./.github/scripts/setup_creds.sh &&
144
+ bundle exec rake test:monitoring
145
+
146
+ test-storage:
147
+ runs-on: self-hosted
148
+ strategy:
149
+ matrix:
150
+ ruby-version: [ '2.7', '3.0' ]
151
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
152
+ max-parallel: 1
153
+
154
+ steps:
155
+ - uses: actions/checkout@v2.4.0
156
+ - name: Set up Ruby
157
+ uses: ruby/setup-ruby@v1
158
+ env:
159
+ # Needs to be set up for self-hosted runners, see:
160
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
161
+ # Image used in runners: summerwind/actions-runner
162
+ ImageOS: ubuntu20
163
+ with:
164
+ ruby-version: ${{ matrix.ruby-version }}
165
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
166
+ - name: Install dependencies
167
+ run: bundle install
168
+ - name: Run tests
169
+ run: >-
170
+ ./.github/scripts/setup_creds.sh &&
171
+ bundle exec rake test:storage
172
+
173
+ test-pubsub:
174
+ runs-on: self-hosted
175
+ strategy:
176
+ matrix:
177
+ ruby-version: [ '2.7', '3.0' ]
178
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
179
+ max-parallel: 1
180
+
181
+ steps:
182
+ - uses: actions/checkout@v2.4.0
183
+ - name: Set up Ruby
184
+ uses: ruby/setup-ruby@v1
185
+ env:
186
+ # Needs to be set up for self-hosted runners, see:
187
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
188
+ # Image used in runners: summerwind/actions-runner
189
+ ImageOS: ubuntu20
190
+ with:
191
+ ruby-version: ${{ matrix.ruby-version }}
192
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
193
+ - name: Install dependencies
194
+ run: bundle install
195
+ - name: Run tests
196
+ run: >-
197
+ ./.github/scripts/setup_creds.sh &&
198
+ bundle exec rake test:pubsub
199
+
200
+ test-sql:
201
+ runs-on: self-hosted
202
+ strategy:
203
+ matrix:
204
+ ruby-version: [ '2.7', '3.0' ]
205
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
206
+ max-parallel: 1
207
+
208
+ steps:
209
+ - uses: actions/checkout@v2.4.0
210
+ - name: Set up Ruby
211
+ uses: ruby/setup-ruby@v1
212
+ env:
213
+ # Needs to be set up for self-hosted runners, see:
214
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
215
+ # Image used in runners: summerwind/actions-runner
216
+ ImageOS: ubuntu20
217
+ with:
218
+ ruby-version: ${{ matrix.ruby-version }}
219
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
220
+ - name: Install dependencies
221
+ run: bundle install
222
+ - name: Run tests
223
+ run: >-
224
+ ./.github/scripts/setup_creds.sh &&
225
+ bundle exec rake test:sql
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/stale@v3.0.18
13
+ - uses: actions/stale@v4
14
14
  with:
15
15
  repo-token: ${{ secrets.GITHUB_TOKEN }}
16
16
  days-before-stale: 60
@@ -0,0 +1,26 @@
1
+ name: unit-tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test-unit:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ['2.5', '2.6', '2.7', '3.0', 'head', 'truffleruby-head']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2.4.0
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby-version }}
22
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
23
+ - name: Install dependencies
24
+ run: bundle install
25
+ - name: Run tests
26
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -6,6 +6,48 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
6
6
 
7
7
  ## Next
8
8
 
9
+ ## 1.18.0
10
+
11
+ ### User-facing
12
+
13
+ #### Fixed
14
+
15
+ - \#556 Correct conflicting Ruby version info in readme [gdubicki]
16
+ - \#557 Update current images projects list [gdubicki]
17
+ - \#558 Fix page iteration when using #files with block [jgigault]
18
+ - \#562 Loosen fog-core dependency
19
+
20
+ ## 1.17.0
21
+
22
+ ### User-facing
23
+
24
+ #### Added
25
+
26
+ - \#550 Add support for instance display device [dcode]
27
+
28
+ ## 1.16.1
29
+
30
+ ### User-facing
31
+
32
+ #### Fixed
33
+
34
+ - \#545 Avoid duplicate GET requests when retrieving body [stanhu]
35
+ - \#547 Remove exec bit from non_scripts [kbrock]
36
+
37
+ ## 1.16.0
38
+
39
+ ### User-facing
40
+
41
+ #### Fixed
42
+
43
+ - \#540 Bring back integration tests for Fog-Google and fix an array of small bugs/regressions [temikus]
44
+
45
+ ### Development changes
46
+
47
+ #### Added
48
+
49
+ - \#532 Add Truffleruby head to CI [gogainda]
50
+
9
51
  ## 1.15.0
10
52
 
11
53
  ### User-facing
data/README.md CHANGED
@@ -1,12 +1,3 @@
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
-
10
1
  # Fog::Google
11
2
 
12
3
  [![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)
@@ -17,10 +8,20 @@ The main maintainers for the Google sections are @icco, @Temikus and @plribeiro3
17
8
 
18
9
  - As of **v1.0.0**, fog-google includes google-api-client as a dependency, there is no need to include it separately anymore.
19
10
 
20
- - Fog-google is currently supported on Ruby 2.4+ See [supported ruby versions](#supported-ruby-versions) for more info.
11
+ - Fog-google is currently supported on Ruby 2.6+ See [supported ruby versions](#supported-ruby-versions) for more info.
21
12
 
22
13
  See **[MIGRATING.md](MIGRATING.md)** for migration between major versions.
23
14
 
15
+ # Sponsors
16
+
17
+ We're proud to be sponsored by MeisterLabs who are generously funding our CI stack. A small message from them:
18
+
19
+ <img align="right" width=100 height=100 src="https://user-images.githubusercontent.com/2083229/125146917-d965a680-e16b-11eb-8ad2-611b39056ca2.png">
20
+
21
+ *"As extensive users of fog-google we are excited to help! Meister is the company behind the productivity tools [MindMeister](https://www.mindmeister.com/), [MeisterTask](https://www.meistertask.com), and [MeisterNote](https://www.meisternote.com/). We are based in Vienna, Austria and we have a very talented international team who build our products on top of Ruby on Rails, Elixir, React and Redux. We are constantly looking for great talent in Engineering, so If you feel like taking on a new Ruby or Elixir challenge. get in touch, open jobs can be found [here](https://www.meisterlabs.com/jobs/)."*
22
+
23
+ # Usage
24
+
24
25
  ## Storage
25
26
 
26
27
  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.
@@ -174,7 +175,7 @@ $ bundle exec pry
174
175
 
175
176
  ## Supported Ruby Versions
176
177
 
177
- Fog-google is currently supported on Ruby 2.4+.
178
+ Fog-google is currently supported on Ruby 2.6+.
178
179
 
179
180
  In general we support (and run our CI) for Ruby versions that are actively supported
180
181
  by Ruby Core - that is, Ruby versions that are not end of life. Older versions of
data/fog-google.gemspec CHANGED
@@ -20,16 +20,24 @@ Gem::Specification.new do |spec|
20
20
  # As of 0.1.1
21
21
  spec.required_ruby_version = ">= 2.0"
22
22
 
23
- # Locked until https://github.com/fog/fog-google/issues/417 is resolved
24
- spec.add_dependency "fog-core", "<= 2.1.0"
23
+ spec.add_dependency "fog-core", "< 2.3"
25
24
  spec.add_dependency "fog-json", "~> 1.2"
26
25
  spec.add_dependency "fog-xml", "~> 0.1.0"
27
26
 
28
- spec.add_dependency "google-api-client", ">= 0.44.2", "< 0.51"
27
+ spec.add_dependency "google-apis-storage_v1", "~> 0.6"
28
+ spec.add_dependency "google-apis-iamcredentials_v1", "~> 0.6"
29
+ spec.add_dependency "google-apis-compute_v1", "~> 0.14"
30
+ spec.add_dependency "google-apis-monitoring_v3", "~> 0.12"
31
+ spec.add_dependency "google-apis-dns_v1", "~> 0.12"
32
+ spec.add_dependency "google-apis-pubsub_v1", "~> 0.7"
33
+ spec.add_dependency "google-apis-sqladmin_v1beta4", "~> 0.13"
34
+
29
35
  spec.add_dependency "google-cloud-env", "~> 1.2"
30
36
 
31
37
  # Debugger
32
- spec.add_development_dependency "pry"
38
+ # Locked because pry-byebug is broken with 13+
39
+ # see: https://github.com/deivid-rodriguez/pry-byebug/issues/343
40
+ spec.add_development_dependency "pry", "= 0.13.0"
33
41
 
34
42
  # Testing gems
35
43
  spec.add_development_dependency "retriable"
File without changes
File without changes
@@ -11,16 +11,17 @@ module Fog
11
11
  GLOBAL_PROJECTS = %w(
12
12
  centos-cloud
13
13
  cos-cloud
14
- coreos-cloud
15
14
  debian-cloud
15
+ fedora-coreos-cloud
16
16
  rhel-cloud
17
17
  rhel-sap-cloud
18
+ rocky-linux-cloud
18
19
  suse-cloud
19
20
  suse-sap-cloud
20
21
  ubuntu-os-cloud
22
+ ubuntu-os-pro-cloud
21
23
  windows-cloud
22
24
  windows-sql-cloud
23
- opensuse-cloud
24
25
  ).freeze
25
26
 
26
27
  def all
@@ -27,7 +27,7 @@ module Fog
27
27
  alias_method :ipv4_range, :i_pv4_range
28
28
 
29
29
  def save
30
- requires :identity, :ipv4_range
30
+ requires :identity
31
31
 
32
32
  data = service.insert_network(identity, attributes)
33
33
  operation = Fog::Compute::Google::Operations.new(:service => service)
File without changes
File without changes
@@ -50,6 +50,13 @@ module Fog
50
50
  # @return [Array<Hash>]
51
51
  attribute :disks
52
52
 
53
+ # @example Enable the display device
54
+ # {
55
+ # :enable_display => true
56
+ # }
57
+ # @return [Hash<String,Boolean>]
58
+ attribute :display_device, :aliases => "displayDevice"
59
+
53
60
  # @example Guest accelerators
54
61
  # [
55
62
  # {
@@ -84,7 +84,10 @@ module Fog
84
84
  server.wait_for { ready? }
85
85
 
86
86
  # Set the disk to be autodeleted
87
- server.set_disk_auto_delete(true)
87
+ # true - autodelete setting
88
+ # nil - device name (not needed if there's only one disk)
89
+ # false - set async to false so set the property synchronously
90
+ server.set_disk_auto_delete(true, nil, false)
88
91
 
89
92
  server
90
93
  end
File without changes
File without changes
@@ -10,18 +10,8 @@ module Fog
10
10
  end
11
11
 
12
12
  class Real
13
- INSERTABLE_NETWORK_FIELDS = %i{
14
- auto_create_subnetworks
15
- description
16
- gateway_i_pv4
17
- i_pv4_range
18
- name
19
- routing_config
20
- }.freeze
21
-
22
13
  def insert_network(network_name, opts = {})
23
- opts = opts.select { |k, _| INSERTABLE_NETWORK_FIELDS.include? k }
24
- .merge(:name => network_name)
14
+ opts = opts.merge(:name => network_name)
25
15
 
26
16
  @compute.insert_network(
27
17
  @project,
@@ -104,6 +104,10 @@ module Fog
104
104
  data[:shielded_instance_config] = ::Google::Apis::ComputeV1::ShieldedInstanceConfig.new(**options[:shielded_instance_config])
105
105
  end
106
106
 
107
+ if data[:display_device]
108
+ data[:display_device] = ::Google::Apis::ComputeV1::DisplayDevice.new(**options[:display_device])
109
+ end
110
+
107
111
  if data[:tags]
108
112
  if options[:tags].is_a?(Array)
109
113
  # Process classic tag notation, i.e. ["fog"]
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "1.15.0".freeze
3
+ VERSION = "1.18.0".freeze
4
4
  end
5
5
  end
@@ -45,7 +45,16 @@ module Fog
45
45
  end
46
46
 
47
47
  def body
48
- last_modified && (file = collection.get(identity)) ? attributes[:body] ||= file.body : attributes[:body] ||= ""
48
+ return attributes[:body] if attributes.key?(:body)
49
+
50
+ file = collection.get(identity)
51
+
52
+ attributes[:body] =
53
+ if file
54
+ file.attributes[:body]
55
+ else
56
+ ""
57
+ end
49
58
  end
50
59
 
51
60
  def body=(new_body)
@@ -13,11 +13,13 @@ module Fog
13
13
  attribute :page_token, :aliases => %w(pageToken page_token)
14
14
  attribute :max_results, :aliases => ["MaxKeys", "max-keys"]
15
15
  attribute :prefix, :aliases => "Prefix"
16
+ attribute :next_page_token
16
17
 
17
18
  def all(options = {})
18
19
  requires :directory
19
- data = service.list_objects(directory.key, attributes.merge(options))
20
- .to_h[:items] || []
20
+ parent = service.list_objects(directory.key, attributes.merge(options))
21
+ attributes[:next_page_token] = parent.next_page_token
22
+ data = parent.to_h[:items] || []
21
23
  load(data)
22
24
  end
23
25
 
@@ -27,6 +29,10 @@ module Fog
27
29
  subset = dup.all
28
30
 
29
31
  subset.each_file_this_page { |f| yield f }
32
+ while subset.next_page_token
33
+ subset = subset.all(:page_token => subset.next_page_token)
34
+ subset.each_file_this_page { |f| yield f }
35
+ end
30
36
  end
31
37
  self
32
38
  end
@@ -42,12 +48,12 @@ module Fog
42
48
 
43
49
  def get_https_url(key, expires, options = {})
44
50
  requires :directory
45
- service.get_object_https_url(directory.key, key, expires, options)
51
+ service.get_object_https_url(directory.key, key, expires, **options)
46
52
  end
47
53
 
48
54
  def metadata(key, options = {})
49
55
  requires :directory
50
- data = service.get_object_metadata(directory.key, key, options).to_h
56
+ data = service.get_object_metadata(directory.key, key, **options).to_h
51
57
  new(data)
52
58
  rescue ::Google::Apis::ClientError
53
59
  nil
@@ -156,12 +156,12 @@ DATA
156
156
  # See https://cloud.google.com/storage/docs/access-control/signed-urls-v2
157
157
  # @return [String] Signature binary blob
158
158
  def iam_signer(string_to_sign)
159
- request = {
160
- "payload": string_to_sign
161
- }
159
+ request = ::Google::Apis::IamcredentialsV1::SignBlobRequest.new(
160
+ payload: string_to_sign
161
+ )
162
162
 
163
163
  resource = "projects/-/serviceAccounts/#{google_access_id}"
164
- response = @iam_service.sign_service_account_blob resource, request, {}
164
+ response = @iam_service.sign_service_account_blob(resource, request)
165
165
 
166
166
  return response.signed_blob
167
167
  end
@@ -6,14 +6,14 @@ module Fog
6
6
  # Deprecated, redirects to get_object_https_url.rb
7
7
  def get_object_url(bucket_name, object_name, expires, options = {})
8
8
  Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
9
- get_object_https_url(bucket_name, object_name, expires, options)
9
+ get_object_https_url(bucket_name, object_name, expires, **options)
10
10
  end
11
11
  end
12
12
 
13
13
  class Mock # :nodoc:all
14
14
  def get_object_url(bucket_name, object_name, expires, options = {})
15
15
  Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
16
- get_object_https_url(bucket_name, object_name, expires, options)
16
+ get_object_https_url(bucket_name, object_name, expires, **options)
17
17
  end
18
18
  end
19
19
  end
@@ -22,8 +22,8 @@ TEST_IMAGE_PROJECT = "debian-cloud".freeze
22
22
  TEST_IMAGE_FAMILY = "debian-9".freeze
23
23
 
24
24
  # XXX This depends on a public image in gs://fog-test-bucket; there may be a better way to do this
25
- # The image was created like so: https://cloud.google.com/compute/docs/images#export_an_image_to_google_cloud_storage
26
- TEST_RAW_DISK_SOURCE = "https://storage.googleapis.com/fog-testing-bucket/fog-test-raw-disk-source.image.tar.gz".freeze
25
+ # The image was created like so: https://cloud.google.com/compute/docs/images/export-image
26
+ TEST_RAW_DISK_SOURCE = "https://storage.googleapis.com/fog-test-assets-bucket/fog-test-raw-disk-source.image.tar.gz".freeze
27
27
 
28
28
  TEST_SQL_TIER = "db-n1-standard-1".freeze
29
29
  TEST_SQL_REGION = TEST_REGION
@@ -17,8 +17,12 @@ end
17
17
  # See https://github.com/seattlerb/minitest/#install
18
18
  gem "minitest"
19
19
  require "minitest/autorun"
20
- # Custom formatters
21
- require "minitest/reporters"
22
- Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
20
+
21
+ # This is a workaround for RubyMine debugger that doesn't play nice with Minitest::Reporters
22
+ unless ENV['RM_INFO']
23
+ # Custom formatters to make the tests more legible in CI
24
+ require "minitest/reporters"
25
+ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
26
+ end
23
27
 
24
28
  require File.join(File.dirname(__FILE__), "../../lib/fog/google")
@@ -135,8 +135,8 @@ class TestServers < FogIntegrationTest
135
135
  def test_reset_windows_password
136
136
  win_disk = @disks.create(
137
137
  :name => "fog-test-1-testservers-test-reset-windows-password-2",
138
- :source_image => "windows-server-1909-dc-core-v20200310",
139
- :size_gb => 32
138
+ :source_image => "windows-server-2019-dc-v20210713",
139
+ :size_gb => 64
140
140
  )
141
141
  server = @factory.create(:disks => [win_disk])
142
142
  server.wait_for { ready? }