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

Commit b068825

Browse files
author
Dan Kirkwood
committed
remove all but Get action
1 parent ceb8409 commit b068825

File tree

4 files changed

+4
-59
lines changed

4 files changed

+4
-59
lines changed

openstack/compute/v2/extensions/quota/requests.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@ package quotas
22

33
import (
44
"github.com/rackspace/gophercloud"
5-
"github.com/rackspace/gophercloud/pagination"
65
)
76

8-
func List(client *gophercloud.ServiceClient) pagination.Pager {
9-
return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page {
10-
return QuotaPage{pagination.SinglePageBase(r)}
11-
})
12-
}
13-
147
// Get returns public data about a previously created Quota.
15-
func Get(client *gophercloud.ServiceClient, name string) GetResult {
8+
func Get(client *gophercloud.ServiceClient, tenantID string) GetResult {
169
var res GetResult
17-
_, res.Err = client.Get(getURL(client, name), &res.Body, nil)
10+
_, res.Err = client.Get(getURL(client, tenantID), &res.Body, nil)
1811
return res
1912
}

openstack/compute/v2/extensions/quota/results.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,8 @@ func (r quotaResult) Extract() (*Quota, error) {
9898
return res.Quota, err
9999
}
100100

101-
// CreateResult is the response from a Create operation. Call its Extract method to interpret it
102-
// as a Quota.
103-
type CreateResult struct {
104-
quotaResult
105-
}
106-
107101
// GetResult is the response from a Get operation. Call its Extract method to interpret it
108102
// as a Quota.
109103
type GetResult struct {
110104
quotaResult
111105
}
112-
113-
// DeleteResult is the response from a Delete operation. Call its Extract method to determine if
114-
// the call succeeded or failed.
115-
type DeleteResult struct {
116-
gophercloud.ErrResult
117-
}

openstack/compute/v2/extensions/quota/urls.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,6 @@ func resourceURL(c *gophercloud.ServiceClient) string {
88
return c.ServiceURL(resourcePath)
99
}
1010

11-
func listURL(c *gophercloud.ServiceClient) string {
12-
return resourceURL(c)
13-
}
14-
15-
func createURL(c *gophercloud.ServiceClient) string {
16-
return resourceURL(c)
17-
}
18-
19-
func getURL(c *gophercloud.ServiceClient, name string) string {
20-
return c.ServiceURL(resourcePath, name)
21-
}
22-
23-
func deleteURL(c *gophercloud.ServiceClient, name string) string {
24-
return getURL(c, name)
11+
func getURL(c *gophercloud.ServiceClient, tenantID string) string {
12+
return c.ServiceURL(resourcePath, tenantID)
2513
}

openstack/compute/v2/extensions/quota/urls_test.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,10 @@ import (
77
"github.com/rackspace/gophercloud/testhelper/client"
88
)
99

10-
func TestListURL(t *testing.T) {
11-
th.SetupHTTP()
12-
defer th.TeardownHTTP()
13-
c := client.ServiceClient()
14-
15-
th.CheckEquals(t, c.Endpoint+"os-quota-sets", listURL(c))
16-
}
17-
18-
func TestCreateURL(t *testing.T) {
19-
th.SetupHTTP()
20-
defer th.TeardownHTTP()
21-
c := client.ServiceClient()
22-
23-
th.CheckEquals(t, c.Endpoint+"os-quota-sets", createURL(c))
24-
}
25-
2610
func TestGetURL(t *testing.T) {
2711
th.SetupHTTP()
2812
defer th.TeardownHTTP()
2913
c := client.ServiceClient()
3014

3115
th.CheckEquals(t, c.Endpoint+"os-quota-sets/wat", getURL(c, "wat"))
3216
}
33-
34-
func TestDeleteURL(t *testing.T) {
35-
th.SetupHTTP()
36-
defer th.TeardownHTTP()
37-
c := client.ServiceClient()
38-
39-
th.CheckEquals(t, c.Endpoint+"os-quota-sets/wat", deleteURL(c, "wat"))
40-
}

0 commit comments

Comments
 (0)