VMware {code} Community
Flying_Cat
Contributor
Contributor

How to quickly navigate to Summary page for a Virtual Machine in vSphere 6.5 HTML Client?

Hi laurentsd,

We encountered an issue when using the JavaScript API(sendNavigationRequest(targetViewId, objectId))  for navigating to Summary page in vSphere Client, for example, if we don't know the objectId, is there any possible that we can fetch the objectId by the virtual machine IP address using JavaScript API in vSphere Client? Or is there any other JavaScript API for sending navigation request using virtual machine IP address like the function of sendNavigationRequest().

Actually, we want to implement a feature like the searching function in vSphere 6.5 Flex Client. Just see the following screenshot:

Capture.PNG

And click the link of virtual machine we can navigate to the page for this virtual machine.

Can you help to answer my question? Urgency!

Thanks in advance.

Tags (2)
Reply
0 Kudos
3 Replies
laurentsd
VMware Employee
VMware Employee

You can construct the object Id of any vSphere inventory object the following way:

"urn:vmomi:" + objectType + ":" + "objectValue" + ":" + vCenterServerGuid

For instance the objectId of a VM looks like this:

urn:vmomi:VirtualMachine:vm-28:ad100567-e359-4206-883e-ce9563d8a072

(This objectId is visible in the browser URL of vSphere Client when you navigate to that inventory object)

The objectType, objectValue and serverGuid are all available in the MoRef (managed object reference) of that object that you can access through vSphere APIs in Java, or through Data Service APIs.  There is no direct Javascript APIs.

Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee

BTW, I am moving this post to the correct forum for plugins, vSphere Web Client SDK .  

Reply
0 Kudos
Flying_Cat
Contributor
Contributor

Thanks very much for your explanation.

Reply
0 Kudos