Delegates for instance actions
diff --git a/rackspace/db/v1/instances/delegate.go b/rackspace/db/v1/instances/delegate.go
index 47f7fb2..aac9128 100644
--- a/rackspace/db/v1/instances/delegate.go
+++ b/rackspace/db/v1/instances/delegate.go
@@ -112,3 +112,19 @@
func EnableRootUser(client *gophercloud.ServiceClient, id string) os.UserRootResult {
return os.EnableRootUser(client, id)
}
+
+func IsRootEnabled(client *gophercloud.ServiceClient, id string) (bool, error) {
+ return os.IsRootEnabled(client, id)
+}
+
+func RestartService(client *gophercloud.ServiceClient, id string) os.ActionResult {
+ return os.RestartService(client, id)
+}
+
+func ResizeInstance(client *gophercloud.ServiceClient, id, flavorRef string) os.ActionResult {
+ return os.ResizeInstance(client, id, flavorRef)
+}
+
+func ResizeVolume(client *gophercloud.ServiceClient, id string, size int) os.ActionResult {
+ return os.ResizeVolume(client, id, size)
+}
diff --git a/rackspace/db/v1/instances/delegate_test.go b/rackspace/db/v1/instances/delegate_test.go
index e902dfe..cc72227 100644
--- a/rackspace/db/v1/instances/delegate_test.go
+++ b/rackspace/db/v1/instances/delegate_test.go
@@ -98,3 +98,36 @@
th.AssertNoErr(t, err)
th.AssertDeepEquals(t, expected, user)
}
+
+func TestRestartService(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ os.HandleRestartSuccessfully(t, instanceID)
+
+ res := RestartService(fake.ServiceClient(), instanceID)
+
+ th.AssertNoErr(t, res.Err)
+}
+
+func TestResizeInstance(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ os.HandleResizeInstanceSuccessfully(t, instanceID)
+
+ res := ResizeInstance(fake.ServiceClient(), instanceID, "2")
+
+ th.AssertNoErr(t, res.Err)
+}
+
+func TestResizeVolume(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ os.HandleResizeVolSuccessfully(t, instanceID)
+
+ res := ResizeVolume(fake.ServiceClient(), instanceID, 4)
+
+ th.AssertNoErr(t, res.Err)
+}