@Sample(name="download-guest-file",
description="This sample downloads a file from the guest to a specified\npath on the host where the client is running. Since vSphere API 5.0")
public class DownloadGuestFile
extends ConnectedVimServiceBase
DownloadGuestFile This sample downloads a file from the guest to a specified path on the host where the client is running. Parameters: url [required] : url of the web service username [required] : username for the authentication password [required] : password for the authentication vmname [required] : name of the virtual machine guestusername [required] : username in the guest guestpassword [required] : password in the guest guestfilepath [required] : path of the file in the guest localfilepath [required] : local file path to download and store the file Command Line: run.bat com.vmware.general.DownloadGuestFile --url [webserviceurl] --username [username] --password [password] --vmname [vmname] --guestusername [guest user] --guestpassword [guest password] --guestfilepath [path of the file inside the guest] --localfilepath [path to download and store the file]
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
DownloadGuestFile() |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setGuestConnection(GuestConnection guestConnection) |
void |
setGuestFilePath(java.lang.String path) |
void |
setLocalFilePath(java.lang.String path) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="guestConnection",
type=GuestConnection.class)
public void setGuestConnection(GuestConnection guestConnection)
@Option(name="guestfilepath",
description="path of the file in the guest")
public void setGuestFilePath(java.lang.String path)
@Option(name="localfilepath",
description="local file path to download and store the file")
public void setLocalFilePath(java.lang.String path)
@Action
public void run()
throws com.vmware.vim25.InvalidPropertyFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg,
com.vmware.vim25.TaskInProgressFaultMsg,
com.vmware.vim25.FileFaultFaultMsg,
com.vmware.vim25.InvalidStateFaultMsg,
com.vmware.vim25.GuestOperationsFaultFaultMsg,
java.security.cert.CertificateException,
java.io.IOException,
com.vmware.vim25.RuntimeFaultFaultMsg
com.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.TaskInProgressFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.GuestOperationsFaultFaultMsgjava.security.cert.CertificateExceptionjava.io.IOExceptioncom.vmware.vim25.RuntimeFaultFaultMsg