google-cloud-storage 1.35.0 → 1.54.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Storage
19
- VERSION = "1.35.0".freeze
19
+ VERSION = "1.54.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -55,6 +55,11 @@ module Google
55
55
  # * `https://www.googleapis.com/auth/devstorage.full_control`
56
56
  # @param [Integer] retries Number of times to retry requests on server
57
57
  # error. The default value is `3`. Optional.
58
+ # @param [Integer] max_elapsed_time Total time in seconds that requests are allowed to keep being retried.
59
+ # @param [Float] base_interval The initial interval in seconds between tries.
60
+ # @param [Integer] max_interval The maximum interval in seconds that any individual retry can reach.
61
+ # @param [Integer] multiplier Each successive interval grows by this factor. A multipler of 1.5 means the next
62
+ # interval will be 1.5x the current interval.
58
63
  # @param [Integer] timeout (default timeout) The max duration, in seconds, to wait before timing out. Optional.
59
64
  # If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol.
60
65
  # @param [Integer] open_timeout How long, in seconds, before failed connections time out. Optional.
@@ -62,6 +67,11 @@ module Google
62
67
  # @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
63
68
  # @param [String] endpoint Override of the endpoint host name. Optional.
64
69
  # If the param is nil, uses the default endpoint.
70
+ # @param universe_domain [String] Override of the universe domain. Optional.
71
+ # If unset or nil, uses the default unvierse domain
72
+ # @param [Integer] upload_chunk_size The chunk size of storage upload, in bytes.
73
+ # The default value is 100 MB, i.e. 104_857_600 bytes. To disable chunking and upload
74
+ # the complete file regardless of size, pass 0 as the chunk size.
65
75
  # @param [String] project Alias for the `project_id` argument. Deprecated.
66
76
  # @param [String] keyfile Alias for the `credentials` argument.
67
77
  # Deprecated.
@@ -79,18 +89,26 @@ module Google
79
89
  # bucket = storage.bucket "my-bucket"
80
90
  # file = bucket.file "path/to/my-file.ext"
81
91
  #
82
- # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
92
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize
83
93
  def self.new project_id: nil, credentials: nil, scope: nil, retries: nil,
84
94
  timeout: nil, open_timeout: nil, read_timeout: nil,
85
- send_timeout: nil, endpoint: nil, project: nil, keyfile: nil
86
- scope ||= configure.scope
87
- retries ||= configure.retries
88
- timeout ||= configure.timeout
89
- open_timeout ||= (configure.open_timeout || timeout)
90
- read_timeout ||= (configure.read_timeout || timeout)
91
- send_timeout ||= (configure.send_timeout || timeout)
92
- endpoint ||= configure.endpoint
93
- credentials ||= (keyfile || default_credentials(scope: scope))
95
+ send_timeout: nil, endpoint: nil, project: nil, keyfile: nil,
96
+ max_elapsed_time: nil, base_interval: nil, max_interval: nil,
97
+ multiplier: nil, upload_chunk_size: nil, universe_domain: nil
98
+ scope ||= configure.scope
99
+ retries ||= configure.retries
100
+ timeout ||= configure.timeout
101
+ open_timeout ||= configure.open_timeout || timeout
102
+ read_timeout ||= configure.read_timeout || timeout
103
+ send_timeout ||= configure.send_timeout || timeout
104
+ endpoint ||= configure.endpoint
105
+ credentials ||= keyfile || default_credentials(scope: scope)
106
+ max_elapsed_time ||= configure.max_elapsed_time
107
+ base_interval ||= configure.base_interval
108
+ max_interval ||= configure.max_interval
109
+ multiplier ||= configure.multiplier
110
+ upload_chunk_size ||= configure.upload_chunk_size
111
+ universe_domain ||= configure.universe_domain
94
112
 
95
113
  unless credentials.is_a? Google::Auth::Credentials
96
114
  credentials = Storage::Credentials.new credentials, scope: scope
@@ -104,11 +122,14 @@ module Google
104
122
  project_id, credentials,
105
123
  retries: retries, timeout: timeout, open_timeout: open_timeout,
