openstack ListAddressesByNetwork op and unit test
diff --git a/openstack/compute/v2/servers/requests.go b/openstack/compute/v2/servers/requests.go
index 3a75b8f..de112cf 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -727,3 +727,12 @@
}
return pagination.NewPager(client, listAddressesURL(client, id), createPageFn)
}
+
+// ListAddressesByNetwork makes a request against the API to list the servers IP addresses
+// for the given network.
+func ListAddressesByNetwork(client *gophercloud.ServiceClient, id, network string) pagination.Pager {
+ createPageFn := func(r pagination.PageResult) pagination.Page {
+ return NetworkAddressPage{pagination.SinglePageBase(r)}
+ }
+ return pagination.NewPager(client, listAddressesByNetworkURL(client, id, network), createPageFn)
+}