v2

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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

View Source
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

func DeleteImageFile(t *testing.T, filepath string)

DeleteImageFile will delete local image file.

func DownloadImageFileFromURL

func DownloadImageFileFromURL(t *testing.T, url, filepath string) error

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 ImportImage

func ImportImage(t *testing.T, client *gophercloud.ServiceClient, imageID string) error

ImportImage will import image data from the remote source to the Imageservice.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL