Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

UID to ManagedObjectReference in vsphere web client

$
0
0

Hello ,

 

I'm currently implementing an Plugin using vsphere web client. I'm currently implementing my own custom service layer , however to give the application the notion of context and initiate a web service call , I need to know which

 

1. ServiceGuid,

2. Type of object being deal with

3. object reference

 

After some investigation I found that _contextObject (which is of type IResourceReference) has UID in the form of ServiceUID:Type:ObjectReference

For example: XXXXXXXXXXXXXXXXXXXX:HostSystem:host-9

 

How can I extract the Service UID , ObjectReference Type and Object Reference  using vmware API with out any custom parsing in my Java Service layer ( so that in case the current schema changes it would effect my application.)?

 

If I'm using Data Access Manager API such as Property Provider Adapater , I can extract objects passed into GetProperties which are of type PropertyRequestSpec propertyRequest and iterating through PropertyRequestSpec.objects I can use

 

Clean API  of

VimObjectReferenceService .getResourceObjectType, getValue ,getServerGuid  which would provide me all the information I need .

 

The reason of the ability to use VimObjectReferenceService in DAM API is internally UID is being converted into this form:

ManagedObjectReference: type = HostSystem, value = host-9, serverGuid = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX

 

I want to eliminate any custom parsing would be really helpful if VMware provided an API which would convert UID or IResourceReference (object) and extract the relavant information such the above 3 that I provided.

 

Thanks!


Viewing all articles
Browse latest Browse all 1860


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>