Enable root user delegate
diff --git a/rackspace/db/v1/instances/delegate.go b/rackspace/db/v1/instances/delegate.go
index 33e69cf..47f7fb2 100644
--- a/rackspace/db/v1/instances/delegate.go
+++ b/rackspace/db/v1/instances/delegate.go
@@ -108,3 +108,7 @@
func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult {
return os.Delete(client, id)
}
+
+func EnableRootUser(client *gophercloud.ServiceClient, id string) os.UserRootResult {
+ return os.EnableRootUser(client, id)
+}
diff --git a/rackspace/db/v1/instances/delegate_test.go b/rackspace/db/v1/instances/delegate_test.go
index 75d1442..e902dfe 100644
--- a/rackspace/db/v1/instances/delegate_test.go
+++ b/rackspace/db/v1/instances/delegate_test.go
@@ -85,3 +85,16 @@
res := Delete(fake.ServiceClient(), instanceID)
th.AssertNoErr(t, res.Err)
}
+
+func TestEnableRootUser(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ os.HandleEnableRootUserSuccessfully(t, instanceID)
+
+ expected := &os.User{Name: "root", Password: "secretsecret"}
+
+ user, err := EnableRootUser(fake.ServiceClient(), instanceID).Extract()
+ th.AssertNoErr(t, err)
+ th.AssertDeepEquals(t, expected, user)
+}