VMware {code} Community
maxpaynebupt
Contributor
Contributor

How can I get the MO from UID passed from browser?

The browser passes the UID, such as HostSystem:host-31 to the controller, but, when we get it, we need to split the string and set the MO's type and value with the splited list.

This is really ugly, if there is some change in the UID structure, programe would fail.

Is there any official tool to convert or construct a MO , or to get the MO with the referrence service from the UID?

0 Kudos
3 Replies
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi,

 

You can achieve this by using vim25 services.

The vSphere Client SDK 6.7 features a new HTML Sample plug-in which demonstrates this.

You can download the SDK from https://code.vmware.com/web/sdk/67/client and look at "VimObjectServiceImpl" class in the HTML Sample plug-in code.

 

Best Regards,

Denis

0 Kudos
maxpaynebupt
Contributor
Contributor

Hi, Denis

I searched the sample in 6.7 html sdk, it seems there is no such class defined in it.

Do you mean the VimObjectReferenceService? 

0 Kudos
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi,

This is strange.

Have you looked into "/html-client-sdk/samples/html-sample/html-sample-service/src/main/java/com/vmware/samples/htmlsample/vim25/services/"?

0 Kudos