106
124
  read_timeout: read_timeout, send_timeout: send_timeout,
107
- host: endpoint, quota_project: configure.quota_project
125
+ host: endpoint, quota_project: configure.quota_project,
126
+ max_elapsed_time: max_elapsed_time, base_interval: base_interval,
127
+ max_interval: max_interval, multiplier: multiplier, upload_chunk_size: upload_chunk_size,
128
+ universe_domain: universe_domain
108
129
  )
109
130
  )
110
131
  end
111
- # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
132
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize
112
133
 
113
134
  ##
114
135
  # Creates an unauthenticated, anonymous client for retrieving public data
@@ -116,6 +137,11 @@ module Google
116
137
  #
117
138
  # @param [Integer] retries Number of times to retry requests on server
118
139
  # error. The default value is `3`. Optional.
140
+ # @param [Integer] max_elapsed_time Total time in seconds that requests are allowed to keep being retried.
141
+ # @param [Float] base_interval The initial interval in seconds between tries.
142
+ # @param [Integer] max_interval The maximum interval in seconds that any individual retry can reach.
143
+ # @param [Integer] multiplier Each successive interval grows by this factor. A multipler of 1.5 means the next
144
+ # interval will be 1.5x the current interval.
119
145
  # @param [Integer] timeout (default timeout) The max duration, in seconds, to wait before timing out. Optional.
120
146
  # If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol.
121
147
  # @param [Integer] open_timeout How long, in seconds, before failed connections time out. Optional.
@@ -123,6 +149,11 @@ module Google
123
149
  # @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
124
150
  # @param [String] endpoint Override of the endpoint host name. Optional.
125
151
  # If the param is nil, uses the default endpoint.
152
+ # @param universe_domain [String] Override of the universe domain. Optional.
153
+ # If unset or nil, uses the default unvierse domain
154
+ # @param [Integer] upload_chunk_size The chunk size of storage upload, in bytes.
155
+ # The default value is 100 MB, i.e. 104_857_600 bytes. To disable chunking and upload
156
+ # the complete file regardless of size, pass 0 as the chunk size.
126
157
  #
127
158
  # @return [Google::Cloud::Storage::Project]
128
159
  #
@@ -139,14 +170,19 @@ module Google
139
170
  # downloaded.read #=> "Hello world!"
140
171
  #
141
172
  def self.anonymous retries: nil, timeout: nil, open_timeout: nil,
142
- read_timeout: nil, send_timeout: nil, endpoint: nil
173
+ read_timeout: nil, send_timeout: nil, endpoint: nil,
174
+ max_elapsed_time: nil, base_interval: nil, max_interval: nil,
175
+ multiplier: nil, upload_chunk_size: nil, universe_domain: nil
143
176
  open_timeout ||= timeout
144
177
  read_timeout ||= timeout
145
178
  send_timeout ||= timeout
146
179
  Storage::Project.new(
147
180
  Storage::Service.new(
148
181
  nil, nil, retries: retries, timeout: timeout, open_timeout: open_timeout,
149
- read_timeout: read_timeout, send_timeout: send_timeout, host: endpoint
182
+ read_timeout: read_timeout, send_timeout: send_timeout, host: endpoint,
183
+ max_elapsed_time: max_elapsed_time, base_interval: base_interval,
184
+ max_interval: max_interval, multiplier: multiplier, upload_chunk_size: upload_chunk_size,
185
+ universe_domain: universe_domain
150
186
  )
151
187
  )
152
188
  end
@@ -168,11 +204,19 @@ module Google
168
204
  # the set of resources and operations that the connection can access.
169
205
  # * `retries` - (Integer) Number of times to retry requests on server
170
206
  # error.
207
+ # * `max_elapsed_time` - (Integer) Total time in seconds that requests
208
+ # are allowed to keep being retried.
209
+ # * `base_interval` - (Float) The initial interval in seconds between tries.
210
+ # * `max_interval` - (Integer) The maximum interval in seconds that any
211
+ # individual retry can reach.
212
+ # * `multiplier` - (Integer) Each successive interval grows by this factor.
213
+ # A multipler of 1.5 means the next interval will be 1.5x the current interval.
171
214
  # * `timeout` - (Integer) (default timeout) The max duration, in seconds, to wait before timing out.
