Skip to content

Conversation

@shubhangi-google
Copy link
Owner

@shubhangi-google shubhangi-google commented Dec 18, 2024

Add support for restoring soft deleted bucket.

Operation Supported:

  • Get Bucket Generation
  • Get a Soft Deleted Bucket (Also soft-delete time and hard-delete time)
  • List Soft Deleted Buckets
  • Restore a Soft Deleted Bucket
@example
require "google/cloud/storage"
storage = Google::Cloud::Storage.new
bucket = storage.bucket "my-bucket"
bucket.delete
##fetch bucket generation
 generation= bucket.generation
## list soft_deleted buckets
deleted_buckets= storage.buckets soft_deleted: true
## restore bucket
bucket = storage.restore_bucket "my-bucket", generation, soft_deleted: true

@shubhangi-google shubhangi-google changed the base branch from soft_deleted_bucket_restore to main December 18, 2024 13:27
@thiyaguk09 thiyaguk09 self-requested a review December 19, 2024 04:27
@shubhangi-google shubhangi-google changed the base branch from main to soft_deleted_bucket_restore December 19, 2024 04:29
@shubhangi-google shubhangi-google changed the base branch from soft_deleted_bucket_restore to main December 19, 2024 04:31
@shubhangi-google shubhangi-google changed the title samples(storage): Soft deleted Bucket Restore feat(storage): Soft deleted Bucket Restore Dec 19, 2024
Copy link
Collaborator

@thiyaguk09 thiyaguk09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 582 to 583
# @param [Boolean] soft_deleted If this parameter is set to
# `true` project looks in the list of soft deleted buckets
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also not required.

Comment on lines 17 to 18
# The ID of your GCS bucket
# bucket_name = "your-unique-bucket-name"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'bucket_name' is not required and is not utilized anywhere. Therefore, it can be removed.

puts "#{bucket_name} Bucket not restored"
end
end
# [END storage_delete_bucket]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# [END storage_delete_bucket]
# [END storage_restore_soft_deleted_bucket]

@shubhangi-google shubhangi-google force-pushed the soft_deleted_bucket_restore_samples_new3 branch from 209b570 to 59a3f9c Compare January 17, 2025 05:41
@shubhangi-google shubhangi-google added bug Something isn't working donotmerge do not merge labels Jan 30, 2025
@shubhangi-google shubhangi-google changed the title feat(storage): Soft deleted Bucket Restore samples(storage): Soft deleted Bucket Restore Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working donotmerge do not merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants