blob: d8cb48ac59868d5ef7e7a00de7b922ca018894f4 [file] [log] [blame]
Jamie Hannaford05665d62015-10-07 14:01:50 +02001package configurations
2
3import (
4 "github.com/rackspace/gophercloud"
5 os "github.com/rackspace/gophercloud/openstack/db/v1/configurations"
6 "github.com/rackspace/gophercloud/pagination"
7)
8
9// List will list all of the available configurations.
10func List(client *gophercloud.ServiceClient) pagination.Pager {
11 return os.List(client)
12}
13
14// Create will create a new configuration group.
15func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult {
16 return os.Create(client, opts)
17}
18
19// Get will retrieve the details for a specified configuration group.
20func Get(client *gophercloud.ServiceClient, configID string) os.GetResult {
21 return os.Get(client, configID)
22}
23
24// Update will modify an existing configuration group by performing a merge
25// between new and existing values. If the key already exists, the new value
26// will overwrite. All other keys will remain unaffected.
27func Update(client *gophercloud.ServiceClient, configID string, opts os.UpdateOptsBuilder) os.UpdateResult {
28 return os.Update(client, configID, opts)
29}
30
31// Replace will modify an existing configuration group by overwriting the
32// entire parameter group with the new values provided. Any existing keys not
33// included in UpdateOptsBuilder will be deleted.
34func Replace(client *gophercloud.ServiceClient, configID string, opts os.UpdateOptsBuilder) os.ReplaceResult {
35 return os.Replace(client, configID, opts)
36}
37
38// Delete will permanently delete a configuration group. Please note that
39// config groups cannot be deleted whilst still attached to running instances -
40// you must detach and then delete them.
41func Delete(client *gophercloud.ServiceClient, configID string) os.DeleteResult {
42 return os.Delete(client, configID)
43}
44
45// ListInstances will list all the instances associated with a particular
46// configuration group.
47func ListInstances(client *gophercloud.ServiceClient, configID string) pagination.Pager {
48 return os.ListInstances(client, configID)
49}
50
51// ListDatastoreParams will list all the available and supported parameters
52// that can be used for a particular datastore ID and a particular version.
53// For example, if you are wondering how you can configure a MySQL 5.6 instance,
54// you can use this operation (you will need to retrieve the MySQL datastore ID
55// by using the datastores API).
56func ListDatastoreParams(client *gophercloud.ServiceClient, datastoreID, versionID string) pagination.Pager {
57 return os.ListDatastoreParams(client, datastoreID, versionID)
58}
59
60// GetDatastoreParam will retrieve information about a specific configuration
61// parameter. For example, you can use this operation to understand more about
62// "innodb_file_per_table" configuration param for MySQL datastores. You will
63// need the param's ID first, which can be attained by using the ListDatastoreParams
64// operation.
65func GetDatastoreParam(client *gophercloud.ServiceClient, datastoreID, versionID, paramID string) os.ParamResult {
66 return os.GetDatastoreParam(client, datastoreID, versionID, paramID)
67}
68
69// ListGlobalParams is similar to ListDatastoreParams but does not require a
70// DatastoreID.
71func ListGlobalParams(client *gophercloud.ServiceClient, versionID string) pagination.Pager {
72 return os.ListGlobalParams(client, versionID)
73}
74
75// GetGlobalParam is similar to GetDatastoreParam but does not require a
76// DatastoreID.
77func GetGlobalParam(client *gophercloud.ServiceClient, versionID, paramID string) os.ParamResult {
78 return os.GetGlobalParam(client, versionID, paramID)
79}