blob: 58843030aed9029389d4894fc7514aa170c7042f [file] [log] [blame]
Jon Perritt9776ef62015-03-16 17:11:22 -06001package cloudnetworks
2
3import (
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.
10func 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.
20func Get(c *gophercloud.ServiceClient, id string) GetResult {
21 var res GetResult
Jamie Hannaford5497f942015-03-25 11:55:51 +010022 _, res.Err = c.Get(getURL(c, id), &res.Body, nil)
Jon Perritt9776ef62015-03-16 17:11:22 -060023 return res
24}