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.
Hi,
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.
Hi,
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.
Thanks llian ,
yes ,type is VC:VirtualMachine.
and as per your suggestion iam able to find that property .
Thnaks for your help.
also
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
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.
Thank you very much .that worked .