VMware {code} Community
mheidemeyer
Contributor
Contributor

How to get "urn:vmomi" ObjectId of an object by using QuerySpec/PropertySpec

I'm currently building a HTML plugin for a custom object. I built a global view for my custom object using Angular, similar to the html-sample. My custom object has related Datastore objects. Now I want to create links to the Summary View of the related Datastores for each custom object, using the 'app.navigateTo' method of the vSphere Client JavaScript API.  I'm able to get a lot of information about the Datastores that my custom object is related to using QuerySpec/PropertySpec and the DataService. What I can't get is the "urn:vmomi" ObjectId, that is expected by the 'app.navigateTo' method (in the 'app.NavigationOptions' parameter).

Is there a way to get the "urn:vmomi" ObjectId of VMware objects (possibly, by using a different method than the DataService)?

Reply
0 Kudos
1 Reply
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi,

 

We have provided an example in the HTML Sample of how to retrieve different host properties (including the ObjectId) using PropertySpec.

In addition, you can also see the ChassisB sample from 6.5U1 SDK where both QuerySpec and PropertySpec are used.

 

Please, let us know if you need further assistance.

Best Regards,

Denis

Reply
0 Kudos