blob: 33f5e04bea3151e0d8535b7396f1f548f638c346 [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
22 _, res.Err = c.Request("GET", getURL(c, id), gophercloud.RequestOpts{
23 JSONResponse: &res.Body,
24 OkCodes: []int{200},
25 })
26 return res
27}