this._count = "select count(distinct id) from affinity_group_view WHERE ";
}
@Override
public AffinityGroupResponse newAffinityGroupResponse(AffinityGroupJoinVO vag) {
AffinityGroupResponse agResponse = new AffinityGroupResponse();
agResponse.setId(vag.getUuid());
agResponse.setName(vag.getName());
agResponse.setDescription(vag.getDescription());
agResponse.setType(vag.getType());
ApiResponseHelper.populateOwner(agResponse, vag);
// update vm information
long instanceId = vag.getVmId();
if (instanceId > 0) {
List<String> vmIdList = new ArrayList<String>();
vmIdList.add(vag.getVmUuid());
agResponse.setVMIdList(vmIdList);
}
agResponse.setObjectName("affinitygroup");
return agResponse;
}