use of com.cloud.legacymodel.communication.answer.UnsupportedAnswer in project cosmic by MissionCriticalCloud.
the class ResourceManagerImpl method getGPUStatistics.
@Override
public HashMap<String, HashMap<String, VgpuTypesInfo>> getGPUStatistics(final HostVO host) {
final Answer answer = this._agentMgr.easySend(host.getId(), new GetGPUStatsCommand(host.getGuid(), host.getName()));
if (answer != null && answer instanceof UnsupportedAnswer) {
return null;
}
if (answer == null || !answer.getResult()) {
final String msg = "Unable to obtain GPU stats for host " + host.getName();
s_logger.warn(msg);
return null;
} else {
// now construct the result object
if (answer instanceof GetGPUStatsAnswer) {
return ((GetGPUStatsAnswer) answer).getGroupDetails();
}
}
return null;
}
use of com.cloud.legacymodel.communication.answer.UnsupportedAnswer in project cosmic by MissionCriticalCloud.
the class ResourceManagerImpl method getHostStatistics.
@Override
public HostStats getHostStatistics(final long hostId) {
final Answer answer = this._agentMgr.easySend(hostId, new GetHostStatsCommand(this._hostDao.findById(hostId).getGuid(), this._hostDao.findById(hostId).getName(), hostId));
if (answer != null && answer instanceof UnsupportedAnswer) {
return null;
}
if (answer == null || !answer.getResult()) {
final String msg = "Unable to obtain host " + hostId + " statistics. ";
s_logger.warn(msg);
return null;
} else {
// now construct the result object
if (answer instanceof GetHostStatsAnswer) {
return ((GetHostStatsAnswer) answer).getHostStats();
}
}
return null;
}
Aggregations