Joe Topjian | 99a0613 | 2015-02-22 05:06:25 +0000 | [diff] [blame] | 1 | package networks |
| 2 | |
| 3 | import ( |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 4 | "github.com/gophercloud/gophercloud" |
| 5 | "github.com/gophercloud/gophercloud/pagination" |
Joe Topjian | 99a0613 | 2015-02-22 05:06:25 +0000 | [diff] [blame] | 6 | ) |
| 7 | |
| 8 | // List returns a Pager that allows you to iterate over a collection of Network. |
| 9 | func List(client *gophercloud.ServiceClient) pagination.Pager { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 10 | return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page { |
Joe Topjian | 99a0613 | 2015-02-22 05:06:25 +0000 | [diff] [blame] | 11 | return NetworkPage{pagination.SinglePageBase(r)} |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 12 | }) |
Joe Topjian | 99a0613 | 2015-02-22 05:06:25 +0000 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | // Get returns data about a previously created Network. |
Jon Perritt | 3860b51 | 2016-03-29 12:01:48 -0500 | [diff] [blame] | 16 | func Get(client *gophercloud.ServiceClient, id string) (r GetResult) { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 17 | _, r.Err = client.Get(getURL(client, id), &r.Body, nil) |
Joe Topjian | 99a0613 | 2015-02-22 05:06:25 +0000 | [diff] [blame] | 18 | } |