google-cloud-storage 1.34.1 → 1.41.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +67 -0
- data/OVERVIEW.md +32 -0
- data/lib/google/cloud/storage/bucket/acl.rb +28 -26
- data/lib/google/cloud/storage/bucket/lifecycle.rb +88 -10
- data/lib/google/cloud/storage/bucket.rb +108 -16
- data/lib/google/cloud/storage/file/signer_v2.rb +1 -1
- data/lib/google/cloud/storage/file/signer_v4.rb +1 -1
- data/lib/google/cloud/storage/project.rb +20 -12
- data/lib/google/cloud/storage/service.rb +227 -230
- data/lib/google/cloud/storage/version.rb +1 -1
- data/lib/google/cloud/storage.rb +66 -13
- data/lib/google-cloud-storage.rb +51 -7
- metadata +9 -9
@@ -326,7 +326,7 @@ module Google
|
|
326
326
|
#
|
327
327
|
def post_object_ext_path
|
328
328
|
path = "/#{@bucket_name}/#{@file_name}"
|
329
|
-
escaped = Addressable::URI.
|
329
|
+
escaped = Addressable::URI.encode_component path, Addressable::URI::CharacterClasses::PATH
|
330
330
|
special_var = "${filename}"
|
331
331
|
# Restore the unencoded `${filename}` variable, if present.
|
332
332
|
if path.include? special_var
|
@@ -288,12 +288,11 @@ module Google
|
|
288
288
|
# roles.
|
289
289
|
# * `public`, `public_read`, `publicRead` - File owner gets OWNER
|
290
290
|
# access, and allUsers get READER access.
|
291
|
-
# @param [String] location The location of the bucket.
|
292
|
-
#
|
293
|
-
#
|
294
|
-
#
|
295
|
-
#
|
296
|
-
# the authoritative list. The default value is `US`.
|
291
|
+
# @param [String] location The location of the bucket. Optional.
|
292
|
+
# If not passed, the default location, 'US', will be used.
|
293
|
+
# If specifying a dual-region location, the `customPlacementConfig`
|
294
|
+
# property should be set in conjunction. See:
|
295
|
+
# [Storage Locations](https://cloud.google.com/storage/docs/locations).
|
297
296
|
# @param [String] logging_bucket The destination bucket for the bucket's
|
298
297
|
# logs. For more information, see [Access
|
299
298
|
# Logs](https://cloud.google.com/storage/docs/access-logs).
|
@@ -364,14 +363,23 @@ module Google
|
|
364
363
|
# b.lifecycle.add_set_storage_class_rule "COLDLINE", age: 10
|
365
364
|
# end
|
366
365
|
#
|
367
|
-
def create_bucket bucket_name,
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
366
|
+
def create_bucket bucket_name,
|
367
|
+
acl: nil,
|
368
|
+
default_acl: nil,
|
369
|
+
location: nil,
|
370
|
+
custom_placement_config: nil,
|
371
|
+
storage_class: nil,
|
372
|
+
logging_bucket: nil,
|
373
|
+
logging_prefix: nil,
|
374
|
+
website_main: nil,
|
375
|
+
website_404: nil,
|
376
|
+
versioning: nil,
|
377
|
+
requester_pays: nil,
|
378
|
+
user_project: nil
|
372
379
|
params = {
|
373
380
|
name: bucket_name,
|
374
|
-
location: location
|
381
|
+
location: location,
|
382
|
+
custom_placement_config: custom_placement_config
|
375
383
|
}.delete_if { |_, v| v.nil? }
|
376
384
|
new_bucket = Google::Apis::StorageV1::Bucket.new(**params)
|
377
385
|
storage_class = storage_class_for storage_class
|