blob: 88ac891e8e6e864ecea27b7ab034c7e168a264f1 [file] [log] [blame]
Jon Perritt23e89c32015-01-19 15:39:45 -07001package flavors
2
3import (
4 "github.com/racker/perigee"
5 "github.com/rackspace/gophercloud"
6 "github.com/rackspace/gophercloud/pagination"
7)
8
9// List returns a single page of CDN flavors.
10func List(c *gophercloud.ServiceClient) pagination.Pager {
11 url := listURL(c)
12 createPage := func(r pagination.PageResult) pagination.Page {
13 return FlavorPage{pagination.SinglePageBase(r)}
14 }
15 return pagination.NewPager(c, url, createPage)
16}
17
18// Get retrieves a specific flavor based on its unique ID.
19func Get(c *gophercloud.ServiceClient, id string) GetResult {
20 var res GetResult
21 _, res.Err = perigee.Request("GET", getURL(c, id), perigee.Options{
22 MoreHeaders: c.AuthenticatedHeaders(),
23 Results: &res.Body,
24 OkCodes: []int{200},
25 })
26 return res
27}