Fetch ClickHouse Cloud service details from API (organization ID, service endpoints, configuration)...
Automate service metadata discovery via ClickHouse Cloud API for gapless-crypto-clickhouse project.
Fetch and store ClickHouse Cloud service details using the ClickHouse Cloud REST API. This skill guides the workflow of:
Use this skill when:
Triggers: User mentions "ClickHouse Cloud service", "fetch service details", "organization ID", "service endpoints"
Required Credentials (stored in Doppler aws-credentials/prd project):
CLICKHOUSE_CLOUD_KEY_ID: API Key ID (format: xnIdJM3n42LDImsZ9zzg)CLICKHOUSE_CLOUD_KEY_SECRET: API Key Secret (secured in Doppler)Service Context:
<CLICKHOUSE_SERVICE_ID> (gapless-crypto-clickhouse service)# Retrieve API credentials from Doppler
KEY_ID=$(doppler secrets get CLICKHOUSE_CLOUD_KEY_ID --project aws-credentials --config prd --plain)
KEY_SECRET=$(doppler secrets get CLICKHOUSE_CLOUD_KEY_SECRET --project aws-credentials --config prd --plain)
API Authentication: HTTP Basic Auth with KEY_ID:KEY_SECRET
# Fetch organizations
curl -s -u "$KEY_ID:$KEY_SECRET" https://api.clickhouse.cloud/v1/organizations | jq -r '.[0].id'
Expected Output: UUID format (e.g., <CLICKHOUSE_ORG_ID>)
Store in Doppler:
doppler secrets set CLICKHOUSE_CLOUD_ORG_ID "<org_id>" --project aws-credentials --config prd
# Get service metadata
SERVICE_ID="<CLICKHOUSE_SERVICE_ID>" # gapless-crypto-clickhouse service
ORG_ID=$(doppler secrets get CLICKHOUSE_CLOUD_ORG_ID --project aws-credentials --config prd --plain)
curl -s -u "$KEY_ID:$KEY_SECRET" \
"https://api.clickhouse.cloud/v1/organizations/$ORG_ID/services/$SERVICE_ID" | jq '.'
Response Schema: See references/api-endpoints.md
From API response, extract:
HTTPS Endpoint (recommended for clickhouse-connect):
<CLICKHOUSE_SERVICE_HOST>8443Native Protocol Endpoint (for clickhouse-client):
<CLICKHOUSE_SERVICE_HOST>9440Store in Doppler:
doppler secrets set CLICKHOUSE_HOST "<CLICKHOUSE_SERVICE_HOST>" --project aws-credentials --config prd
doppler secrets set CLICKHOUSE_PORT "8443" --project aws-credentials --config prd
doppler secrets set CLICKHOUSE_USER "default" --project aws-credentials --config prd
Configuration Details:
0.0.0.0/0 (open to world, consider restricting for production)State Validation: Ensure service state is running
runningIssue: "Could not authenticate with ClickHouse Cloud API"
CLICKHOUSE_CLOUD_KEY_ID and CLICKHOUSE_CLOUD_KEY_SECRET in DopplerIssue: "Service not found"
<CLICKHOUSE_SERVICE_ID>Issue: "Service state is not running"
references/api-endpoints.mdAfter service setup, proceed to:
clickhouse-cloud-credentials - Store all credentials in Doppler + 1Passwordclickhouse-cloud-connection - Test connection to ClickHouse Cloud