Jamie Hannaford | 5b7acc1 | 2015-02-13 09:14:25 +0100 | [diff] [blame] | 1 | package flavors |
| 2 | |
| 3 | import ( |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 4 | "github.com/gophercloud/gophercloud" |
Krzysztof Szukiełojć | 24a29ce | 2017-05-07 14:24:02 +0200 | [diff] [blame^] | 5 | "gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination" |
Jamie Hannaford | 5b7acc1 | 2015-02-13 09:14:25 +0100 | [diff] [blame] | 6 | ) |
| 7 | |
Jamie Hannaford | 9793d94 | 2015-02-18 15:13:20 +0100 | [diff] [blame] | 8 | // List will list all available hardware flavors that an instance can use. The |
| 9 | // operation is identical to the one supported by the Nova API, but without the |
| 10 | // "disk" property. |
Jamie Hannaford | 5b7acc1 | 2015-02-13 09:14:25 +0100 | [diff] [blame] | 11 | func List(client *gophercloud.ServiceClient) pagination.Pager { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 12 | return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page { |
Jamie Hannaford | 5b7acc1 | 2015-02-13 09:14:25 +0100 | [diff] [blame] | 13 | return FlavorPage{pagination.LinkedPageBase{PageResult: r}} |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 14 | }) |
Jamie Hannaford | 5b7acc1 | 2015-02-13 09:14:25 +0100 | [diff] [blame] | 15 | } |
| 16 | |
Jamie Hannaford | 9793d94 | 2015-02-18 15:13:20 +0100 | [diff] [blame] | 17 | // Get will retrieve information for a specified hardware flavor. |
Jon Perritt | 3860b51 | 2016-03-29 12:01:48 -0500 | [diff] [blame] | 18 | func Get(client *gophercloud.ServiceClient, id string) (r GetResult) { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 19 | _, r.Err = client.Get(getURL(client, id), &r.Body, nil) |
jrperritt | 29ae6b3 | 2016-04-13 12:59:37 -0500 | [diff] [blame] | 20 | return |
Jamie Hannaford | 5b7acc1 | 2015-02-13 09:14:25 +0100 | [diff] [blame] | 21 | } |