use of com.emc.vipr.model.sys.healthmonitor.NodeHardwareInfoRestRep in project coprhd-controller by CoprHD.
the class NodeResourceAllocationChecker method getNodeHardwareInfo.
private NodeHardwareInfoRestRep getNodeHardwareInfo(String svcId) throws SysClientException {
NodeHardwareInfoRestRep nodeHardwareInfoRestRep = null;
try {
_log.info("Get node: {} resp.", svcId);
nodeHardwareInfoRestRep = SysClientFactory.getSysClient(_coordinator.getNodeEndpointForSvcId(svcId)).get(SysClientFactory.URI_GET_INTERNAL_NODE_HARDWARE, NodeHardwareInfoRestRep.class, null);
} catch (SysClientException ex) {
_log.error("Error get node hardware info with node: {} Cause: {}", svcId, ex.getMessage());
throw ex;
}
return nodeHardwareInfoRestRep;
}
use of com.emc.vipr.model.sys.healthmonitor.NodeHardwareInfoRestRep in project coprhd-controller by CoprHD.
the class NodeResourceAllocationChecker method getNodeResourceAllocationCheckResult.
public String getNodeResourceAllocationCheckResult() {
try {
final List<String> svcIds = _coordinator.getAllNodes();
final String mySvcId = _coordinator.getMySvcId();
NodeHardwareInfoRestRep myBaseRep = getNodeHardwareInfo(mySvcId);
for (String svcId : svcIds) {
if (!svcId.equals(mySvcId)) {
NodeHardwareInfoRestRep compareRep = getNodeHardwareInfo(svcId);
if (!check2NodesReourceAllocation(myBaseRep, compareRep)) {
return STATUS_IMBALANCE;
}
}
}
return STATUS_OK;
} catch (SysClientException ex) {
// Ignore exception
return STATUS_IMBALANCE;
}
}
Aggregations