Documentation ¶
Overview ¶
Package v2 contains common functions for creating imageservice resources for use in acceptance tests. See the `*_test.go` files for example usages.
Index ¶
- Constants
- func CreateEmptyImage(t *testing.T, client *gophercloud.ServiceClient) (*images.Image, error)
- func CreateTask(t *testing.T, client *gophercloud.ServiceClient, imageURL string) (*tasks.Task, error)
- func DeleteImage(t *testing.T, client *gophercloud.ServiceClient, image *images.Image)
- func DeleteImageFile(t *testing.T, filepath string)
- func DownloadImageFileFromURL(t *testing.T, url, filepath string) error
- func GetImportInfo(t *testing.T, client *gophercloud.ServiceClient) (*imageimport.ImportInfo, error)
- func StageImage(t *testing.T, client *gophercloud.ServiceClient, filepath, imageID string) error
Constants ¶
const ImportImageURL = "http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img"
ImportImageURL contains an URL of a test image that can be imported.
Variables ¶
This section is empty.
Functions ¶
func CreateEmptyImage ¶
func CreateEmptyImage(t *testing.T, client *gophercloud.ServiceClient) (*images.Image, error)
CreateEmptyImage will create an image, but with no actual image data. An error will be returned if an image was unable to be created.
func CreateTask ¶
func CreateTask(t *testing.T, client *gophercloud.ServiceClient, imageURL string) (*tasks.Task, error)
CreateTask will create a task to import the CirrOS image. An error will be returned if a task couldn't be created.
func DeleteImage ¶
func DeleteImage(t *testing.T, client *gophercloud.ServiceClient, image *images.Image)
DeleteImage deletes an image. A fatal error will occur if the image failed to delete. This works best when used as a deferred function.
func DeleteImageFile ¶
DeleteImageFile will delete local image file.
func DownloadImageFileFromURL ¶
DownloadImageFileFromURL will download an image from the specified URL and place it into the specified path.
func GetImportInfo ¶
func GetImportInfo(t *testing.T, client *gophercloud.ServiceClient) (*imageimport.ImportInfo, error)
GetImportInfo will retrieve Import API information.
func StageImage ¶
func StageImage(t *testing.T, client *gophercloud.ServiceClient, filepath, imageID string) error
StageImage will stage local image file to the referenced remote queued image.
Types ¶
This section is empty.