Managed Postgres OpenAPI
Use the ClickHouse OpenAPI to programmatically control your Managed Postgres services just like ClickHouse services. The same API also exposes a Prometheus endpoint for scraping service metrics. Already familiar with OpenAPI? Get your API keys and jump right to the Managed Postgres API reference. Otherwise, follow along for a quick run-through.API Keys
Using the ClickHouse OpenAPI requires authentication; see API keys for how to create them. Then use them via basic auth credentials like so:Organization ID
Next you’ll need your organization ID.- Select your organization name in the lower left corner of the console.
- Select Organization details.
- Hit the copy icon to the right of Organization ID to copy it directly to your clipboard.
CRUD
Let’s explore the lifecycle of a Postgres service.Create
First, create a new one using the create API. It requires the following properties in the JSON body of the request:name: Name of the new Postgres serviceprovider: Name of the cloud providerregion: Region within the provider’s network in which to deploy the servicesize: The VM sizestorageSize: The storage size for the VM
Read
Use theid from the response to fetch the service again:
state; when it changes to running, the server is ready:
connectionString property to connect, for example via
psql:
\q to exit psql.