Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 75e8cc4

Browse files
author
Jamie Hannaford
committed
rename functions
1 parent e65ad95 commit 75e8cc4

File tree

8 files changed

+24
-23
lines changed

8 files changed

+24
-23
lines changed

acceptance/openstack/db/v1/instance_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (c context) isRootEnabled() {
112112

113113
func (c context) restartInstance() {
114114
id := c.instanceID
115-
err := instances.RestartService(c.client, id).ExtractErr()
115+
err := instances.Restart(c.client, id).ExtractErr()
116116
c.AssertNoErr(err)
117117
c.Logf("Restarting %s. Waiting...", id)
118118
c.WaitUntilActive(id)
@@ -121,7 +121,7 @@ func (c context) restartInstance() {
121121

122122
func (c context) resizeInstance() {
123123
id := c.instanceID
124-
err := instances.ResizeInstance(c.client, id, "3").ExtractErr()
124+
err := instances.Resize(c.client, id, "3").ExtractErr()
125125
c.AssertNoErr(err)
126126
c.Logf("Resizing %s. Waiting...", id)
127127
c.WaitUntilActive(id)

acceptance/rackspace/db/v1/instance_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (c *context) isRootEnabled() {
137137

138138
func (c *context) restartInstance() {
139139
id := c.instanceID
140-
err := instances.RestartService(c.client, id).ExtractErr()
140+
err := instances.Restart(c.client, id).ExtractErr()
141141
c.AssertNoErr(err)
142142
c.Logf("Restarting %s. Waiting...", id)
143143
c.WaitUntilActive(id)
@@ -146,7 +146,7 @@ func (c *context) restartInstance() {
146146

147147
func (c *context) resizeInstance() {
148148
id := c.instanceID
149-
err := instances.ResizeInstance(c.client, id, "2").ExtractErr()
149+
err := instances.Resize(c.client, id, "2").ExtractErr()
150150
c.AssertNoErr(err)
151151
c.Logf("Resizing %s. Waiting...", id)
152152
c.WaitUntilActive(id)

openstack/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ func NewOrchestrationV1(client *gophercloud.ProviderClient, eo gophercloud.Endpo
262262
return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil
263263
}
264264

265+
// NewDBV1 creates a ServiceClient that may be used to access the v1 DB service.
265266
func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
266267
eo.ApplyDefaults("database")
267268
url, err := client.EndpointLocator(eo)

openstack/db/v1/instances/requests.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ func IsRootEnabled(client *gophercloud.ServiceClient, id string) (bool, error) {
172172
return res.Body.(map[string]interface{})["rootEnabled"] == true, err
173173
}
174174

175-
// RestartService will restart only the MySQL Instance. Restarting MySQL will
175+
// Restart will restart only the MySQL Instance. Restarting MySQL will
176176
// erase any dynamic configuration settings that you have made within MySQL.
177177
// The MySQL service will be unavailable until the instance restarts.
178-
func RestartService(client *gophercloud.ServiceClient, id string) ActionResult {
178+
func Restart(client *gophercloud.ServiceClient, id string) ActionResult {
179179
var res ActionResult
180180

181181
_, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{
@@ -186,9 +186,9 @@ func RestartService(client *gophercloud.ServiceClient, id string) ActionResult {
186186
return res
187187
}
188188

189-
// ResizeInstance changes the memory size of the instance, assuming a valid
189+
// Resize changes the memory size of the instance, assuming a valid
190190
// flavorRef is provided. It will also restart the MySQL service.
191-
func ResizeInstance(client *gophercloud.ServiceClient, id, flavorRef string) ActionResult {
191+
func Resize(client *gophercloud.ServiceClient, id, flavorRef string) ActionResult {
192192
var res ActionResult
193193

194194
type resize struct {

openstack/db/v1/instances/requests_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,21 @@ func TestIsRootEnabled(t *testing.T) {
105105
th.AssertEquals(t, true, isEnabled)
106106
}
107107

108-
func TestRestartService(t *testing.T) {
108+
func TestRestart(t *testing.T) {
109109
th.SetupHTTP()
110110
defer th.TeardownHTTP()
111111
HandleRestart(t)
112112

113-
res := RestartService(fake.ServiceClient(), instanceID)
113+
res := Restart(fake.ServiceClient(), instanceID)
114114
th.AssertNoErr(t, res.Err)
115115
}
116116

117-
func TestResizeInstance(t *testing.T) {
117+
func TestResize(t *testing.T) {
118118
th.SetupHTTP()
119119
defer th.TeardownHTTP()
120120
HandleResize(t)
121121

122-
res := ResizeInstance(fake.ServiceClient(), instanceID, "2")
122+
res := Resize(fake.ServiceClient(), instanceID, "2")
123123
th.AssertNoErr(t, res.Err)
124124
}
125125

rackspace/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func NewRackConnectV3(client *gophercloud.ProviderClient, eo gophercloud.Endpoin
213213
return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil
214214
}
215215

216-
// NewOrchestrationV1 creates a ServiceClient that may be used to access the v1 DB service.
216+
// NewDBV1 creates a ServiceClient that may be used to access the v1 DB service.
217217
func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
218218
eo.ApplyDefaults("rax:database")
219219
url, err := client.EndpointLocator(eo)

rackspace/db/v1/instances/delegate.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ func IsRootEnabled(client *gophercloud.ServiceClient, id string) (bool, error) {
2828
return os.IsRootEnabled(client, id)
2929
}
3030

31-
// RestartService will restart only the MySQL Instance. Restarting MySQL will
31+
// Restart will restart only the MySQL Instance. Restarting MySQL will
3232
// erase any dynamic configuration settings that you have made within MySQL.
3333
// The MySQL service will be unavailable until the instance restarts.
34-
func RestartService(client *gophercloud.ServiceClient, id string) os.ActionResult {
35-
return os.RestartService(client, id)
34+
func Restart(client *gophercloud.ServiceClient, id string) os.ActionResult {
35+
return os.Restart(client, id)
3636
}
3737

38-
// ResizeInstance changes the memory size of the instance, assuming a valid
38+
// Resize changes the memory size of the instance, assuming a valid
3939
// flavorRef is provided. It will also restart the MySQL service.
40-
func ResizeInstance(client *gophercloud.ServiceClient, id, flavorRef string) os.ActionResult {
41-
return os.ResizeInstance(client, id, flavorRef)
40+
func Resize(client *gophercloud.ServiceClient, id, flavorRef string) os.ActionResult {
41+
return os.Resize(client, id, flavorRef)
4242
}
4343

4444
// ResizeVolume will resize the attached volume for an instance. It supports

rackspace/db/v1/instances/delegate_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ func TestEnableRootUser(t *testing.T) {
7979
th.AssertDeepEquals(t, expected, user)
8080
}
8181

82-
func TestRestartService(t *testing.T) {
82+
func TestRestart(t *testing.T) {
8383
th.SetupHTTP()
8484
defer th.TeardownHTTP()
8585
os.HandleRestart(t)
8686

87-
res := RestartService(fake.ServiceClient(), instanceID)
87+
res := Restart(fake.ServiceClient(), instanceID)
8888
th.AssertNoErr(t, res.Err)
8989
}
9090

91-
func TestResizeInstance(t *testing.T) {
91+
func TestResize(t *testing.T) {
9292
th.SetupHTTP()
9393
defer th.TeardownHTTP()
9494
os.HandleResize(t)
9595

96-
res := ResizeInstance(fake.ServiceClient(), instanceID, "2")
96+
res := Resize(fake.ServiceClient(), instanceID, "2")
9797
th.AssertNoErr(t, res.Err)
9898
}
9999

0 commit comments

Comments
 (0)