Code to reclaim IP address space from removed peers

This commit is contained in:
Bryan Boreham committed 2017-11-14 14:06:33 +00:00
1 parent 267bd8b51d
commit a552f194b4
3 files changed
+134 -31

No files matched your search

+6
View File
@@ -62,6 +62,12 @@ func (client *Client) ReleaseIPsFor(ID string) error {
return err
}
// release all IP space owned by a peer
func (client *Client) RmPeer(peerName string) (string, error) {
result, err := client.httpVerb("DELETE", fmt.Sprintf("/peer/%s", peerName), nil)
return result, err
}
func (client *Client) DefaultSubnet() (*net.IPNet, error) {
cidr, err := client.httpVerb("GET", fmt.Sprintf("/ipinfo/defaultsubnet"), nil)
if err != nil {