Delete an Apache Kafka® cluster
Console
API
Python
Go
-
Go to the Clusters
-
Select the cluster you want to delete.
-
Click Delete in the upper-right corner of the page.
-
Check the I want to delete cluster [your cluster name] box.
-
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.
import json
import logging
import doublecloud
from doublecloud.kafka.v1.cluster_service_pb2 import DeleteClusterRequest
from doublecloud.kafka.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))
For more in-depth examples, check out DoubleCloud API Python SDK repository
func deleteCluster(ctx context.Context, dc *dc.SDK, clusterID string) (*operation.Operation, error) {
op, err := dc.WrapOperation(dc.Kafka().Cluster().Delete(ctx, &kafka.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
Previous
Next