Last active
February 4, 2022 03:48
-
-
Save jsj14/248c4bf770b211f906af71d1ef5d152f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.cloud import storage | |
storage_client = storage.Client(project='your-project-id') #add your ProjectID here | |
def delete_bucket(bucket_name): | |
"""Deletes a bucket. The bucket must be empty.""" | |
# bucket_name = "your-bucket-name" | |
storage_client = storage.Client() | |
bucket = storage_client.get_bucket(bucket_name) | |
bucket.delete() | |
print("Bucket {} deleted".format(bucket.name)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment