Jon Perritt | 9776ef6 | 2015-03-16 17:11:22 -0600 | [diff] [blame] | 1 | package cloudnetworks |
| 2 | |
| 3 | import ( |
| 4 | "github.com/rackspace/gophercloud" |
| 5 | "github.com/rackspace/gophercloud/pagination" |
| 6 | ) |
| 7 | |
| 8 | // List returns all cloud networks that are associated with RackConnect. The ID |
| 9 | // returned for each network is the same as the ID returned by the networks package. |
| 10 | func List(c *gophercloud.ServiceClient) pagination.Pager { |
| 11 | url := listURL(c) |
| 12 | createPage := func(r pagination.PageResult) pagination.Page { |
| 13 | return CloudNetworkPage{pagination.SinglePageBase(r)} |
| 14 | } |
| 15 | return pagination.NewPager(c, url, createPage) |
| 16 | } |
| 17 | |
| 18 | // Get retrieves a specific cloud network (that is associated with RackConnect) |
| 19 | // based on its unique ID. |
| 20 | func Get(c *gophercloud.ServiceClient, id string) GetResult { |
| 21 | var res GetResult |
Jamie Hannaford | 5497f94 | 2015-03-25 11:55:51 +0100 | [diff] [blame] | 22 | _, res.Err = c.Get(getURL(c, id), &res.Body, nil) |
Jon Perritt | 9776ef6 | 2015-03-16 17:11:22 -0600 | [diff] [blame] | 23 | return res |
| 24 | } |