blob: 6e723d2228efe85e8db7eeeb7e23d355ab07f288 [file] [log] [blame]
Jamie Hannafordb6927c12014-11-03 10:31:26 +01001package nodes
Jamie Hannaford3cfa00a2014-11-03 11:16:35 +01002
3import (
4 "fmt"
5
6 "github.com/rackspace/gophercloud"
7 "github.com/rackspace/gophercloud/pagination"
8)
9
10func List(client *gophercloud.ServiceClient, loadBalancerID int, limit *int) pagination.Pager {
11 url := rootURL(client, loadBalancerID)
12
13 if limit != nil {
14 url += fmt.Sprintf("?limit=%d", limit)
15 }
16
17 createPageFn := func(r pagination.PageResult) pagination.Page {
18 return NodePage{pagination.SinglePageBase(r)}
19 }
20 return pagination.NewPager(client, url, createPageFn)
21}