Joe Topjian | c21202d | 2015-02-27 21:32:58 +0000 | [diff] [blame^] | 1 | package tenantnetworks |
| 2 | |
| 3 | import ( |
| 4 | "github.com/rackspace/gophercloud" |
| 5 | "github.com/rackspace/gophercloud/pagination" |
| 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 { |
| 10 | url := listURL(client) |
| 11 | createPage := func(r pagination.PageResult) pagination.Page { |
| 12 | return NetworkPage{pagination.SinglePageBase(r)} |
| 13 | } |
| 14 | return pagination.NewPager(client, url, createPage) |
| 15 | } |
| 16 | |
| 17 | // Get returns data about a previously created Network. |
| 18 | func Get(client *gophercloud.ServiceClient, id string) GetResult { |
| 19 | var res GetResult |
| 20 | _, res.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{ |
| 21 | JSONResponse: &res.Body, |
| 22 | OkCodes: []int{200}, |
| 23 | }) |
| 24 | return res |
| 25 | } |