google-cloud-storage 1.37.0 → 1.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -26
- data/CHANGELOG.md +116 -0
- data/OVERVIEW.md +32 -0
- data/lib/google/cloud/storage/bucket/acl.rb +28 -26
- data/lib/google/cloud/storage/bucket/cors.rb +2 -2
- data/lib/google/cloud/storage/bucket.rb +339 -10
- data/lib/google/cloud/storage/file/list.rb +10 -3
- data/lib/google/cloud/storage/file/signer_v2.rb +5 -4
- data/lib/google/cloud/storage/file/signer_v4.rb +5 -5
- data/lib/google/cloud/storage/file.rb +141 -10
- data/lib/google/cloud/storage/project.rb +75 -6
- data/lib/google/cloud/storage/service.rb +283 -227
- data/lib/google/cloud/storage/version.rb +1 -1
- data/lib/google/cloud/storage.rb +23 -8
- data/lib/google-cloud-storage.rb +24 -16
- metadata +42 -20
data/lib/google/cloud/storage.rb
CHANGED
@@ -67,6 +67,11 @@ module Google
|
|
67
67
|
# @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
|
68
68
|
# @param [String] endpoint Override of the endpoint host name. Optional.
|
69
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.
|
70
75
|
# @param [String] project Alias for the `project_id` argument. Deprecated.
|
71
76
|
# @param [String] keyfile Alias for the `credentials` argument.
|
72
77
|
# Deprecated.
|
@@ -89,19 +94,21 @@ module Google
|
|
89
94
|
timeout: nil, open_timeout: nil, read_timeout: nil,
|
90
95
|
send_timeout: nil, endpoint: nil, project: nil, keyfile: nil,
|
91
96
|
max_elapsed_time: nil, base_interval: nil, max_interval: nil,
|
92
|
-
multiplier: nil
|
97
|
+
multiplier: nil, upload_chunk_size: nil, universe_domain: nil
|
93
98
|
scope ||= configure.scope
|
94
99
|
retries ||= configure.retries
|
95
100
|
timeout ||= configure.timeout
|
96
|
-
open_timeout ||=
|
97
|
-
read_timeout ||=
|
98
|
-
send_timeout ||=
|
101
|
+
open_timeout ||= configure.open_timeout || timeout
|
102
|
+
read_timeout ||= configure.read_timeout || timeout
|
103
|
+
send_timeout ||= configure.send_timeout || timeout
|
99
104
|
endpoint ||= configure.endpoint
|
100
|
-
credentials ||=
|
105
|
+
credentials ||= keyfile || default_credentials(scope: scope)
|
101
106
|
max_elapsed_time ||= configure.max_elapsed_time
|
102
107
|
base_interval ||= configure.base_interval
|
103
108
|
max_interval ||= configure.max_interval
|
104
109
|
multiplier ||= configure.multiplier
|
110
|
+
upload_chunk_size ||= configure.upload_chunk_size
|
111
|
+
universe_domain ||= configure.universe_domain
|
105
112
|
|
106
113
|
unless credentials.is_a? Google::Auth::Credentials
|
107
114
|
credentials = Storage::Credentials.new credentials, scope: scope
|
@@ -117,7 +124,8 @@ module Google
|
|
117
124
|
read_timeout: read_timeout, send_timeout: send_timeout,
|
118
125
|
host: endpoint, quota_project: configure.quota_project,
|
119
126
|
max_elapsed_time: max_elapsed_time, base_interval: base_interval,
|
120
|
-
max_interval: max_interval, multiplier: multiplier
|
127
|
+
max_interval: max_interval, multiplier: multiplier, upload_chunk_size: upload_chunk_size,
|
128
|
+
universe_domain: universe_domain
|
121
129
|
)
|
122
130
|
)
|
123
131
|
end
|
@@ -141,6 +149,11 @@ module Google
|
|
141
149
|
# @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
|
142
150
|
# @param [String] endpoint Override of the endpoint host name. Optional.
|
143
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.
|
144
157
|
#
|
145
158
|
# @return [Google::Cloud::Storage::Project]
|
146
159
|
#
|
@@ -159,7 +172,7 @@ module Google
|
|
159
172
|
def self.anonymous retries: nil, timeout: nil, open_timeout: nil,
|
160
173
|
read_timeout: nil, send_timeout: nil, endpoint: nil,
|
161
174
|
max_elapsed_time: nil, base_interval: nil, max_interval: nil,
|
162
|
-
multiplier: nil
|
175
|
+
multiplier: nil, upload_chunk_size: nil, universe_domain: nil
|
163
176
|
open_timeout ||= timeout
|
164
177
|
read_timeout ||= timeout
|
165
178
|
send_timeout ||= timeout
|
@@ -168,7 +181,8 @@ module Google
|
|
168
181
|
nil, nil, retries: retries, timeout: timeout, open_timeout: open_timeout,
|
169
182
|
read_timeout: read_timeout, send_timeout: send_timeout, host: endpoint,
|
170
183
|
max_elapsed_time: max_elapsed_time, base_interval: base_interval,
|
171
|
-
max_interval: max_interval, multiplier: multiplier
|
184
|
+
max_interval: max_interval, multiplier: multiplier, upload_chunk_size: upload_chunk_size,
|
185
|
+
universe_domain: universe_domain
|
172
186
|
)
|
173
187
|
)
|
174
188
|
end
|
@@ -202,6 +216,7 @@ module Google
|
|
202
216
|
# * `open_timeout` - (Integer) How long, in seconds, before failed connections time out.
|
203
217
|
# * `read_timeout` - (Integer) How long, in seconds, before requests time out.
|
204
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.
|
205
220
|
#
|
206
221
|
# @return [Google::Cloud::Config] The configuration object the
|
207
222
|
# Google::Cloud::Storage library uses.
|
data/lib/google-cloud-storage.rb
CHANGED
@@ -55,6 +55,9 @@ module Google
|
|
55
55
|
# @param [Integer] open_timeout How long, in seconds, before failed connections time out. Optional.
|
56
56
|
# @param [Integer] read_timeout How long, in seconds, before requests time out. Optional.
|
57
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.
|
58
61
|
#
|
59
62
|
# @return [Google::Cloud::Storage::Project]
|
60
63
|
#
|
@@ -74,17 +77,18 @@ module Google
|
|
74
77
|
# readonly_storage = gcloud.storage scope: readonly_scope
|
75
78
|
#
|
76
79
|
def storage scope: nil, retries: nil, timeout: nil, open_timeout: nil, read_timeout: nil, send_timeout: nil,
|
77
|
-
max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil
|
80
|
+
max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil, upload_chunk_size: nil
|
78
81
|
Google::Cloud.storage @project, @keyfile, scope: scope,
|
79
|
-
retries:
|
80
|
-
timeout:
|
81
|
-
open_timeout:
|
82
|
-
read_timeout:
|
83
|
-
send_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,
|
84
87
|
max_elapsed_time: max_elapsed_time,
|
85
88
|
base_interval: base_interval,
|
86
89
|
max_interval: max_interval,
|
87
|
-
multiplier: multiplier
|
90
|
+
multiplier: multiplier,
|
91
|
+
upload_chunk_size: upload_chunk_size
|
88
92
|
end
|
89
93
|
|
90
94
|
##
|
@@ -120,6 +124,9 @@ module Google
|
|
120
124
|
# @param [Integer] open_timeout How long, in seconds, before failed connections time out. Optional.
|
121
125
|
# @param [Integer] read_timeout How long, in seconds, before requests time out. Optional.
|
122
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.
|
123
130
|
#
|
124
131
|
# @return [Google::Cloud::Storage::Project]
|
125
132
|
#
|
@@ -134,26 +141,27 @@ module Google
|
|
134
141
|
#
|
135
142
|
def self.storage project_id = nil, credentials = nil, scope: nil,
|
136
143
|
retries: nil, timeout: nil, open_timeout: nil, read_timeout: nil, send_timeout: nil,
|
137
|
-
max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil
|
144
|
+
max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil,
|
145
|
+
upload_chunk_size: nil
|
138
146
|
require "google/cloud/storage"
|
139
147
|
Google::Cloud::Storage.new project_id: project_id,
|
140
148
|
credentials: credentials,
|
141
149
|
scope: scope,
|
142
150
|
retries: retries,
|
143
151
|
timeout: timeout,
|
144
|
-
open_timeout:
|
145
|
-
read_timeout:
|
146
|
-
send_timeout:
|
152
|
+
open_timeout: open_timeout || timeout,
|
153
|
+
read_timeout: read_timeout || timeout,
|
154
|
+
send_timeout: send_timeout || timeout,
|
147
155
|
max_elapsed_time: max_elapsed_time,
|
148
156
|
base_interval: base_interval,
|
149
157
|
max_interval: max_interval,
|
150
|
-
multiplier: multiplier
|
158
|
+
multiplier: multiplier,
|
159
|
+
upload_chunk_size: upload_chunk_size
|
151
160
|
end
|
152
161
|
end
|
153
162
|
end
|
154
163
|
|
155
164
|
# Set the default storage configuration
|
156
|
-
# rubocop:disable Metrics/BlockLength
|
157
165
|
Google::Cloud.configure.add_config! :storage do |config|
|
158
166
|
default_project = Google::Cloud::Config.deferred do
|
159
167
|
ENV["STORAGE_PROJECT"]
|
@@ -182,7 +190,7 @@ Google::Cloud.configure.add_config! :storage do |config|
|
|
182
190
|
config.add_field! :open_timeout, nil, match: Integer
|
183
191
|
config.add_field! :read_timeout, nil, match: Integer
|
184
192
|
config.add_field! :send_timeout, nil, match: Integer
|
185
|
-
|
186
|
-
config.add_field! :endpoint,
|
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
|
187
196
|
end
|
188
|
-
# rubocop:enable Metrics/BlockLength
|
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.
|
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:
|
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.
|
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.
|
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.
|
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.
|
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:
|
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:
|
83
|
+
version: '1.9'
|
76
84
|
- !ruby/object:Gem::Dependency
|
77
85
|
name: digest-crc
|
78
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,14 +129,14 @@ dependencies:
|
|
121
129
|
requirements:
|
122
130
|
- - "~>"
|
123
131
|
- !ruby/object:Gem::Version
|
124
|
-
version: 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.
|
139
|
+
version: 1.30.0
|
132
140
|
- !ruby/object:Gem::Dependency
|
133
141
|
name: minitest
|
134
142
|
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:
|
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.
|
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
|