Skip to content

Commit

Permalink
docs(storage): Update Bucket#default_kms_key= docs
Browse files Browse the repository at this point in the history
* Demonstrate deleting the Cloud KMS encryption key

pr: #7845
refs: #7823
  • Loading branch information
quartzmo committed Sep 29, 2020
1 parent f9b6bf8 commit c0d1e79
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion google-cloud-storage/lib/google/cloud/storage/bucket.rb
Expand Up @@ -557,7 +557,8 @@ def default_kms_key
# Set the Cloud KMS encryption key that will be used to protect files.
# For example: `projects/a/locations/b/keyRings/c/cryptoKeys/d`
#
# @param [String] new_default_kms_key New Cloud KMS key name.
# @param [String, nil] new_default_kms_key New Cloud KMS key name, or
# `nil` to delete the Cloud KMS encryption key.
#
# @example
# require "google/cloud/storage"
Expand All @@ -571,6 +572,15 @@ def default_kms_key
#
# bucket.default_kms_key = kms_key_name
#
# @example Delete the default Cloud KMS encryption key:
# require "google/cloud/storage"
#
# storage = Google::Cloud::Storage.new
#
# bucket = storage.bucket "my-bucket"
#
# bucket.default_kms_key = nil
#
def default_kms_key= new_default_kms_key
@gapi.encryption = API::Bucket::Encryption.new \
default_kms_key_name: new_default_kms_key
Expand Down

0 comments on commit c0d1e79

Please sign in to comment.