Documentation
¶
Overview ¶
Package v2 contains common functions for creating block storage based resources for use in acceptance tests. See the `*_test.go` files for example usages.
Index ¶
- func CreateBackup(t *testing.T, client *gophercloud.ServiceClient, volumeID string) (*backups.Backup, error)
- func CreateSnapshot(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) (*snapshots.Snapshot, error)
- func CreateUploadImage(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) (volumes.VolumeImage, error)
- func CreateVolume(t *testing.T, client *gophercloud.ServiceClient) (*volumes.Volume, error)
- func CreateVolumeAttach(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume, ...) error
- func CreateVolumeFromImage(t *testing.T, client *gophercloud.ServiceClient) (*volumes.Volume, error)
- func CreateVolumeReserve(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error
- func DeleteBackup(t *testing.T, client *gophercloud.ServiceClient, backupID string)
- func DeleteSnapshot(t *testing.T, client *gophercloud.ServiceClient, snapshot *snapshots.Snapshot)
- func DeleteUploadedImage(t *testing.T, client *gophercloud.ServiceClient, imageID string) error
- func DeleteVolume(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume)
- func DeleteVolumeAttach(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume)
- func DeleteVolumeReserve(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume)
- func ExtendVolumeSize(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error
- func ResetBackupStatus(t *testing.T, client *gophercloud.ServiceClient, backup *backups.Backup, ...) error
- func ResetVolumeStatus(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume, ...) error
- func SetBootable(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error
- func SetImageMetadata(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error
- func WaitForBackupStatus(client *gophercloud.ServiceClient, id, status string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBackup ¶
func CreateBackup(t *testing.T, client *gophercloud.ServiceClient, volumeID string) (*backups.Backup, error)
CreateBackup will create a backup based on a volume. An error will be will be returned if the backup could not be created.
func CreateSnapshot ¶
func CreateSnapshot(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) (*snapshots.Snapshot, error)
CreateSnapshot will create a snapshot of the specified volume. Snapshot will be assigned a random name and description.
func CreateUploadImage ¶
func CreateUploadImage(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) (volumes.VolumeImage, error)
CreateUploadImage will upload volume it as volume-baked image. An name of new image or err will be returned
func CreateVolume ¶
CreateVolume will create a volume with a random name and size of 1GB. An error will be returned if the volume was unable to be created.
func CreateVolumeAttach ¶
func CreateVolumeAttach(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume, server *servers.Server) error
CreateVolumeAttach will attach a volume to an instance. An error will be returned if the attachment failed.
func CreateVolumeFromImage ¶
func CreateVolumeFromImage(t *testing.T, client *gophercloud.ServiceClient) (*volumes.Volume, error)
CreateVolumeFromImage will create a volume from with a random name and size of 1GB. An error will be returned if the volume was unable to be created.
func CreateVolumeReserve ¶
func CreateVolumeReserve(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error
CreateVolumeReserve creates a volume reservation. An error will be returned if the reservation failed.
func DeleteBackup ¶
DeleteBackup will delete a backup. A fatal error will occur if the backup could not be deleted. This works best when used as a deferred function.
func DeleteSnapshot ¶
DeleteSnapshot will delete a snapshot. A fatal error will occur if the snapshot failed to be deleted.
func DeleteUploadedImage ¶
DeleteUploadedImage deletes uploaded image. An error will be returned if the deletion request failed.
func DeleteVolume ¶
DeleteVolume will delete a volume. A fatal error will occur if the volume failed to be deleted. This works best when used as a deferred function.
func DeleteVolumeAttach ¶
DeleteVolumeAttach will detach a volume from an instance. A fatal error will occur if the snapshot failed to be deleted. This works best when used as a deferred function.
func DeleteVolumeReserve ¶
DeleteVolumeReserve deletes a volume reservation. A fatal error will occur if the deletion request failed. This works best when used as a deferred function.
func ExtendVolumeSize ¶
func ExtendVolumeSize(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error
ExtendVolumeSize will extend the size of a volume.
func ResetBackupStatus ¶
func ResetBackupStatus(t *testing.T, client *gophercloud.ServiceClient, backup *backups.Backup, status string) error
ResetBackupStatus will reset the status of a backup.
func ResetVolumeStatus ¶
func ResetVolumeStatus(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume, status string) error
ResetVolumeStatus will reset the status of a volume.
func SetBootable ¶
SetBootable will set a bootable status to a volume.
func SetImageMetadata ¶
func SetImageMetadata(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error
SetImageMetadata will apply the metadata to a volume.
func WaitForBackupStatus ¶
WaitForBackupStatus will continually poll a backup, checking for a particular status. It will do this for the amount of seconds defined.
Types ¶
This section is empty.