| 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 |
| } |