use of com.vmware.flowgate.nlyteworker.model.JsonResultForPDURealtimeValue in project flowgate by vmware.
the class NlyteDataService method generateRealTimeData.
public RealTimeData generateRealTimeData(Asset asset, NlyteAPIClient nlyteAPIclient, HashMap<AdvanceSettingType, String> advanceSettingMap) {
RealTimeData realTimeData = null;
JsonResultForPDURealtimeValue result = nlyteAPIclient.getPowerStripsRealtimeValue(asset.getAssetNumber()).getBody();
List<ValueUnit> valueUnits = generateValueUnits(result.getValue(), advanceSettingMap);
if (!valueUnits.isEmpty()) {
realTimeData = new RealTimeData();
realTimeData.setAssetID(asset.getId());
realTimeData.setValues(valueUnits);
realTimeData.setTime(valueUnits.get(0).getTime());
realTimeData.setId(realTimeData.getAssetID() + "_" + realTimeData.getTime());
}
return realTimeData;
}
use of com.vmware.flowgate.nlyteworker.model.JsonResultForPDURealtimeValue in project flowgate by vmware.
the class SycnRealTimeDataJobTest method getPowerStripsRealtimeValue1.
public ResponseEntity<JsonResultForPDURealtimeValue> getPowerStripsRealtimeValue1() {
JsonResultForPDURealtimeValue pduvalue = new JsonResultForPDURealtimeValue();
List<PowerStripsRealtimeValue> value = new ArrayList<PowerStripsRealtimeValue>();
PowerStripsRealtimeValue power = new PowerStripsRealtimeValue();
power.setName("RealtimePower");
power.setValue(20);
power.setRecordedDateTime("2018-09-20T14:35:25Z");
value.add(power);
PowerStripsRealtimeValue current = new PowerStripsRealtimeValue();
current.setName("RealtimeLoad");
current.setValue(20);
current.setUnit("");
current.setRecordedDateTime("2018-09-20T14:35:25Z");
value.add(current);
PowerStripsRealtimeValue voltage = new PowerStripsRealtimeValue();
voltage.setName("RealtimeVoltage");
voltage.setUnit("Volts");
voltage.setValue(120);
voltage.setRecordedDateTime("2018-09-20T14:35:25Z");
value.add(voltage);
pduvalue.setValue(value);
return new ResponseEntity<JsonResultForPDURealtimeValue>(pduvalue, HttpStatus.OK);
}
use of com.vmware.flowgate.nlyteworker.model.JsonResultForPDURealtimeValue in project flowgate by vmware.
the class SycnRealTimeDataJobTest method getPowerStripsRealtimeValue.
public ResponseEntity<JsonResultForPDURealtimeValue> getPowerStripsRealtimeValue() {
JsonResultForPDURealtimeValue pduvalue = new JsonResultForPDURealtimeValue();
List<PowerStripsRealtimeValue> value = new ArrayList<PowerStripsRealtimeValue>();
PowerStripsRealtimeValue power = new PowerStripsRealtimeValue();
power.setName("RealtimePower");
power.setUnit("kw");
power.setValue(20);
power.setRecordedDateTime("2018-09-20T14:35:25Z");
value.add(power);
PowerStripsRealtimeValue current = new PowerStripsRealtimeValue();
current.setName("RealtimeLoad");
current.setUnit("Amps");
current.setValue(20);
current.setRecordedDateTime("2018-09-20T14:35:25Z");
value.add(current);
PowerStripsRealtimeValue voltage = new PowerStripsRealtimeValue();
voltage.setName("RealtimeVoltage");
voltage.setUnit("Volts");
voltage.setValue(120);
voltage.setRecordedDateTime("2018-09-20T14:35:25Z");
value.add(voltage);
pduvalue.setValue(value);
return new ResponseEntity<JsonResultForPDURealtimeValue>(pduvalue, HttpStatus.OK);
}
Aggregations