2017-01-27 09:11:55 -05:00
|
|
|
package common
|
2013-12-24 13:31:57 -05:00
|
|
|
|
2020-08-17 14:35:42 -04:00
|
|
|
import (
|
2020-12-17 16:29:25 -05:00
|
|
|
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
2020-08-17 14:35:42 -04:00
|
|
|
)
|
|
|
|
|
2013-11-07 15:28:41 -05:00
|
|
|
type RemoteDriver interface {
|
2017-01-27 09:11:55 -05:00
|
|
|
Driver
|
2013-11-07 15:28:41 -05:00
|
|
|
|
|
|
|
// UploadISO uploads a local ISO to the remote side and returns the
|
|
|
|
// new path that should be used in the VMX along with an error if it
|
|
|
|
// exists.
|
2020-11-19 14:54:31 -05:00
|
|
|
UploadISO(path string, checksum string, ui packersdk.Ui) (string, error)
|
2013-11-07 15:28:41 -05:00
|
|
|
|
2018-04-26 13:56:48 -04:00
|
|
|
// RemoveCache deletes localPath from the remote cache.
|
|
|
|
RemoveCache(localPath string) error
|
|
|
|
|
2013-11-07 15:28:41 -05:00
|
|
|
// Adds a VM to inventory specified by the path to the VMX given.
|
2020-05-28 05:02:09 -04:00
|
|
|
Register(path string) error
|
2013-11-07 15:28:41 -05:00
|
|
|
|
|
|
|
// Removes a VM from inventory specified by the path to the VMX given.
|
2020-05-28 05:02:09 -04:00
|
|
|
Unregister(path string) error
|
2014-11-16 13:31:08 -05:00
|
|
|
|
2015-02-13 05:13:58 -05:00
|
|
|
// Destroys a VM
|
|
|
|
Destroy() error
|
|
|
|
|
|
|
|
// Checks if the VM is destroyed.
|
|
|
|
IsDestroyed() (bool, error)
|
|
|
|
|
2014-11-16 13:31:08 -05:00
|
|
|
// Uploads a local file to remote side.
|
2020-11-19 14:54:31 -05:00
|
|
|
upload(dst, src string, ui packersdk.Ui) error
|
2014-11-16 13:31:08 -05:00
|
|
|
|
2017-02-06 02:13:37 -05:00
|
|
|
// Download a remote file to a local file.
|
|
|
|
Download(src, dst string) error
|
|
|
|
|
2014-11-16 13:31:08 -05:00
|
|
|
// Reload VM on remote side.
|
|
|
|
ReloadVM() error
|
2013-11-07 15:28:41 -05:00
|
|
|
}
|