Support subnet and iprange arguments on network create

This commit is contained in:
Bryan Boreham authored and Matthias Radestock committed 2016-01-22 13:37:36 +00:00
1 parent 7f3dc6f202
commit 1a59734cdb
3 files changed
+81 -20

No files matched your search

+8
View File
@@ -18,6 +18,14 @@ func (client *Client) AllocateIP(ID string) (*net.IPNet, error) {
return client.ipamOp(ID, "POST")
}
func (client *Client) AllocateIPInSubnet(ID string, subnet *net.IPNet) (*net.IPNet, error) {
ip, err := client.httpVerb("POST", fmt.Sprintf("/ip/%s/%s", ID, subnet), nil)
if err != nil {
return nil, err
}
return parseIP(ip)
}
// returns an IP for the ID given, or nil if one has not been
// allocated
func (client *Client) LookupIP(ID string) (*net.IPNet, error) {