github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/compute/v2/extensions/networks/requests.go (about)

     1  package networks
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  	"github.com/huaweicloud/golangsdk/pagination"
     6  )
     7  
     8  // List returns a Pager that allows you to iterate over a collection of Network.
     9  func List(client *golangsdk.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 *golangsdk.ServiceClient, id string) (r GetResult) {
    17  	_, r.Err = client.Get(getURL(client, id), &r.Body, nil)
    18  	return
    19  }