Package com.vmware.guest
Class RunProgram
- java.lang.Object
-
- com.vmware.connection.ConnectedVimServiceBase
-
- com.vmware.guest.RunProgram
-
@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 ConnectedVimServiceBaseRunProgram 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]
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vmware.connection.ConnectedVimServiceBase
ConnectedVimServiceBase.ConnectionException
-
-
Field Summary
-
Fields inherited from class com.vmware.connection.ConnectedVimServiceBase
PROP_ME_NAME, SVC_INST_NAME
-
-
Constructor Summary
Constructors Constructor Description RunProgram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()main method annotated with "Action"voidsetGuestConnection(GuestConnection guestConnection)voidsetGuestProgramPath(java.lang.String guestProgramPath)voidsetInteractive(java.lang.String interactive)voidsetLocalOutputFilePath(java.lang.String localOutputFilePath)-
Methods inherited from class com.vmware.connection.ConnectedVimServiceBase
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
-
-
-
-
Method Detail
-
setGuestConnection
@Option(name="guestConnection", type=GuestConnection.class) public void setGuestConnection(GuestConnection guestConnection)
-
setGuestProgramPath
@Option(name="guestprogrampath", description="Fully qualified path of the program inside the guest.") public void setGuestProgramPath(java.lang.String guestProgramPath)
-
setLocalOutputFilePath
@Option(name="localoutputfilepath", description="Path to the local file to store the output.") public void setLocalOutputFilePath(java.lang.String localOutputFilePath)
-
setInteractive
@Option(name="interactivesession", required=false, description="Run the program within an interactive session inside the guest.") public void setInteractive(java.lang.String interactive)
-
run
@Action public void run() throws java.lang.Exception, com.vmware.vim25.InvalidPropertyFaultMsgmain method annotated with "Action"- Throws:
java.lang.Exceptioncom.vmware.vim25.InvalidPropertyFaultMsg
-
-