4 Replies Latest reply on Jul 11, 2018 3:50 AM by jvm2016

    api explorer_vRO

    jvm2016 Hot Shot

      Hi All ,


      I am developing a simple workflow to  retrive few properties of virtual machine .


      need some help using api explorer built in vRO.



      folowing is what i did .


      1:create input parameter vmName and bind it to in tab of scriptable task .

      2:under scriptable element wrote folowing  javascript code to get name ,state and nics of vm respectively .

      can someone help me how to reach to" state property" in apiexplorer  as its giving me undefined result.


        • 1. Re: api explorer_vRO
          iiliev Virtuoso
          VMware EmployeesCommunity Warriors



          I assume vmName is of type VC:VirtualMachine, right?


          vmName.guest returns an object of type VcGuestInfo. This type does not have a property named state, and that's why you are getting undefined.


          Instead of vmName.guest.state you probably want to use vmName.guest.guestState, as VcGuestInfo has a property named guestState.

          1 person found this helpful
          • 2. Re: api explorer_vRO
            jvm2016 Hot Shot

            Thanks llian ,


            yes ,type is VC:VirtualMachine.

            and as per your suggestion iam able to find that property .

            Thnaks for your help.



            if you can help me in following.



            1:what schema element should i drag so that i can input virtual machine name directly insted of going to vcenter inventory.


            below is what i am currently using

            • 3. Re: api explorer_vRO
              iiliev Virtuoso
              Community WarriorsVMware Employees

              So you want to not use inventory browser to find a select the VM, but instead just type the name of the VM? Just go to Presentation tab, and on the vmName input field add property 'Select value as' with value 'list'. After that, when you launch the workflow presentation, it should show a field where you can type some text ang get filtered list of VMs whose name matches the entered text as a substring.

              1 person found this helpful
              • 4. Re: api explorer_vRO
                jvm2016 Hot Shot

                Thank you very much .that worked .