google-cloud-storage 1.57.1 → 1.58.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d5702660db1aed635fecb508a9f704e9f42fab5aa79db322097e775fbe0c60eb
|
|
4
|
+
data.tar.gz: e4ce8ea28ef05a416e3f1f751365f7fef62b2599be2d5b22dcd91d5a735b0cd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e981b3eddd57eb932728eeb6f3e19d4442e4d88f190aba854e764d95b901e4756b164142b835088407e3993c7f989ccfd24aac17432f02aff87fe8c3b4ccf921
|
|
7
|
+
data.tar.gz: dbe8ece884a8bbb25416806c236098e279eadd3b8d3e223a3134de71f76f40fc307a1a54dcedcf45512ae1e0e925eec3adc90ba3831b5a436fd7a531e55c190d
|
data/CHANGELOG.md
CHANGED
|
@@ -27,6 +27,14 @@ module Google
|
|
|
27
27
|
# that match the request and this value should be passed to
|
|
28
28
|
# the next {Google::Cloud::Storage::Project#buckets} to continue.
|
|
29
29
|
attr_accessor :token
|
|
30
|
+
##
|
|
31
|
+
# Provides a list of bucket names that are unreachable.
|
|
32
|
+
#
|
|
33
|
+
# This is only populated when `return_partial_success` is set to `true`
|
|
34
|
+
# in the call to {Google::Cloud::Storage::Project#buckets}.
|
|
35
|
+
#
|
|
36
|
+
# @return [Array<String>]
|
|
37
|
+
attr_reader :unreachable
|
|
30
38
|
|
|
31
39
|
##
|
|
32
40
|
# @private Create a new Bucket::List with an array of values.
|
|
@@ -147,7 +155,7 @@ module Google
|
|
|
147
155
|
# @private New Bucket::List from a Google API Client
|
|
148
156
|
# Google::Apis::StorageV1::Buckets object.
|
|
149
157
|
def self.from_gapi gapi_list, service, prefix = nil, max = nil,
|
|
150
|
-
user_project: nil, soft_deleted: nil
|
|
158
|
+
user_project: nil, soft_deleted: nil, return_partial_success: nil
|
|
151
159
|
buckets = new(Array(gapi_list.items).map do |gapi_object|
|
|
152
160
|
Bucket.from_gapi gapi_object, service, user_project: user_project
|
|
153
161
|
end)
|
|
@@ -157,6 +165,7 @@ module Google
|
|
|
157
165
|
buckets.instance_variable_set :@max, max
|
|
158
166
|
buckets.instance_variable_set :@user_project, user_project
|
|
159
167
|
buckets.instance_variable_set :@soft_deleted, soft_deleted
|
|
168
|
+
buckets.instance_variable_set :@unreachable, Array(gapi_list.unreachable) if return_partial_success
|
|
160
169
|
buckets
|
|
161
170
|
end
|
|
162
171
|
|
|
@@ -158,6 +158,9 @@ module Google
|
|
|
158
158
|
# bucket instances and their files.
|
|
159
159
|
#
|
|
160
160
|
# See also {Bucket#requester_pays=} and {Bucket#requester_pays}.
|
|
161
|
+
# @param [Boolean] return_partial_success
|
|
162
|
+
# If true, the response will contain a list of unreachable buckets.
|
|
163
|
+
# If false, ListBuckets will throw an error if there are any unreachable buckets.
|
|
161
164
|
#
|
|
162
165
|
# @return [Array<Google::Cloud::Storage::Bucket>] (See
|
|
163
166
|
# {Google::Cloud::Storage::Bucket::List})
|
|
@@ -201,11 +204,22 @@ module Google
|
|
|
201
204
|
# soft_deleted_buckets.each do |bucket|
|
|
202
205
|
# puts bucket.name
|
|
203
206
|
# end
|
|
204
|
-
|
|
207
|
+
# @example Retrieve list of unreachable buckets
|
|
208
|
+
# require "google/cloud/storage"
|
|
209
|
+
#
|
|
210
|
+
# storage = Google::Cloud::Storage.new
|
|
211
|
+
#
|
|
212
|
+
# buckets = storage.buckets return_partial_success: true
|
|
213
|
+
# buckets.unreachable.each do |unreachable_bucket_name|
|
|
214
|
+
# puts unreachable_bucket_name
|
|
215
|
+
# end
|
|
216
|
+
#
|
|
217
|
+
def buckets prefix: nil, token: nil, max: nil, user_project: nil, soft_deleted: nil, return_partial_success: nil
|
|
205
218
|
gapi = service.list_buckets \
|
|
206
|
-
prefix: prefix, token: token, max: max, user_project: user_project, soft_deleted: soft_deleted
|
|
219
|
+
prefix: prefix, token: token, max: max, user_project: user_project, soft_deleted: soft_deleted, return_partial_success: return_partial_success
|
|
207
220
|
Bucket::List.from_gapi \
|
|
208
|
-
gapi, service, prefix, max, user_project: user_project, soft_deleted: soft_deleted
|
|
221
|
+
gapi, service, prefix, max, user_project: user_project, soft_deleted: soft_deleted, return_partial_success: return_partial_success
|
|
222
|
+
|
|
209
223
|
end
|
|
210
224
|
alias find_buckets buckets
|
|
211
225
|
|
|
@@ -96,12 +96,14 @@ module Google
|
|
|
96
96
|
|
|
97
97
|
##
|
|
98
98
|
# Retrieves a list of buckets for the given project.
|
|
99
|
-
def list_buckets prefix: nil, token: nil, max: nil, user_project: nil, soft_deleted: nil, options: {}
|
|
99
|
+
def list_buckets prefix: nil, token: nil, max: nil, user_project: nil, soft_deleted: nil, return_partial_success: nil, options: {}
|
|
100
100
|
execute do
|
|
101
101
|
service.list_buckets \
|
|
102
102
|
@project, prefix: prefix, page_token: token, max_results: max,
|
|
103
103
|
user_project: user_project(user_project),
|
|
104
|
-
soft_deleted: soft_deleted,
|
|
104
|
+
soft_deleted: soft_deleted,
|
|
105
|
+
return_partial_success: return_partial_success,
|
|
106
|
+
options: options
|
|
105
107
|
end
|
|
106
108
|
end
|
|
107
109
|
|