CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-gcloud

Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub

Overall
score

93%

Overview
Eval results
Files

task.mdevals/scenario-9/

Cloud Storage Bucket Manager

Build a simple bucket management utility that organizes cloud storage containers for a data archival system.

Requirements

Create a utility that manages storage buckets with the following capabilities:

Bucket Creation

The system should allow creating new storage buckets with a given name. The utility should handle bucket creation and report success or failure appropriately.

  • Creating a bucket with name "test-archive-bucket" succeeds and the bucket exists afterward @test
  • Attempting to create a bucket that already exists handles the error gracefully @test

Bucket Listing

The system should retrieve and display all available storage buckets in the project.

  • Listing buckets returns all bucket names in the project @test
  • When multiple buckets exist (e.g., "bucket-a", "bucket-b", "bucket-c"), listing returns all of them @test

Bucket Retrieval

The system should retrieve information about a specific bucket by name and confirm it exists.

  • Retrieving an existing bucket by name returns the bucket information @test
  • Attempting to retrieve a non-existent bucket handles the error appropriately @test

Implementation

@generates

The implementation should provide functions to create, list, and retrieve storage buckets.

API

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
    """
    pass

Dependencies { .dependencies }

gcloud { .dependency }

Provides Google Cloud Platform storage services.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-gcloud

tile.json