blob: b67a07b000236898d4a097582a73f530bbff49d9 [file] [log] [blame]
Jamie Hannaford5b7acc12015-02-13 09:14:25 +01001package flavors
2
3import (
Jamie Hannaford5b7acc12015-02-13 09:14:25 +01004 "github.com/rackspace/gophercloud"
5 "github.com/rackspace/gophercloud/pagination"
6)
7
8func List(client *gophercloud.ServiceClient) pagination.Pager {
9 createPage := func(r pagination.PageResult) pagination.Page {
10 return FlavorPage{pagination.LinkedPageBase{PageResult: r}}
11 }
12
13 return pagination.NewPager(client, listURL(client), createPage)
14}
15
16func Get(client *gophercloud.ServiceClient, id string) GetResult {
17 var gr GetResult
Jamie Hannaforda50d1352015-02-18 11:38:38 +010018
19 _, gr.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
20 JSONResponse: &gr.Body,
21 OkCodes: []int{200},
Jamie Hannaford5b7acc12015-02-13 09:14:25 +010022 })
Jamie Hannaforda50d1352015-02-18 11:38:38 +010023
Jamie Hannaford5b7acc12015-02-13 09:14:25 +010024 return gr
25}