| // +build acceptance compute images |
| "github.com/rackspace/gophercloud/openstack/compute/v2/images" |
| "github.com/rackspace/gophercloud/pagination" |
| func TestListImages(t *testing.T) { |
| client, err := newClient() |
| t.Fatalf("Unable to create a compute: client: %v", err) |
| t.Logf("ID\tRegion\tName\tStatus\tCreated") |
| pager := images.ListDetail(client, nil) |
| pager.EachPage(func(page pagination.Page) (bool, error) { |
| images, err := images.ExtractImages(page) |
| for _, i := range images { |
| t.Logf("%s\t%s\t%s\t%s", i.ID, i.Name, i.Status, i.Created) |
| t.Logf("--------\n%d images listed on %d pages.", count, pages) |