rename functions
diff --git a/acceptance/openstack/db/v1/instance_test.go b/acceptance/openstack/db/v1/instance_test.go
index 253044c..dfded21 100644
--- a/acceptance/openstack/db/v1/instance_test.go
+++ b/acceptance/openstack/db/v1/instance_test.go
@@ -112,7 +112,7 @@
func (c context) restartInstance() {
id := c.instanceID
- err := instances.RestartService(c.client, id).ExtractErr()
+ err := instances.Restart(c.client, id).ExtractErr()
c.AssertNoErr(err)
c.Logf("Restarting %s. Waiting...", id)
c.WaitUntilActive(id)
@@ -121,7 +121,7 @@
func (c context) resizeInstance() {
id := c.instanceID
- err := instances.ResizeInstance(c.client, id, "3").ExtractErr()
+ err := instances.Resize(c.client, id, "3").ExtractErr()
c.AssertNoErr(err)
c.Logf("Resizing %s. Waiting...", id)
c.WaitUntilActive(id)
diff --git a/acceptance/rackspace/db/v1/instance_test.go b/acceptance/rackspace/db/v1/instance_test.go
index 47897e1..b5540e3 100644
--- a/acceptance/rackspace/db/v1/instance_test.go
+++ b/acceptance/rackspace/db/v1/instance_test.go
@@ -137,7 +137,7 @@
func (c *context) restartInstance() {
id := c.instanceID
- err := instances.RestartService(c.client, id).ExtractErr()
+ err := instances.Restart(c.client, id).ExtractErr()
c.AssertNoErr(err)
c.Logf("Restarting %s. Waiting...", id)
c.WaitUntilActive(id)
@@ -146,7 +146,7 @@
func (c *context) resizeInstance() {
id := c.instanceID
- err := instances.ResizeInstance(c.client, id, "2").ExtractErr()
+ err := instances.Resize(c.client, id, "2").ExtractErr()
c.AssertNoErr(err)
c.Logf("Resizing %s. Waiting...", id)
c.WaitUntilActive(id)
diff --git a/openstack/client.go b/openstack/client.go
index 1d3f4d7..b30d205 100644
--- a/openstack/client.go
+++ b/openstack/client.go
@@ -262,6 +262,7 @@
return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil
}
+// NewDBV1 creates a ServiceClient that may be used to access the v1 DB service.
func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
eo.ApplyDefaults("database")
url, err := client.EndpointLocator(eo)
diff --git a/openstack/db/v1/instances/requests.go b/openstack/db/v1/instances/requests.go
index 425db13..e2b8ad0 100644
--- a/openstack/db/v1/instances/requests.go
+++ b/openstack/db/v1/instances/requests.go
@@ -172,10 +172,10 @@
return res.Body.(map[string]interface{})["rootEnabled"] == true, err
}
-// RestartService will restart only the MySQL Instance. Restarting MySQL will
+// Restart will restart only the MySQL Instance. Restarting MySQL will
// erase any dynamic configuration settings that you have made within MySQL.
// The MySQL service will be unavailable until the instance restarts.
-func RestartService(client *gophercloud.ServiceClient, id string) ActionResult {
+func Restart(client *gophercloud.ServiceClient, id string) ActionResult {
var res ActionResult
_, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
@@ -186,9 +186,9 @@
return res
}
-// ResizeInstance changes the memory size of the instance, assuming a valid
+// Resize changes the memory size of the instance, assuming a valid
// flavorRef is provided. It will also restart the MySQL service.
-func ResizeInstance(client *gophercloud.ServiceClient, id, flavorRef string) ActionResult {
+func Resize(client *gophercloud.ServiceClient, id, flavorRef string) ActionResult {
var res ActionResult
type resize struct {
diff --git a/openstack/db/v1/instances/requests_test.go b/openstack/db/v1/instances/requests_test.go
index 9e28df4..3cc2b70 100644
--- a/openstack/db/v1/instances/requests_test.go
+++ b/openstack/db/v1/instances/requests_test.go
@@ -105,21 +105,21 @@
th.AssertEquals(t, true, isEnabled)
}
-func TestRestartService(t *testing.T) {
+func TestRestart(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
HandleRestart(t)
- res := RestartService(fake.ServiceClient(), instanceID)
+ res := Restart(fake.ServiceClient(), instanceID)
th.AssertNoErr(t, res.Err)
}
-func TestResizeInstance(t *testing.T) {
+func TestResize(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
HandleResize(t)
- res := ResizeInstance(fake.ServiceClient(), instanceID, "2")
+ res := Resize(fake.ServiceClient(), instanceID, "2")
th.AssertNoErr(t, res.Err)
}
diff --git a/rackspace/client.go b/rackspace/client.go
index cc10688..a8f413e 100644
--- a/rackspace/client.go
+++ b/rackspace/client.go
@@ -213,7 +213,7 @@
return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil
}
-// NewOrchestrationV1 creates a ServiceClient that may be used to access the v1 DB service.
+// NewDBV1 creates a ServiceClient that may be used to access the v1 DB service.
func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
eo.ApplyDefaults("rax:database")
url, err := client.EndpointLocator(eo)
diff --git a/rackspace/db/v1/instances/delegate.go b/rackspace/db/v1/instances/delegate.go
index 40838f7..f2656fe 100644
--- a/rackspace/db/v1/instances/delegate.go
+++ b/rackspace/db/v1/instances/delegate.go
@@ -28,17 +28,17 @@
return os.IsRootEnabled(client, id)
}
-// RestartService will restart only the MySQL Instance. Restarting MySQL will
+// Restart will restart only the MySQL Instance. Restarting MySQL will
// erase any dynamic configuration settings that you have made within MySQL.
// The MySQL service will be unavailable until the instance restarts.
-func RestartService(client *gophercloud.ServiceClient, id string) os.ActionResult {
- return os.RestartService(client, id)
+func Restart(client *gophercloud.ServiceClient, id string) os.ActionResult {
+ return os.Restart(client, id)
}
-// ResizeInstance changes the memory size of the instance, assuming a valid
+// Resize changes the memory size of the instance, assuming a valid
// flavorRef is provided. It will also restart the MySQL service.
-func ResizeInstance(client *gophercloud.ServiceClient, id, flavorRef string) os.ActionResult {
- return os.ResizeInstance(client, id, flavorRef)
+func Resize(client *gophercloud.ServiceClient, id, flavorRef string) os.ActionResult {
+ return os.Resize(client, id, flavorRef)
}
// ResizeVolume will resize the attached volume for an instance. It supports
diff --git a/rackspace/db/v1/instances/delegate_test.go b/rackspace/db/v1/instances/delegate_test.go
index e94ce39..716e0a4 100644
--- a/rackspace/db/v1/instances/delegate_test.go
+++ b/rackspace/db/v1/instances/delegate_test.go
@@ -79,21 +79,21 @@
th.AssertDeepEquals(t, expected, user)
}
-func TestRestartService(t *testing.T) {
+func TestRestart(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
os.HandleRestart(t)
- res := RestartService(fake.ServiceClient(), instanceID)
+ res := Restart(fake.ServiceClient(), instanceID)
th.AssertNoErr(t, res.Err)
}
-func TestResizeInstance(t *testing.T) {
+func TestResize(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
os.HandleResize(t)
- res := ResizeInstance(fake.ServiceClient(), instanceID, "2")
+ res := Resize(fake.ServiceClient(), instanceID, "2")
th.AssertNoErr(t, res.Err)
}