blob: 37994698d522ab4686566b656c4c706bab8f81b7 [file] [log] [blame]
Jamie Hannaford5b7acc12015-02-13 09:14:25 +01001package flavors
2
3import (
4 "github.com/racker/perigee"
5 "github.com/rackspace/gophercloud"
6 "github.com/rackspace/gophercloud/pagination"
7)
8
9func List(client *gophercloud.ServiceClient) pagination.Pager {
10 createPage := func(r pagination.PageResult) pagination.Page {
11 return FlavorPage{pagination.LinkedPageBase{PageResult: r}}
12 }
13
14 return pagination.NewPager(client, listURL(client), createPage)
15}
16
17func Get(client *gophercloud.ServiceClient, id string) GetResult {
18 var gr GetResult
19 gr.Err = perigee.Get(getURL(client, id), perigee.Options{
20 Results: &gr.Body,
21 MoreHeaders: client.AuthenticatedHeaders(),
22 })
23 return gr
24}