Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (r UpdateRes
}

// Delete will permanently delete a particular LoadBalancer based on its unique ID.
func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult) {
_, r.Err = c.Delete2(resourceURL(c, id), &r.Body, &golangsdk.RequestOpts{
func Delete(c *golangsdk.ServiceClient, id string, keepEIP bool) (r DeleteResult) {
_, r.Err = c.Delete2(deleteURL(c, id, keepEIP), &r.Body, &golangsdk.RequestOpts{
OkCodes: []int{200},
})
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ func rootURL(c *golangsdk.ServiceClient) string {
func resourceURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(rootPath, resourcePath, id)
}

func deleteURL(c *golangsdk.ServiceClient, id string, keepEIP bool) string {
if keepEIP {
return c.ServiceURL(rootPath, resourcePath, id, "keep-eip")
}
return c.ServiceURL(rootPath, resourcePath, id)
}