在vSphere web客户端插件中,我想获取数据存储的远程主机和远程路径
我在中介类中创建了一个DataByModelRequest,并从中介调用了一个模型
[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是我的模型类
[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;
}
正在获取所有字段的null值,但name工作正常,我尝试过
[型号(type=“NasDatastoreInfo”)]