Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub
Overall
score
93%
Build a simple bucket management utility that organizes cloud storage containers for a data archival system.
Create a utility that manages storage buckets with the following capabilities:
The system should allow creating new storage buckets with a given name. The utility should handle bucket creation and report success or failure appropriately.
The system should retrieve and display all available storage buckets in the project.
The system should retrieve information about a specific bucket by name and confirm it exists.
@generates
The implementation should provide functions to create, list, and retrieve storage buckets.
def create_bucket(project_id: str, bucket_name: str) -> bool:
"""
Creates a new storage bucket.
Args:
project_id: The Google Cloud project ID
bucket_name: The name for the new bucket
Returns:
True if bucket was created successfully, False otherwise
"""
pass
def list_buckets(project_id: str) -> list:
"""
Lists all storage buckets in the project.
Args:
project_id: The Google Cloud project ID
Returns:
List of bucket names (strings)
"""
pass
def get_bucket(project_id: str, bucket_name: str) -> dict:
"""
Retrieves information about a specific bucket.
Args:
project_id: The Google Cloud project ID
bucket_name: The name of the bucket to retrieve
Returns:
Dictionary with bucket information including at least 'name' key,
or None if bucket doesn't exist
"""
passProvides Google Cloud Platform storage services.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-gcloudevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10