172
215
  # If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol.
173
216
  # * `open_timeout` - (Integer) How long, in seconds, before failed connections time out.
174
217
  # * `read_timeout` - (Integer) How long, in seconds, before requests time out.
175
218
  # * `send_timeout` - (Integer) How long, in seconds, before receiving response from server times out.
219
+ # * `upload_chunk_size` - (Integer) The chunk size of storage upload, in bytes.
176
220
  #
177
221
  # @return [Google::Cloud::Config] The configuration object the
178
222
  # Google::Cloud::Storage library uses.
@@ -45,11 +45,19 @@ module Google
45
45
  # * `https://www.googleapis.com/auth/devstorage.full_control`
46
46
  # @param [Integer] retries Number of times to retry requests on server
47
47
  # error. The default value is `3`. Optional.
48
+ # @param [Integer] max_elapsed_time Total time in seconds that requests are allowed to keep being retried.
49
+ # @param [Float] base_interval The initial interval in seconds between tries.
50
+ # @param [Integer] max_interval The maximum interval in seconds that any individual retry can reach.
51
+ # @param [Integer] multiplier Each successive interval grows by this factor. A multipler of 1.5 means the next
52
+ # interval will be 1.5x the current interval.
48
53
  # @param [Integer] timeout (default timeout) The max duration, in seconds, to wait before timing out. Optional.
49
- # If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol.
54
+ # If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol.
50
55
  # @param [Integer] open_timeout How long, in seconds, before failed connections time out. Optional.
51
56
  # @param [Integer] read_timeout How long, in seconds, before requests time out. Optional.
52
57
  # @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
58
+ # @param [Integer] upload_chunk_size The chunk size of storage upload, in bytes.
59
+ # The default value is 100 MB, i.e. 104_857_600 bytes. To disable chunking and upload
60
+ # the complete file regardless of size, pass 0 as the chunk size.
53
61
  #
54
62
  # @return [Google::Cloud::Storage::Project]
55
63
  #
@@ -68,13 +76,19 @@ module Google
68
76
  # readonly_scope = "https://www.googleapis.com/auth/devstorage.read_only"
69
77
  # readonly_storage = gcloud.storage scope: readonly_scope
70
78
  #
71
- def storage scope: nil, retries: nil, timeout: nil, open_timeout: nil, read_timeout: nil, send_timeout: nil
79
+ def storage scope: nil, retries: nil, timeout: nil, open_timeout: nil, read_timeout: nil, send_timeout: nil,
80
+ max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil, upload_chunk_size: nil
72
81
  Google::Cloud.storage @project, @keyfile, scope: scope,
73
- retries: (retries || @retries),
74
- timeout: (timeout || @timeout),
75
- open_timeout: (open_timeout || timeout),
76
- read_timeout: (read_timeout || timeout),
77
- send_timeout: (send_timeout || timeout)
82
+ retries: retries || @retries,
83
+ timeout: timeout || @timeout,
84
+ open_timeout: open_timeout || timeout,
85
+ read_timeout: read_timeout || timeout,
86
+ send_timeout: send_timeout || timeout,
87
+ max_elapsed_time: max_elapsed_time,
88
+ base_interval: base_interval,
89
+ max_interval: max_interval,
90
+ multiplier: multiplier,
91
+ upload_chunk_size: upload_chunk_size
78
92
  end
79
93
 
80
94
  ##
@@ -100,11 +114,19 @@ module Google
100
114
  # * `https://www.googleapis.com/auth/devstorage.full_control`
101
115
  # @param [Integer] retries Number of times to retry requests on server
102
116
  # error. The default value is `3`. Optional.
117
+ # @param [Integer] max_elapsed_time Total time in seconds that requests are allowed to keep being retried.
118
+ # @param [Float] base_interval The initial interval in seconds between tries.
119
+ # @param [Integer] max_interval The maximum interval in seconds that any individual retry can reach.
120
+ # @param [Integer] multiplier Each successive interval grows by this factor. A multipler of 1.5 means the next
121
+ # interval will be 1.5x the current interval.
103
122
  # @param [Integer] timeout (default timeout) The max duration, in seconds, to wait before timing out. Optional.
104
123
  # If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol.
105
124
  # @param [Integer] open_timeout How long, in seconds, before failed connections time out. Optional.
106
125
  # @param [Integer] read_timeout How long, in seconds, before requests time out. Optional.
107
126
  # @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
127
+ # @param [Integer] upload_chunk_size The chunk size of storage upload, in bytes.
128
+ # The default value is 100 MB, i.e. 104_857_600 bytes. To disable chunking and upload
129
+ # the complete file regardless of size, pass 0 as the chunk size.
108
130
  #
109
131
  # @return [Google::Cloud::Storage::Project]
110
132
  #
@@ -118,16 +140,23 @@ module Google
118
140
  # file = bucket.file "path/to/my-file.ext"
119
141
  #
120
142
  def self.storage project_id = nil, credentials = nil, scope: nil,
121
- retries: nil, timeout: nil, open_timeout: nil, read_timeout: nil, send_timeout: nil
143
+ retries: nil, timeout: nil, open_timeout: nil, read_timeout: nil, send_timeout: nil,
144
+ max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil,
145
+ upload_chunk_size: nil
122
146
  require "google/cloud/storage"
123
147
  Google::Cloud::Storage.new project_id: project_id,
124
148
  credentials: credentials,
125
149
  scope: scope,
126
150
  retries: retries,
127
151
  timeout: timeout,
128
- open_timeout: (open_timeout || timeout),
129
- read_timeout: (read_timeout || timeout),
130
- send_timeout: (send_timeout || timeout)
152
+ open_timeout: open_timeout || timeout,
153
+ read_timeout: read_timeout || timeout,
154
+ send_timeout: send_timeout || timeout,
155
+ max_elapsed_time: max_elapsed_time,
156
+ base_interval: base_interval,
157
+ max_interval: max_interval,
158
+ multiplier: multiplier,
159
+ upload_chunk_size: upload_chunk_size
131
160
  end
132
161
  end
133
162
  end
@@ -153,10 +182,15 @@ Google::Cloud.configure.add_config! :storage do |config|
153
182
  config.add_field! :scope, nil, match: [String, Array]
154
183
  config.add_field! :quota_project, nil, match: String
155
184
  config.add_field! :retries, nil, match: Integer
185
+ config.add_field! :max_elapsed_time, nil, match: Integer
186
+ config.add_field! :base_interval, nil, match: Float
187
+ config.add_field! :max_interval, nil, match: Integer
188
+ config.add_field! :multiplier, nil, match: Integer
156
189
  config.add_field! :timeout, nil, match: Integer
157
190
  config.add_field! :open_timeout, nil, match: Integer
158
191
  config.add_field! :read_timeout, nil, match: Integer
159
192
  config.add_field! :send_timeout, nil, match: Integer
160
- # TODO: Remove once discovery document is updated.
161
- config.add_field! :endpoint, "https://storage.googleapis.com/", match: String
193
+ config.add_field! :upload_chunk_size, nil, match: Integer
194
+ config.add_field! :endpoint, nil, match: String, allow_nil: true
195
+ config.add_field! :universe_domain, nil, match: String, allow_nil: true
162
196
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.35.0
4
+ version: 1.54.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-12-08 00:00:00.000000000 Z
12
+ date: 2024-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -25,54 +25,62 @@ dependencies:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.6'
28
+ - !ruby/object:Gem::Dependency
29
+ name: google-apis-core
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '0.13'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '0.13'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: google-apis-iamcredentials_v1
30
44
  requirement: !ruby/object:Gem::Requirement
31
45
  requirements:
32
46
  - - "~>"
33
47
  - !ruby/object:Gem::Version
34
- version: '0.1'
48
+ version: '0.18'
35
49
  type: :runtime
36
50
  prerelease: false
37
51
  version_requirements: !ruby/object:Gem::Requirement
38
52
  requirements:
39
53
  - - "~>"
40
54
  - !ruby/object:Gem::Version
41
- version: '0.1'
55
+ version: '0.18'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: google-apis-storage_v1
44
58
  requirement: !ruby/object:Gem::Requirement
45
59
  requirements:
46
60
  - - "~>"
47
61
  - !ruby/object:Gem::Version
48
- version: '0.1'
62
+ version: '0.38'
49
63
  type: :runtime
50
64
  prerelease: false
51
65
  version_requirements: !ruby/object:Gem::Requirement
52
66
  requirements:
53
67
  - - "~>"
54
68
  - !ruby/object:Gem::Version
55
- version: '0.1'
69
+ version: '0.38'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: googleauth
58
72
  requirement: !ruby/object:Gem::Requirement
59
73
  requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: 0.16.2
63
- - - "<"
74
+ - - "~>"
64
75
  - !ruby/object:Gem::Version
65
- version: 2.a
76
+ version: '1.9'
66
77
  type: :runtime
67
78
  prerelease: false
68
79
  version_requirements: !ruby/object:Gem::Requirement
69
80
  requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: 0.16.2
73
- - - "<"
81
+ - - "~>"
74
82
  - !ruby/object:Gem::Version
75
- version: 2.a
83
+ version: '1.9'
76
84
  - !ruby/object:Gem::Dependency
77
85
  name: digest-crc
78
86
  requirement: !ruby/object:Gem::Requirement
@@ -121,28 +129,28 @@ dependencies:
121
129
  requirements:
122
130
  - - "~>"
123
131
  - !ruby/object:Gem::Version
124
- version: 1.25.1
132
+ version: 1.30.0
125
133
  type: :development
126
134
  prerelease: false
127
135
  version_requirements: !ruby/object:Gem::Requirement
128
136
  requirements:
129
137
  - - "~>"
130
138
  - !ruby/object:Gem::Version
131
- version: 1.25.1
139
+ version: 1.30.0
132
140
  - !ruby/object:Gem::Dependency
133
141
  name: minitest
134
142
  requirement: !ruby/object:Gem::Requirement
135
143
  requirements:
136
144
  - - "~>"
137
145
  - !ruby/object:Gem::Version
138
- version: '5.10'
146
+ version: '5.16'
139
147
  type: :development
140
148
  prerelease: false
141
149
  version_requirements: !ruby/object:Gem::Requirement
142
150
  requirements:
143
151
  - - "~>"
144
152
  - !ruby/object:Gem::Version
145
- version: '5.10'
153
+ version: '5.16'
146
154
  - !ruby/object:Gem::Dependency
147
155
  name: minitest-autotest
148
156
  requirement: !ruby/object:Gem::Requirement
@@ -255,6 +263,20 @@ dependencies:
255
263
  - - "~>"
256
264
  - !ruby/object:Gem::Version
257
265
  version: 0.1.13
266
+ - !ruby/object:Gem::Dependency
267
+ name: retriable
268
+ requirement: !ruby/object:Gem::Requirement
269
+ requirements:
270
+ - - "~>"
271
+ - !ruby/object:Gem::Version
272
+ version: 3.1.2
273
+ type: :development
274
+ prerelease: false
275
+ version_requirements: !ruby/object:Gem::Requirement
276
+ requirements:
277
+ - - "~>"
278
+ - !ruby/object:Gem::Version
279
+ version: 3.1.2
258
280
  description: google-cloud-storage is the official library for Google Cloud Storage.
259
281
  email:
260
282
  - mike@blowmage.com
@@ -311,14 +333,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
311
333
  requirements:
312
334
  - - ">="
313
335
  - !ruby/object:Gem::Version
314
- version: '2.5'
336
+ version: 3.0.0
315
337
  required_rubygems_version: !ruby/object:Gem::Requirement
316
338
  requirements:
317
339
  - - ">="
318
340
  - !ruby/object:Gem::Version
319
341
  version: '0'
320
342
  requirements: []
321
- rubygems_version: 3.2.17
343
+ rubygems_version: 3.5.23
322
344
  signing_key:
323
345
  specification_version: 4
324
346
  summary: API Client library for Google Cloud Storage