blob: a887cc6976c0d512f232efc25987e4d5c3b74b3b [file] [log] [blame]
package images
import (
"github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
// List enumerates the available images.
func List(client *gophercloud.ServiceClient) pagination.Pager {
createPage := func(r pagination.LastHTTPResponse) pagination.Page {
return ImagePage{pagination.LinkedPageBase{LastHTTPResponse: r}}
}
return pagination.NewPager(client, listURL(client), createPage)
}
// Get acquires additional detail about a specific image by ID.
// Use ExtractImage() to intepret the result as an openstack Image.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var result GetResult
_, result.Err = perigee.Request("GET", imageURL(client, id), perigee.Options{
MoreHeaders: client.Provider.AuthenticatedHeaders(),
Results: &result.Resp,
OkCodes: []int{200},
})
return result
}