Claim address requested by caller

This commit is contained in:
Bryan Boreham committed 2016-01-27 12:11:01 +00:00
1 parent 31f736b37e
commit 610a90c727
3 files changed
+26 -7

No files matched your search

+6
View File
@@ -32,6 +32,12 @@ func (client *Client) LookupIP(ID string) (*net.IPNet, error) {
return client.ipamOp(ID, "GET")
}
// Claim a specific IP on behalf of the ID
func (client *Client) ClaimIP(ID string, addr net.IP) error {
_, err := client.httpVerb("PUT", fmt.Sprintf("/ip/%s/%s", ID, addr), nil)
return err
}
// release an IP which is no longer needed
func (client *Client) ReleaseIP(ID string) error {
_, err := client.ipamOp(ID, "DELETE")