github.com/gophercloud/gophercloud@v1.11.0/openstack/compute/v2/extensions/tenantnetworks/requests.go (about)

     1  package tenantnetworks
     2  
     3  import (
     4  	"github.com/gophercloud/gophercloud"
     5  	"github.com/gophercloud/gophercloud/pagination"
     6  )
     7  
     8  // List returns a Pager that allows you to iterate over a collection of Networks.
     9  func List(client *gophercloud.ServiceClient) pagination.Pager {
    10  	return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page {
    11  		return NetworkPage{pagination.SinglePageBase(r)}
    12  	})
    13  }
    14  
    15  // Get returns data about a previously created Network.
    16  func Get(client *gophercloud.ServiceClient, id string) (r GetResult) {
    17  	resp, err := client.Get(getURL(client, id), &r.Body, nil)
    18  	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
    19  	return
    20  }