blob: a5057334fc60faa0e4141587ffc72e0e97def3fd [file] [log] [blame]
Joe Topjian99a06132015-02-22 05:06:25 +00001package networks
2
3import (
Jon Perritt27249f42016-02-18 10:35:59 -06004 "github.com/gophercloud/gophercloud"
5 "github.com/gophercloud/gophercloud/pagination"
Joe Topjian99a06132015-02-22 05:06:25 +00006)
7
8// List returns a Pager that allows you to iterate over a collection of Network.
9func 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.
18func Get(client *gophercloud.ServiceClient, id string) GetResult {
19 var res GetResult
20 _, res.Err = client.Get(getURL(client, id), &res.Body, nil)
21 return res
22}