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