tessl install tessl/pypi-gcloud@0.7.0Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
78%
A utility for backing up local files to cloud storage and restoring them when needed.
Build a simple file backup manager that uploads local files to a cloud storage bucket and can download them back to the local filesystem. The system should handle text files, track their content types, and provide a straightforward interface for backup and restore operations.
The system must support uploading files to cloud storage:
The system must support downloading files from cloud storage:
The system must provide a way to list all backed-up files in the storage bucket to help users see what files are available for restoration.
@generates
def backup_file(bucket_name, local_file_path, cloud_file_name):
"""
Backs up a local file to cloud storage.
Args:
bucket_name: The name of the storage bucket
local_file_path: Path to the local file to backup
cloud_file_name: Destination name for the file in cloud storage
"""
pass
def restore_file(bucket_name, cloud_file_name, local_file_path):
"""
Restores a file from cloud storage to the local filesystem.
Args:
bucket_name: The name of the storage bucket
cloud_file_name: Name of the file in cloud storage
local_file_path: Destination path for the restored file
"""
pass
def list_backup_files(bucket_name):
"""
Lists all files currently backed up in the storage bucket.
Args:
bucket_name: The name of the storage bucket
Returns:
A list of file names stored in the bucket
"""
passProvides cloud storage capabilities for file backup and retrieval.