Class 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 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]
     
    • Constructor Detail

      • RunProgram

        public RunProgram()
    • Method Detail

      • 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.InvalidPropertyFaultMsg
        main method annotated with "Action"
        Throws:
        java.lang.Exception
        com.vmware.vim25.InvalidPropertyFaultMsg