github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dws/v1/cluster/DeleteCluster.go (about) 1 package cluster 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 ) 7 8 type DeleteClusterOpts struct { 9 ClusterId string `json:"-"` 10 // The number of the latest manual snapshots that need to be retained for a cluster. 11 KeepLastManualSnapshot *int `json:"keep_last_manual_snapshot" required:"true"` 12 } 13 14 func DeleteCluster(client *golangsdk.ServiceClient, opts DeleteClusterOpts) error { 15 b, err := build.RequestBody(opts, "") 16 if err != nil { 17 return err 18 } 19 20 // DELETE /v1.0/{project_id}/clusters/{cluster_id} 21 _, err = client.DeleteWithBody(client.ServiceURL("clusters", opts.ClusterId), b, nil) 22 return err 23 }