Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 1 | package agents |
| 2 | |
| 3 | import ( |
| 4 | gophercloud "gerrit.mcp.mirantis.net/debian/gophercloud.git" |
Ildar Svetlov | 790e9f2 | 2019-03-24 22:33:37 +0400 | [diff] [blame] | 5 | "gerrit.mcp.mirantis.net/debian/gophercloud.git/openstack/networking/v2/networks" |
Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 6 | "gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination" |
| 7 | ) |
| 8 | |
| 9 | func List(c *gophercloud.ServiceClient) pagination.Pager { |
| 10 | u := listURL(c) |
| 11 | return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page { |
Dmitry Kalashnik | 4b70b46 | 2017-06-01 20:46:04 +0400 | [diff] [blame] | 12 | return AgentPage{pagination.SinglePageBase(r)} |
Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 13 | }) |
| 14 | } |
Ildar Svetlov | 790e9f2 | 2019-03-24 22:33:37 +0400 | [diff] [blame] | 15 | |
| 16 | // ListDHCPNetworks makes a request against the API to list networks that a DHCP agent hosts. |
| 17 | func ListDHCPNetworks(c *gophercloud.ServiceClient, id string) pagination.Pager { |
| 18 | return pagination.NewPager(c, listDHCPNetworksURL(c, id), func(r pagination.PageResult) pagination.Page { |
| 19 | return networks.NetworkPage{pagination.LinkedPageBase{PageResult: r}} |
| 20 | }) |
| 21 | } |