Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Add kafka delete physical method to http lib (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
codyaray authored Oct 24, 2018
1 parent b20caf9 commit 9c5758f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion http/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,20 @@ func (s *KafkaService) Create(config *schedv1.KafkaClusterConfig) (*schedv1.Kafk

// Delete terminates the given kafka cluster.
func (s *KafkaService) Delete(cluster *schedv1.KafkaCluster) (*http.Response, error) {
return s.delete(cluster, false)
}

// DeletePhysical terminates the given physical kafka cluster and all active logical kafkas.
// This is only supported for users who login with an @confluent.io email address.
func (s *KafkaService) DeletePhysical(cluster *schedv1.KafkaCluster) (*http.Response, error) {
return s.delete(cluster, true)
}

func (s *KafkaService) delete(cluster *schedv1.KafkaCluster, destroyPhysical bool) (*http.Response, error) {
if cluster.Id == "" {
return nil, shared.ErrNotFound
}
body := &schedv1.DeleteKafkaClusterRequest{Cluster: cluster}
body := &schedv1.DeleteKafkaClusterRequest{Cluster: cluster, DestroyPhysical: destroyPhysical}
reply := new(schedv1.DeleteKafkaClusterReply)
resp, err := s.sling.New().Delete("/api/clusters/"+cluster.Id).BodyJSON(body).Receive(reply, reply)
if err != nil {
Expand Down

0 comments on commit 9c5758f

Please sign in to comment.