Documentation ¶
Index ¶
- Constants
- Variables
- func CreateVirtualMachineExport(client kubecli.KubevirtClient, vmeInfo *VMExportInfo) error
- func DeleteVirtualMachineExport(client kubecli.KubevirtClient, vmeInfo *VMExportInfo) error
- func DownloadVirtualMachineExport(client kubecli.KubevirtClient, vmeInfo *VMExportInfo) error
- func GetUrlFromVirtualMachineExport(vmexport *exportv1.VirtualMachineExport, vmeInfo *VMExportInfo) (string, error)
- func NewVirtualMachineExportCommand(clientConfig clientcmd.ClientConfig) *cobra.Command
- func SetDefaultHTTPClientCreator()
- func SetHTTPClientCreator(f HTTPClientCreator)
- type HTTPClientCreator
- type VMExportInfo
Constants ¶
const ( // Available vmexport functions CREATE = "create" DELETE = "delete" DOWNLOAD = "download" // Available vmexport flags OUTPUT_FLAG = "--output" VOLUME_FLAG = "--volume" VM_FLAG = "--vm" SNAPSHOT_FLAG = "--snapshot" INSECURE_FLAG = "--insecure" KEEP_FLAG = "--keep-vme" PVC_FLAG = "--pvc" TTL_FLAG = "--ttl" // ErrRequiredFlag serves as error message when a mandatory flag is missing ErrRequiredFlag = "Need to specify the '%s' flag when using '%s'" // ErrIncompatibleFlag serves as error message when an incompatible flag is used ErrIncompatibleFlag = "The '%s' flag is incompatible with '%s'" // ErrRequiredExportType serves as error message when no export kind is provided ErrRequiredExportType = "Need to specify export kind when attempting to create a VirtualMachineExport [--pvc|--vm|--snapshot]" // ErrIncompatibleExportType serves as error message when an export kind is provided with an incompatible argument ErrIncompatibleExportType = "Should not specify export kind" )
Variables ¶
var ExportProcessingComplete exportCompleteFunc = waitForVirtualMachineExport
ExportProcessingComplete is used to store the function to wait for the export object to be ready. Useful for unit tests.
Functions ¶
func CreateVirtualMachineExport ¶
func CreateVirtualMachineExport(client kubecli.KubevirtClient, vmeInfo *VMExportInfo) error
CreateVirtualMachineExport serves as a wrapper to create the virtualMachineExport object and, if needed, do error handling
func DeleteVirtualMachineExport ¶
func DeleteVirtualMachineExport(client kubecli.KubevirtClient, vmeInfo *VMExportInfo) error
DeleteVirtualMachineExport serves as a wrapper to delete the virtualMachineExport object
func DownloadVirtualMachineExport ¶
func DownloadVirtualMachineExport(client kubecli.KubevirtClient, vmeInfo *VMExportInfo) error
DownloadVirtualMachineExport handles the process of downloading the requested volume from a VirtualMachineExport object
func GetUrlFromVirtualMachineExport ¶
func GetUrlFromVirtualMachineExport(vmexport *exportv1.VirtualMachineExport, vmeInfo *VMExportInfo) (string, error)
GetUrlFromVirtualMachineExport inspects the VirtualMachineExport status to fetch the extected URL
func NewVirtualMachineExportCommand ¶
func NewVirtualMachineExportCommand(clientConfig clientcmd.ClientConfig) *cobra.Command
NewVirtualMachineExportCommand returns a cobra.Command to handle the export process
func SetDefaultHTTPClientCreator ¶
func SetDefaultHTTPClientCreator()
SetDefaultHTTPClientCreator sets the http client creator back to default
func SetHTTPClientCreator ¶
func SetHTTPClientCreator(f HTTPClientCreator)
SetHTTPClientCreator allows overriding the default http client (useful for unit testing)