Adding ListAPIVersions operation
diff --git a/openstack/networking/v2/networks/requests.go b/openstack/networking/v2/networks/requests.go
index b74608b..da97f56 100644
--- a/openstack/networking/v2/networks/requests.go
+++ b/openstack/networking/v2/networks/requests.go
@@ -1,5 +1,10 @@
package networks
+import (
+ "github.com/racker/perigee"
+ "github.com/rackspace/gophercloud"
+)
+
// User-defined options sent to the API when creating or updating a network.
type NetworkOpts struct {
// The administrative state of the network, which is up (true) or down (false).
@@ -15,3 +20,19 @@
// own. You cannot change this value through authorization policies.
TenantID string `json:"tenant_id"`
}
+
+func APIVersions(c *gophercloud.ServiceClient) (*APIVersionsList, error) {
+ url := APIVersionsURL(c)
+
+ var resp APIVersionsList
+ _, err := perigee.Request("GET", url, perigee.Options{
+ MoreHeaders: c.Provider.AuthenticatedHeaders(),
+ Results: &resp,
+ OkCodes: []int{200},
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ return &resp, nil
+}