google-cloud-storage 1.18.1 → 1.44.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +17 -30
- data/CHANGELOG.md +312 -0
- data/CONTRIBUTING.md +4 -5
- data/LOGGING.md +1 -1
- data/OVERVIEW.md +37 -5
- data/TROUBLESHOOTING.md +2 -8
- data/lib/google/cloud/storage/bucket/acl.rb +40 -40
- data/lib/google/cloud/storage/bucket/cors.rb +4 -1
- data/lib/google/cloud/storage/bucket/lifecycle.rb +259 -44
- data/lib/google/cloud/storage/bucket/list.rb +3 -3
- data/lib/google/cloud/storage/bucket.rb +1096 -172
- data/lib/google/cloud/storage/convert.rb +4 -3
- data/lib/google/cloud/storage/credentials.rb +16 -14
- data/lib/google/cloud/storage/errors.rb +7 -2
- data/lib/google/cloud/storage/file/acl.rb +181 -20
- data/lib/google/cloud/storage/file/list.rb +10 -8
- data/lib/google/cloud/storage/file/signer_v2.rb +36 -18
- data/lib/google/cloud/storage/file/signer_v4.rb +249 -61
- data/lib/google/cloud/storage/file/verifier.rb +2 -2
- data/lib/google/cloud/storage/file.rb +450 -84
- data/lib/google/cloud/storage/hmac_key/list.rb +182 -0
- data/lib/google/cloud/storage/hmac_key.rb +316 -0
- data/lib/google/cloud/storage/policy/binding.rb +246 -0
- data/lib/google/cloud/storage/policy/bindings.rb +196 -0
- data/lib/google/cloud/storage/policy/condition.rb +138 -0
- data/lib/google/cloud/storage/policy.rb +277 -24
- data/lib/google/cloud/storage/post_object.rb +20 -2
- data/lib/google/cloud/storage/project.rb +249 -50
- data/lib/google/cloud/storage/service.rb +479 -288
- data/lib/google/cloud/storage/version.rb +1 -1
- data/lib/google/cloud/storage.rb +86 -16
- data/lib/google-cloud-storage.rb +54 -7
- metadata +74 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7829a0c2c9afddc17d897bd33e73af95e922a4767bfd6d6e8474eec0bac46194
|
4
|
+
data.tar.gz: 41f4328eb840bb9f2373cd291e2271e95d6f066db1a0dd62dbb7354e9e9c8c0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec55a9d4632ee6f5d3637e6b4dc5d156ba45fc01da7b20d7f2e69a1fa4945d55d300385ee6aafba2244edcdf8fe0f36be1340adb28c074920cfad4eca667af21
|
7
|
+
data.tar.gz: 2194c91da01d5719d35756e3a9e1aceb49bfd9e15fb0466ddd8a7c4fae64074e06be41ea14437d0ed8698c777ab7c81f5ea6d90d5932336603c7dd99c5907558
|
data/AUTHENTICATION.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
In general, the google-cloud-storage library uses [Service
|
4
4
|
Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
|
5
|
-
credentials to connect to Google Cloud services. When running on
|
5
|
+
credentials to connect to Google Cloud services. When running on Google Cloud
|
6
|
+
Platform (GCP), including Google Compute Engine (GCE), Google Kubernetes Engine
|
7
|
+
(GKE), Google App Engine (GAE), Google Cloud Functions (GCF) and Cloud Run,
|
6
8
|
the credentials will be discovered automatically. When running on other
|
7
9
|
environments, the Service Account credentials can be specified by providing the
|
8
10
|
path to the [JSON
|
@@ -35,32 +37,10 @@ providing **Project ID** and **Service Account Credentials** directly in code.
|
|
35
37
|
|
36
38
|
### Google Cloud Platform environments
|
37
39
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
should be written as if already authenticated.
|
42
|
-
GCE instance][gce-how-to], you add the correct scopes for the APIs you want to
|
43
|
-
access. For example:
|
44
|
-
|
45
|
-
* **All APIs**
|
46
|
-
* `https://www.googleapis.com/auth/cloud-platform`
|
47
|
-
* `https://www.googleapis.com/auth/cloud-platform.read-only`
|
48
|
-
* **BigQuery**
|
49
|
-
* `https://www.googleapis.com/auth/bigquery`
|
50
|
-
* `https://www.googleapis.com/auth/bigquery.insertdata`
|
51
|
-
* **Compute Engine**
|
52
|
-
* `https://www.googleapis.com/auth/compute`
|
53
|
-
* **Datastore**
|
54
|
-
* `https://www.googleapis.com/auth/datastore`
|
55
|
-
* `https://www.googleapis.com/auth/userinfo.email`
|
56
|
-
* **DNS**
|
57
|
-
* `https://www.googleapis.com/auth/ndev.clouddns.readwrite`
|
58
|
-
* **Pub/Sub**
|
59
|
-
* `https://www.googleapis.com/auth/pubsub`
|
60
|
-
* **Storage**
|
61
|
-
* `https://www.googleapis.com/auth/devstorage.full_control`
|
62
|
-
* `https://www.googleapis.com/auth/devstorage.read_only`
|
63
|
-
* `https://www.googleapis.com/auth/devstorage.read_write`
|
40
|
+
When running on Google Cloud Platform (GCP), including Google Compute Engine (GCE),
|
41
|
+
Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud Functions
|
42
|
+
(GCF) and Cloud Run, the **Project ID** and **Credentials** and are discovered
|
43
|
+
automatically. Code should be written as if already authenticated.
|
64
44
|
|
65
45
|
### Environment Variables
|
66
46
|
|
@@ -97,7 +77,8 @@ storage = Google::Cloud::Storage.new
|
|
97
77
|
|
98
78
|
### Configuration
|
99
79
|
|
100
|
-
The **Project ID** and **Credentials JSON** can be configured
|
80
|
+
The **Project ID** and the path to the **Credentials JSON** file can be configured
|
81
|
+
instead of placing them in environment variables or providing them as arguments.
|
101
82
|
|
102
83
|
```ruby
|
103
84
|
require "google/cloud/storage"
|
@@ -122,8 +103,14 @@ To configure your system for this, simply:
|
|
122
103
|
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
123
104
|
3. Write code as if already authenticated.
|
124
105
|
|
125
|
-
**NOTE:**
|
126
|
-
*should* only be used during development.
|
106
|
+
**NOTE:** The use of Cloud SDK credentials is _not_ recommended for running in
|
107
|
+
production. The Cloud SDK *should* only be used during development.
|
108
|
+
|
109
|
+
**NOTE:** The use of Cloud SDK credentials may not support certain methods such as
|
110
|
+
those that produce
|
111
|
+
[signed URLs](https://cloud.google.com/storage/docs/access-control/signed-urls) and
|
112
|
+
post objects. For these methods, authentication using a service account JSON key file
|
113
|
+
is required.
|
127
114
|
|
128
115
|
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
129
116
|
[dev-console]: https://console.cloud.google.com/project
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,317 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 1.44.0 (2022-11-02)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* support autoclass
|
8
|
+
|
9
|
+
### 1.43.0 (2022-09-30)
|
10
|
+
|
11
|
+
#### Features
|
12
|
+
|
13
|
+
* Add retry conformance test ([#18230](https://github.com/googleapis/google-cloud-ruby/issues/18230))
|
14
|
+
|
15
|
+
### 1.42.0 (2022-09-21)
|
16
|
+
|
17
|
+
#### Features
|
18
|
+
|
19
|
+
* send invocation_id header in all requests ([#19161](https://github.com/googleapis/google-cloud-ruby/issues/19161))
|
20
|
+
|
21
|
+
### 1.41.0 (2022-09-16)
|
22
|
+
|
23
|
+
#### Features
|
24
|
+
|
25
|
+
* add retry support for non-idempotent operations ([#19134](https://github.com/googleapis/google-cloud-ruby/issues/19134))
|
26
|
+
#### Bug Fixes
|
27
|
+
|
28
|
+
* Correct options checks in retry operations ([#19135](https://github.com/googleapis/google-cloud-ruby/issues/19135))
|
29
|
+
* Update api for bucket update ([#19110](https://github.com/googleapis/google-cloud-ruby/issues/19110))
|
30
|
+
|
31
|
+
### 1.40.0 (2022-09-13)
|
32
|
+
|
33
|
+
#### Features
|
34
|
+
|
35
|
+
* Update all patch bucket helper methods to accept preconditions ([#19117](https://github.com/googleapis/google-cloud-ruby/issues/19117))
|
36
|
+
|
37
|
+
### 1.39.0 (2022-08-24)
|
38
|
+
|
39
|
+
#### Features
|
40
|
+
|
41
|
+
* add support for conditional idempotent operations ([#18834](https://github.com/googleapis/google-cloud-ruby/issues/18834))
|
42
|
+
|
43
|
+
### 1.38.0 (2022-07-31)
|
44
|
+
|
45
|
+
#### Features
|
46
|
+
|
47
|
+
* Add support for dual region gcs buckets ([#18862](https://github.com/googleapis/google-cloud-ruby/issues/18862))
|
48
|
+
|
49
|
+
### 1.37.0 (2022-06-30)
|
50
|
+
|
51
|
+
#### Features
|
52
|
+
|
53
|
+
* support OLM Prefix/Suffix ([#18190](https://github.com/googleapis/google-cloud-ruby/issues/18190))
|
54
|
+
* allow retry options to be configurable on client initialization ([#18332](https://github.com/googleapis/google-cloud-ruby/issues/18332))
|
55
|
+
#### Bug Fixes
|
56
|
+
|
57
|
+
* update object path parsing to handle hashes in them
|
58
|
+
|
59
|
+
### 1.36.2 (2022-04-20)
|
60
|
+
|
61
|
+
#### Documentation
|
62
|
+
|
63
|
+
* Document support for dual region buckets
|
64
|
+
|
65
|
+
### 1.36.1 / 2022-02-08
|
66
|
+
|
67
|
+
#### Documentation
|
68
|
+
|
69
|
+
* Update the RPO sample output. ([#17277](https://www.github.com/googleapis/google-cloud-ruby/issues/17277))
|
70
|
+
|
71
|
+
### 1.36.0 / 2022-01-12
|
72
|
+
|
73
|
+
#### Features
|
74
|
+
|
75
|
+
* add support for RPO (turbo replication). ([#14407](https://www.github.com/googleapis/google-cloud-ruby/issues/14407))
|
76
|
+
|
77
|
+
### 1.35.0 / 2021-12-08
|
78
|
+
|
79
|
+
#### Features
|
80
|
+
|
81
|
+
* changed PAP unspecified to inherited
|
82
|
+
* support for more client timeout options
|
83
|
+
|
84
|
+
#### Bug Fixes
|
85
|
+
|
86
|
+
* Update dependency on the addressable gem to 2.8 to remediate a vulnerability
|
87
|
+
|
88
|
+
### 1.34.1 / 2021-07-08
|
89
|
+
|
90
|
+
#### Documentation
|
91
|
+
|
92
|
+
* Update AUTHENTICATION.md in handwritten packages
|
93
|
+
|
94
|
+
### 1.34.0 / 2021-06-30
|
95
|
+
|
96
|
+
#### Features
|
97
|
+
|
98
|
+
* Add support for automatic crc32c and md5 upload verification
|
99
|
+
* Add checksum to Bucket#create_file
|
100
|
+
|
101
|
+
### 1.33.0 / 2021-06-29
|
102
|
+
|
103
|
+
#### Features
|
104
|
+
|
105
|
+
* Add support for PublicAccessPrevention
|
106
|
+
* Add Bucket#public_access_prevention
|
107
|
+
* Add Bucket#public_access_prevention=
|
108
|
+
* Add Bucket#public_access_prevention_enforced?
|
109
|
+
* Add Bucket#public_access_prevention_unspecified?
|
110
|
+
* Add samples for PublicAccessPrevention
|
111
|
+
|
112
|
+
### 1.32.0 / 2021-06-22
|
113
|
+
|
114
|
+
#### Features
|
115
|
+
|
116
|
+
* Add sources_if_generation_match to Bucket#compose
|
117
|
+
* Add support for (meta)generation preconditions to File operations
|
118
|
+
* Add if_(meta)generation_match options to Bucket#compose
|
119
|
+
* Add if_(meta)generation_(not_)match options to Bucket#create_file
|
120
|
+
* Add if_(meta)generation_(not_)match options to Bucket#file
|
121
|
+
* Add if_(meta)generation_(not_)match options to File#delete.
|
122
|
+
* Add if_(meta)generation_(not_)match options to File#rewrite
|
123
|
+
* Add generation and if_(meta)generation_(not_)match options to File#update
|
124
|
+
* Add generation and if_(meta)generation_(not_)match options to File::Acl predefined_acl methods
|
125
|
+
|
126
|
+
#### Bug Fixes
|
127
|
+
|
128
|
+
* Expand googleauth dependency to support future 1.x versions
|
129
|
+
* Update File::Verifier to test for File#to_path
|
130
|
+
|
131
|
+
### 1.31.1 / 2021-05-19
|
132
|
+
|
133
|
+
#### Documentation
|
134
|
+
|
135
|
+
* Update IAMCredentialsService#sign_service_account_blob examples
|
136
|
+
|
137
|
+
### 1.31.0 / 2021-03-10
|
138
|
+
|
139
|
+
#### Features
|
140
|
+
|
141
|
+
* Drop support for Ruby 2.4 and add support for Ruby 3.0
|
142
|
+
|
143
|
+
### 1.30.0 / 2021-01-13
|
144
|
+
|
145
|
+
#### Features
|
146
|
+
|
147
|
+
* Replace google-api-client with specific client gems
|
148
|
+
* Remove google-api-client
|
149
|
+
* Add google-apis-iamcredentials_v1
|
150
|
+
* Add google-apis-storage_v1
|
151
|
+
|
152
|
+
#### Documentation
|
153
|
+
|
154
|
+
* Update Bucket#generate_signed_post_policy_v4 documentation
|
155
|
+
|
156
|
+
### 1.29.2 / 2020-12-14
|
157
|
+
|
158
|
+
#### Bug Fixes
|
159
|
+
|
160
|
+
* Fix support for #generate_signed_post_policy_v4 conditions
|
161
|
+
|
162
|
+
### 1.29.1 / 2020-10-05
|
163
|
+
|
164
|
+
#### Bug Fixes
|
165
|
+
|
166
|
+
* Fix encoding of space characters in file names in signed_url v4
|
167
|
+
|
168
|
+
#### Documentation
|
169
|
+
|
170
|
+
* Update Bucket#default_kms_key= docs
|
171
|
+
* Demonstrate deleting the Cloud KMS encryption key
|
172
|
+
* Update customer-supplied encryption key docs and examples ([#7851](https://www.github.com/googleapis/google-cloud-ruby/issues/7851))
|
173
|
+
|
174
|
+
### 1.29.0 / 2020-09-22
|
175
|
+
|
176
|
+
#### Features
|
177
|
+
|
178
|
+
* quota_project can be set via library configuration ([#7656](https://www.github.com/googleapis/google-cloud-ruby/issues/7656))
|
179
|
+
|
180
|
+
#### Bug Fixes
|
181
|
+
|
182
|
+
* Fix encoding of space characters in #signed_url version: :v4
|
183
|
+
* Fix encoding of space characters to use percent encoding (%20) instead of plus sign (+).
|
184
|
+
|
185
|
+
#### Documentation
|
186
|
+
|
187
|
+
* Add custom time to file metadata sample
|
188
|
+
|
189
|
+
### 1.28.0 / 2020-08-26
|
190
|
+
|
191
|
+
* Add Object Lifecycle Management fields
|
192
|
+
* Add custom_time_before to Lifecycle::Rule
|
193
|
+
* Add days_since_custom_time to Lifecycle::Rule
|
194
|
+
* Add days_since_noncurrent_time to Lifecycle::Rule
|
195
|
+
* Add noncurrent_time_before to Lifecycle::Rule
|
196
|
+
* Add File#custom_time and #custom_time=
|
197
|
+
|
198
|
+
### 1.27.0 / 2020-07-29
|
199
|
+
|
200
|
+
#### Features
|
201
|
+
|
202
|
+
* Add support for signing URLs with IAMCredentials SignBlob API
|
203
|
+
* Add signer parameter accepting Procs to the following methods:
|
204
|
+
* Project#signed_url
|
205
|
+
* Bucket#generate_signed_post_policy_v4
|
206
|
+
* Bucket#post_object
|
207
|
+
* Bucket#signed_url
|
208
|
+
* File#signed_url
|
209
|
+
* Update signer aliases signing_key and private_key to similarly support Procs
|
210
|
+
|
211
|
+
#### Documentation
|
212
|
+
|
213
|
+
* Update documentation of SignedUrlUnavailable
|
214
|
+
|
215
|
+
### 1.26.2 / 2020-05-28
|
216
|
+
|
217
|
+
#### Documentation
|
218
|
+
|
219
|
+
* Fix a few broken links
|
220
|
+
|
221
|
+
### 1.26.1 / 2020-05-06
|
222
|
+
|
223
|
+
#### Bug Fixes
|
224
|
+
|
225
|
+
* Add missing bucket condition in SignerV4#post_object
|
226
|
+
* Ensure bucket is not returned in PostObject fields
|
227
|
+
|
228
|
+
### 1.26.0 / 2020-04-06
|
229
|
+
|
230
|
+
#### Features
|
231
|
+
|
232
|
+
* Update V4 Signature support in Project#signed_url, Bucket#signed_url and File#signed_url
|
233
|
+
* Add scheme, virtual_hosted_style and bucket_bound_hostname to #signed_url methods
|
234
|
+
* Add support for V4 query param encoding and ordering
|
235
|
+
* Convert tabs in V4 to single whitespace character
|
236
|
+
* Set payload in V4 to X-Goog-Content-SHA256 if present
|
237
|
+
* Fix method param default value GET for #signed_url
|
238
|
+
* Add support for V4 Signature POST Policies
|
239
|
+
* Add Bucket#generate_signed_post_policy_v4
|
240
|
+
|
241
|
+
#### Bug Fixes
|
242
|
+
|
243
|
+
* Address keyword argument warnings in Ruby 2.7 and later
|
244
|
+
|
245
|
+
### 1.25.1 / 2020-01-06
|
246
|
+
|
247
|
+
#### Documentation
|
248
|
+
|
249
|
+
* Add ARCHIVE storage class
|
250
|
+
|
251
|
+
### 1.25.0 / 2019-12-12
|
252
|
+
|
253
|
+
#### Features
|
254
|
+
|
255
|
+
* Add IAM Conditions support to Policy
|
256
|
+
|
257
|
+
### 1.24.0 / 2019-11-12
|
258
|
+
|
259
|
+
#### Features
|
260
|
+
|
261
|
+
* Add force_copy_metadata to File#copy and #rewrite
|
262
|
+
|
263
|
+
#### Bug Fixes
|
264
|
+
|
265
|
+
* Update #post_object to support special variable `${filename}`
|
266
|
+
|
267
|
+
### 1.23.0 / 2019-11-05
|
268
|
+
|
269
|
+
#### Features
|
270
|
+
|
271
|
+
* Add support for Bucket#uniform_bucket_level_access
|
272
|
+
* Deprecate Bucket#policy_only=, #policy_only?, and #policy_only_locked_at,
|
273
|
+
which are now aliases for the uniform_bucket_level_access methods.
|
274
|
+
|
275
|
+
### 1.22.0 / 2019-10-28
|
276
|
+
|
277
|
+
* Now requires Ruby 2.4 or later.
|
278
|
+
* This release uses the updated default endpoint for Cloud Storage.
|
279
|
+
|
280
|
+
### 1.21.1 / 2019-09-30
|
281
|
+
|
282
|
+
#### Documentation
|
283
|
+
|
284
|
+
* update storage class examples in docs and tests
|
285
|
+
* Replace MULTI_REGIONAL and REGIONAL with STANDARD and NEARLINE.
|
286
|
+
|
287
|
+
### 1.21.0 / 2019-08-16
|
288
|
+
|
289
|
+
#### Features
|
290
|
+
|
291
|
+
* Support overriding of service endpoint
|
292
|
+
* Update documentation
|
293
|
+
|
294
|
+
#### Bug Fixes
|
295
|
+
|
296
|
+
* Fix Bucket Policy Only service bug temporarily
|
297
|
+
* Set UniformBucketLevelAccess to same value as BucketPolicyOnly
|
298
|
+
|
299
|
+
### 1.20.0 / 2019-08-08
|
300
|
+
|
301
|
+
* Add HmacKey
|
302
|
+
* Add Project#create_hmac_key, Project#hmac_key, and Project#hmac_keys.
|
303
|
+
* Update documentation listings of current and legacy storage classes.
|
304
|
+
* Fix File#download to use generation from current File object.
|
305
|
+
|
306
|
+
### 1.19.0 / 2019-07-11
|
307
|
+
|
308
|
+
* Add Bucket#location_type
|
309
|
+
* Remove :multi_regional and :regional from storage_class docs
|
310
|
+
|
311
|
+
### 1.18.2 / 2019-05-21
|
312
|
+
|
313
|
+
* Declare explicit dependency on mime-types
|
314
|
+
|
3
315
|
### 1.18.1 / 2019-04-29
|
4
316
|
|
5
317
|
* Update Storage Bucket Policy Only documentation.
|
data/CONTRIBUTING.md
CHANGED
@@ -24,7 +24,7 @@ be able to accept your pull requests.
|
|
24
24
|
In order to use the google-cloud-storage console and run the project's tests,
|
25
25
|
there is a small amount of setup:
|
26
26
|
|
27
|
-
1. Install Ruby. google-cloud-storage requires Ruby 2.
|
27
|
+
1. Install Ruby. google-cloud-storage requires Ruby 2.5+. You may choose to
|
28
28
|
manage your Ruby and gem installations with [RVM](https://rvm.io/),
|
29
29
|
[rbenv](https://github.com/rbenv/rbenv), or
|
30
30
|
[chruby](https://github.com/postmodern/chruby).
|
@@ -45,7 +45,7 @@ there is a small amount of setup:
|
|
45
45
|
|
46
46
|
```sh
|
47
47
|
$ cd google-cloud-storage/
|
48
|
-
$ bundle
|
48
|
+
$ bundle install
|
49
49
|
```
|
50
50
|
|
51
51
|
## Console
|
@@ -119,15 +119,14 @@ If you alter an example's title, you may encounter breaking tests.
|
|
119
119
|
### Storage Acceptance Tests
|
120
120
|
|
121
121
|
The Storage acceptance tests interact with the live service API. Follow the
|
122
|
-
instructions in the {file:AUTHENTICATION.md Authentication
|
122
|
+
instructions in the {file:AUTHENTICATION.md Authentication Guide} for enabling
|
123
123
|
the Storage API. Occasionally, some API features may not yet be generally
|
124
124
|
available, making it difficult for some contributors to successfully run the
|
125
125
|
entire acceptance test suite. However, please ensure that you do successfully
|
126
126
|
run acceptance tests for any code areas covered by your pull request.
|
127
127
|
|
128
128
|
To run the acceptance tests, first create and configure a project in the Google
|
129
|
-
Developers Console, as described in the {file:AUTHENTICATION.md Authentication
|
130
|
-
guide}. Be sure to download the JSON KEY file. Make note of the PROJECT_ID and
|
129
|
+
Developers Console, as described in the {file:AUTHENTICATION.md Authentication Guide}. Be sure to download the JSON KEY file. Make note of the PROJECT_ID and
|
131
130
|
the KEYFILE location on your system.
|
132
131
|
|
133
132
|
Before you can run the Storage acceptance tests, you must first create indexes
|
data/LOGGING.md
CHANGED
@@ -6,7 +6,7 @@ Client](https://github.com/google/google-api-ruby-client/blob/master/README.md#l
|
|
6
6
|
library. The logger that you set may be a Ruby stdlib
|
7
7
|
[`Logger`](https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html) as
|
8
8
|
shown below, or a
|
9
|
-
[`Google::Cloud::Logging::Logger`](https://googleapis.
|
9
|
+
[`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
10
10
|
that will write logs to [Stackdriver
|
11
11
|
Logging](https://cloud.google.com/logging/).
|
12
12
|
|
data/OVERVIEW.md
CHANGED
@@ -7,11 +7,11 @@ perform data operations in a cost effective manner.
|
|
7
7
|
|
8
8
|
The goal of google-cloud is to provide an API that is comfortable to Rubyists.
|
9
9
|
Your authentication credentials are detected automatically in Google Cloud
|
10
|
-
Platform
|
11
|
-
Google
|
12
|
-
|
13
|
-
|
14
|
-
Guide}.
|
10
|
+
Platform (GCP), including Google Compute Engine (GCE), Google Kubernetes Engine
|
11
|
+
(GKE), Google App Engine (GAE), Google Cloud Functions (GCF) and Cloud Run. In
|
12
|
+
other environments you can configure authentication easily, either directly in
|
13
|
+
your code or via environment variables. Read more about the options for
|
14
|
+
connecting in the {file:AUTHENTICATION.md Authentication Guide}.
|
15
15
|
|
16
16
|
```ruby
|
17
17
|
require "google/cloud/storage"
|
@@ -563,6 +563,38 @@ require "google/cloud/storage"
|
|
563
563
|
storage = Google::Cloud::Storage.new retries: 10, timeout: 120
|
564
564
|
```
|
565
565
|
|
566
|
+
The library by default retries all API requests which are always idempotent on a
|
567
|
+
"transient" error.
|
568
|
+
|
569
|
+
For API requests which are idempotent only if the some conditions are satisfied
|
570
|
+
(For ex. a file has the same "generation"), the library retries only if the
|
571
|
+
condition is specified.
|
572
|
+
|
573
|
+
Rather than using this default behaviour, you may choose to disable the retries
|
574
|
+
on your own.
|
575
|
+
|
576
|
+
You can pass `retries` as `0` to disable retries for all operations regardless
|
577
|
+
of their idempotencies.
|
578
|
+
|
579
|
+
```ruby
|
580
|
+
require "google/cloud/storage"
|
581
|
+
|
582
|
+
storage = Google::Cloud::Storage.new retries: 0
|
583
|
+
```
|
584
|
+
|
585
|
+
You can also disable retries for a particular operation by passing `retries` as
|
586
|
+
`0` in the `options` field.
|
587
|
+
|
588
|
+
```ruby
|
589
|
+
require "google/cloud/storage"
|
590
|
+
|
591
|
+
storage = Google::Cloud::Storage.new
|
592
|
+
service = storage.service
|
593
|
+
service.get_bucket bucket_name, options: {retries: 0}
|
594
|
+
```
|
595
|
+
|
596
|
+
For those API requests which are never idempotent, the library passes retries=0 by default, suppressing any retries.
|
597
|
+
|
566
598
|
See the [Storage status and error
|
567
599
|
codes](https://cloud.google.com/storage/docs/json_api/v1/status-codes)
|
568
600
|
for a list of error conditions.
|
data/TROUBLESHOOTING.md
CHANGED
@@ -24,14 +24,8 @@ improved, *please* create a new issue on GitHub so we can talk about it.
|
|
24
24
|
|
25
25
|
- [New issue][gh-ruby]
|
26
26
|
|
27
|
-
Or, you can ask questions on the [Google Cloud Platform Slack][slack-ruby]. You
|
28
|
-
can use the "ruby" channel for general Ruby questions, or use the
|
29
|
-
"google-cloud-ruby" channel if you have questions about this gem in particular.
|
30
|
-
|
31
27
|
[so-ruby]: http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby+storage
|
32
28
|
|
33
|
-
[gh-search-ruby]: https://github.com/
|
34
|
-
|
35
|
-
[gh-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues/new
|
29
|
+
[gh-search-ruby]: https://github.com/googleapis/google-cloud-ruby/issues?q=label%3A%22api%3A+storage%22
|
36
30
|
|
37
|
-
[
|
31
|
+
[gh-ruby]: https://github.com/googleapis/google-cloud-ruby/issues/new
|