Export the Extensions URL functions for overriding.
diff --git a/openstack/common/extensions/requests.go b/openstack/common/extensions/requests.go
index 8b3f0d2..ed5ea4b 100644
--- a/openstack/common/extensions/requests.go
+++ b/openstack/common/extensions/requests.go
@@ -9,7 +9,7 @@
// Get retrieves information for a specific extension using its alias.
func Get(c *gophercloud.ServiceClient, alias string) GetResult {
var res GetResult
- _, err := perigee.Request("GET", extensionURL(c, alias), perigee.Options{
+ _, err := perigee.Request("GET", ExtensionURL(c, alias), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
Results: &res.Resp,
OkCodes: []int{200},
@@ -21,7 +21,7 @@
// List returns a Pager which allows you to iterate over the full collection of extensions.
// It does not accept query parameters.
func List(c *gophercloud.ServiceClient) pagination.Pager {
- return pagination.NewPager(c, listExtensionURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
+ return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
return ExtensionPage{pagination.SinglePageBase(r)}
})
}
diff --git a/openstack/common/extensions/urls.go b/openstack/common/extensions/urls.go
index 2d9a563..6460c66 100644
--- a/openstack/common/extensions/urls.go
+++ b/openstack/common/extensions/urls.go
@@ -2,10 +2,12 @@
import "github.com/rackspace/gophercloud"
-func extensionURL(c *gophercloud.ServiceClient, name string) string {
+// ExtensionURL generates the URL for an extension resource by name.
+func ExtensionURL(c *gophercloud.ServiceClient, name string) string {
return c.ServiceURL("extensions", name)
}
-func listExtensionURL(c *gophercloud.ServiceClient) string {
+// ListExtensionURL generates the URL for the extensions resource collection.
+func ListExtensionURL(c *gophercloud.ServiceClient) string {
return c.ServiceURL("extensions")
}
diff --git a/openstack/common/extensions/urls_test.go b/openstack/common/extensions/urls_test.go
index 94c36cc..3223b1c 100644
--- a/openstack/common/extensions/urls_test.go
+++ b/openstack/common/extensions/urls_test.go
@@ -14,13 +14,13 @@
}
func TestExtensionURL(t *testing.T) {
- actual := extensionURL(endpointClient(), "agent")
+ actual := ExtensionURL(endpointClient(), "agent")
expected := endpoint + "extensions/agent"
th.AssertEquals(t, expected, actual)
}
func TestListExtensionURL(t *testing.T) {
- actual := listExtensionURL(endpointClient())
+ actual := ListExtensionURL(endpointClient())
expected := endpoint + "extensions"
th.AssertEquals(t, expected, actual)
}