@openpets/clickhouse
v1.0.3
Published
ClickHouse Cloud API plugin for managing organizations, services, backups, API keys, and members. Supports service lifecycle management, scaling, and monitoring via Prometheus metrics.
Downloads
90
Maintainers
Readme
ClickHouse Cloud Plugin
Manage ClickHouse Cloud services, organizations, backups, and more through the ClickHouse Cloud API.
Features
- Organizations - List and manage organizations
- Services - Create, update, delete, start/stop ClickHouse services
- Backups - View and manage backup configurations
- API Keys - Create and manage API keys
- Members - Manage organization members and invitations
- ClickPipes - Manage data ingestion pipelines
- Prometheus Metrics - Access monitoring data
Quick Start
1. Get API Credentials
- Go to ClickHouse Cloud Console
- Navigate to Settings > API Keys
- Create a new API key
- Copy both the Key ID and Key Secret
2. Configure Environment
Create a .env file with your credentials:
CLICKHOUSE_API_KEY=your_key_id_here
CLICKHOUSE_API_SECRET=your_key_secret_here3. Test Connection
opencode run "test clickhouse connection" --print-logsAvailable Tools (60 total)
Organization Management
clickhouse-organization-get-list- List all organizationsclickhouse-organization-get- Get organization detailsclickhouse-organization-update- Update organization
Service Management
clickhouse-instance-get-list- List all servicesclickhouse-instance-get- Get service detailsclickhouse-instance-create- Create a new serviceclickhouse-instance-update- Update service configurationclickhouse-instance-delete- Delete a serviceclickhouse-instance-state-update- Start/stop a serviceclickhouse-instance-replica-scaling-update- Scale replicasclickhouse-instance-password-update- Update default password
Backup Management
clickhouse-backup-get-list- List backupsclickhouse-backup-get- Get backup detailsclickhouse-backup-configuration-get- Get backup configurationclickhouse-backup-configuration-update- Update backup configuration
API Key Management
clickhouse-openapi-key-get-list- List API keysclickhouse-openapi-key-create- Create new API keyclickhouse-openapi-key-get- Get API key detailsclickhouse-openapi-key-delete- Delete API key
Member Management
clickhouse-member-get-list- List organization membersclickhouse-member-get- Get member detailsclickhouse-invitation-get-list- List invitationsclickhouse-invitation-create- Invite new member
ClickPipes (Data Ingestion)
clickhouse-click-pipe-get-list- List ClickPipesclickhouse-click-pipe-create- Create ClickPipeclickhouse-click-pipe-state-update- Start/stop ClickPipe
Monitoring
clickhouse-instance-prometheus-get- Get Prometheus metricsclickhouse-organization-prometheus-get- Get org-level metrics
Example Queries
# List organizations
opencode run "list my clickhouse organizations"
# List all services
opencode run "list all clickhouse services in organization abc123"
# Get service details
opencode run "get details for clickhouse service xyz789"
# Start a service
opencode run "start clickhouse service xyz789 in organization abc123"
# Stop a service
opencode run "stop clickhouse service xyz789"
# View service backups
opencode run "list backups for clickhouse service xyz789"
# Get prometheus metrics
opencode run "get prometheus metrics for clickhouse service xyz789"Authentication
ClickHouse Cloud API uses HTTP Basic Authentication:
- Username: API Key ID (
CLICKHOUSE_API_KEY) - Password: API Key Secret (
CLICKHOUSE_API_SECRET)
Read-Only Mode
To restrict to read-only operations:
pets read-only clickhouse onThis disables all write operations (create, update, delete, start, stop).
Regenerating Tools
If the ClickHouse Cloud API is updated, regenerate tools:
cd pets/clickhouse
pets generate-openapi --verbose