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

Getting the Properties of NAS Datastore in vSphere Webclient SDK

$
0
0

In vSphere web client plugin i want to fetch the remotehost and remotepath of the datastore

I created a DataByModelRequest in the mediator class and calling one model from the mediator

[Event(name="{com.vmware.data.query.events.DataByModelRequest.REQUEST_ID}",
  type="com.vmware.data.query.events.DataByModelRequest")]

  private function requestData():void {
  var requestInfo:DataRequestInfo = new DataRequestInfo(DataUpdateSpec.newImplicitInstance());


  var dsdatarequest:DataByModelRequest = DataByModelRequest.newInstance(
  _contextObject, DatastoreDataItem, requestInfo);
  dispatchEvent(vmdatarequest);
  }

[ResponseHandler(name=
  "{com.vmware.data.query.events.DataByModelRequest.RESPONSE_ID}")]
  public function onDataRetrieved(request:DataByModelRequest,
  result:DatastoreDataItem, error:Error):void {

  if (error != null) {
  Alert.show("ERROR");
  _logger.debug("onDataRetrieved error: " + error.message);
  return;
  }
  else
  Alert.show(ObjectUtil.toString(_contextObject));
  Alert.show("RETRIVED");


  // Assigning the result to variables to update the view.
  _view.dsprop = result;
  Alert.show(ObjectUtil.toString(result));

  }

DatastoreDataItem is my Model Class

[Bindable]
[Model(type="Datastore")]

public class DatastoreDataItem extends DataObject {



  [Model(relation="info.nas", property="type")]
  public var type:String;

  [Model(relation="info.nas", property="remoteHost")]
  public var remotehost:String;

  [Model(relation="info.nas", property="remotePath")]
  public var remotepath:String;

  [Model(property="url")]
  public var url:String;
  }

am getting the null value for all fields but name is working fine and i tried [Model(type="NasDatastoreInfo")] also


Viewing all articles
Browse latest Browse all 2218

Trending Articles



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