@Sample(name="run-program",
description="This sample runs a specified program inside a virtual machine with\noutput re-directed to a temporary file inside the guest and\ndownloads the output file. Since vSphere API 5.0\n")
public class RunProgram
extends ConnectedVimServiceBase
RunProgram
This sample runs a specified program inside a virtual machine with
output re-directed to a temporary file inside the guest and
downloads the output file.
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
guestprogrampath [required] : Fully qualified path of the program
inside the guest.
localoutputfilepath [required] : Path to the local file to store the
output.
interactivesession [optional] : Run the program within an
interactive session inside the guest.
Command Line:
run.bat com.vmware.general.RunProgram --url [webserviceurl]
--username [username] --password [password] --vmname [vmname]
--guestusername [guest user] --guestpassword [guest password]
--guestprogrampath [Fully qualified path of the program in the guest]
--localoutputfilepath [Path to the local file to store the output]
[--interactivesession]
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
RunProgram() |
| Modifier and Type | Method and Description |
|---|---|
void |
run()
main method annotated with "Action"
|
void |
setGuestConnection(GuestConnection guestConnection) |
void |
setGuestProgramPath(java.lang.String guestProgramPath) |
void |
setInteractive(java.lang.String interactive) |
void |
setLocalOutputFilePath(java.lang.String localOutputFilePath) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="guestConnection",
type=GuestConnection.class)
public void setGuestConnection(GuestConnection guestConnection)
@Option(name="guestprogrampath",
description="Fully qualified path of the program inside the guest.")
public void setGuestProgramPath(java.lang.String guestProgramPath)
@Option(name="localoutputfilepath",
description="Path to the local file to store the output.")
public void setLocalOutputFilePath(java.lang.String localOutputFilePath)
@Option(name="interactivesession",
required=false,
description="Run the program within an interactive session inside the guest.")
public void setInteractive(java.lang.String interactive)
@Action
public void run()
throws java.lang.Exception,
com.vmware.vim25.InvalidPropertyFaultMsg
java.lang.Exceptioncom.vmware.vim25.InvalidPropertyFaultMsg