@Sample(name="upload-guest-file",
description="This sample uploads a file from the client machine to a\nspecified location inside the guest. Since vSphere API 5.0")
public class UploadGuestFile
extends ConnectedVimServiceBase
UploadGuestFile This sample uploads a file from the client machine to a specified location inside the guest. 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 upload guesttype [required] : Type of the guest. (windows or posix) overwrite [optional] : whether to overwrite the file in the guest Command Line: run.bat com.vmware.general.UploadGuestFile --url [webserviceurl] --username [username] --password [password] --vmname [vmname] --guestusername [guest user] --guestpassword [guest password] --guestfilepath [path of the file inside the guest] --localfilepath [local file path to upload] --guesttype [windows or posix] [--overwrite]
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
UploadGuestFile() |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setGuestConnection(GuestConnection guestConnection) |
void |
setGuestFilePath(java.lang.String path) |
void |
setGuestType(java.lang.String type) |
void |
setLocalFilePath(java.lang.String path) |
void |
setOverwrite(java.lang.Boolean overwrite) |
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 upload")
public void setLocalFilePath(java.lang.String path)
@Option(name="guesttype",
description="Type of the guest. (windows or posix)")
public void setGuestType(java.lang.String type)
@Option(name="overwrite",
required=false,
description="whether to overwrite the file in the guest",
parameter=false)
public void setOverwrite(java.lang.Boolean overwrite)
@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.io.IOException,
java.security.cert.CertificateException,
com.vmware.vim25.RuntimeFaultFaultMsg,
javax.xml.datatype.DatatypeConfigurationException
com.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.TaskInProgressFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.GuestOperationsFaultFaultMsgjava.io.IOExceptionjava.security.cert.CertificateExceptioncom.vmware.vim25.RuntimeFaultFaultMsgjavax.xml.datatype.DatatypeConfigurationException