Update instance/associate with config group
diff --git a/rackspace/db/v1/instances/requests.go b/rackspace/db/v1/instances/requests.go
index a0ffcad..60775dd 100644
--- a/rackspace/db/v1/instances/requests.go
+++ b/rackspace/db/v1/instances/requests.go
@@ -19,3 +19,22 @@
return res
}
+
+func AssociateWithConfigGroup(client *gophercloud.ServiceClient, instanceID, configGroupID string) UpdateResult {
+ reqBody := map[string]string{
+ "configuration": configGroupID,
+ }
+
+ var res UpdateResult
+
+ resp, err := perigee.Request("PUT", resourceURL(client, instanceID), perigee.Options{
+ MoreHeaders: client.AuthenticatedHeaders(),
+ ReqBody: map[string]map[string]string{"instance": reqBody},
+ OkCodes: []int{202},
+ })
+
+ res.Header = resp.HttpResponse.Header
+ res.Err = err
+
+ return res
+}