Delete a Managed ClickHouse® cluster

  1. Go to the Clusters page in the console.

  2. Select the cluster you want to delete.

  3. Click Delete in the upper-right corner of the page.

  4. Check the I want to delete cluster [your cluster name] box.

  5. Click Delete.

Use the ClusterService delete method and pass the cluster ID in the cluster_id request parameter.

To find the cluster ID, get a list of clusters in the project.

github-mark-white

View this example on GitHub

import json
import logging

import doublecloud

from doublecloud.clickhouse.v1.cluster_service_pb2 import DeleteClusterRequest
from doublecloud.clickhouse.v1.cluster_service_pb2_grpc import ClusterServiceStub

def delete_cluster(sdk, cluster_id):
   cluster_service = sdk.client(ClusterServiceStub)
   return cluster_service.Delete(DeleteClusterRequest(cluster_id=cluster_id))
func deleteCluster(ctx context.Context, dc *dc.SDK, clusterID string) (*operation.Operation, error) {
   op, err := dc.WrapOperation(dc.ClickHouse().Cluster().Delete(ctx, &clickhouse.DeleteClusterRequest{ClusterId: clusterID}))
   if err != nil {
      log.Fatal(err)
   }
   err = op.Wait(ctx)
   return op, err
}

For more in-depth examples, check out DoubleCloud API Go SDK repository .