mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-03 03:57:54 +00:00
FW Upgrade error messages/status handling, re-enable Survey based stats for ChannelBandwidth and RadioUtilization
This commit is contained in:
@@ -33,13 +33,13 @@ import com.telecominfraproject.wlan.client.session.models.ClientSessionMetricDet
|
|||||||
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface;
|
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface;
|
||||||
import com.telecominfraproject.wlan.core.model.entity.CountryCode;
|
import com.telecominfraproject.wlan.core.model.entity.CountryCode;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.AutoOrManualValue;
|
import com.telecominfraproject.wlan.core.model.equipment.AutoOrManualValue;
|
||||||
|
import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.DetectedAuthMode;
|
import com.telecominfraproject.wlan.core.model.equipment.DetectedAuthMode;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
|
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.NeighborScanPacketType;
|
import com.telecominfraproject.wlan.core.model.equipment.NeighborScanPacketType;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.NetworkType;
|
import com.telecominfraproject.wlan.core.model.equipment.NetworkType;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
|
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
|
||||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
|
||||||
import com.telecominfraproject.wlan.customer.models.Customer;
|
import com.telecominfraproject.wlan.customer.models.Customer;
|
||||||
import com.telecominfraproject.wlan.customer.models.EquipmentAutoProvisioningSettings;
|
import com.telecominfraproject.wlan.customer.models.EquipmentAutoProvisioningSettings;
|
||||||
import com.telecominfraproject.wlan.customer.service.CustomerServiceInterface;
|
import com.telecominfraproject.wlan.customer.service.CustomerServiceInterface;
|
||||||
@@ -52,7 +52,6 @@ import com.telecominfraproject.wlan.equipment.models.RadioConfiguration;
|
|||||||
import com.telecominfraproject.wlan.equipment.models.StateSetting;
|
import com.telecominfraproject.wlan.equipment.models.StateSetting;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWBaseCommand;
|
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWBaseCommand;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWFirmwareDownloadRequest;
|
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWFirmwareDownloadRequest;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWFirmwareFlashRequest;
|
|
||||||
import com.telecominfraproject.wlan.firmware.FirmwareServiceInterface;
|
import com.telecominfraproject.wlan.firmware.FirmwareServiceInterface;
|
||||||
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackRecord;
|
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackRecord;
|
||||||
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackSettings;
|
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackSettings;
|
||||||
@@ -98,8 +97,8 @@ import com.telecominfraproject.wlan.status.equipment.models.EquipmentAdminStatus
|
|||||||
import com.telecominfraproject.wlan.status.equipment.models.EquipmentLANStatusData;
|
import com.telecominfraproject.wlan.status.equipment.models.EquipmentLANStatusData;
|
||||||
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolState;
|
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolState;
|
||||||
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolStatusData;
|
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolStatusData;
|
||||||
import com.telecominfraproject.wlan.status.equipment.models.EquipmentResetMethod;
|
|
||||||
import com.telecominfraproject.wlan.status.equipment.models.EquipmentUpgradeState;
|
import com.telecominfraproject.wlan.status.equipment.models.EquipmentUpgradeState;
|
||||||
|
import com.telecominfraproject.wlan.status.equipment.models.EquipmentUpgradeState.FailureReason;
|
||||||
import com.telecominfraproject.wlan.status.equipment.models.EquipmentUpgradeStatusData;
|
import com.telecominfraproject.wlan.status.equipment.models.EquipmentUpgradeStatusData;
|
||||||
import com.telecominfraproject.wlan.status.equipment.models.VLANStatusData;
|
import com.telecominfraproject.wlan.status.equipment.models.VLANStatusData;
|
||||||
import com.telecominfraproject.wlan.status.equipment.report.models.ActiveBSSID;
|
import com.telecominfraproject.wlan.status.equipment.report.models.ActiveBSSID;
|
||||||
@@ -129,10 +128,6 @@ import sts.OpensyncStats.Neighbor;
|
|||||||
import sts.OpensyncStats.Neighbor.NeighborBss;
|
import sts.OpensyncStats.Neighbor.NeighborBss;
|
||||||
import sts.OpensyncStats.RadioBandType;
|
import sts.OpensyncStats.RadioBandType;
|
||||||
import sts.OpensyncStats.Report;
|
import sts.OpensyncStats.Report;
|
||||||
import sts.OpensyncStats.RssiPeer;
|
|
||||||
import sts.OpensyncStats.RssiPeer.RssiSample;
|
|
||||||
import sts.OpensyncStats.RssiPeer.RssiSource;
|
|
||||||
import sts.OpensyncStats.RssiReport;
|
|
||||||
import sts.OpensyncStats.Survey;
|
import sts.OpensyncStats.Survey;
|
||||||
import sts.OpensyncStats.Survey.SurveySample;
|
import sts.OpensyncStats.Survey.SurveySample;
|
||||||
import sts.OpensyncStats.SurveyType;
|
import sts.OpensyncStats.SurveyType;
|
||||||
@@ -699,14 +694,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
gatewayController.updateActiveCustomer(ce.getCustomerId());
|
gatewayController.updateActiveCustomer(ce.getCustomerId());
|
||||||
ListOfEquipmentCommandResponses responses = gatewayController.sendCommands(commands);
|
ListOfEquipmentCommandResponses responses = gatewayController.sendCommands(commands);
|
||||||
LOG.debug("FW Download Response {}", responses);
|
LOG.debug("FW Download Response {}", responses);
|
||||||
CEGWFirmwareFlashRequest fwFlashRequest = new CEGWFirmwareFlashRequest(ce.getInventoryId(),
|
|
||||||
ce.getId(), fwVersion.getVersionName());
|
|
||||||
commands = new ArrayList<>();
|
|
||||||
commands.add(fwFlashRequest);
|
|
||||||
responses = gatewayController.sendCommands(commands);
|
|
||||||
LOG.debug("FW Upgrade Response {}", responses);
|
|
||||||
|
|
||||||
LOG.info("FW upgrade request response {}", responses);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -876,8 +863,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
populateNeighbourScanReports(metricRecordList, report, customerId, equipmentId);
|
populateNeighbourScanReports(metricRecordList, report, customerId, equipmentId);
|
||||||
try {
|
try {
|
||||||
// TODO: depends on survey
|
// TODO: depends on survey
|
||||||
// populateChannelInfoReports(metricRecordList, report, customerId,
|
populateChannelInfoReports(metricRecordList, report, customerId, equipmentId);
|
||||||
// equipmentId);
|
|
||||||
populateApSsidMetrics(metricRecordList, report, customerId, equipmentId, extractApIdFromTopic(topic));
|
populateApSsidMetrics(metricRecordList, report, customerId, equipmentId, extractApIdFromTopic(topic));
|
||||||
// handleRssiMetrics(metricRecordList, report, customerId,
|
// handleRssiMetrics(metricRecordList, report, customerId,
|
||||||
// equipmentId);
|
// equipmentId);
|
||||||
@@ -892,32 +878,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleRssiMetrics(List<ServiceMetric> metricRecordList, Report report, int customerId,
|
|
||||||
long equipmentId) {
|
|
||||||
LOG.debug("handleRssiMetrics for Customer {} Equipment {}", customerId, equipmentId);
|
|
||||||
|
|
||||||
for (RssiReport rssiReport : report.getRssiReportList()) {
|
|
||||||
|
|
||||||
for (RssiPeer peer : rssiReport.getPeerListList()) {
|
|
||||||
if (peer.getRssiSource().equals(RssiSource.CLIENT)) {
|
|
||||||
int rssi = 0;
|
|
||||||
|
|
||||||
for (RssiSample sample : peer.getRssiListList()) {
|
|
||||||
rssi += getNegativeSignedIntFromUnsigned(sample.getRssi());
|
|
||||||
LOG.debug("RSSI Sample: unsignedValue {} signedValue {}", sample.getRssi(),
|
|
||||||
getNegativeSignedIntFromUnsigned(sample.getRssi()));
|
|
||||||
}
|
|
||||||
|
|
||||||
rssi = rssi / peer.getRssiListCount();
|
|
||||||
|
|
||||||
LOG.debug("RssiReport::RssiPeer::Band {} RssiPeer MAC {} RssiSamples Avg {} RxPpdus {} TxPpdus {}",
|
|
||||||
rssiReport.getBand(), peer.getMacAddress(), rssi, peer.getRxPpdus(), peer.getTxPpdus());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void populateApNodeMetrics(List<ServiceMetric> metricRecordList, Report report, int customerId,
|
private void populateApNodeMetrics(List<ServiceMetric> metricRecordList, Report report, int customerId,
|
||||||
long equipmentId) {
|
long equipmentId) {
|
||||||
{
|
{
|
||||||
@@ -935,8 +895,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
apNodeMetrics.setApPerformance(apPerformance);
|
apNodeMetrics.setApPerformance(apPerformance);
|
||||||
|
|
||||||
smr.setCreatedTimestamp(deviceReport.getTimestampMs());
|
smr.setCreatedTimestamp(deviceReport.getTimestampMs());
|
||||||
// data.setChannelUtilization2G(channelUtilization2G);
|
|
||||||
// data.setChannelUtilization5G(channelUtilization5G);
|
|
||||||
|
|
||||||
if (deviceReport.getRadioTempCount() > 0) {
|
if (deviceReport.getRadioTempCount() > 0) {
|
||||||
float cpuTemperature = 0;
|
float cpuTemperature = 0;
|
||||||
@@ -1071,51 +1029,64 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
// private Integer timestampSeconds;
|
// private Integer timestampSeconds;
|
||||||
|
|
||||||
// populate it from report.survey
|
// populate it from report.survey
|
||||||
// for (Survey survey : report.getSurveyList()) {
|
for (Survey survey : report.getSurveyList()) {
|
||||||
/*
|
|
||||||
* LOG.debug("Survey {}", survey); // int oBSS = 0; // int iBSS = 0;
|
int oBSS = 0;
|
||||||
* // int totalBusy = 0; // int durationMs = 0; for (SurveySample
|
int iBSS = 0;
|
||||||
* surveySample : survey.getSurveyListList()) { if
|
int totalBusy = 0;
|
||||||
* (surveySample.getDurationMs() == 0) { continue; }
|
int durationMs = 0;
|
||||||
*
|
for (SurveySample surveySample : survey.getSurveyListList()) {
|
||||||
* // iBSS += surveySample.getBusySelf() + //
|
if (surveySample.getDurationMs() == 0) {
|
||||||
* surveySample.getBusyTx(); // oBSS += surveySample.getBusyRx(); //
|
continue;
|
||||||
* totalBusy += surveySample.getBusy(); // durationMs +=
|
}
|
||||||
* surveySample.getDurationMs();
|
|
||||||
*
|
iBSS += surveySample.getBusySelf() + surveySample.getBusyTx();
|
||||||
* RadioUtilization radioUtil = new RadioUtilization(); radioUtil
|
oBSS += surveySample.getBusyRx();
|
||||||
* .setTimestampSeconds((int) ((survey.getTimestampMs() +
|
totalBusy += surveySample.getBusy();
|
||||||
* surveySample.getOffsetMs()) / 1000));
|
durationMs += surveySample.getDurationMs();
|
||||||
* radioUtil.setAssocClientTx(100 * surveySample.getBusyTx() /
|
|
||||||
* surveySample.getDurationMs()); radioUtil.setAssocClientRx(100 *
|
RadioUtilization radioUtil = new RadioUtilization();
|
||||||
* surveySample.getBusyRx() / surveySample.getDurationMs());
|
radioUtil
|
||||||
* radioUtil.setNonWifi( 100 * (surveySample.getBusy() -
|
.setTimestampSeconds((int) ((survey.getTimestampMs() + surveySample.getOffsetMs()) / 1000));
|
||||||
* surveySample.getBusyTx() - surveySample.getBusyRx()) /
|
radioUtil.setAssocClientTx(100 * surveySample.getBusyTx() / surveySample.getDurationMs());
|
||||||
* surveySample.getDurationMs());
|
radioUtil.setAssocClientRx(100 * surveySample.getBusyRx() / surveySample.getDurationMs());
|
||||||
*
|
radioUtil.setNonWifi(
|
||||||
* RadioType radioType = RadioType.UNSUPPORTED; switch
|
100 * (surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusyRx())
|
||||||
* (survey.getBand()) { case BAND2G: radioType =
|
/ surveySample.getDurationMs());
|
||||||
* RadioType.is2dot4GHz; break; case BAND5G: radioType =
|
|
||||||
* RadioType.is5GHz; break; case BAND5GL: radioType =
|
RadioType radioType = RadioType.UNSUPPORTED;
|
||||||
* RadioType.is5GHzL; break; case BAND5GU: radioType =
|
switch (survey.getBand()) {
|
||||||
* RadioType.is5GHzU; break; }
|
case BAND2G:
|
||||||
*
|
radioType = RadioType.is2dot4GHz;
|
||||||
* apNodeMetrics.getRadioUtilization(radioType).add(radioUtil);
|
break;
|
||||||
*
|
case BAND5G:
|
||||||
* }
|
radioType = RadioType.is5GHz;
|
||||||
*
|
break;
|
||||||
* // Double totalUtilization = 100D * totalBusy / durationMs; //
|
case BAND5GL:
|
||||||
* LOG.trace("Total Utilization {}", totalUtilization); // Double
|
radioType = RadioType.is5GHzL;
|
||||||
* totalWifiUtilization = 100D * (iBSS + oBSS) / // durationMs; //
|
break;
|
||||||
* LOG.trace("Total Wifi Utilization {}", // totalWifiUtilization);
|
case BAND5GU:
|
||||||
* // LOG.trace("Total Non-Wifi Utilization {}", // totalUtilization
|
radioType = RadioType.is5GHzU;
|
||||||
* - // totalWifiUtilization); // if (survey.getBand() ==
|
break;
|
||||||
* RadioBandType.BAND2G) { //
|
}
|
||||||
* data.setChannelUtilization2G(totalUtilization.intValue()); // }
|
|
||||||
* else { //
|
apNodeMetrics.getRadioUtilization(radioType).add(radioUtil);
|
||||||
* data.setChannelUtilization5G(totalUtilization.intValue()); // }
|
|
||||||
*/
|
}
|
||||||
// }
|
|
||||||
|
Double totalUtilization = 100D * totalBusy / durationMs;
|
||||||
|
Double totalWifiUtilization = 100D * (iBSS + oBSS) / durationMs;
|
||||||
|
if (survey.getBand() == RadioBandType.BAND2G) { //
|
||||||
|
apNodeMetrics.setChannelUtilization(RadioType.is2dot4GHz, totalUtilization.intValue());
|
||||||
|
|
||||||
|
} else if (survey.getBand() == RadioBandType.BAND5G) {
|
||||||
|
apNodeMetrics.setChannelUtilization(RadioType.is5GHz, totalUtilization.intValue());
|
||||||
|
} else if (survey.getBand() == RadioBandType.BAND5GL) {
|
||||||
|
apNodeMetrics.setChannelUtilization(RadioType.is5GHzL, totalUtilization.intValue());
|
||||||
|
} else if (survey.getBand() == RadioBandType.BAND5GU) {
|
||||||
|
apNodeMetrics.setChannelUtilization(RadioType.is5GHzU, totalUtilization.intValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1734,6 +1705,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
radioType = RadioType.is5GHzU;
|
radioType = RadioType.is5GHzU;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelBandwidth channelBandwidth = ((ApElementConfiguration) equipmentServiceInterface.get(equipmentId).getDetails())
|
||||||
|
.getRadioMap().get(radioType).getChannelBandwidth();
|
||||||
|
|
||||||
if (survey.getSurveyType().equals(SurveyType.OFF_CHANNEL)
|
if (survey.getSurveyType().equals(SurveyType.OFF_CHANNEL)
|
||||||
|| survey.getSurveyType().equals(SurveyType.FULL)) {
|
|| survey.getSurveyType().equals(SurveyType.FULL)) {
|
||||||
|
|
||||||
@@ -1757,7 +1731,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (List<SurveySample> surveySampleList : sampleByChannelMap.values()) {
|
for (List<SurveySample> surveySampleList : sampleByChannelMap.values()) {
|
||||||
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList);
|
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList, channelBandwidth);
|
||||||
|
|
||||||
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
|
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
|
||||||
if (channelInfoList == null) {
|
if (channelInfoList == null) {
|
||||||
@@ -1771,7 +1745,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
List<SurveySample> surveySampleList = survey.getSurveyListList();
|
List<SurveySample> surveySampleList = survey.getSurveyListList();
|
||||||
|
|
||||||
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList);
|
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList, channelBandwidth);
|
||||||
|
|
||||||
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
|
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
|
||||||
if (channelInfoList == null) {
|
if (channelInfoList == null) {
|
||||||
@@ -1787,7 +1761,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ChannelInfo createChannelInfo(long equipmentId, RadioType radioType, List<SurveySample> surveySampleList) {
|
private ChannelInfo createChannelInfo(long equipmentId, RadioType radioType, List<SurveySample> surveySampleList, ChannelBandwidth channelBandwidth) {
|
||||||
int busyTx = 0; /* Tx */
|
int busyTx = 0; /* Tx */
|
||||||
int busySelf = 0; /* Rx_self (derived from succesful Rx frames) */
|
int busySelf = 0; /* Rx_self (derived from succesful Rx frames) */
|
||||||
int busy = 0; /* Busy = Rx + Tx + Interference */
|
int busy = 0; /* Busy = Rx + Tx + Interference */
|
||||||
@@ -1807,8 +1781,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
channelInfo.setTotalUtilization(busy);
|
channelInfo.setTotalUtilization(busy);
|
||||||
channelInfo.setWifiUtilization(totalWifi);
|
channelInfo.setWifiUtilization(totalWifi);
|
||||||
channelInfo.setBandwidth(((ApElementConfiguration) equipmentServiceInterface.get(equipmentId).getDetails())
|
channelInfo.setBandwidth(channelBandwidth);
|
||||||
.getRadioMap().get(radioType).getChannelBandwidth());
|
|
||||||
channelInfo.setNoiseFloor(-84); // TODO: when this
|
channelInfo.setNoiseFloor(-84); // TODO: when this
|
||||||
// becomes available
|
// becomes available
|
||||||
// add
|
// add
|
||||||
@@ -2148,6 +2121,111 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EquipmentUpgradeState fwUpgradeState = EquipmentUpgradeState.undefined;
|
||||||
|
FailureReason fwUpgradeFailureReason = null;
|
||||||
|
switch (opensyncAPState.getUpgradeStatus()) {
|
||||||
|
case 0:
|
||||||
|
break; // nothing
|
||||||
|
case -1:
|
||||||
|
LOG.error("upgrade_status: Wrong arguments (app error)");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.downloadRequestRejected;
|
||||||
|
break;
|
||||||
|
case -3:
|
||||||
|
LOG.error("upgrade_status: Incorrect URL)");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.unreachableUrl;
|
||||||
|
break;
|
||||||
|
case -4:
|
||||||
|
LOG.error("upgrade_status: Failed firmware image download");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.downloadFailed;
|
||||||
|
break;
|
||||||
|
case -5:
|
||||||
|
LOG.error("upgrade_status: Error while downloading firmware md5 sum file");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.downloadFailed;
|
||||||
|
break;
|
||||||
|
case -6:
|
||||||
|
LOG.error("upgrade_status: md5 checksum file error");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.validationFailed;
|
||||||
|
break;
|
||||||
|
case -7:
|
||||||
|
LOG.error("upgrade_status: Firmware image error");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.validationFailed;
|
||||||
|
break;
|
||||||
|
case -8:
|
||||||
|
LOG.error("upgrade_status: Flash erase failed");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -9:
|
||||||
|
LOG.error("upgrade_status: Flash write failed");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -10:
|
||||||
|
LOG.error("upgrade_status: Flash verification failed");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.validationFailed;
|
||||||
|
break;
|
||||||
|
case -11:
|
||||||
|
LOG.error("upgrade_status: Set new bootconfig failed");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -12:
|
||||||
|
LOG.error("upgrade_status: Device restart failed");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.reboot_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.rebootTimedout;
|
||||||
|
break;
|
||||||
|
case -14:
|
||||||
|
LOG.error("upgrade_status: Flash BootConfig erase failed");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -15:
|
||||||
|
LOG.error("upgrade_status: Safe update is running");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -16:
|
||||||
|
LOG.error("upgrade_status: Not enough free space on device");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
||||||
|
fwUpgradeFailureReason = FailureReason.downloadRequestFailedFlashFull;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
LOG.info("upgrade_status: Firmware download started for AP {}", apId);
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.download_initiated;
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
LOG.info("upgrade_status: Firmware download successful, triggering upgrade.");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.download_complete;
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
LOG.info("upgrade_status: FW write on alt partition started");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_initiated;
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
LOG.info("upgrade_status: FW image write successfully completed");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_complete;
|
||||||
|
break;
|
||||||
|
case 30:
|
||||||
|
LOG.info("upgrade_status: Bootconfig partition update started");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_initiated;
|
||||||
|
break;
|
||||||
|
case 31:
|
||||||
|
LOG.info("upgrade_status: Bootconfig partition update completed");
|
||||||
|
fwUpgradeState = EquipmentUpgradeState.apply_complete;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG.debug("upgrade_status: {}", opensyncAPState.getUpgradeStatus());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Status protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
|
Status protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
|
||||||
if (protocolStatus == null) {
|
if (protocolStatus == null) {
|
||||||
protocolStatus = new Status();
|
protocolStatus = new Status();
|
||||||
@@ -2190,8 +2268,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
EquipmentUpgradeStatusData firmwareStatusData = (EquipmentUpgradeStatusData) firmwareStatus.getDetails();
|
EquipmentUpgradeStatusData firmwareStatusData = (EquipmentUpgradeStatusData) firmwareStatus.getDetails();
|
||||||
firmwareStatusData.setActiveSwVersion(opensyncAPState.getFirmwareVersion());
|
firmwareStatusData.setActiveSwVersion(opensyncAPState.getFirmwareVersion());
|
||||||
firmwareStatusData.setTargetSwVersion(opensyncAPState.getVersionMatrix().get("FIRMWARE"));
|
firmwareStatusData.setTargetSwVersion(opensyncAPState.getVersionMatrix().get("FIRMWARE"));
|
||||||
firmwareStatusData.setUpgradeState(EquipmentUpgradeState.getById(opensyncAPState.getUpgradeStatus()));
|
firmwareStatusData.setUpgradeState(fwUpgradeState);
|
||||||
|
if (fwUpgradeFailureReason != null) {
|
||||||
|
firmwareStatusData.setReason(fwUpgradeFailureReason);
|
||||||
|
}
|
||||||
// only post update if there is a change
|
// only post update if there is a change
|
||||||
if (!((EquipmentUpgradeStatusData) statusServiceInterface
|
if (!((EquipmentUpgradeStatusData) statusServiceInterface
|
||||||
.getOrNull(customerId, equipmentId, StatusDataType.FIRMWARE).getDetails()).equals(firmwareStatusData)) {
|
.getOrNull(customerId, equipmentId, StatusDataType.FIRMWARE).getDetails()).equals(firmwareStatusData)) {
|
||||||
@@ -2203,7 +2283,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
statusServiceInterface.update(updates);
|
statusServiceInterface.update(updates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -167,9 +167,9 @@ public class OpensyncCloudGatewayController {
|
|||||||
case FirmwareDownloadRequest:
|
case FirmwareDownloadRequest:
|
||||||
ret.add(processFirmwareDownload(session, (CEGWFirmwareDownloadRequest) command));
|
ret.add(processFirmwareDownload(session, (CEGWFirmwareDownloadRequest) command));
|
||||||
break;
|
break;
|
||||||
case FirmwareFlashRequest:
|
// case FirmwareFlashRequest:
|
||||||
ret.add(processFirmwareFlash(session, (CEGWFirmwareFlashRequest) command));
|
// ret.add(processFirmwareFlash(session, (CEGWFirmwareFlashRequest) command));
|
||||||
break;
|
// break;
|
||||||
case RadioReset:
|
case RadioReset:
|
||||||
ret.add(processRadioReset(session, (CEGWRadioResetRequest) command));
|
ret.add(processRadioReset(session, (CEGWRadioResetRequest) command));
|
||||||
break;
|
break;
|
||||||
@@ -274,10 +274,6 @@ public class OpensyncCloudGatewayController {
|
|||||||
String newRedirectorAddress = ((CEGWStartDebugEngine) command).getGatewayHostname();
|
String newRedirectorAddress = ((CEGWStartDebugEngine) command).getGatewayHostname();
|
||||||
connectusOvsdbClient.changeRedirectorAddress(inventoryId, newRedirectorAddress);
|
connectusOvsdbClient.changeRedirectorAddress(inventoryId, newRedirectorAddress);
|
||||||
// TODO: add support for additional commands below
|
// TODO: add support for additional commands below
|
||||||
} else if (command instanceof CEGWFirmwareFlashRequest) {
|
|
||||||
String firmwareVersion = ((CEGWFirmwareFlashRequest) command).getFirmwareVersion();
|
|
||||||
connectusOvsdbClient.processFlashFirmware(inventoryId, firmwareVersion);
|
|
||||||
|
|
||||||
} else if (command instanceof CEGWFirmwareDownloadRequest) {
|
} else if (command instanceof CEGWFirmwareDownloadRequest) {
|
||||||
|
|
||||||
CEGWFirmwareDownloadRequest dlRequest = (CEGWFirmwareDownloadRequest)command;
|
CEGWFirmwareDownloadRequest dlRequest = (CEGWFirmwareDownloadRequest)command;
|
||||||
@@ -303,10 +299,6 @@ public class OpensyncCloudGatewayController {
|
|||||||
return sendMessage(session, command.getInventoryId(), command);
|
return sendMessage(session, command.getInventoryId(), command);
|
||||||
}
|
}
|
||||||
|
|
||||||
private EquipmentCommandResponse processFirmwareFlash(OvsdbSession session, CEGWFirmwareFlashRequest command) {
|
|
||||||
return sendMessage(session, command.getInventoryId(), command);
|
|
||||||
}
|
|
||||||
|
|
||||||
private EquipmentCommandResponse processBlinkRequest(OvsdbSession session, CEGWBlinkRequest command) {
|
private EquipmentCommandResponse processBlinkRequest(OvsdbSession session, CEGWBlinkRequest command) {
|
||||||
|
|
||||||
return sendMessage(session, command.getInventoryId(), command);
|
return sendMessage(session, command.getInventoryId(), command);
|
||||||
|
|||||||
@@ -13,7 +13,5 @@ public interface ConnectusOvsdbClientInterface {
|
|||||||
String processFirmwareDownload(String apId, String firmwareUrl, String firmwareVersion, String username,
|
String processFirmwareDownload(String apId, String firmwareUrl, String firmwareVersion, String username,
|
||||||
String validationCode);
|
String validationCode);
|
||||||
|
|
||||||
String processFlashFirmware(String apId, String firmwareVersion);
|
|
||||||
|
|
||||||
String closeSession(String apId);
|
String closeSession(String apId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,11 +99,13 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
// of KDC unique qrCode)
|
// of KDC unique qrCode)
|
||||||
String key = clientCn + "_" + connectNodeInfo.serialNumber;
|
String key = clientCn + "_" + connectNodeInfo.serialNumber;
|
||||||
ovsdbSessionMapInterface.newSession(key, ovsdbClient);
|
ovsdbSessionMapInterface.newSession(key, ovsdbClient);
|
||||||
|
|
||||||
extIntegrationInterface.apConnected(key, connectNodeInfo);
|
extIntegrationInterface.apConnected(key, connectNodeInfo);
|
||||||
|
|
||||||
|
monitorOvsdbStateTables(ovsdbClient, key);
|
||||||
|
|
||||||
// push configuration to AP
|
// push configuration to AP
|
||||||
connectNodeInfo = processConnectRequest(ovsdbClient, clientCn, connectNodeInfo);
|
connectNodeInfo = processConnectRequest(ovsdbClient, clientCn, connectNodeInfo);
|
||||||
monitorOvsdbStateTables(ovsdbClient, key);
|
|
||||||
|
|
||||||
LOG.info("ovsdbClient connected from {} on port {} key {} ", remoteHost, localPort, key);
|
LOG.info("ovsdbClient connected from {} on port {} key {} ", remoteHost, localPort, key);
|
||||||
LOG.info("ovsdbClient connectedClients = {}", ovsdbSessionMapInterface.getNumSessions());
|
LOG.info("ovsdbClient connectedClients = {}", ovsdbSessionMapInterface.getNumSessions());
|
||||||
@@ -520,20 +522,4 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
return "Initialized firmware download to " + apId;
|
return "Initialized firmware download to " + apId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String processFlashFirmware(String apId, String firmwareVersion) {
|
|
||||||
try {
|
|
||||||
OvsdbSession session = ovsdbSessionMapInterface.getSession(apId);
|
|
||||||
|
|
||||||
ovsdbDao.flashFirmware(session.getOvsdbClient(), apId, firmwareVersion);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.error("Failed to flash firmware version {} on AP {} ", firmwareVersion, apId, e);
|
|
||||||
return "Failed to flash firmware version " + firmwareVersion + " on AP " + apId + "\n"
|
|
||||||
+ e.getLocalizedMessage();
|
|
||||||
|
|
||||||
}
|
|
||||||
LOG.debug("Flashed firmware version {} on AP {}", firmwareVersion, apId);
|
|
||||||
return "Flashed firmware version " + firmwareVersion + " on AP " + apId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package com.telecominfraproject.wlan.opensync.ovsdb.dao;
|
package com.telecominfraproject.wlan.opensync.ovsdb.dao;
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -121,9 +118,9 @@ public class OvsdbDao {
|
|||||||
@org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.wifi-iface.max:8}")
|
@org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.wifi-iface.max:8}")
|
||||||
public int maxInterfacesPerRadio;
|
public int maxInterfacesPerRadio;
|
||||||
|
|
||||||
@org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.awlan-node.upgrade_dl_timer:300}")
|
@org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.awlan-node.upgrade_dl_timer:60}")
|
||||||
public long upgradeDlTimerSeconds;
|
public long upgradeDlTimerSeconds;
|
||||||
@org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.awlan-node.upgrade_timer:300}")
|
@org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.awlan-node.upgrade_timer:60}")
|
||||||
public long upgradeTimerSeconds;
|
public long upgradeTimerSeconds;
|
||||||
|
|
||||||
public static final String ovsdbName = "Open_vSwitch";
|
public static final String ovsdbName = "Open_vSwitch";
|
||||||
@@ -997,8 +994,7 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
wifiVifConfigInfo.macList = row.getSetColumn("mac_list");
|
wifiVifConfigInfo.macList = row.getSetColumn("mac_list");
|
||||||
|
|
||||||
if (row.getColumns().get("mac_list_typ") != null &&
|
if (row.getColumns().get("mac_list_typ") != null && row.getColumns().get("mac_list_typ").getClass()
|
||||||
row.getColumns().get("mac_list_typ").getClass()
|
|
||||||
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
||||||
wifiVifConfigInfo.macListType = row.getStringColumn("mac_list_typ");
|
wifiVifConfigInfo.macListType = row.getStringColumn("mac_list_typ");
|
||||||
}
|
}
|
||||||
@@ -2013,10 +2009,9 @@ public class OvsdbDao {
|
|||||||
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
||||||
tableState.setVersion(row.getUuidColumn("_version"));
|
tableState.setVersion(row.getUuidColumn("_version"));
|
||||||
}
|
}
|
||||||
if ((map.get("upgrade_status") != null) && map.get("upgrade_status").getClass()
|
|
||||||
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
tableState.setUpgradeStatus(row.getIntegerColumn("upgrade_status").intValue());
|
||||||
tableState.setUpgradeTimer(row.getIntegerColumn("upgrade_status").intValue());
|
|
||||||
}
|
|
||||||
if ((map.get("device_mode") != null) && map.get("device_mode").getClass()
|
if ((map.get("device_mode") != null) && map.get("device_mode").getClass()
|
||||||
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
||||||
tableState.setDeviceMode(row.getStringColumn("device_mode"));
|
tableState.setDeviceMode(row.getStringColumn("device_mode"));
|
||||||
@@ -2382,7 +2377,7 @@ public class OvsdbDao {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO fill from NBI
|
// TODO fill from NBI
|
||||||
Set<String> macBlackList = new HashSet<>();
|
Set<String> macBlackList = new HashSet<>();
|
||||||
Set<String> macWhiteList = new HashSet<>();
|
Set<String> macWhiteList = new HashSet<>();
|
||||||
|
|
||||||
@@ -2650,12 +2645,6 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
provisionWifiStatsConfigClient(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations);
|
provisionWifiStatsConfigClient(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations);
|
||||||
|
|
||||||
provisionWifiStatsConfigBandSteering(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations);
|
|
||||||
|
|
||||||
provisionWifiStatsConfigCapacity(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations);
|
|
||||||
|
|
||||||
provisionWifiStatsRssi(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations);
|
|
||||||
|
|
||||||
if (!operations.isEmpty()) {
|
if (!operations.isEmpty()) {
|
||||||
LOG.debug("Sending batch of operations : {} ", operations);
|
LOG.debug("Sending batch of operations : {} ", operations);
|
||||||
|
|
||||||
@@ -2676,80 +2665,6 @@ public class OvsdbDao {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void provisionWifiStatsConfigCapacity(Map<String, WifiRadioConfigInfo> radioConfigs,
|
|
||||||
Map<String, WifiStatsConfigInfo> provisionedWifiStatsConfigs, List<Operation> operations) {
|
|
||||||
|
|
||||||
radioConfigs.values().stream().forEach(new Consumer<WifiRadioConfigInfo>() {
|
|
||||||
@Override
|
|
||||||
public void accept(WifiRadioConfigInfo rc) {
|
|
||||||
if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_capacity")) {
|
|
||||||
//
|
|
||||||
Map<String, Value> rowColumns = new HashMap<>();
|
|
||||||
rowColumns.put("radio_type", new Atom<>(rc.freqBand));
|
|
||||||
rowColumns.put("reporting_interval", new Atom<>(60));
|
|
||||||
// rowColumns.put("sampling_interval", new Atom<>(3));
|
|
||||||
rowColumns.put("stats_type", new Atom<>("capacity"));
|
|
||||||
// rowColumns.put("survey_interval_ms", new Atom<>(65));
|
|
||||||
// rowColumns.put("survey_type", new Atom<>("on-chan"));
|
|
||||||
|
|
||||||
Row updateRow = new Row(rowColumns);
|
|
||||||
operations.add(new Insert(wifiStatsConfigDbTable, updateRow));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void provisionWifiStatsConfigBandSteering(Map<String, WifiRadioConfigInfo> radioConfigs,
|
|
||||||
Map<String, WifiStatsConfigInfo> provisionedWifiStatsConfigs, List<Operation> operations) {
|
|
||||||
|
|
||||||
radioConfigs.values().stream().forEach(new Consumer<WifiRadioConfigInfo>() {
|
|
||||||
@Override
|
|
||||||
public void accept(WifiRadioConfigInfo rc) {
|
|
||||||
if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_steering")) {
|
|
||||||
//
|
|
||||||
Map<String, Value> rowColumns = new HashMap<>();
|
|
||||||
rowColumns.put("radio_type", new Atom<>(rc.freqBand));
|
|
||||||
rowColumns.put("reporting_interval", new Atom<>(60));
|
|
||||||
// rowColumns.put("sampling_interval", new Atom<>(3));
|
|
||||||
rowColumns.put("stats_type", new Atom<>("steering"));
|
|
||||||
// rowColumns.put("survey_interval_ms", new Atom<>(65));
|
|
||||||
// rowColumns.put("survey_type", new Atom<>("on-chan"));
|
|
||||||
|
|
||||||
Row updateRow = new Row(rowColumns);
|
|
||||||
operations.add(new Insert(wifiStatsConfigDbTable, updateRow));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void provisionWifiStatsRssi(Map<String, WifiRadioConfigInfo> radioConfigs,
|
|
||||||
Map<String, WifiStatsConfigInfo> provisionedWifiStatsConfigs, List<Operation> operations) {
|
|
||||||
|
|
||||||
radioConfigs.values().stream().forEach(new Consumer<WifiRadioConfigInfo>() {
|
|
||||||
@Override
|
|
||||||
public void accept(WifiRadioConfigInfo rc) {
|
|
||||||
if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_rssi")) {
|
|
||||||
//
|
|
||||||
Map<String, Value> rowColumns = new HashMap<>();
|
|
||||||
rowColumns.put("radio_type", new Atom<>(rc.freqBand));
|
|
||||||
rowColumns.put("reporting_interval", new Atom<>(30));
|
|
||||||
// rowColumns.put("sampling_interval", new Atom<>(3));
|
|
||||||
rowColumns.put("stats_type", new Atom<>("rssi"));
|
|
||||||
rowColumns.put("survey_interval_ms", new Atom<>(65));
|
|
||||||
// rowColumns.put("survey_type", new Atom<>("on-chan"));
|
|
||||||
|
|
||||||
Row updateRow = new Row(rowColumns);
|
|
||||||
operations.add(new Insert(wifiStatsConfigDbTable, updateRow));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void provisionWifiStatsConfigNeighbor(Map<String, Set<Integer>> allowedChannels,
|
private void provisionWifiStatsConfigNeighbor(Map<String, Set<Integer>> allowedChannels,
|
||||||
Map<String, WifiRadioConfigInfo> radioConfigs, Map<String, WifiStatsConfigInfo> provisionedWifiStatsConfigs,
|
Map<String, WifiRadioConfigInfo> radioConfigs, Map<String, WifiStatsConfigInfo> provisionedWifiStatsConfigs,
|
||||||
List<Operation> operations) {
|
List<Operation> operations) {
|
||||||
@@ -2952,34 +2867,24 @@ public class OvsdbDao {
|
|||||||
try {
|
try {
|
||||||
LOG.debug("configureFirmwareDownload for {} to version {} url {} validationCode {} username {}", apId,
|
LOG.debug("configureFirmwareDownload for {} to version {} url {} validationCode {} username {}", apId,
|
||||||
firmwareVersion, firmwareUrl, validationCode, username);
|
firmwareVersion, firmwareUrl, validationCode, username);
|
||||||
|
// TODO: version matrix update
|
||||||
|
// waiting on AP to provide guidance wrt load naming and version
|
||||||
|
// matrix content
|
||||||
// get existing table info
|
// get existing table info
|
||||||
Row awlanNode = getAWLANNodeDbTableForFirmwareUpdate(ovsdbClient);
|
// Row awlanNode = getAWLANNodeDbTableForFirmwareUpdate(ovsdbClient);
|
||||||
|
//
|
||||||
|
// if (awlanNode == null) {
|
||||||
|
// LOG.error("Cannot update AWLAN_Node firmware information");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
if (awlanNode == null) {
|
|
||||||
LOG.error("Cannot update AWLAN_Node firmware information");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
URL aURL = new URL(firmwareUrl);
|
|
||||||
|
|
||||||
Map<String, String> versionMap = awlanNode.getMapColumn("version_matrix");
|
|
||||||
versionMap.put("vendor/ipq40xx", aURL.getPath().substring(0, aURL.getPath().lastIndexOf('/')));
|
|
||||||
versionMap.put("FIRMWARE", firmwareVersion);
|
|
||||||
versionMap.put("FW_VERSION", firmwareVersion.substring(0, firmwareVersion.indexOf('-')));
|
|
||||||
versionMap.put("FW_BUILD",
|
|
||||||
firmwareVersion.substring(firmwareVersion.indexOf('-') + 1, firmwareVersion.lastIndexOf('-')));
|
|
||||||
versionMap.put("FW_COMMIT", firmwareVersion.substring(firmwareVersion.lastIndexOf('-') + 1));
|
|
||||||
versionMap.put("HOST", aURL.getHost());
|
|
||||||
versionMap.put("FW_PROFILE", firmwareVersion.substring(0, firmwareVersion.indexOf('-')));
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
|
|
||||||
versionMap.put("DATE", sdf.format(new Date()));
|
|
||||||
|
|
||||||
List<Operation> operations = new ArrayList<>();
|
List<Operation> operations = new ArrayList<>();
|
||||||
Map<String, Value> updateColumns = new HashMap<>();
|
Map<String, Value> updateColumns = new HashMap<>();
|
||||||
updateColumns.put("upgrade_dl_timer", new Atom<>(upgradeDlTimerSeconds));
|
updateColumns.put("upgrade_dl_timer", new Atom<>(upgradeDlTimerSeconds));
|
||||||
updateColumns.put("firmware_pass", new Atom<>(validationCode));
|
updateColumns.put("firmware_pass", new Atom<>(validationCode));
|
||||||
updateColumns.put("firmware_url", new Atom<>(firmwareUrl));
|
updateColumns.put("firmware_url", new Atom<>(firmwareUrl));
|
||||||
updateColumns.put("version_matrix", com.vmware.ovsdb.protocol.operation.notation.Map.of(versionMap));
|
updateColumns.put("upgrade_timer", new Atom<>(upgradeTimerSeconds));
|
||||||
|
|
||||||
Row row = new Row(updateColumns);
|
Row row = new Row(updateColumns);
|
||||||
operations.add(new Update(awlanNodeDbTable, row));
|
operations.add(new Update(awlanNodeDbTable, row));
|
||||||
@@ -2997,25 +2902,6 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void flashFirmware(OvsdbClient ovsdbClient, String apId, String firmwareVersion) throws Exception {
|
|
||||||
|
|
||||||
LOG.debug("flashFirmware for {} to version {}", apId, firmwareVersion);
|
|
||||||
List<Operation> operations = new ArrayList<>();
|
|
||||||
Map<String, Value> updateColumns = new HashMap<>();
|
|
||||||
updateColumns.put("upgrade_timer", new Atom<>(upgradeTimerSeconds));
|
|
||||||
|
|
||||||
Row row = new Row(updateColumns);
|
|
||||||
operations.add(new Update(awlanNodeDbTable, row));
|
|
||||||
|
|
||||||
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
|
|
||||||
OperationResult[] result = fResult.get(ovsdbTimeoutSec, TimeUnit.SECONDS);
|
|
||||||
for (OperationResult r : result) {
|
|
||||||
LOG.debug("Op Result {}", r);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeAllStatsConfigs(OvsdbClient ovsdbClient) {
|
public void removeAllStatsConfigs(OvsdbClient ovsdbClient) {
|
||||||
|
|
||||||
LOG.info("Remove existing Wifi_Stats_Config table entries");
|
LOG.info("Remove existing Wifi_Stats_Config table entries");
|
||||||
|
|||||||
Reference in New Issue
Block a user