github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/autoscaling/v1/instances/delete.go (about)

     1  package instances
     2  
     3  import "github.com/opentelekomcloud/gophertelekomcloud"
     4  
     5  type DeleteOpts struct {
     6  	InstanceId string
     7  	// Specifies whether an instance is deleted when it is removed from the AS group.
     8  	// Options:
     9  	// no (default): The instance will not be deleted.
    10  	// yes: The instance will be deleted.
    11  	DeleteInstance string `q:"instance_delete"`
    12  }
    13  
    14  func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) error {
    15  	url, err := golangsdk.NewURLBuilder().WithEndpoints("scaling_group_instance", opts.InstanceId).WithQueryParams(&opts).Build()
    16  	if err != nil {
    17  		return err
    18  	}
    19  
    20  	_, err = client.Delete(client.ServiceURL(url.String()), nil)
    21  	return err
    22  }