Adding isRootEnabled feature
diff --git a/openstack/db/v1/instances/requests.go b/openstack/db/v1/instances/requests.go
index b54b9fa..8bac170 100644
--- a/openstack/db/v1/instances/requests.go
+++ b/openstack/db/v1/instances/requests.go
@@ -241,3 +241,15 @@
return res
}
+
+func IsRootEnabled(client *gophercloud.ServiceClient, id string) (bool, error) {
+ var res gophercloud.Result
+
+ _, err := perigee.Request("GET", userRootURL(client, id), perigee.Options{
+ MoreHeaders: client.AuthenticatedHeaders(),
+ Results: &res.Body,
+ OkCodes: []int{200},
+ })
+
+ return res.Body.(map[string]interface{})["rootEnabled"] == true, err
+}