Hi There,
My requirement is to fetch the name property of the host and the names of all VMs on that host.
I trying following code, but unable to fetch "vm.name" property. Am i missing something here.
QuerySpec qs = new QuerySpec();
qs.resourceSpec = new ResourceSpec();
qs.resourceSpec.constraint.targetType = HOST_TYPE;
// request the name property
PropertySpec pSpec = new PropertySpec();
pSpec.propertyNames = new String[]{"name","vm.name"};
qs.resourceSpec.propertySpecs = new PropertySpec[]{pSpec};
qs.resultSpec = new ResultSpec();
qs.resultSpec.maxResultCount = 1;
// use default ordering
qs.resultSpec.order = new OrderingCriteria();
qs.resultSpec.order.orderingProperties = new OrderingPropertySpec[0];
// get data from DataService
RequestSpec qsSpec = new RequestSpec();
qsSpec.querySpec = new QuerySpec[]{qs};
Response response = _dataService.getData(qsSpec);
Thanks