Beispiel #1
0
func TestExtractList(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()
	servers.HandleServerListSuccessfully(t)

	pages := 0
	err := servers.List(client.ServiceClient(), nil).EachPage(func(page pagination.Page) (bool, error) {
		pages++

		config, err := ExtractDiskConfig(page, 0)
		th.AssertNoErr(t, err)
		th.CheckEquals(t, Manual, *config)

		return true, nil
	})
	th.AssertNoErr(t, err)
	th.CheckEquals(t, pages, 1)
}
Beispiel #2
0
// List makes a request against the API to list servers accessible to you.
func List(client *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager {
	return os.List(client, opts)
}