v3

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package v3 contains common functions for creating block storage based resources for use in acceptance tests. See the `*_test.go` files for example usages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeVolumeType

func ChangeVolumeType(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume, vt *volumetypes.VolumeType) error

ChangeVolumeType will extend the size of a volume.

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 CreatePrivateVolumeType

func CreatePrivateVolumeType(t *testing.T, client *gophercloud.ServiceClient) (*volumetypes.VolumeType, error)

CreatePrivateVolumeType will create a private volume type with a random name and no extra specs. An error will be returned if the volume type was unable to be created.

func CreateQoS

func CreateQoS(t *testing.T, client *gophercloud.ServiceClient) (*qos.QoS, error)

CreateQoS will create a QoS with one spec and a random name. An error will be returned if the volume was unable to 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

func CreateVolume(t *testing.T, client *gophercloud.ServiceClient) (*volumes.Volume, error)

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 CreateVolumeAttachment

func CreateVolumeAttachment(t *testing.T, client *gophercloud.ServiceClient, volume *v3.Volume, server *servers.Server) error

CreateVolumeAttachment will attach a volume to an instance. An error will be returned if the attachment failed.

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 CreateVolumeType

func CreateVolumeType(t *testing.T, client *gophercloud.ServiceClient) (*volumetypes.VolumeType, error)

CreateVolumeType will create a volume type with a random name. An error will be returned if the volume was unable to be created.

func CreateVolumeTypeMultiAttach

func CreateVolumeTypeMultiAttach(t *testing.T, client *gophercloud.ServiceClient) (*volumetypes.VolumeType, error)

CreateVolumeTypeMultiAttach will create a volume type with a random name and extra specs for multi-attach. An error will be returned if the volume type was unable to be created.

func CreateVolumeTypeNoExtraSpecs

func CreateVolumeTypeNoExtraSpecs(t *testing.T, client *gophercloud.ServiceClient) (*volumetypes.VolumeType, error)

CreateVolumeTypeNoExtraSpecs will create a volume type with a random name and no extra specs. This is required to bypass cinder-scheduler filters and be able to create a volume with this volumeType. An error will be returned if the volume type was unable to be created.

func CreateVolumeWithType

func CreateVolumeWithType(t *testing.T, client *gophercloud.ServiceClient, vt *volumetypes.VolumeType) (*volumes.Volume, error)

CreateVolumeWithType will create a volume of the given volume type with a random name and size of 1GB. An error will be returned if the volume was unable to be created.

func DeleteBackup

func DeleteBackup(t *testing.T, client *gophercloud.ServiceClient, backupID string)

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 DeleteQoS

func DeleteQoS(t *testing.T, client *gophercloud.ServiceClient, qs *qos.QoS)

DeleteQoS will delete a QoS. A fatal error will occur if the QoS failed to be deleted. This works best when used as a deferred function.

func DeleteSnapshot

func DeleteSnapshot(t *testing.T, client *gophercloud.ServiceClient, snapshot *snapshots.Snapshot)

DeleteSnapshot will delete a snapshot. A fatal error will occur if the snapshot failed to be deleted.

func DeleteUploadedImage

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

DeleteUploadedImage deletes uploaded image. An error will be returned if the deletion request failed.

func DeleteVolume

func DeleteVolume(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume)

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

func DeleteVolumeAttach(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume)

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 DeleteVolumeAttachment

func DeleteVolumeAttachment(t *testing.T, client *gophercloud.ServiceClient, volume *v3.Volume)

DeleteVolumeAttachment will detach a volume from an instance. A fatal error will occur if the attachment failed to be deleted.

func DeleteVolumeReserve

func DeleteVolumeReserve(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume)

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 DeleteVolumeType

func DeleteVolumeType(t *testing.T, client *gophercloud.ServiceClient, vt *volumetypes.VolumeType)

DeleteVolumeType will delete a volume type. A fatal error will occur if the volume type failed to be deleted. 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 ReImage

func ReImage(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume, imageID string) error

ReImage will re-image 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

func SetBootable(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error

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

func WaitForBackupStatus(client *gophercloud.ServiceClient, id, status string) error

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.

Jump to

Keyboard shortcuts

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