Quantcast
Channel: VMware Communities : Discussion List - vSphere Client SDK
Viewing all articles
Browse latest Browse all 2218

Need help in getting datacenter name in vsphere webclient SDK 6.0

$
0
0

we were using 5.5 SDK and retrieving datacenter name .Now,with 6.0 SDK,the dc name code throws null pointer exception.Please suggest

 

 

serverConnection sc = si.getServerConnection();
         
         String dcName = null;
         _logger.info(" Server connection url :  " + sc.getUrl());
         Object dvsObject = MorUtil.createExactManagedEntity(sc, dvsMor);
        
        
        if(dvsObject != null && dvsObject instanceof DistributedVirtualSwitch){
            DistributedVirtualSwitch dvsObj = (DistributedVirtualSwitch)dvsObject;
            
            ManagedEntity me = dvsObj.getParent();
                
            ManagedObjectReference networkMor = me.getMOR();

 

The above line throws null pointer.Please suggest an example to retrieve the dc name from dvs object.

Is there any change in amanged object entity hierarchy and folder hierarchy in 6.0?

Marianne

erverConnection sc = si.getServerConnection();
         
         String dcName = null;
         _logger.info(" Server connection url :  " + sc.getUrl());
         Object dvsObject = MorUtil.createExactManagedEntity(sc, dvsMor);
        
        
        if(dvsObject != null && dvsObject instanceof DistributedVirtualSwitch){
            DistributedVirtualSwitch dvsObj = (DistributedVirtualSwitch)dvsObject;
            
            ManagedEntity me = dvsObj.getParent();
                
            ManagedObjectReference networkMor = me.getMOR();

Viewing all articles
Browse latest Browse all 2218

Trending Articles



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