blob: 4f66ff94ce8c16482d8733092bddd6b9a1ba15c4 [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 {
Jon Perrittdb0ae142016-03-13 00:33:41 -060010 return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page {
Joe Topjian99a06132015-02-22 05:06:25 +000011 return NetworkPage{pagination.SinglePageBase(r)}
Jon Perrittdb0ae142016-03-13 00:33:41 -060012 })
Joe Topjian99a06132015-02-22 05:06:25 +000013}
14
15// Get returns data about a previously created Network.
Jon Perritt3860b512016-03-29 12:01:48 -050016func Get(client *gophercloud.ServiceClient, id string) (r GetResult) {
Jon Perrittdb0ae142016-03-13 00:33:41 -060017 _, r.Err = client.Get(getURL(client, id), &r.Body, nil)
Joe Topjian99a06132015-02-22 05:06:25 +000018}