From 59ec71d3246b3fec58dca49c3a9a10b8b851a50a Mon Sep 17 00:00:00 2001 From: Mike Hansen Date: Tue, 9 Jun 2020 13:04:29 -0400 Subject: [PATCH] Integrate RF survey reportwith cloud backend, OSGW: Support RADIUS and WPA Enterprise pre-work --- .../OpensyncExternalIntegrationCloud.java | 1958 ++++++++--------- .../src/main/resources/config_2_ssids.json | 27 - .../integration/models/OpensyncAPConfig.java | 287 +-- .../OpensyncExternalIntegrationSimple.java | 8 + .../src/main/resources/EquipmentExample.json | 515 ++--- .../src/main/resources/ProfileAPExample.json | 86 +- .../src/main/resources/ProfileRadius.json | 34 + .../src/main/resources/ProfileSsid.json | 308 +-- ...yncProcess (local, KDC certs) cloud.launch | 3 +- .../app/opensync/EquipmentExample.json | 515 ++--- .../app/opensync/ProfileAPExample.json | 86 +- .../app/opensync/ProfileRadius.json | 34 + .../app/opensync/ProfileSsid.json | 308 +-- .../app/opensync/config_2_ssids.json | 27 - .../docker/app/opensync/EquipmentExample.json | 515 ++--- .../docker/app/opensync/ProfileAPExample.json | 86 +- .../docker/app/opensync/ProfileRadius.json | 34 + .../main/docker/app/opensync/ProfileSsid.json | 308 +-- .../docker/app/opensync/config_2_ssids.json | 27 - .../app/opensync/EquipmentExample.json | 515 ++--- .../app/opensync/ProfileAPExample.json | 86 +- .../resources/app/opensync/ProfileRadius.json | 34 + .../resources/app/opensync/ProfileSsid.json | 308 +-- .../app/opensync/config_2_ssids.json | 2 +- ...ncProcess (local, KDC certs) static.launch | 3 +- .../opensync/ovsdb/ConnectusOvsdbClient.java | 18 +- .../wlan/opensync/ovsdb/dao/OvsdbDao.java | 441 ++-- 27 files changed, 3363 insertions(+), 3210 deletions(-) delete mode 100644 opensync-ext-cloud/src/main/resources/config_2_ssids.json create mode 100644 opensync-ext-static/src/main/resources/ProfileRadius.json create mode 100644 opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileRadius.json delete mode 100644 opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/config_2_ssids.json create mode 100644 opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileRadius.json delete mode 100644 opensync-gateway-static-docker/src/main/docker/app/opensync/config_2_ssids.json create mode 100644 opensync-gateway-static-process/src/main/resources/app/opensync/ProfileRadius.json diff --git a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java index 4c87d60..7e442fe 100644 --- a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java +++ b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.Callable; +import java.util.stream.Collectors; import javax.annotation.PostConstruct; @@ -88,1055 +89,1050 @@ import wc.stats.IpDnsTelemetry.WCStatsReport; @Component public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegrationInterface { - private static final Logger LOG = LoggerFactory.getLogger(OpensyncExternalIntegrationCloud.class); - - @Autowired - private AlarmServiceInterface alarmServiceInterface; - @Autowired - private CustomerServiceInterface customerServiceInterface; - @Autowired - private LocationServiceInterface locationServiceInterface; - @Autowired - private OvsdbSessionMapInterface ovsdbSessionMapInterface; - @Autowired - private CloudEventDispatcherInterface equipmentMetricsCollectorInterface; - @Autowired - private EquipmentServiceInterface equipmentServiceInterface; - @Autowired - private RoutingServiceInterface routingServiceInterface; - @Autowired - private ProfileServiceInterface profileServiceInterface; - @Autowired - private StatusServiceInterface statusServiceInterface; - @Autowired - private ClientServiceInterface clientServiceInterface; - - @Autowired - private OpensyncCloudGatewayController gatewayController; - - @Value("${connectus.ovsdb.autoProvisionedCustomerId:1970}") - private int autoProvisionedCustomerId; - @Value("${connectus.ovsdb.autoProvisionedLocationId:8}") - private int autoProvisionedLocationId; - @Value("${connectus.ovsdb.autoProvisionedProfileId:1}") - private int autoProvisionedProfileId; - @Value("${connectus.ovsdb.autoProvisionedSsid:autoProvisionedSsid}") - private String autoProvisionedSsid; - - @Autowired - private CacheManager cacheManagerShortLived; - private Cache cloudEquipmentRecordCache; - // private Map opensyncNodeMap; - - // @Value("${connectus.ovsdb.configFileName:/Users/mikehansen/git/wlan-cloud-workspace/wlan-cloud-opensync-controller/opensync-ext-cloud/src/main/resources/config_2_ssids.json}") - // private String configFileName; - - @PostConstruct - private void postCreate() { - LOG.info("Using Cloud integration"); - cloudEquipmentRecordCache = cacheManagerShortLived.getCache("equipment_record_cache"); - // opensyncNodeMap = Collections.synchronizedMap(new HashMap()); - } - - public Equipment getCustomerEquipment(String apId) { - Equipment ce = null; - - try { - ce = cloudEquipmentRecordCache.get(apId, new Callable() { - @Override - public Equipment call() throws Exception { - return equipmentServiceInterface.getByInventoryIdOrNull(apId); - } - }); - } - catch (Exception e) { - LOG.error("Could not get customer equipment for {}", apId, e); - } - - return ce; - } - - @Override - public void apConnected(String apId, ConnectNodeInfo connectNodeInfo) { - - Equipment ce = getCustomerEquipment(apId); - - try { - - if (ce == null) { - ce = new Equipment(); - ce.setEquipmentType(EquipmentType.AP); - ce.setInventoryId(apId); - ce.setSerial(connectNodeInfo.serialNumber); - ce.setDetails(ApElementConfiguration.createWithDefaults()); - ce = equipmentServiceInterface.create(ce); - - ce.setCustomerId(autoProvisionedCustomerId); - ce.setName(apId); - ce.setLocationId(autoProvisionedLocationId); - ApElementConfiguration apElementConfig = (ApElementConfiguration) ce.getDetails(); - apElementConfig.setEquipmentModel(connectNodeInfo.model); - apElementConfig.getAdvancedRadioMap().get(RadioType.is2dot4GHz) - .setAutoChannelSelection(StateSetting.disabled); - apElementConfig.getAdvancedRadioMap().get(RadioType.is5GHzL) - .setAutoChannelSelection(StateSetting.disabled); - apElementConfig.getAdvancedRadioMap().get(RadioType.is5GHzU) - .setAutoChannelSelection(StateSetting.disabled); - - apElementConfig.getRadioMap().get(RadioType.is2dot4GHz).setAutoChannelSelection(false); - apElementConfig.getRadioMap().get(RadioType.is5GHzL).setAutoChannelSelection(false); - apElementConfig.getRadioMap().get(RadioType.is5GHzU).setAutoChannelSelection(false); - - ce.setDetails(apElementConfig); - ce = equipmentServiceInterface.update(ce); - - Profile apProfile = new Profile(); - apProfile.setCustomerId(ce.getCustomerId()); - apProfile.setName("DefaultApProfile"); - apProfile.setDetails(ApNetworkConfiguration.createWithDefaults()); - apProfile = profileServiceInterface.create(apProfile); - - Profile ssidProfile = new Profile(); - ssidProfile.setCustomerId(ce.getCustomerId()); - ssidProfile.setName("DefaultSsid"); - SsidConfiguration ssidConfig = SsidConfiguration.createWithDefaults(); - ssidConfig.setSecureMode(SecureMode.wpa2PSK); - ssidConfig.setKeyStr("12345678"); - Set appliedRadios = new HashSet<>(); - appliedRadios.add(RadioType.is2dot4GHz); - ssidConfig.setAppliedRadios(appliedRadios); - ssidProfile.setDetails(ssidConfig); - ssidProfile = profileServiceInterface.create(ssidProfile); - - Profile ssidProfile5g = new Profile(); - ssidProfile5g.setCustomerId(ce.getCustomerId()); - ssidProfile5g.setName("DefaultSsid-5"); - SsidConfiguration ssidConfig5g = SsidConfiguration.createWithDefaults(); - ssidConfig5g.setSecureMode(SecureMode.wpa2PSK); - ssidConfig5g.setKeyStr("12345678"); - Set appliedRadios5g = new HashSet<>(); - appliedRadios5g.add(RadioType.is5GHzL); - appliedRadios5g.add(RadioType.is5GHzU); - ssidConfig5g.setAppliedRadios(appliedRadios5g); - ssidProfile5g.setDetails(ssidConfig5g); - ssidProfile5g = profileServiceInterface.create(ssidProfile5g); - - Set childProfileIds = new HashSet<>(); - childProfileIds.add(ssidProfile.getId()); - childProfileIds.add(ssidProfile5g.getId()); - - apProfile.setChildProfileIds(childProfileIds); - - apProfile = profileServiceInterface.update(apProfile); - ce.setProfileId(apProfile.getId()); - - ce = equipmentServiceInterface.update(ce); - - Customer customer = customerServiceInterface.getOrNull(ce.getCustomerId()); - if (customer == null) { - customer = new Customer(); - customer.setId(autoProvisionedCustomerId); - customerServiceInterface.create(customer); - ce.setCustomerId(customer.getId()); - equipmentServiceInterface.update(ce); - } - } - - EquipmentRoutingRecord equipmentRoutingRecord = gatewayController.registerCustomerEquipment(ce.getName(), - ce.getCustomerId(), ce.getId()); - - updateApStatus(ce, connectNodeInfo); - - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - ovsdbSession.setRoutingId(equipmentRoutingRecord.getId()); - ovsdbSession.setEquipmentId(ce.getId()); - ovsdbSession.setCustomerId(ce.getCustomerId()); - - LOG.debug("Equipment {}", ce); - LOG.info("AP {} got connected to the gateway", apId); - LOG.info("ConnectNodeInfo {}", connectNodeInfo); - - } - catch (Exception e) { - LOG.error("Could not process connection from AP {}", apId, e); - throw e; - } - - } - - private void updateApStatus(Equipment ce, ConnectNodeInfo connectNodeInfo) { - - try { - - Status statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), - StatusDataType.EQUIPMENT_ADMIN); - if (statusRecord == null) { - statusRecord = new Status(); - statusRecord.setCustomerId(ce.getCustomerId()); - statusRecord.setEquipmentId(ce.getId()); - EquipmentAdminStatusData statusData = new EquipmentAdminStatusData(); - statusRecord.setDetails(statusData); - } - - ((EquipmentAdminStatusData) statusRecord.getDetails()).setStatusCode(StatusCode.normal); - // Update the equipment admin status - statusRecord = statusServiceInterface.update(statusRecord); - - // update LAN status - nothing to do here for now - statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.LANINFO); - if (statusRecord == null) { - statusRecord = new Status(); - statusRecord.setCustomerId(ce.getCustomerId()); - statusRecord.setEquipmentId(ce.getId()); - - EquipmentLANStatusData statusData = new EquipmentLANStatusData(); - statusRecord.setDetails(statusData); - } - - Map vlanStatusDataMap = new HashMap<>(); - ((EquipmentLANStatusData) statusRecord.getDetails()).setVlanStatusDataMap(vlanStatusDataMap); - - statusServiceInterface.update(statusRecord); - - // update protocol status - statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.PROTOCOL); - if (statusRecord == null) { - statusRecord = new Status(); - statusRecord.setCustomerId(ce.getCustomerId()); - statusRecord.setEquipmentId(ce.getId()); - - EquipmentProtocolStatusData statusData = new EquipmentProtocolStatusData(); - statusRecord.setDetails(statusData); - } - - EquipmentProtocolStatusData protocolStatusData = (EquipmentProtocolStatusData) statusRecord.getDetails(); - protocolStatusData.setPoweredOn(true); - protocolStatusData.setCloudProtocolVersion("1100"); - protocolStatusData.setProtocolState(EquipmentProtocolState.ready); - protocolStatusData.setBandPlan("FCC"); - protocolStatusData.setBaseMacAddress(MacAddress.valueOf(connectNodeInfo.macAddress)); - protocolStatusData.setCloudCfgDataVersion(42L); - protocolStatusData.setReportedCfgDataVersion(42L); - protocolStatusData.setCountryCode("CA"); - protocolStatusData.setReportedCC(CountryCode.ca); - protocolStatusData.setReportedHwVersion(connectNodeInfo.platformVersion); - protocolStatusData.setReportedSwVersion(connectNodeInfo.firmwareVersion); - protocolStatusData.setReportedSwAltVersion(connectNodeInfo.firmwareVersion); - try { - protocolStatusData.setReportedIpV4Addr(InetAddress.getByName(connectNodeInfo.ipV4Address)); - } - catch (UnknownHostException e) { - // do nothing here - } - if (connectNodeInfo.macAddress != null && MacAddress.valueOf(connectNodeInfo.macAddress) != null) { - protocolStatusData.setReportedMacAddr(MacAddress.valueOf(connectNodeInfo.macAddress)); - } - protocolStatusData.setReportedSku(connectNodeInfo.skuNumber); - protocolStatusData.setSerialNumber(connectNodeInfo.serialNumber); - protocolStatusData.setSystemName(connectNodeInfo.model); - - statusRecord.setDetails(protocolStatusData); - statusServiceInterface.update(statusRecord); - - statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.FIRMWARE); - if (statusRecord == null) { - statusRecord = new Status(); - statusRecord.setCustomerId(ce.getCustomerId()); - statusRecord.setEquipmentId(ce.getId()); - EquipmentUpgradeStatusData statusData = new EquipmentUpgradeStatusData(); - statusRecord.setDetails(statusData); - } - EquipmentUpgradeStatusData fwUpgradeStatusData = (EquipmentUpgradeStatusData) statusRecord.getDetails(); - fwUpgradeStatusData.setActiveSwVersion(connectNodeInfo.firmwareVersion); - fwUpgradeStatusData.setAlternateSwVersion(connectNodeInfo.firmwareVersion); - fwUpgradeStatusData.setTargetSwVersion(connectNodeInfo.firmwareVersion); - fwUpgradeStatusData.setUpgradeState(EquipmentUpgradeState.up_to_date); - statusRecord.setDetails(fwUpgradeStatusData); - statusServiceInterface.update(statusRecord); - - // TODO: - // equipmentStatusInterface.updateNetworkAdminStatus(networkAdminStatusRecord); - // dtop: this one populates traffic capacity and usage dial on the - // main dashboard - // from APDemoMetric properties getPeriodLengthSec, getRxBytes2G, - // getTxBytes2G, getRxBytes5G, getTxBytes5G - Status networkAdminStatusRec = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), - StatusDataType.NETWORK_ADMIN); - if (networkAdminStatusRec == null) { - networkAdminStatusRec = new Status(); - networkAdminStatusRec.setCustomerId(ce.getCustomerId()); - networkAdminStatusRec.setEquipmentId(ce.getId()); - NetworkAdminStatusData statusData = new NetworkAdminStatusData(); - networkAdminStatusRec.setDetails(statusData); - } - - NetworkAdminStatusData netAdminStatusData = (NetworkAdminStatusData) networkAdminStatusRec.getDetails(); - netAdminStatusData.setDhcpStatus(StatusCode.normal); - netAdminStatusData.setCloudLinkStatus(StatusCode.normal); - netAdminStatusData.setDnsStatus(StatusCode.normal); - - networkAdminStatusRec.setDetails(netAdminStatusData); - - statusServiceInterface.update(networkAdminStatusRec); - - Status networkAggStatusRec = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), - StatusDataType.NETWORK_AGGREGATE); - if (networkAggStatusRec == null) { - networkAggStatusRec = new Status(); - networkAggStatusRec.setCustomerId(ce.getCustomerId()); - networkAggStatusRec.setEquipmentId(ce.getId()); - NetworkAggregateStatusData naStatusData = new NetworkAggregateStatusData(); - networkAggStatusRec.setDetails(naStatusData); - } - - statusServiceInterface.update(networkAggStatusRec); - - } - catch (Exception e) { - LOG.debug("Exception in updateApStatus", e); - } - - } - - @Override - public void apDisconnected(String apId) { - LOG.info("AP {} got disconnected from the gateway", apId); - try { - - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - - if (ovsdbSession != null) { - if (ovsdbSession.getRoutingId() > 0L) { - try { - routingServiceInterface.delete(ovsdbSession.getRoutingId()); - } - catch (Exception e) { - LOG.warn("Unable to delete routing service Id {} for ap {}. {}", ovsdbSession.getRoutingId(), - apId, e); - } - } - } - else { - LOG.warn("Cannot find ap {} in inventory", apId); - } - } - catch (Exception e) { - LOG.error("Exception when registering ap routing {}", apId, e); - } - - } - - @Override - public OpensyncAPConfig getApConfig(String apId) { - LOG.info("Retrieving config for AP {} ", apId); - OpensyncAPConfig ret = null; - - try { - - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - if (ovsdbSession == null) { - throw new IllegalStateException("AP is not connected " + apId); - } - - Equipment equipmentConfig = getCustomerEquipment(apId); - - if (equipmentConfig == null) { - throw new IllegalStateException("Cannot retrieve configuration for " + apId); - } - - ret = new OpensyncAPConfig(); - - ret.setCustomerEquipment(equipmentConfig); - - Location eqLocation = locationServiceInterface.get(equipmentConfig.getLocationId()); - - ret.setEquipmentLocation(eqLocation); - - ProfileContainer profileContainer = new ProfileContainer( - profileServiceInterface.getProfileWithChildren(equipmentConfig.getProfileId())); - - ret.setApProfile(profileContainer.getOrNull(equipmentConfig.getProfileId())); - - ret.setSsidProfile(profileContainer.getChildrenOfType(equipmentConfig.getProfileId(), ProfileType.ssid)); - - LOG.debug("ApConfig {}", ret.toString()); - - } - catch (Exception e) { - LOG.error("Cannot read config for AP {}", apId, e); - } + private static final Logger LOG = LoggerFactory.getLogger(OpensyncExternalIntegrationCloud.class); + + @Autowired + private AlarmServiceInterface alarmServiceInterface; + @Autowired + private CustomerServiceInterface customerServiceInterface; + @Autowired + private LocationServiceInterface locationServiceInterface; + @Autowired + private OvsdbSessionMapInterface ovsdbSessionMapInterface; + @Autowired + private CloudEventDispatcherInterface equipmentMetricsCollectorInterface; + @Autowired + private EquipmentServiceInterface equipmentServiceInterface; + @Autowired + private RoutingServiceInterface routingServiceInterface; + @Autowired + private ProfileServiceInterface profileServiceInterface; + @Autowired + private StatusServiceInterface statusServiceInterface; + @Autowired + private ClientServiceInterface clientServiceInterface; + + @Autowired + private OpensyncCloudGatewayController gatewayController; + + @Value("${connectus.ovsdb.autoProvisionedCustomerId:1970}") + private int autoProvisionedCustomerId; + @Value("${connectus.ovsdb.autoProvisionedLocationId:8}") + private int autoProvisionedLocationId; + @Value("${connectus.ovsdb.autoProvisionedProfileId:1}") + private int autoProvisionedProfileId; + @Value("${connectus.ovsdb.autoProvisionedSsid:autoProvisionedSsid}") + private String autoProvisionedSsid; + + @Autowired + private CacheManager cacheManagerShortLived; + private Cache cloudEquipmentRecordCache; + // private Map opensyncNodeMap; + + // @Value("${connectus.ovsdb.configFileName:/Users/mikehansen/git/wlan-cloud-workspace/wlan-cloud-opensync-controller/opensync-ext-cloud/src/main/resources/config_2_ssids.json}") + // private String configFileName; + + @PostConstruct + private void postCreate() { + LOG.info("Using Cloud integration"); + cloudEquipmentRecordCache = cacheManagerShortLived.getCache("equipment_record_cache"); + // opensyncNodeMap = Collections.synchronizedMap(new HashMap()); + } + + public Equipment getCustomerEquipment(String apId) { + Equipment ce = null; + + try { + ce = cloudEquipmentRecordCache.get(apId, new Callable() { + @Override + public Equipment call() throws Exception { + return equipmentServiceInterface.getByInventoryIdOrNull(apId); + } + }); + } catch (Exception e) { + LOG.error("Could not get customer equipment for {}", apId, e); + } + + return ce; + } + + @Override + public void apConnected(String apId, ConnectNodeInfo connectNodeInfo) { + + Equipment ce = getCustomerEquipment(apId); + + try { + + if (ce == null) { + ce = new Equipment(); + ce.setEquipmentType(EquipmentType.AP); + ce.setInventoryId(apId); + ce.setSerial(connectNodeInfo.serialNumber); + ce.setDetails(ApElementConfiguration.createWithDefaults()); + ce = equipmentServiceInterface.create(ce); + + ce.setCustomerId(autoProvisionedCustomerId); + ce.setName(apId); + ce.setLocationId(autoProvisionedLocationId); + ApElementConfiguration apElementConfig = (ApElementConfiguration) ce.getDetails(); + apElementConfig.setEquipmentModel(connectNodeInfo.model); + apElementConfig.getAdvancedRadioMap().get(RadioType.is2dot4GHz) + .setAutoChannelSelection(StateSetting.disabled); + apElementConfig.getAdvancedRadioMap().get(RadioType.is5GHzL) + .setAutoChannelSelection(StateSetting.disabled); + apElementConfig.getAdvancedRadioMap().get(RadioType.is5GHzU) + .setAutoChannelSelection(StateSetting.disabled); + + apElementConfig.getRadioMap().get(RadioType.is2dot4GHz).setAutoChannelSelection(false); + apElementConfig.getRadioMap().get(RadioType.is5GHzL).setAutoChannelSelection(false); + apElementConfig.getRadioMap().get(RadioType.is5GHzU).setAutoChannelSelection(false); + + ce.setDetails(apElementConfig); + ce = equipmentServiceInterface.update(ce); + + Profile apProfile = new Profile(); + apProfile.setCustomerId(ce.getCustomerId()); + apProfile.setName("DefaultApProfile"); + apProfile.setDetails(ApNetworkConfiguration.createWithDefaults()); + apProfile = profileServiceInterface.create(apProfile); + + Profile ssidProfile = new Profile(); + ssidProfile.setCustomerId(ce.getCustomerId()); + ssidProfile.setName("DefaultSsid"); + SsidConfiguration ssidConfig = SsidConfiguration.createWithDefaults(); + ssidConfig.setSecureMode(SecureMode.wpa2PSK); + ssidConfig.setKeyStr("12345678"); + Set appliedRadios = new HashSet<>(); + appliedRadios.add(RadioType.is2dot4GHz); + ssidConfig.setAppliedRadios(appliedRadios); + ssidProfile.setDetails(ssidConfig); + ssidProfile = profileServiceInterface.create(ssidProfile); + + Profile ssidProfile5g = new Profile(); + ssidProfile5g.setCustomerId(ce.getCustomerId()); + ssidProfile5g.setName("DefaultSsid-5"); + SsidConfiguration ssidConfig5g = SsidConfiguration.createWithDefaults(); + ssidConfig5g.setSecureMode(SecureMode.wpa2PSK); + ssidConfig5g.setKeyStr("12345678"); + Set appliedRadios5g = new HashSet<>(); + appliedRadios5g.add(RadioType.is5GHzL); + appliedRadios5g.add(RadioType.is5GHzU); + ssidConfig5g.setAppliedRadios(appliedRadios5g); + ssidProfile5g.setDetails(ssidConfig5g); + ssidProfile5g = profileServiceInterface.create(ssidProfile5g); + + Set childProfileIds = new HashSet<>(); + childProfileIds.add(ssidProfile.getId()); + childProfileIds.add(ssidProfile5g.getId()); + + apProfile.setChildProfileIds(childProfileIds); + + apProfile = profileServiceInterface.update(apProfile); + ce.setProfileId(apProfile.getId()); + + ce = equipmentServiceInterface.update(ce); + + Customer customer = customerServiceInterface.getOrNull(ce.getCustomerId()); + if (customer == null) { + customer = new Customer(); + customer.setId(autoProvisionedCustomerId); + customerServiceInterface.create(customer); + ce.setCustomerId(customer.getId()); + equipmentServiceInterface.update(ce); + } + } + + EquipmentRoutingRecord equipmentRoutingRecord = gatewayController.registerCustomerEquipment(ce.getName(), + ce.getCustomerId(), ce.getId()); + + updateApStatus(ce, connectNodeInfo); + + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + ovsdbSession.setRoutingId(equipmentRoutingRecord.getId()); + ovsdbSession.setEquipmentId(ce.getId()); + ovsdbSession.setCustomerId(ce.getCustomerId()); + + LOG.debug("Equipment {}", ce); + LOG.info("AP {} got connected to the gateway", apId); + LOG.info("ConnectNodeInfo {}", connectNodeInfo); + + } catch (Exception e) { + LOG.error("Could not process connection from AP {}", apId, e); + throw e; + } + + } + + private void updateApStatus(Equipment ce, ConnectNodeInfo connectNodeInfo) { + + try { + + Status statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), + StatusDataType.EQUIPMENT_ADMIN); + if (statusRecord == null) { + statusRecord = new Status(); + statusRecord.setCustomerId(ce.getCustomerId()); + statusRecord.setEquipmentId(ce.getId()); + EquipmentAdminStatusData statusData = new EquipmentAdminStatusData(); + statusRecord.setDetails(statusData); + } + + ((EquipmentAdminStatusData) statusRecord.getDetails()).setStatusCode(StatusCode.normal); + // Update the equipment admin status + statusRecord = statusServiceInterface.update(statusRecord); + + // update LAN status - nothing to do here for now + statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.LANINFO); + if (statusRecord == null) { + statusRecord = new Status(); + statusRecord.setCustomerId(ce.getCustomerId()); + statusRecord.setEquipmentId(ce.getId()); + + EquipmentLANStatusData statusData = new EquipmentLANStatusData(); + statusRecord.setDetails(statusData); + } + + Map vlanStatusDataMap = new HashMap<>(); + ((EquipmentLANStatusData) statusRecord.getDetails()).setVlanStatusDataMap(vlanStatusDataMap); + + statusServiceInterface.update(statusRecord); + + // update protocol status + statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.PROTOCOL); + if (statusRecord == null) { + statusRecord = new Status(); + statusRecord.setCustomerId(ce.getCustomerId()); + statusRecord.setEquipmentId(ce.getId()); + + EquipmentProtocolStatusData statusData = new EquipmentProtocolStatusData(); + statusRecord.setDetails(statusData); + } + + EquipmentProtocolStatusData protocolStatusData = (EquipmentProtocolStatusData) statusRecord.getDetails(); + protocolStatusData.setPoweredOn(true); + protocolStatusData.setCloudProtocolVersion("1100"); + protocolStatusData.setProtocolState(EquipmentProtocolState.ready); + protocolStatusData.setBandPlan("FCC"); + protocolStatusData.setBaseMacAddress(MacAddress.valueOf(connectNodeInfo.macAddress)); + protocolStatusData.setCloudCfgDataVersion(42L); + protocolStatusData.setReportedCfgDataVersion(42L); + protocolStatusData.setCountryCode("CA"); + protocolStatusData.setReportedCC(CountryCode.ca); + protocolStatusData.setReportedHwVersion(connectNodeInfo.platformVersion); + protocolStatusData.setReportedSwVersion(connectNodeInfo.firmwareVersion); + protocolStatusData.setReportedSwAltVersion(connectNodeInfo.firmwareVersion); + try { + protocolStatusData.setReportedIpV4Addr(InetAddress.getByName(connectNodeInfo.ipV4Address)); + } catch (UnknownHostException e) { + // do nothing here + } + if (connectNodeInfo.macAddress != null && MacAddress.valueOf(connectNodeInfo.macAddress) != null) { + protocolStatusData.setReportedMacAddr(MacAddress.valueOf(connectNodeInfo.macAddress)); + } + protocolStatusData.setReportedSku(connectNodeInfo.skuNumber); + protocolStatusData.setSerialNumber(connectNodeInfo.serialNumber); + protocolStatusData.setSystemName(connectNodeInfo.model); + + statusRecord.setDetails(protocolStatusData); + statusServiceInterface.update(statusRecord); + + statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.FIRMWARE); + if (statusRecord == null) { + statusRecord = new Status(); + statusRecord.setCustomerId(ce.getCustomerId()); + statusRecord.setEquipmentId(ce.getId()); + EquipmentUpgradeStatusData statusData = new EquipmentUpgradeStatusData(); + statusRecord.setDetails(statusData); + } + EquipmentUpgradeStatusData fwUpgradeStatusData = (EquipmentUpgradeStatusData) statusRecord.getDetails(); + fwUpgradeStatusData.setActiveSwVersion(connectNodeInfo.firmwareVersion); + fwUpgradeStatusData.setAlternateSwVersion(connectNodeInfo.firmwareVersion); + fwUpgradeStatusData.setTargetSwVersion(connectNodeInfo.firmwareVersion); + fwUpgradeStatusData.setUpgradeState(EquipmentUpgradeState.up_to_date); + statusRecord.setDetails(fwUpgradeStatusData); + statusServiceInterface.update(statusRecord); + + // TODO: + // equipmentStatusInterface.updateNetworkAdminStatus(networkAdminStatusRecord); + // dtop: this one populates traffic capacity and usage dial on the + // main dashboard + // from APDemoMetric properties getPeriodLengthSec, getRxBytes2G, + // getTxBytes2G, getRxBytes5G, getTxBytes5G + Status networkAdminStatusRec = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), + StatusDataType.NETWORK_ADMIN); + if (networkAdminStatusRec == null) { + networkAdminStatusRec = new Status(); + networkAdminStatusRec.setCustomerId(ce.getCustomerId()); + networkAdminStatusRec.setEquipmentId(ce.getId()); + NetworkAdminStatusData statusData = new NetworkAdminStatusData(); + networkAdminStatusRec.setDetails(statusData); + } + + NetworkAdminStatusData netAdminStatusData = (NetworkAdminStatusData) networkAdminStatusRec.getDetails(); + netAdminStatusData.setDhcpStatus(StatusCode.normal); + netAdminStatusData.setCloudLinkStatus(StatusCode.normal); + netAdminStatusData.setDnsStatus(StatusCode.normal); + + networkAdminStatusRec.setDetails(netAdminStatusData); + + statusServiceInterface.update(networkAdminStatusRec); + + Status networkAggStatusRec = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), + StatusDataType.NETWORK_AGGREGATE); + if (networkAggStatusRec == null) { + networkAggStatusRec = new Status(); + networkAggStatusRec.setCustomerId(ce.getCustomerId()); + networkAggStatusRec.setEquipmentId(ce.getId()); + NetworkAggregateStatusData naStatusData = new NetworkAggregateStatusData(); + networkAggStatusRec.setDetails(naStatusData); + } + + statusServiceInterface.update(networkAggStatusRec); + + } catch (Exception e) { + LOG.debug("Exception in updateApStatus", e); + } + + } + + @Override + public void apDisconnected(String apId) { + LOG.info("AP {} got disconnected from the gateway", apId); + try { + + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + + if (ovsdbSession != null) { + if (ovsdbSession.getRoutingId() > 0L) { + try { + routingServiceInterface.delete(ovsdbSession.getRoutingId()); + } catch (Exception e) { + LOG.warn("Unable to delete routing service Id {} for ap {}. {}", ovsdbSession.getRoutingId(), + apId, e); + } + } + } else { + LOG.warn("Cannot find ap {} in inventory", apId); + } + } catch (Exception e) { + LOG.error("Exception when registering ap routing {}", apId, e); + } + + } + + @Override + public OpensyncAPConfig getApConfig(String apId) { + LOG.info("Retrieving config for AP {} ", apId); + OpensyncAPConfig ret = null; + + try { + + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + if (ovsdbSession == null) { + throw new IllegalStateException("AP is not connected " + apId); + } + + Equipment equipmentConfig = getCustomerEquipment(apId); + + if (equipmentConfig == null) { + throw new IllegalStateException("Cannot retrieve configuration for " + apId); + } + + ret = new OpensyncAPConfig(); + + ret.setCustomerEquipment(equipmentConfig); + + Location eqLocation = locationServiceInterface.get(equipmentConfig.getLocationId()); + + ret.setEquipmentLocation(eqLocation); - return ret; - } + ProfileContainer profileContainer = new ProfileContainer( + profileServiceInterface.getProfileWithChildren(equipmentConfig.getProfileId())); - /** - * @param topic - * @return apId extracted from the topic name, or null if it cannot be - * extracted - */ - public static String extractApIdFromTopic(String topic) { - // Topic is formatted as - // "/ap/"+clientCn+"_"+ret.serialNumber+"/opensync" - if (topic == null) { - return null; - } + ret.setApProfile(profileContainer.getOrNull(equipmentConfig.getProfileId())); - String[] parts = topic.split("/"); - if (parts.length < 3) { - return null; - } + ret.setSsidProfile(profileContainer.getChildrenOfType(equipmentConfig.getProfileId(), ProfileType.ssid)); - // apId is the third element in the topic - return parts[2]; - } + Set radiusSet = new HashSet(); + for (Profile ssidProfile : ret.getSsidProfile()) { - /** - * @param topic - * @return customerId looked up from the topic name, or -1 if it cannot be - * extracted - */ - public int extractCustomerIdFromTopic(String topic) { - - String apId = extractApIdFromTopic(topic); - if (apId == null) { - return -1; - } + radiusSet.addAll(profileContainer.getChildrenOfType(ssidProfile.getId(), ProfileType.radius)); - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - - if (ovsdbSession != null) { - return ovsdbSession.getCustomerId(); - } - - return -1; - - } - - public long extractEquipmentIdFromTopic(String topic) { - - String apId = extractApIdFromTopic(topic); - if (apId == null) { - return -1; - } + } + ret.setRadiusProfiles(new ArrayList(radiusSet)); - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + LOG.debug("ApConfig {}", ret.toString()); - if (ovsdbSession != null) { - return ovsdbSession.getEquipmentId(); - } - - return -1; - - } - - @Override - public void processMqttMessage(String topic, Report report) { - LOG.info("Received report on topic {} for ap {}", topic, report.getNodeID()); - int customerId = extractCustomerIdFromTopic(topic); - - long equipmentId = extractEquipmentIdFromTopic(topic); - if (equipmentId <= 0 || customerId <= 0) { - LOG.warn("Cannot determine equipment ids from topic {} - customerId {} equipmentId {}", topic, customerId, - equipmentId); - return; - } - - List metricRecordList = new ArrayList<>(); - - populateApClientMetrics(metricRecordList, report, customerId, equipmentId); - populateApNodeMetrics(metricRecordList, report, customerId, equipmentId); - - try { - populateApSsidMetrics(metricRecordList, report, customerId, equipmentId, extractApIdFromTopic(topic)); - } - catch (Exception e) { - LOG.error("Exception when processing populateApSsidMetrics", e); - } - - if (!metricRecordList.isEmpty()) { - equipmentMetricsCollectorInterface.publishMetrics(metricRecordList); - } - - } - - private void populateApNodeMetrics(List metricRecordList, Report report, int customerId, - long equipmentId) { - { - LOG.debug("populateApNodeMetrics for Customer {} Equipment {}", customerId, equipmentId); - ApNodeMetrics apNodeMetrics = null; - - for (Device deviceReport : report.getDeviceList()) { - - ServiceMetric smr = new ServiceMetric(customerId, equipmentId); - metricRecordList.add(smr); - - apNodeMetrics = new ApNodeMetrics(); - smr.setDetails(apNodeMetrics); - ApPerformance apPerformance = new ApPerformance(); - apNodeMetrics.setApPerformance(apPerformance); - - smr.setCreatedTimestamp(deviceReport.getTimestampMs()); - // data.setChannelUtilization2G(channelUtilization2G); - // data.setChannelUtilization5G(channelUtilization5G); - - if (deviceReport.getRadioTempCount() > 0) { - int cpuTemperature = 0; - int numSamples = 0; - for (RadioTemp r : deviceReport.getRadioTempList()) { - if (r.hasValue()) { - cpuTemperature += r.getValue(); - numSamples++; - } - } - - if (numSamples > 0) { - apPerformance.setCpuTemperature(cpuTemperature / numSamples); - } - } - - if (deviceReport.hasCpuUtil() && deviceReport.getCpuUtil().hasCpuUtil()) { - apPerformance - .setCpuUtilized(new byte[] { (byte) deviceReport.getCpuUtil().getCpuUtil(), (byte) 0 }); - } - - apPerformance.setEthLinkState(EthernetLinkState.UP1000_FULL_DUPLEX); - - if (deviceReport.hasMemUtil() && deviceReport.getMemUtil().hasMemTotal() - && deviceReport.getMemUtil().hasMemUsed()) { - apPerformance.setFreeMemory( - deviceReport.getMemUtil().getMemTotal() - deviceReport.getMemUtil().getMemUsed()); - } - apPerformance.setUpTime((long) deviceReport.getUptime()); - } - if (apNodeMetrics != null) { - - // Main Network dashboard shows Traffic and Capacity values that - // are - // calculated - // from - // ApNodeMetric properties getPeriodLengthSec, getRxBytes2G, - // getTxBytes2G, - // getRxBytes5G, getTxBytes5G - - // go over all the clients to aggregate per-client tx/rx stats - - // we - // want to do - // this - // only once per batch of ApNodeMetrics - so we do not repeat - // values - // over and - // over again - long rxBytes2g = 0; - long txBytes2g = 0; - - long rxBytes5g = 0; - long txBytes5g = 0; - - for (ClientReport clReport : report.getClientsList()) { - for (Client cl : clReport.getClientListList()) { - if (clReport.getBand() == RadioBandType.BAND2G) { - if (cl.getStats().hasTxBytes()) { - txBytes2g += cl.getStats().getTxBytes(); - } - if (cl.getStats().hasRxBytes()) { - rxBytes2g += cl.getStats().getRxBytes(); - } - } - else { - if (cl.getStats().hasTxBytes()) { - txBytes5g += cl.getStats().getTxBytes(); - } - if (cl.getStats().hasRxBytes()) { - rxBytes5g += cl.getStats().getRxBytes(); - } - } - } - } - - apNodeMetrics.setRxBytes(RadioType.is2dot4GHz, rxBytes2g); - apNodeMetrics.setTxBytes(RadioType.is2dot4GHz, txBytes2g); - apNodeMetrics.setRxBytes(RadioType.is5GHz, rxBytes5g); - apNodeMetrics.setTxBytes(RadioType.is5GHz, txBytes5g); - apNodeMetrics.setPeriodLengthSec(60); - - // Now try to populate metrics for calculation of radio capacity - // see - // com.telecominfraproject.wlan.metrics.streaming.spark.equipmentreport.CapacityDStreamsConfig.toAggregatedStats(int, - // long, ApNodeMetric data) - // result.stats2g = - // toAggregatedRadioStats(data.getNoiseFloor2G(),data.getRadioUtilization2G()); - // result.stats5g = - // toAggregatedRadioStats(data.getNoiseFloor5G(),data.getRadioUtilization5G()); - // RadioUtilization - // private Integer assocClientTx; - // private Integer unassocClientTx; - // private Integer assocClientRx; - // private Integer unassocClientRx; - // private Integer nonWifi; - // private Integer timestampSeconds; - - // TODO: temporary solution as this was causing Noise Floor to - // disappear from Dashboard and Access Point rows - apNodeMetrics.setNoiseFloor(RadioType.is2dot4GHz, -98); - apNodeMetrics.setNoiseFloor(RadioType.is5GHz, -98); - - apNodeMetrics.setRadioUtilization(RadioType.is2dot4GHz, new ArrayList<>()); - apNodeMetrics.setRadioUtilization(RadioType.is5GHz, new ArrayList<>()); - - // populate it from report.survey - for (Survey survey : report.getSurveyList()) { - // int oBSS = 0; - // int iBSS = 0; - // int totalBusy = 0; - // int durationMs = 0; - for (SurveySample surveySample : survey.getSurveyListList()) { - if (surveySample.getDurationMs() == 0) { - continue; - } - - // iBSS += surveySample.getBusySelf() + - // surveySample.getBusyTx(); - // oBSS += surveySample.getBusyRx(); - // totalBusy += surveySample.getBusy(); - // durationMs += surveySample.getDurationMs(); - - RadioUtilization radioUtil = new RadioUtilization(); - radioUtil.setTimestampSeconds( - (int) ((survey.getTimestampMs() + surveySample.getOffsetMs()) / 1000)); - radioUtil.setAssocClientTx(100 * surveySample.getBusyTx() / surveySample.getDurationMs()); - radioUtil.setAssocClientRx(100 * surveySample.getBusyRx() / surveySample.getDurationMs()); - radioUtil.setNonWifi( - 100 * (surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusyRx()) - / surveySample.getDurationMs()); - if (survey.getBand() == RadioBandType.BAND2G) { - apNodeMetrics.getRadioUtilization(RadioType.is2dot4GHz).add(radioUtil); - } - else { - apNodeMetrics.getRadioUtilization(RadioType.is5GHz).add(radioUtil); - } - - } - - // Double totalUtilization = 100D * totalBusy / durationMs; - // LOG.trace("Total Utilization {}", totalUtilization); - // Double totalWifiUtilization = 100D * (iBSS + oBSS) / - // durationMs; - // LOG.trace("Total Wifi Utilization {}", - // totalWifiUtilization); - // LOG.trace("Total Non-Wifi Utilization {}", - // totalUtilization - - // totalWifiUtilization); - // if (survey.getBand() == RadioBandType.BAND2G) { - // data.setChannelUtilization2G(totalUtilization.intValue()); - // } else { - // data.setChannelUtilization5G(totalUtilization.intValue()); - // } - } - - } - if (LOG.isDebugEnabled()) { - LOG.debug("ApNodeMetrics Report {}", apNodeMetrics.toPrettyString()); - } - - } - - } - - private void populateApClientMetrics(List metricRecordList, Report report, int customerId, - long equipmentId) { - LOG.debug("populateApClientMetrics for Customer {} Equipment {}", customerId, equipmentId); - - for (ClientReport clReport : report.getClientsList()) { - - for (Client cl : clReport.getClientListList()) { - - if (cl.getMacAddress() == null) { - LOG.debug( - "No mac address for Client {}, cannot set device mac address for client in ClientMetrics.", - cl); - continue; - } - - ServiceMetric smr = new ServiceMetric(customerId, equipmentId, new MacAddress(cl.getMacAddress())); - metricRecordList.add(smr); - - smr.setCreatedTimestamp(clReport.getTimestampMs()); - - // clReport.getChannel(); - ClientMetrics cMetrics = new ClientMetrics(); - smr.setDetails(cMetrics); - - Integer periodLengthSec = 60; // matches what's configured by - // OvsdbDao.configureStats(OvsdbClient) - cMetrics.setPeriodLengthSec(periodLengthSec); - - RadioType radioType = RadioType.UNSUPPORTED; - switch (clReport.getBand()) { - case BAND2G: - radioType = RadioType.is2dot4GHz; - break; - case BAND5G: - radioType = RadioType.is5GHz; - break; - case BAND5GL: - radioType = RadioType.is5GHzL; - break; - case BAND5GU: - radioType = RadioType.is5GHzU; - break; - } - cMetrics.setRadioType(radioType); - - if (cl.hasStats()) { - if (cl.getStats().hasRssi()) { - cMetrics.setRssi(cl.getStats().getRssi()); - } - - // we'll report each device as having a single (very long) - // session - cMetrics.setSessionId(smr.getClientMac()); - - // populate Rx stats - if (cl.getStats().hasRxBytes()) { - cMetrics.setRxBytes(cl.getStats().getRxBytes()); - } - - if (cl.getStats().hasRxRate()) { - // cMetrics.setAverageRxRate(cl.getStats().getRxRate()); - } - - if (cl.getStats().hasRxErrors()) { - cMetrics.setNumRxNoFcsErr((int) cl.getStats().getRxErrors()); - } - - if (cl.getStats().hasRxFrames()) { - // cMetrics.setNumRxFramesReceived(cl.getStats().getRxFrames()); - cMetrics.setNumRxPackets(cl.getStats().getRxFrames()); - } - - if (cl.getStats().hasRxRetries()) { - cMetrics.setNumRxRetry((int) cl.getStats().getRxRetries()); - } - - // populate Tx stats - if (cl.getStats().hasTxBytes()) { - cMetrics.setNumTxBytes(cl.getStats().getTxBytes()); - } - - if (cl.getStats().hasTxRate()) { - // cMetrics.setAverageTxRate(cl.getStats().getTxRate()); - } - - if (cl.getStats().hasTxRate() && cl.getStats().hasRxRate()) { - cMetrics.setRates( - new byte[] { (byte) cl.getStats().getTxRate(), (byte) cl.getStats().getRxRate() }); - } + } catch (Exception e) { + LOG.error("Cannot read config for AP {}", apId, e); + } - if (cl.getStats().hasTxErrors()) { - cMetrics.setNumTxDropped((int) cl.getStats().getTxErrors()); - } + return ret; + } - if (cl.getStats().hasRxFrames()) { - // cMetrics.setNumTxFramesTransmitted(cl.getStats().getTxFrames()); - cMetrics.setNumTxPackets(cl.getStats().getRxFrames()); - } - - if (cl.getStats().hasTxRetries()) { - cMetrics.setNumTxDataRetries((int) cl.getStats().getTxRetries()); - } - - } - - if (LOG.isDebugEnabled()) { - LOG.debug("ApClientMetrics Report {}", cMetrics.toPrettyString()); - } - - } - - } - - } + /** + * @param topic + * @return apId extracted from the topic name, or null if it cannot be extracted + */ + public static String extractApIdFromTopic(String topic) { + // Topic is formatted as + // "/ap/"+clientCn+"_"+ret.serialNumber+"/opensync" + if (topic == null) { + return null; + } - private void populateApSsidMetrics(List metricRecordList, Report report, int customerId, - long equipmentId, String apId) { - - if (report.getClientsCount() == 0) { - LOG.debug("No clients reported, will not populate ApSsidMetrics report"); - return; - } - else { - LOG.debug("populateApSsidMetrics for Customer {} Equipment {} AP {}", customerId, equipmentId, apId); - } - - // TODO: implement, using information from status and config to - // populate/correlate AP data with the Client SSID data - - } - - @Override - public void processMqttMessage(String topic, FlowReport flowReport) { - - LOG.info("Received report on topic {}", topic); - int customerId = extractCustomerIdFromTopic(topic); + String[] parts = topic.split("/"); + if (parts.length < 3) { + return null; + } - long equipmentId = extractEquipmentIdFromTopic(topic); - if (equipmentId <= 0 || customerId <= 0) { - LOG.warn("Cannot determine equipment ids from topic {} - customerId {} equipmentId {}", topic, customerId, - equipmentId); - return; - } + // apId is the third element in the topic + return parts[2]; + } - String apId = extractApIdFromTopic(topic); + /** + * @param topic + * @return customerId looked up from the topic name, or -1 if it cannot be + * extracted + */ + public int extractCustomerIdFromTopic(String topic) { - if (apId == null) { - LOG.warn("Cannot determine AP id from topic {} - customerId {} equipmentId {} apId {}", topic, customerId, - equipmentId, apId); - return; - } + String apId = extractApIdFromTopic(topic); + if (apId == null) { + return -1; + } - } + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - @Override - public void processMqttMessage(String topic, WCStatsReport wcStatsReport) { - LOG.debug("Received WCStatsReport {}", wcStatsReport.toString()); - - LOG.info("Received report on topic {}", topic); - int customerId = extractCustomerIdFromTopic(topic); + if (ovsdbSession != null) { + return ovsdbSession.getCustomerId(); + } - long equipmentId = extractEquipmentIdFromTopic(topic); - if (equipmentId <= 0 || customerId <= 0) { - LOG.warn("Cannot determine equipment ids from topic {} - customerId {} equipmentId {}", topic, customerId, - equipmentId); - return; - } + return -1; - String apId = extractApIdFromTopic(topic); + } - if (apId == null) { - LOG.warn("Cannot determine AP id from topic {} - customerId {} equipmentId {} apId {}", topic, customerId, - equipmentId, apId); - return; - } + public long extractEquipmentIdFromTopic(String topic) { - } + String apId = extractApIdFromTopic(topic); + if (apId == null) { + return -1; + } - @Override - public void wifiVIFStateDbTableUpdate(List vifStateTables, String apId) { + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - Equipment ce = getCustomerEquipment(apId); - if (ce == null) { - LOG.debug("wifiVIFStateDbTableUpdate::Cannot get Equipment for AP {}", apId); - return; - } + if (ovsdbSession != null) { + return ovsdbSession.getEquipmentId(); + } - long equipmentId = ce.getId(); + return -1; - if (equipmentId < 0L) { - LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); - return; - } + } - if (vifStateTables == null || vifStateTables.isEmpty() || apId == null) { - return; - } + @Override + public void processMqttMessage(String topic, Report report) { + LOG.info("Received report on topic {} for ap {}", topic, report.getNodeID()); + int customerId = extractCustomerIdFromTopic(topic); - for (OpensyncAPVIFState vifState : vifStateTables) { - // TODO: implement me - } + long equipmentId = extractEquipmentIdFromTopic(topic); + if (equipmentId <= 0 || customerId <= 0) { + LOG.warn("Cannot determine equipment ids from topic {} - customerId {} equipmentId {}", topic, customerId, + equipmentId); + return; + } + + List metricRecordList = new ArrayList<>(); + + populateApClientMetrics(metricRecordList, report, customerId, equipmentId); + populateApNodeMetrics(metricRecordList, report, customerId, equipmentId); + + try { + populateApSsidMetrics(metricRecordList, report, customerId, equipmentId, extractApIdFromTopic(topic)); + } catch (Exception e) { + LOG.error("Exception when processing populateApSsidMetrics", e); + } + + if (!metricRecordList.isEmpty()) { + equipmentMetricsCollectorInterface.publishMetrics(metricRecordList); + } + + } + + private void populateApNodeMetrics(List metricRecordList, Report report, int customerId, + long equipmentId) { + { + LOG.debug("populateApNodeMetrics for Customer {} Equipment {}", customerId, equipmentId); + ApNodeMetrics apNodeMetrics = null; + + for (Device deviceReport : report.getDeviceList()) { + + ServiceMetric smr = new ServiceMetric(customerId, equipmentId); + metricRecordList.add(smr); + + apNodeMetrics = new ApNodeMetrics(); + smr.setDetails(apNodeMetrics); + ApPerformance apPerformance = new ApPerformance(); + apNodeMetrics.setApPerformance(apPerformance); + + smr.setCreatedTimestamp(deviceReport.getTimestampMs()); + // data.setChannelUtilization2G(channelUtilization2G); + // data.setChannelUtilization5G(channelUtilization5G); + + if (deviceReport.getRadioTempCount() > 0) { + int cpuTemperature = 0; + int numSamples = 0; + for (RadioTemp r : deviceReport.getRadioTempList()) { + if (r.hasValue()) { + cpuTemperature += r.getValue(); + numSamples++; + } + } + + if (numSamples > 0) { + apPerformance.setCpuTemperature(cpuTemperature / numSamples); + } + } + + if (deviceReport.hasCpuUtil() && deviceReport.getCpuUtil().hasCpuUtil()) { + apPerformance + .setCpuUtilized(new byte[] { (byte) deviceReport.getCpuUtil().getCpuUtil(), (byte) 0 }); + } + + apPerformance.setEthLinkState(EthernetLinkState.UP1000_FULL_DUPLEX); + + if (deviceReport.hasMemUtil() && deviceReport.getMemUtil().hasMemTotal() + && deviceReport.getMemUtil().hasMemUsed()) { + apPerformance.setFreeMemory( + deviceReport.getMemUtil().getMemTotal() - deviceReport.getMemUtil().getMemUsed()); + } + apPerformance.setUpTime((long) deviceReport.getUptime()); + } + if (apNodeMetrics != null) { + + // Main Network dashboard shows Traffic and Capacity values that + // are + // calculated + // from + // ApNodeMetric properties getPeriodLengthSec, getRxBytes2G, + // getTxBytes2G, + // getRxBytes5G, getTxBytes5G + + // go over all the clients to aggregate per-client tx/rx stats - + // we + // want to do + // this + // only once per batch of ApNodeMetrics - so we do not repeat + // values + // over and + // over again + long rxBytes2g = 0; + long txBytes2g = 0; + + long rxBytes5g = 0; + long txBytes5g = 0; + + for (ClientReport clReport : report.getClientsList()) { + for (Client cl : clReport.getClientListList()) { + if (clReport.getBand() == RadioBandType.BAND2G) { + if (cl.getStats().hasTxBytes()) { + txBytes2g += cl.getStats().getTxBytes(); + } + if (cl.getStats().hasRxBytes()) { + rxBytes2g += cl.getStats().getRxBytes(); + } + } else { + if (cl.getStats().hasTxBytes()) { + txBytes5g += cl.getStats().getTxBytes(); + } + if (cl.getStats().hasRxBytes()) { + rxBytes5g += cl.getStats().getRxBytes(); + } + } + } + } + + apNodeMetrics.setRxBytes(RadioType.is2dot4GHz, rxBytes2g); + apNodeMetrics.setTxBytes(RadioType.is2dot4GHz, txBytes2g); + apNodeMetrics.setRxBytes(RadioType.is5GHz, rxBytes5g); + apNodeMetrics.setTxBytes(RadioType.is5GHz, txBytes5g); + apNodeMetrics.setPeriodLengthSec(60); + + // Now try to populate metrics for calculation of radio capacity + // see + // com.telecominfraproject.wlan.metrics.streaming.spark.equipmentreport.CapacityDStreamsConfig.toAggregatedStats(int, + // long, ApNodeMetric data) + // result.stats2g = + // toAggregatedRadioStats(data.getNoiseFloor2G(),data.getRadioUtilization2G()); + // result.stats5g = + // toAggregatedRadioStats(data.getNoiseFloor5G(),data.getRadioUtilization5G()); + // RadioUtilization + // private Integer assocClientTx; + // private Integer unassocClientTx; + // private Integer assocClientRx; + // private Integer unassocClientRx; + // private Integer nonWifi; + // private Integer timestampSeconds; + + // TODO: temporary solution as this was causing Noise Floor to + // disappear from Dashboard and Access Point rows + apNodeMetrics.setNoiseFloor(RadioType.is2dot4GHz, -98); + apNodeMetrics.setNoiseFloor(RadioType.is5GHz, -98); + + apNodeMetrics.setRadioUtilization(RadioType.is2dot4GHz, new ArrayList<>()); + apNodeMetrics.setRadioUtilization(RadioType.is5GHz, new ArrayList<>()); + + // populate it from report.survey + for (Survey survey : report.getSurveyList()) { + // int oBSS = 0; + // int iBSS = 0; + // int totalBusy = 0; + // int durationMs = 0; + for (SurveySample surveySample : survey.getSurveyListList()) { + if (surveySample.getDurationMs() == 0) { + continue; + } + + // iBSS += surveySample.getBusySelf() + + // surveySample.getBusyTx(); + // oBSS += surveySample.getBusyRx(); + // totalBusy += surveySample.getBusy(); + // durationMs += surveySample.getDurationMs(); + + RadioUtilization radioUtil = new RadioUtilization(); + radioUtil.setTimestampSeconds( + (int) ((survey.getTimestampMs() + surveySample.getOffsetMs()) / 1000)); + radioUtil.setAssocClientTx(100 * surveySample.getBusyTx() / surveySample.getDurationMs()); + radioUtil.setAssocClientRx(100 * surveySample.getBusyRx() / surveySample.getDurationMs()); + radioUtil.setNonWifi( + 100 * (surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusyRx()) + / surveySample.getDurationMs()); + if (survey.getBand() == RadioBandType.BAND2G) { + apNodeMetrics.getRadioUtilization(RadioType.is2dot4GHz).add(radioUtil); + } else { + apNodeMetrics.getRadioUtilization(RadioType.is5GHz).add(radioUtil); + } + + } + + // Double totalUtilization = 100D * totalBusy / durationMs; + // LOG.trace("Total Utilization {}", totalUtilization); + // Double totalWifiUtilization = 100D * (iBSS + oBSS) / + // durationMs; + // LOG.trace("Total Wifi Utilization {}", + // totalWifiUtilization); + // LOG.trace("Total Non-Wifi Utilization {}", + // totalUtilization - + // totalWifiUtilization); + // if (survey.getBand() == RadioBandType.BAND2G) { + // data.setChannelUtilization2G(totalUtilization.intValue()); + // } else { + // data.setChannelUtilization5G(totalUtilization.intValue()); + // } + } + + } + if (LOG.isDebugEnabled()) { + LOG.debug("ApNodeMetrics Report {}", apNodeMetrics.toPrettyString()); + } + + } + + } + + private void populateApClientMetrics(List metricRecordList, Report report, int customerId, + long equipmentId) { + LOG.debug("populateApClientMetrics for Customer {} Equipment {}", customerId, equipmentId); + + for (ClientReport clReport : report.getClientsList()) { + + for (Client cl : clReport.getClientListList()) { + + if (cl.getMacAddress() == null) { + LOG.debug( + "No mac address for Client {}, cannot set device mac address for client in ClientMetrics.", + cl); + continue; + } + + ServiceMetric smr = new ServiceMetric(customerId, equipmentId, new MacAddress(cl.getMacAddress())); + metricRecordList.add(smr); + + smr.setCreatedTimestamp(clReport.getTimestampMs()); + + // clReport.getChannel(); + ClientMetrics cMetrics = new ClientMetrics(); + smr.setDetails(cMetrics); + + Integer periodLengthSec = 60; // matches what's configured by + // OvsdbDao.configureStats(OvsdbClient) + cMetrics.setPeriodLengthSec(periodLengthSec); + + RadioType radioType = RadioType.UNSUPPORTED; + switch (clReport.getBand()) { + case BAND2G: + radioType = RadioType.is2dot4GHz; + break; + case BAND5G: + radioType = RadioType.is5GHz; + break; + case BAND5GL: + radioType = RadioType.is5GHzL; + break; + case BAND5GU: + radioType = RadioType.is5GHzU; + break; + } + cMetrics.setRadioType(radioType); + + if (cl.hasStats()) { + if (cl.getStats().hasRssi()) { + cMetrics.setRssi(cl.getStats().getRssi()); + } + + // we'll report each device as having a single (very long) + // session + cMetrics.setSessionId(smr.getClientMac()); + + // populate Rx stats + if (cl.getStats().hasRxBytes()) { + cMetrics.setRxBytes(cl.getStats().getRxBytes()); + } + + if (cl.getStats().hasRxRate()) { + // cMetrics.setAverageRxRate(cl.getStats().getRxRate()); + } + + if (cl.getStats().hasRxErrors()) { + cMetrics.setNumRxNoFcsErr((int) cl.getStats().getRxErrors()); + } + + if (cl.getStats().hasRxFrames()) { + // cMetrics.setNumRxFramesReceived(cl.getStats().getRxFrames()); + cMetrics.setNumRxPackets(cl.getStats().getRxFrames()); + } + + if (cl.getStats().hasRxRetries()) { + cMetrics.setNumRxRetry((int) cl.getStats().getRxRetries()); + } + + // populate Tx stats + if (cl.getStats().hasTxBytes()) { + cMetrics.setNumTxBytes(cl.getStats().getTxBytes()); + } + + if (cl.getStats().hasTxRate()) { + // cMetrics.setAverageTxRate(cl.getStats().getTxRate()); + } + + if (cl.getStats().hasTxRate() && cl.getStats().hasRxRate()) { + cMetrics.setRates( + new byte[] { (byte) cl.getStats().getTxRate(), (byte) cl.getStats().getRxRate() }); + } - } + if (cl.getStats().hasTxErrors()) { + cMetrics.setNumTxDropped((int) cl.getStats().getTxErrors()); + } - @Override - public void wifiRadioStatusDbTableUpdate(List radioStateTables, String apId) { + if (cl.getStats().hasRxFrames()) { + // cMetrics.setNumTxFramesTransmitted(cl.getStats().getTxFrames()); + cMetrics.setNumTxPackets(cl.getStats().getRxFrames()); + } + + if (cl.getStats().hasTxRetries()) { + cMetrics.setNumTxDataRetries((int) cl.getStats().getTxRetries()); + } - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + } + + if (LOG.isDebugEnabled()) { + LOG.debug("ApClientMetrics Report {}", cMetrics.toPrettyString()); + } + + } + + } - if (ovsdbSession == null) { - LOG.debug("wifiRadioStatusDbTableUpdate::Cannot get Session for AP {}", apId); - return; - } - - Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); - if (ce == null) { - LOG.debug("wifiRadioStatusDbTableUpdate::Cannot get Equipment for AP {}", apId); - return; - } - - for (OpensyncAPRadioState radioState : radioStateTables) { + } - if (radioState.getFreqBand().equals(RadioType.UNSUPPORTED)) { - LOG.debug("Could not get radio configuration for AP {}", apId); - continue; - } + private void populateApSsidMetrics(List metricRecordList, Report report, int customerId, + long equipmentId, String apId) { + + if (report.getClientsCount() == 0) { + LOG.debug("No clients reported, will not populate ApSsidMetrics report"); + return; + } else { + LOG.debug("populateApSsidMetrics for Customer {} Equipment {} AP {}", customerId, equipmentId, apId); + } + + // TODO: implement, using information from status and config to + // populate/correlate AP data with the Client SSID data + + } + + @Override + public void processMqttMessage(String topic, FlowReport flowReport) { + + LOG.info("Received report on topic {}", topic); + int customerId = extractCustomerIdFromTopic(topic); - if (radioState.getAllowedChannels() != null && !radioState.getAllowedChannels().isEmpty()) { - ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails()); - apElementConfiguration.getRadioMap().get(radioState.getFreqBand()) - .setAllowedChannels(new ArrayList<>(radioState.getAllowedChannels())); - ce.setDetails(apElementConfiguration); - ce = equipmentServiceInterface.update(ce); - LOG.debug("Updated AllowedChannels from Wifi_Radio_State table change {}", ce); + long equipmentId = extractEquipmentIdFromTopic(topic); + if (equipmentId <= 0 || customerId <= 0) { + LOG.warn("Cannot determine equipment ids from topic {} - customerId {} equipmentId {}", topic, customerId, + equipmentId); + return; + } - } + String apId = extractApIdFromTopic(topic); - if (radioState.getTxPower() > 0) { - ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails()); - apElementConfiguration.getRadioMap().get(radioState.getFreqBand()) - .setEirpTxPower(AutoOrManualValue.createManualInstance(radioState.getTxPower())); - ce.setDetails(apElementConfiguration); - ce = equipmentServiceInterface.update(ce); - LOG.debug("Updated TxPower from Wifi_Radio_State table change {}", ce); + if (apId == null) { + LOG.warn("Cannot determine AP id from topic {} - customerId {} equipmentId {} apId {}", topic, customerId, + equipmentId, apId); + return; + } - } + } - StateSetting state = StateSetting.disabled; - if (radioState.isEnabled()) { - state = StateSetting.enabled; - } - ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails()); - if (!apElementConfiguration.getAdvancedRadioMap().get(radioState.getFreqBand()).getRadioAdminState() - .equals(state)) { - // only update if changed - apElementConfiguration.getAdvancedRadioMap().get(radioState.getFreqBand()).setRadioAdminState(state); - ce.setDetails(apElementConfiguration); - ce = equipmentServiceInterface.update(ce); + @Override + public void processMqttMessage(String topic, WCStatsReport wcStatsReport) { + LOG.debug("Received WCStatsReport {}", wcStatsReport.toString()); + + LOG.info("Received report on topic {}", topic); + int customerId = extractCustomerIdFromTopic(topic); - LOG.debug("Updated RadioAdminState from Wifi_Radio_State table change {}", ce); + long equipmentId = extractEquipmentIdFromTopic(topic); + if (equipmentId <= 0 || customerId <= 0) { + LOG.warn("Cannot determine equipment ids from topic {} - customerId {} equipmentId {}", topic, customerId, + equipmentId); + return; + } - } - } + String apId = extractApIdFromTopic(topic); - } + if (apId == null) { + LOG.warn("Cannot determine AP id from topic {} - customerId {} equipmentId {} apId {}", topic, customerId, + equipmentId, apId); + return; + } - @Override - public void wifiInetStateDbTableUpdate(List inetStateTables, String apId) { - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + } - if (ovsdbSession == null) { - LOG.debug("wifiInetStateDbTableUpdate::Cannot get Session for AP {}", apId); - return; - } + @Override + public void wifiVIFStateDbTableUpdate(List vifStateTables, String apId) { - Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); - if (ce == null) { - LOG.debug("wifiInetStateDbTableUpdate::Cannot get Equipment for AP {}", apId); - return; - } + Equipment ce = getCustomerEquipment(apId); + if (ce == null) { + LOG.debug("wifiVIFStateDbTableUpdate::Cannot get Equipment for AP {}", apId); + return; + } - if (inetStateTables == null || inetStateTables.isEmpty() || apId == null) { - return; - } + long equipmentId = ce.getId(); - for (OpensyncAPInetState inetState : inetStateTables) { - // TODO: implement me - } + if (equipmentId < 0L) { + LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); + return; + } - } + if (vifStateTables == null || vifStateTables.isEmpty() || apId == null) { + return; + } - @Override - public void wifiAssociatedClientsDbTableUpdate(List wifiAssociatedClients, - String apId) { + for (OpensyncAPVIFState vifState : vifStateTables) { + // TODO: implement me + } - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + } - if (ovsdbSession == null) { - LOG.debug("wifiAssociatedClientsDbTableUpdate::Cannot get Session for AP {}", apId); - return; - } + @Override + public void wifiRadioStatusDbTableUpdate(List radioStateTables, String apId) { - Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); - if (ce == null) { - LOG.debug("wifiAssociatedClientsDbTableUpdate::Cannot get Equipment for AP {}", apId); - return; - } - - long equipmentId = ce.getId(); - - if (equipmentId < 0L) { - LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); - return; - } - - if (wifiAssociatedClients == null || wifiAssociatedClients.isEmpty() || apId == null) { - return; - } + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - // TODO: update activeBSSDs, etc based on associated clients + if (ovsdbSession == null) { + LOG.debug("wifiRadioStatusDbTableUpdate::Cannot get Session for AP {}", apId); + return; + } - } - - @Override - public void awlanNodeDbTableUpdate(OpensyncAWLANNode opensyncAPState, String apId) { + Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); + if (ce == null) { + LOG.debug("wifiRadioStatusDbTableUpdate::Cannot get Equipment for AP {}", apId); + return; + } + + for (OpensyncAPRadioState radioState : radioStateTables) { - Equipment ce = getCustomerEquipment(apId); - if (ce == null) { - LOG.debug("awlanNodeDbTableUpdate::Cannot get Equipment for AP {}", apId); - return; - } + if (radioState.getFreqBand().equals(RadioType.UNSUPPORTED)) { + LOG.debug("Could not get radio configuration for AP {}", apId); + continue; + } - long equipmentId = ce.getId(); + if (radioState.getAllowedChannels() != null && !radioState.getAllowedChannels().isEmpty()) { + ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails()); + apElementConfiguration.getRadioMap().get(radioState.getFreqBand()) + .setAllowedChannels(new ArrayList<>(radioState.getAllowedChannels())); + ce.setDetails(apElementConfiguration); + ce = equipmentServiceInterface.update(ce); + LOG.debug("Updated AllowedChannels from Wifi_Radio_State table change {}", ce); - if (equipmentId < 0L) { - LOG.debug("awlanNodeDbTableUpdate::Cannot get equipmentId {} for session {}", equipmentId); - return; - } + } - // TODO: update config where applicable - } + if (radioState.getTxPower() > 0) { + ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails()); + apElementConfiguration.getRadioMap().get(radioState.getFreqBand()) + .setEirpTxPower(AutoOrManualValue.createManualInstance(radioState.getTxPower())); + ce.setDetails(apElementConfiguration); + ce = equipmentServiceInterface.update(ce); + LOG.debug("Updated TxPower from Wifi_Radio_State table change {}", ce); - @Override - public void wifiVIFStateDbTableDelete(List vifStateTables, String apId) { + } - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + StateSetting state = StateSetting.disabled; + if (radioState.isEnabled()) { + state = StateSetting.enabled; + } + ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails()); + if (!apElementConfiguration.getAdvancedRadioMap().get(radioState.getFreqBand()).getRadioAdminState() + .equals(state)) { + // only update if changed + apElementConfiguration.getAdvancedRadioMap().get(radioState.getFreqBand()).setRadioAdminState(state); + ce.setDetails(apElementConfiguration); + ce = equipmentServiceInterface.update(ce); - if (ovsdbSession == null) { - LOG.debug("wifiVIFStateDbTableDelete::Cannot get Session for AP {}", apId); - return; - } + LOG.debug("Updated RadioAdminState from Wifi_Radio_State table change {}", ce); - Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); - if (ce == null) { - LOG.debug("wifiVIFStateDbTableDelete::Cannot get Equipment for AP {}", apId); - return; - } + } + } - long equipmentId = ce.getId(); + } - if (equipmentId < 0L) { - LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); - return; - } + @Override + public void wifiInetStateDbTableUpdate(List inetStateTables, String apId) { + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - // TODO: if applicable, remove SsidProfiles related to deleted VIF rows - // for this AP - } + if (ovsdbSession == null) { + LOG.debug("wifiInetStateDbTableUpdate::Cannot get Session for AP {}", apId); + return; + } - @Override - public void wifiAssociatedClientsDbTableDelete(String deletedClientMac, String apId) { + Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); + if (ce == null) { + LOG.debug("wifiInetStateDbTableUpdate::Cannot get Equipment for AP {}", apId); + return; + } - OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + if (inetStateTables == null || inetStateTables.isEmpty() || apId == null) { + return; + } - if (ovsdbSession == null) { - LOG.debug("wifiAssociatedClientsDbTableDelete::Cannot get Session for AP {}", apId); - return; - } + for (OpensyncAPInetState inetState : inetStateTables) { + // TODO: implement me + } - Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); - if (ce == null) { - LOG.debug("wifiAssociatedClientsDbTableDelete::Cannot get Equipment for AP {}", apId); - return; - } - long equipmentId = ce.getId(); + } - if (equipmentId < 0L) { - LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); - return; - } + @Override + public void wifiAssociatedClientsDbTableUpdate(List wifiAssociatedClients, + String apId) { - // TODO: update activeBSSDs, etc based on associated clients, client - // information, etc + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); - } + if (ovsdbSession == null) { + LOG.debug("wifiAssociatedClientsDbTableUpdate::Cannot get Session for AP {}", apId); + return; + } + + Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); + if (ce == null) { + LOG.debug("wifiAssociatedClientsDbTableUpdate::Cannot get Equipment for AP {}", apId); + return; + } + + long equipmentId = ce.getId(); + + if (equipmentId < 0L) { + LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); + return; + } + + if (wifiAssociatedClients == null || wifiAssociatedClients.isEmpty() || apId == null) { + return; + } + + // TODO: update activeBSSDs, etc based on associated clients + + } + + @Override + public void awlanNodeDbTableUpdate(OpensyncAWLANNode opensyncAPState, String apId) { + + Equipment ce = getCustomerEquipment(apId); + if (ce == null) { + LOG.debug("awlanNodeDbTableUpdate::Cannot get Equipment for AP {}", apId); + return; + } + + long equipmentId = ce.getId(); + + if (equipmentId < 0L) { + LOG.debug("awlanNodeDbTableUpdate::Cannot get equipmentId {} for session {}", equipmentId); + return; + } + + // TODO: update config where applicable + } + + @Override + public void wifiVIFStateDbTableDelete(List vifStateTables, String apId) { + + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + + if (ovsdbSession == null) { + LOG.debug("wifiVIFStateDbTableDelete::Cannot get Session for AP {}", apId); + return; + } + + Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); + if (ce == null) { + LOG.debug("wifiVIFStateDbTableDelete::Cannot get Equipment for AP {}", apId); + return; + } + + long equipmentId = ce.getId(); + + if (equipmentId < 0L) { + LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); + return; + } + + // TODO: if applicable, remove SsidProfiles related to deleted VIF rows + // for this AP + } + + @Override + public void wifiAssociatedClientsDbTableDelete(String deletedClientMac, String apId) { + + OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); + + if (ovsdbSession == null) { + LOG.debug("wifiAssociatedClientsDbTableDelete::Cannot get Session for AP {}", apId); + return; + } + + Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); + if (ce == null) { + LOG.debug("wifiAssociatedClientsDbTableDelete::Cannot get Equipment for AP {}", apId); + return; + } + long equipmentId = ce.getId(); + + if (equipmentId < 0L) { + LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); + return; + } + + // TODO: update activeBSSDs, etc based on associated clients, client + // information, etc + + } } diff --git a/opensync-ext-cloud/src/main/resources/config_2_ssids.json b/opensync-ext-cloud/src/main/resources/config_2_ssids.json deleted file mode 100644 index 441d6e7..0000000 --- a/opensync-ext-cloud/src/main/resources/config_2_ssids.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "model_type" : "OpensyncAPConfig", - "radioConfig" : { - "model_type" : "OpensyncAPRadioConfig", - "country" : "CA", - "radioChannel24G" : 1, - "radioChannel5LG" : 44, - "radioChannel5HG" : 108 - }, - "ssidConfigs" : [ { - "model_type" : "OpensyncAPSsidConfig", - "radioType" : "is2dot4GHz", - "ssid" : "Connectus-cloud", - "encryption" : "WPA-PSK", - "key" : "12345678", - "mode" : "2", - "broadcast" : true - }, { - "model_type" : "OpensyncAPSsidConfig", - "radioType" : "is5GHzL", - "ssid" : "Connectus-cloud", - "encryption" : "WPA-PSK", - "key" : "12345678", - "mode" : "2", - "broadcast" : true - } ] -} diff --git a/opensync-ext-interface/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/models/OpensyncAPConfig.java b/opensync-ext-interface/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/models/OpensyncAPConfig.java index 70eab7d..e1e51dc 100644 --- a/opensync-ext-interface/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/models/OpensyncAPConfig.java +++ b/opensync-ext-interface/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/models/OpensyncAPConfig.java @@ -24,177 +24,186 @@ import com.telecominfraproject.wlan.routing.models.EquipmentRoutingRecord; public class OpensyncAPConfig extends BaseJsonModel { - private static final long serialVersionUID = 3917975477206236668L; + private static final long serialVersionUID = 3917975477206236668L; - private Equipment customerEquipment; - private Profile apProfile; - private List ssidProfile; - private Location equipmentLocation; - private EquipmentRoutingRecord equipmentRouting; - private EquipmentGatewayRecord equipmentGateway; + private Equipment customerEquipment; + private Profile apProfile; + private List ssidProfile; + private List radiusProfiles; + private Location equipmentLocation; + private EquipmentRoutingRecord equipmentRouting; + private EquipmentGatewayRecord equipmentGateway; - // Handle Legacy Config Support - public void setRadioConfig(OpensyncAPRadioConfig radioConfig) { + // Handle Legacy Config Support + public void setRadioConfig(OpensyncAPRadioConfig radioConfig) { - if (customerEquipment == null) { - customerEquipment = new Equipment(); - customerEquipment.setId(0); - customerEquipment.setEquipmentType(EquipmentType.AP); - customerEquipment.setDetails(ApElementConfiguration.createWithDefaults()); - ApElementConfiguration apConfig = (ApElementConfiguration) customerEquipment.getDetails(); - apConfig.getRadioMap().get(RadioType.is2dot4GHz).setChannelNumber(radioConfig.getRadioChannel24G()); - apConfig.getRadioMap().get(RadioType.is5GHzL).setChannelNumber(radioConfig.getRadioChannel5LG()); - apConfig.getRadioMap().get(RadioType.is5GHzU).setChannelNumber(radioConfig.getRadioChannel5HG()); - customerEquipment.setDetails(apConfig); - } + if (customerEquipment == null) { + customerEquipment = new Equipment(); + customerEquipment.setId(0); + customerEquipment.setEquipmentType(EquipmentType.AP); + customerEquipment.setDetails(ApElementConfiguration.createWithDefaults()); + ApElementConfiguration apConfig = (ApElementConfiguration) customerEquipment.getDetails(); + apConfig.getRadioMap().get(RadioType.is2dot4GHz).setChannelNumber(radioConfig.getRadioChannel24G()); + apConfig.getRadioMap().get(RadioType.is5GHzL).setChannelNumber(radioConfig.getRadioChannel5LG()); + apConfig.getRadioMap().get(RadioType.is5GHzU).setChannelNumber(radioConfig.getRadioChannel5HG()); + customerEquipment.setDetails(apConfig); + } - if (equipmentLocation == null) { - equipmentLocation = new Location(); - equipmentLocation.setId(1); - equipmentLocation.setDetails(LocationDetails.createWithDefaults()); - ((LocationDetails) equipmentLocation.getDetails()) - .setCountryCode(CountryCode.getByName(radioConfig.getCountry().toLowerCase())); - customerEquipment.setLocationId(equipmentLocation.getId()); - } + if (equipmentLocation == null) { + equipmentLocation = new Location(); + equipmentLocation.setId(1); + equipmentLocation.setDetails(LocationDetails.createWithDefaults()); + ((LocationDetails) equipmentLocation.getDetails()) + .setCountryCode(CountryCode.getByName(radioConfig.getCountry().toLowerCase())); + customerEquipment.setLocationId(equipmentLocation.getId()); + } - } + } - // Handle Legacy Config Support - public void setSsidConfigs(List ssidConfigs) { + // Handle Legacy Config Support + public void setSsidConfigs(List ssidConfigs) { - if (apProfile == null) { - apProfile = new Profile(); - apProfile.setName("GeneratedApProfile"); - apProfile.setId(2); - apProfile.setDetails(ApNetworkConfiguration.createWithDefaults()); - } + if (apProfile == null) { + apProfile = new Profile(); + apProfile.setName("GeneratedApProfile"); + apProfile.setId(2); + apProfile.setDetails(ApNetworkConfiguration.createWithDefaults()); + } - long ssidProfileId = 3; - for (OpensyncAPSsidConfig ssidConfig : ssidConfigs) { + long ssidProfileId = 3; + for (OpensyncAPSsidConfig ssidConfig : ssidConfigs) { - Profile profile = new Profile(); - profile.setProfileType(ProfileType.ssid); - profile.setName(ssidConfig.getSsid()); - SsidConfiguration cfg = SsidConfiguration.createWithDefaults(); - Set appliedRadios = new HashSet(); - appliedRadios.add(ssidConfig.getRadioType()); - cfg.setAppliedRadios(appliedRadios); - cfg.setSsid(ssidConfig.getSsid()); - if (ssidConfig.getEncryption().equals("WPA-PSK") && ssidConfig.getMode().equals("1")) - cfg.setSecureMode(SecureMode.wpaPSK); - else - cfg.setSecureMode(SecureMode.wpa2PSK); - cfg.setBroadcastSsid(ssidConfig.isBroadcast() ? StateSetting.enabled : StateSetting.disabled); + Profile profile = new Profile(); + profile.setProfileType(ProfileType.ssid); + profile.setName(ssidConfig.getSsid()); + SsidConfiguration cfg = SsidConfiguration.createWithDefaults(); + Set appliedRadios = new HashSet(); + appliedRadios.add(ssidConfig.getRadioType()); + cfg.setAppliedRadios(appliedRadios); + cfg.setSsid(ssidConfig.getSsid()); + if (ssidConfig.getEncryption().equals("WPA-PSK") && ssidConfig.getMode().equals("1")) + cfg.setSecureMode(SecureMode.wpaPSK); + else + cfg.setSecureMode(SecureMode.wpa2PSK); + cfg.setBroadcastSsid(ssidConfig.isBroadcast() ? StateSetting.enabled : StateSetting.disabled); - profile.setDetails(cfg); - profile.setId(ssidProfileId); - if (this.ssidProfile == null) - this.ssidProfile = new ArrayList(); - this.ssidProfile.add(profile); - apProfile.getChildProfileIds().add(ssidProfileId); - ssidProfileId++; + profile.setDetails(cfg); + profile.setId(ssidProfileId); + if (this.ssidProfile == null) + this.ssidProfile = new ArrayList(); + this.ssidProfile.add(profile); + apProfile.getChildProfileIds().add(ssidProfileId); + ssidProfileId++; - } + } - if (customerEquipment != null) { - customerEquipment.setProfileId(apProfile.getId()); - } + if (customerEquipment != null) { + customerEquipment.setProfileId(apProfile.getId()); + } - } + } - public EquipmentGatewayRecord getEquipmentGateway() { - return equipmentGateway; - } + public EquipmentGatewayRecord getEquipmentGateway() { + return equipmentGateway; + } - public void setEquipmentGateway(EquipmentGatewayRecord equipmentGateway) { - this.equipmentGateway = equipmentGateway; - } + public void setEquipmentGateway(EquipmentGatewayRecord equipmentGateway) { + this.equipmentGateway = equipmentGateway; + } - public EquipmentRoutingRecord getEquipmentRouting() { - return equipmentRouting; - } + public EquipmentRoutingRecord getEquipmentRouting() { + return equipmentRouting; + } - public void setEquipmentRouting(EquipmentRoutingRecord equipmentRouting) { - this.equipmentRouting = equipmentRouting; - } + public void setEquipmentRouting(EquipmentRoutingRecord equipmentRouting) { + this.equipmentRouting = equipmentRouting; + } - public Equipment getCustomerEquipment() { - return customerEquipment; - } + public Equipment getCustomerEquipment() { + return customerEquipment; + } - public void setCustomerEquipment(Equipment customerEquipment) { - this.customerEquipment = customerEquipment; - } + public void setCustomerEquipment(Equipment customerEquipment) { + this.customerEquipment = customerEquipment; + } - public Profile getApProfile() { - return apProfile; - } + public Profile getApProfile() { + return apProfile; + } - public void setApProfile(Profile apProfile) { - this.apProfile = apProfile; - } + public void setApProfile(Profile apProfile) { + this.apProfile = apProfile; + } - public List getSsidProfile() { - return ssidProfile; - } + public List getSsidProfile() { + return ssidProfile; + } - public void setSsidProfile(List ssidProfile) { - this.ssidProfile = ssidProfile; - } + public void setSsidProfile(List ssidProfile) { + this.ssidProfile = ssidProfile; + } - public Location getEquipmentLocation() { - return equipmentLocation; - } + public Location getEquipmentLocation() { + return equipmentLocation; + } - public void setEquipmentLocation(Location equipmentLocation) { - this.equipmentLocation = equipmentLocation; - } + public void setEquipmentLocation(Location equipmentLocation) { + this.equipmentLocation = equipmentLocation; + } - public String getCountryCode() { - return Location.getCountryCode(this.equipmentLocation).toString(); - } + public String getCountryCode() { + return Location.getCountryCode(this.equipmentLocation).toString(); + } - public static long getSerialversionuid() { - return serialVersionUID; - } + public static long getSerialversionuid() { + return serialVersionUID; + } - @Override - public OpensyncAPConfig clone() { - OpensyncAPConfig ret = (OpensyncAPConfig) super.clone(); + @Override + public OpensyncAPConfig clone() { + OpensyncAPConfig ret = (OpensyncAPConfig) super.clone(); - if (customerEquipment != null) - ret.customerEquipment = customerEquipment.clone(); - if (equipmentLocation != null) - ret.equipmentLocation = equipmentLocation.clone(); - if (ssidProfile != null) { - List ssidList = new ArrayList(); - for (Profile profile : ssidProfile) { - ssidList.add(profile.clone()); - } - ret.ssidProfile = ssidList; - } - if (apProfile != null) - ret.apProfile = apProfile.clone(); - if (equipmentRouting != null) - ret.equipmentRouting = equipmentRouting.clone(); - if (equipmentGateway != null) - ret.equipmentGateway = equipmentGateway.clone(); + if (customerEquipment != null) + ret.customerEquipment = customerEquipment.clone(); + if (equipmentLocation != null) + ret.equipmentLocation = equipmentLocation.clone(); + if (ssidProfile != null) { + List ssidList = new ArrayList(); + for (Profile profile : ssidProfile) { + ssidList.add(profile.clone()); + } + ret.ssidProfile = ssidList; + } + if (apProfile != null) + ret.apProfile = apProfile.clone(); + if (equipmentRouting != null) + ret.equipmentRouting = equipmentRouting.clone(); + if (equipmentGateway != null) + ret.equipmentGateway = equipmentGateway.clone(); - return ret; - } + return ret; + } - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append(customerEquipment.toString()); - sb.append(apProfile.toString()); - for (Profile ssid : ssidProfile) { - sb.append(ssid.toString()); - } - sb.append(equipmentLocation.toString()); + @Override + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append(customerEquipment.toString()); + sb.append(apProfile.toString()); + for (Profile ssid : ssidProfile) { + sb.append(ssid.toString()); + } + sb.append(equipmentLocation.toString()); - return sb.toString(); + return sb.toString(); - } + } + + public List getRadiusProfiles() { + return radiusProfiles; + } + + public void setRadiusProfiles(List radiusProfiles) { + this.radiusProfiles = radiusProfiles; + } } diff --git a/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java b/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java index 3e2b71d..88ec911 100644 --- a/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java +++ b/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java @@ -41,6 +41,9 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr @Value("${connectus.ovsdb.ssidProfileFileName:/Users/mikehansen/git/wlan-cloud-workspace/wlan-cloud-opensync-controller/opensync-ext-static/src/main/resources/ProfileSsid.json}") private String ssidProfileFileName; + @Value("${connectus.ovsdb.radiusProfileFileName:/Users/mikehansen/git/wlan-cloud-workspace/wlan-cloud-opensync-controller/opensync-ext-static/src/main/resources/ProfileRadius.json}") + private String radiusProfileFileName; + @Value("${connectus.ovsdb.locationFileName:/Users/mikehansen/git/wlan-cloud-workspace/wlan-cloud-opensync-controller/opensync-ext-static/src/main/resources/LocationBuildingExample.json}") private String locationFileName; @@ -76,11 +79,15 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr com.telecominfraproject.wlan.profile.models.Profile apProfile = com.telecominfraproject.wlan.profile.models.Profile .fromFile(apProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class); + List ssidProfiles = com.telecominfraproject.wlan.profile.models.Profile .listFromFile(ssidProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class); ssidProfiles.stream().forEach(p -> apProfile.getChildProfileIds().add(p.getId())); + List radiusProfiles = com.telecominfraproject.wlan.profile.models.Profile + .listFromFile(radiusProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class); + equipment.setProfileId(apProfile.getId()); Location location = Location.fromFile(locationFileName, Location.class); @@ -91,6 +98,7 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr ret.setCustomerEquipment(equipment); ret.setApProfile(apProfile); ret.setSsidProfile(ssidProfiles); + ret.setRadiusProfiles(radiusProfiles); ret.setEquipmentLocation(location); } catch (IOException e) { diff --git a/opensync-ext-static/src/main/resources/EquipmentExample.json b/opensync-ext-static/src/main/resources/EquipmentExample.json index fc1ee97..5eb69c5 100644 --- a/opensync-ext-static/src/main/resources/EquipmentExample.json +++ b/opensync-ext-static/src/main/resources/EquipmentExample.json @@ -1,290 +1,293 @@ { - "model_type" : "Equipment", - "id" : 51, - "customerId" : 2, - "profileId" : 3, - "locationId" : 8, - "equipmentType" : "AP", - "inventoryId" : "Test_Client_21P10C68818122", - "name" : "Test_Client_21P10C68818122", - "details" : { - "model_type" : "ApElementConfiguration", - "sampleDetailsStr" : null, - "elementConfigVersion" : "AP-V1", - "equipmentType" : "AP", - "deviceMode" : "standaloneAP", - "gettingIP" : "dhcp", - "staticIP" : null, - "staticIpMaskCidr" : null, - "staticIpGw" : null, - "gettingDNS" : "dhcp", - "staticDnsIp1" : null, - "staticDnsIp2" : null, - "peerInfoList" : [ ], - "deviceName" : "Test_Client_21P10C68818122", - "locationData" : null, - "locallyConfiguredMgmtVlan" : 0, - "locallyConfigured" : false, - "deploymentType" : "CEILING", - "syntheticClientEnabled" : null, - "frameReportThrottleEnabled" : true, - "antennaType" : "OMNI", - "costSavingEventsEnabled" : true, - "forwardMode" : "BRIDGE", - "radioMap" : { - "is2dot4GHz" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is2dot4GHz", - "channelNumber" : 6, - "manualChannelNumber" : 6, - "backupChannelNumber" : 11, - "autoChannelSelection" : true, - "channelBandwidth" : "is20MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "model_type": "Equipment", + "id": 51, + "customerId": 2, + "profileId": 5, + "locationId": 8, + "equipmentType": "AP", + "inventoryId": "Test_Client_21P10C68818122", + "name": "Test_Client_21P10C68818122", + "details": { + "model_type": "ApElementConfiguration", + "equipmentModel": "EA8300-CA", + "elementConfigVersion": "AP-V1", + "equipmentType": "AP", + "deviceMode": "standaloneAP", + "gettingIP": "dhcp", + "staticIP": null, + "staticIpMaskCidr": null, + "staticIpGw": null, + "gettingDNS": "dhcp", + "staticDnsIp1": null, + "staticDnsIp2": null, + "peerInfoList": [], + "deviceName": "Default Device Name", + "locationData": null, + "locallyConfiguredMgmtVlan": 0, + "locallyConfigured": false, + "deploymentType": "CEILING", + "syntheticClientEnabled": null, + "frameReportThrottleEnabled": true, + "antennaType": "OMNI", + "costSavingEventsEnabled": true, + "forwardMode": "BRIDGE", + "radioMap": { + "is2dot4GHz": { + "model_type": "ElementRadioConfiguration", + "radioType": "is2dot4GHz", + "channelNumber": 6, + "manualChannelNumber": 6, + "backupChannelNumber": 11, + "autoChannelSelection": false, + "channelBandwidth": "is20MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 6 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 6 }, - "is5GHzL" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is5GHzL", - "channelNumber" : 36, - "manualChannelNumber" : 36, - "backupChannelNumber" : 44, - "autoChannelSelection" : true, - "channelBandwidth" : "is80MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "is5GHzU": { + "model_type": "ElementRadioConfiguration", + "radioType": "is5GHzU", + "channelNumber": 149, + "manualChannelNumber": 149, + "backupChannelNumber": 154, + "autoChannelSelection": false, + "channelBandwidth": "is80MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 36 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 149 }, - "is5GHzU" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is5GHzU", - "channelNumber" : 149, - "manualChannelNumber" : 149, - "backupChannelNumber" : 154, - "autoChannelSelection" : true, - "channelBandwidth" : "is80MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "is5GHzL": { + "model_type": "ElementRadioConfiguration", + "radioType": "is5GHzL", + "channelNumber": 36, + "manualChannelNumber": 36, + "backupChannelNumber": 44, + "autoChannelSelection": false, + "channelBandwidth": "is80MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 149 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 36 } }, - "advancedRadioMap" : { - "is2dot4GHz" : { - "model_type" : "RadioConfiguration", - "radioType" : "is2dot4GHz", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeN", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "advancedRadioMap": { + "is2dot4GHz": { + "model_type": "RadioConfiguration", + "radioType": "is2dot4GHz", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeN", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 20, - "minLoadFactor" : 50 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 20, + "minLoadFactor": 50 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null }, - "is5GHzU" : { - "model_type" : "RadioConfiguration", - "radioType" : "is5GHzU", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeAC", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "is5GHzU": { + "model_type": "RadioConfiguration", + "radioType": "is5GHzU", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeAC", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 30, - "minLoadFactor" : 40 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 30, + "minLoadFactor": 40 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null }, - "is5GHzL" : { - "model_type" : "RadioConfiguration", - "radioType" : "is5GHzL", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeAC", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "is5GHzL": { + "model_type": "RadioConfiguration", + "radioType": "is5GHzL", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeAC", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 30, - "minLoadFactor" : 40 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 30, + "minLoadFactor": 40 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null } } }, - "latitude" : null, - "longitude" : null, - "serial" : "21P10C68818122", - "createdTimestamp" : 1590607072871, - "lastModifiedTimestamp" : 1590607073116 -} + "latitude": null, + "longitude": null, + "serial": "21P10C68818122", + "createdTimestamp": 1591653239821, + "lastModifiedTimestamp": 1591653241398 +} \ No newline at end of file diff --git a/opensync-ext-static/src/main/resources/ProfileAPExample.json b/opensync-ext-static/src/main/resources/ProfileAPExample.json index 31bf667..8420e24 100644 --- a/opensync-ext-static/src/main/resources/ProfileAPExample.json +++ b/opensync-ext-static/src/main/resources/ProfileAPExample.json @@ -1,50 +1,54 @@ { - "model_type" : "Profile", - "id" : 3, - "customerId" : 2, - "profileType" : "equipment_ap", - "name" : "autoprovisionedApProfile", - "details" : { - "model_type" : "ApNetworkConfiguration", - "networkConfigVersion" : "AP-1", - "equipmentType" : "AP", - "vlanNative" : true, - "vlan" : 0, - "ntpServer" : { - "model_type" : "AutoOrManualString", - "auto" : true, - "value" : "pool.ntp.org" + "model_type": "Profile", + "id": 5, + "customerId": 2, + "profileType": "equipment_ap", + "name": "DefaultApProfile", + "details": { + "model_type": "ApNetworkConfiguration", + "networkConfigVersion": "AP-1", + "equipmentType": "AP", + "vlanNative": true, + "vlan": 0, + "ntpServer": { + "model_type": "AutoOrManualString", + "auto": true, + "value": "pool.ntp.org" }, - "syslogRelay" : null, - "rtlsSettings" : null, - "syntheticClientEnabled" : true, - "ledControlEnabled" : true, - "equipmentDiscovery" : false, - "radioMap" : { - "is5GHz" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "syslogRelay": null, + "rtlsSettings": null, + "syntheticClientEnabled": true, + "ledControlEnabled": true, + "equipmentDiscovery": false, + "radioMap": { + "is5GHz": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is2dot4GHz" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is2dot4GHz": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is5GHzU" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is5GHzU": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is5GHzL" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is5GHzL": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" } }, - "profileType" : "equipment_ap" + "profileType": "equipment_ap" }, - "createdTimestamp" : 1590607072994, - "lastModifiedTimestamp" : 1590607073083, - "childProfileIds" : [ 4, 5, 6 ] + "createdTimestamp": 1591653239947, + "lastModifiedTimestamp": 1591654336724, + "childProfileIds": [ + 6, + 7, + 8 + ] } \ No newline at end of file diff --git a/opensync-ext-static/src/main/resources/ProfileRadius.json b/opensync-ext-static/src/main/resources/ProfileRadius.json new file mode 100644 index 0000000..322a581 --- /dev/null +++ b/opensync-ext-static/src/main/resources/ProfileRadius.json @@ -0,0 +1,34 @@ +[ +{ + "model_type": "Profile", + "id": 1, + "customerId": 2, + "profileType": "radius", + "name": "RadiusProfileOttawa", + "details": { + "model_type": "RadiusProfile", + "subnetConfiguration": null, + "serviceRegionMap": { + "Ottawa": { + "model_type": "RadiusServiceRegion", + "serverMap": { + "RadiusProfileOttawa": [ + { + "model_type": "RadiusServer", + "ipAddress": "Mikes-MacBook-Pro.local", + "secret": "testing123", + "authPort": 1812, + "timeout": null + } + ] + }, + "regionName": "Ottawa" + } + }, + "profileType": "radius" + }, + "createdTimestamp": 1591653174195, + "lastModifiedTimestamp": 1591653174195, + "childProfileIds": [] +} +] \ No newline at end of file diff --git a/opensync-ext-static/src/main/resources/ProfileSsid.json b/opensync-ext-static/src/main/resources/ProfileSsid.json index 6648bc7..88df143 100644 --- a/opensync-ext-static/src/main/resources/ProfileSsid.json +++ b/opensync-ext-static/src/main/resources/ProfileSsid.json @@ -1,176 +1,184 @@ [ { - "model_type" : "Profile", - "id" : 4, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid", - "appliedRadios" : [ "is2dot4GHz" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 6, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-2g", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-2g", + "appliedRadios": [ + "is2dot4GHz" + ], + "ssidAdminState": "enabled", + "secureMode": "wpa2PSK", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": null, + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073026, - "lastModifiedTimestamp" : 1590607073026, - "childProfileIds" : [ ] + "createdTimestamp": 1591653239983, + "lastModifiedTimestamp": 1591653239983, + "childProfileIds": [] }, { - "model_type" : "Profile", - "id" : 5, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid-5l", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid-5l", - "appliedRadios" : [ "is5GHzL" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 7, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-5gl", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-5gl", + "appliedRadios": [ + "is5GHzL" + ], + "ssidAdminState": "enabled", + "secureMode": "wpaEAP", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": "RadiusProfileOttawa", + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073044, - "lastModifiedTimestamp" : 1590607073044, - "childProfileIds" : [ ] + "createdTimestamp": 1591653240017, + "lastModifiedTimestamp": 1591654215374, + "childProfileIds": [ + 1 + ] }, { - "model_type" : "Profile", - "id" : 6, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid-5u", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid-5u", - "appliedRadios" : [ "is5GHzU" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 8, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-5gu", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-5gu", + "appliedRadios": [ + "is5GHzU" + ], + "ssidAdminState": "enabled", + "secureMode": "wpa2PSK", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": null, + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073065, - "lastModifiedTimestamp" : 1590607073065, - "childProfileIds" : [ ] + "createdTimestamp": 1591654301763, + "lastModifiedTimestamp": 1591654301763, + "childProfileIds": [] } ] \ No newline at end of file diff --git a/opensync-gateway-cloud-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) cloud.launch b/opensync-gateway-cloud-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) cloud.launch index 3a4223f..982f3f4 100644 --- a/opensync-gateway-cloud-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) cloud.launch +++ b/opensync-gateway-cloud-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) cloud.launch @@ -18,7 +18,8 @@ + - + diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/EquipmentExample.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/EquipmentExample.json index fc1ee97..5eb69c5 100644 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/EquipmentExample.json +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/EquipmentExample.json @@ -1,290 +1,293 @@ { - "model_type" : "Equipment", - "id" : 51, - "customerId" : 2, - "profileId" : 3, - "locationId" : 8, - "equipmentType" : "AP", - "inventoryId" : "Test_Client_21P10C68818122", - "name" : "Test_Client_21P10C68818122", - "details" : { - "model_type" : "ApElementConfiguration", - "sampleDetailsStr" : null, - "elementConfigVersion" : "AP-V1", - "equipmentType" : "AP", - "deviceMode" : "standaloneAP", - "gettingIP" : "dhcp", - "staticIP" : null, - "staticIpMaskCidr" : null, - "staticIpGw" : null, - "gettingDNS" : "dhcp", - "staticDnsIp1" : null, - "staticDnsIp2" : null, - "peerInfoList" : [ ], - "deviceName" : "Test_Client_21P10C68818122", - "locationData" : null, - "locallyConfiguredMgmtVlan" : 0, - "locallyConfigured" : false, - "deploymentType" : "CEILING", - "syntheticClientEnabled" : null, - "frameReportThrottleEnabled" : true, - "antennaType" : "OMNI", - "costSavingEventsEnabled" : true, - "forwardMode" : "BRIDGE", - "radioMap" : { - "is2dot4GHz" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is2dot4GHz", - "channelNumber" : 6, - "manualChannelNumber" : 6, - "backupChannelNumber" : 11, - "autoChannelSelection" : true, - "channelBandwidth" : "is20MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "model_type": "Equipment", + "id": 51, + "customerId": 2, + "profileId": 5, + "locationId": 8, + "equipmentType": "AP", + "inventoryId": "Test_Client_21P10C68818122", + "name": "Test_Client_21P10C68818122", + "details": { + "model_type": "ApElementConfiguration", + "equipmentModel": "EA8300-CA", + "elementConfigVersion": "AP-V1", + "equipmentType": "AP", + "deviceMode": "standaloneAP", + "gettingIP": "dhcp", + "staticIP": null, + "staticIpMaskCidr": null, + "staticIpGw": null, + "gettingDNS": "dhcp", + "staticDnsIp1": null, + "staticDnsIp2": null, + "peerInfoList": [], + "deviceName": "Default Device Name", + "locationData": null, + "locallyConfiguredMgmtVlan": 0, + "locallyConfigured": false, + "deploymentType": "CEILING", + "syntheticClientEnabled": null, + "frameReportThrottleEnabled": true, + "antennaType": "OMNI", + "costSavingEventsEnabled": true, + "forwardMode": "BRIDGE", + "radioMap": { + "is2dot4GHz": { + "model_type": "ElementRadioConfiguration", + "radioType": "is2dot4GHz", + "channelNumber": 6, + "manualChannelNumber": 6, + "backupChannelNumber": 11, + "autoChannelSelection": false, + "channelBandwidth": "is20MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 6 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 6 }, - "is5GHzL" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is5GHzL", - "channelNumber" : 36, - "manualChannelNumber" : 36, - "backupChannelNumber" : 44, - "autoChannelSelection" : true, - "channelBandwidth" : "is80MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "is5GHzU": { + "model_type": "ElementRadioConfiguration", + "radioType": "is5GHzU", + "channelNumber": 149, + "manualChannelNumber": 149, + "backupChannelNumber": 154, + "autoChannelSelection": false, + "channelBandwidth": "is80MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 36 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 149 }, - "is5GHzU" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is5GHzU", - "channelNumber" : 149, - "manualChannelNumber" : 149, - "backupChannelNumber" : 154, - "autoChannelSelection" : true, - "channelBandwidth" : "is80MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "is5GHzL": { + "model_type": "ElementRadioConfiguration", + "radioType": "is5GHzL", + "channelNumber": 36, + "manualChannelNumber": 36, + "backupChannelNumber": 44, + "autoChannelSelection": false, + "channelBandwidth": "is80MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 149 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 36 } }, - "advancedRadioMap" : { - "is2dot4GHz" : { - "model_type" : "RadioConfiguration", - "radioType" : "is2dot4GHz", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeN", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "advancedRadioMap": { + "is2dot4GHz": { + "model_type": "RadioConfiguration", + "radioType": "is2dot4GHz", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeN", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 20, - "minLoadFactor" : 50 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 20, + "minLoadFactor": 50 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null }, - "is5GHzU" : { - "model_type" : "RadioConfiguration", - "radioType" : "is5GHzU", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeAC", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "is5GHzU": { + "model_type": "RadioConfiguration", + "radioType": "is5GHzU", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeAC", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 30, - "minLoadFactor" : 40 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 30, + "minLoadFactor": 40 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null }, - "is5GHzL" : { - "model_type" : "RadioConfiguration", - "radioType" : "is5GHzL", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeAC", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "is5GHzL": { + "model_type": "RadioConfiguration", + "radioType": "is5GHzL", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeAC", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 30, - "minLoadFactor" : 40 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 30, + "minLoadFactor": 40 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null } } }, - "latitude" : null, - "longitude" : null, - "serial" : "21P10C68818122", - "createdTimestamp" : 1590607072871, - "lastModifiedTimestamp" : 1590607073116 -} + "latitude": null, + "longitude": null, + "serial": "21P10C68818122", + "createdTimestamp": 1591653239821, + "lastModifiedTimestamp": 1591653241398 +} \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json index 31bf667..8420e24 100644 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json @@ -1,50 +1,54 @@ { - "model_type" : "Profile", - "id" : 3, - "customerId" : 2, - "profileType" : "equipment_ap", - "name" : "autoprovisionedApProfile", - "details" : { - "model_type" : "ApNetworkConfiguration", - "networkConfigVersion" : "AP-1", - "equipmentType" : "AP", - "vlanNative" : true, - "vlan" : 0, - "ntpServer" : { - "model_type" : "AutoOrManualString", - "auto" : true, - "value" : "pool.ntp.org" + "model_type": "Profile", + "id": 5, + "customerId": 2, + "profileType": "equipment_ap", + "name": "DefaultApProfile", + "details": { + "model_type": "ApNetworkConfiguration", + "networkConfigVersion": "AP-1", + "equipmentType": "AP", + "vlanNative": true, + "vlan": 0, + "ntpServer": { + "model_type": "AutoOrManualString", + "auto": true, + "value": "pool.ntp.org" }, - "syslogRelay" : null, - "rtlsSettings" : null, - "syntheticClientEnabled" : true, - "ledControlEnabled" : true, - "equipmentDiscovery" : false, - "radioMap" : { - "is5GHz" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "syslogRelay": null, + "rtlsSettings": null, + "syntheticClientEnabled": true, + "ledControlEnabled": true, + "equipmentDiscovery": false, + "radioMap": { + "is5GHz": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is2dot4GHz" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is2dot4GHz": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is5GHzU" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is5GHzU": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is5GHzL" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is5GHzL": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" } }, - "profileType" : "equipment_ap" + "profileType": "equipment_ap" }, - "createdTimestamp" : 1590607072994, - "lastModifiedTimestamp" : 1590607073083, - "childProfileIds" : [ 4, 5, 6 ] + "createdTimestamp": 1591653239947, + "lastModifiedTimestamp": 1591654336724, + "childProfileIds": [ + 6, + 7, + 8 + ] } \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileRadius.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileRadius.json new file mode 100644 index 0000000..322a581 --- /dev/null +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileRadius.json @@ -0,0 +1,34 @@ +[ +{ + "model_type": "Profile", + "id": 1, + "customerId": 2, + "profileType": "radius", + "name": "RadiusProfileOttawa", + "details": { + "model_type": "RadiusProfile", + "subnetConfiguration": null, + "serviceRegionMap": { + "Ottawa": { + "model_type": "RadiusServiceRegion", + "serverMap": { + "RadiusProfileOttawa": [ + { + "model_type": "RadiusServer", + "ipAddress": "Mikes-MacBook-Pro.local", + "secret": "testing123", + "authPort": 1812, + "timeout": null + } + ] + }, + "regionName": "Ottawa" + } + }, + "profileType": "radius" + }, + "createdTimestamp": 1591653174195, + "lastModifiedTimestamp": 1591653174195, + "childProfileIds": [] +} +] \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileSsid.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileSsid.json index 6648bc7..88df143 100644 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileSsid.json +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileSsid.json @@ -1,176 +1,184 @@ [ { - "model_type" : "Profile", - "id" : 4, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid", - "appliedRadios" : [ "is2dot4GHz" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 6, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-2g", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-2g", + "appliedRadios": [ + "is2dot4GHz" + ], + "ssidAdminState": "enabled", + "secureMode": "wpa2PSK", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": null, + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073026, - "lastModifiedTimestamp" : 1590607073026, - "childProfileIds" : [ ] + "createdTimestamp": 1591653239983, + "lastModifiedTimestamp": 1591653239983, + "childProfileIds": [] }, { - "model_type" : "Profile", - "id" : 5, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid-5l", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid-5l", - "appliedRadios" : [ "is5GHzL" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 7, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-5gl", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-5gl", + "appliedRadios": [ + "is5GHzL" + ], + "ssidAdminState": "enabled", + "secureMode": "wpaEAP", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": "RadiusProfileOttawa", + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073044, - "lastModifiedTimestamp" : 1590607073044, - "childProfileIds" : [ ] + "createdTimestamp": 1591653240017, + "lastModifiedTimestamp": 1591654215374, + "childProfileIds": [ + 1 + ] }, { - "model_type" : "Profile", - "id" : 6, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid-5u", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid-5u", - "appliedRadios" : [ "is5GHzU" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 8, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-5gu", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-5gu", + "appliedRadios": [ + "is5GHzU" + ], + "ssidAdminState": "enabled", + "secureMode": "wpa2PSK", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": null, + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073065, - "lastModifiedTimestamp" : 1590607073065, - "childProfileIds" : [ ] + "createdTimestamp": 1591654301763, + "lastModifiedTimestamp": 1591654301763, + "childProfileIds": [] } ] \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/config_2_ssids.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/config_2_ssids.json deleted file mode 100644 index c28975d..0000000 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/config_2_ssids.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "model_type" : "OpensyncAPConfig", - "radioConfig" : { - "model_type" : "OpensyncAPRadioConfig", - "country" : "CA", - "radioChannel24G" : 1, - "radioChannel5LG" : 44, - "radioChannel5HG" : 108 - }, - "ssidConfigs" : [ { - "model_type" : "OpensyncAPSsidConfig", - "radioType" : "is2dot4GHz", - "ssid" : "Connectus-local", - "encryption" : "WPA-PSK", - "key" : "12345678", - "mode" : "2", - "broadcast" : true - }, { - "model_type" : "OpensyncAPSsidConfig", - "radioType" : "is5GHzL", - "ssid" : "Connectus-local-5l", - "encryption" : "WPA-PSK", - "key" : "12345678", - "mode" : "2", - "broadcast" : true - } ] -} diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/EquipmentExample.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/EquipmentExample.json index fc1ee97..5eb69c5 100644 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/EquipmentExample.json +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/EquipmentExample.json @@ -1,290 +1,293 @@ { - "model_type" : "Equipment", - "id" : 51, - "customerId" : 2, - "profileId" : 3, - "locationId" : 8, - "equipmentType" : "AP", - "inventoryId" : "Test_Client_21P10C68818122", - "name" : "Test_Client_21P10C68818122", - "details" : { - "model_type" : "ApElementConfiguration", - "sampleDetailsStr" : null, - "elementConfigVersion" : "AP-V1", - "equipmentType" : "AP", - "deviceMode" : "standaloneAP", - "gettingIP" : "dhcp", - "staticIP" : null, - "staticIpMaskCidr" : null, - "staticIpGw" : null, - "gettingDNS" : "dhcp", - "staticDnsIp1" : null, - "staticDnsIp2" : null, - "peerInfoList" : [ ], - "deviceName" : "Test_Client_21P10C68818122", - "locationData" : null, - "locallyConfiguredMgmtVlan" : 0, - "locallyConfigured" : false, - "deploymentType" : "CEILING", - "syntheticClientEnabled" : null, - "frameReportThrottleEnabled" : true, - "antennaType" : "OMNI", - "costSavingEventsEnabled" : true, - "forwardMode" : "BRIDGE", - "radioMap" : { - "is2dot4GHz" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is2dot4GHz", - "channelNumber" : 6, - "manualChannelNumber" : 6, - "backupChannelNumber" : 11, - "autoChannelSelection" : true, - "channelBandwidth" : "is20MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "model_type": "Equipment", + "id": 51, + "customerId": 2, + "profileId": 5, + "locationId": 8, + "equipmentType": "AP", + "inventoryId": "Test_Client_21P10C68818122", + "name": "Test_Client_21P10C68818122", + "details": { + "model_type": "ApElementConfiguration", + "equipmentModel": "EA8300-CA", + "elementConfigVersion": "AP-V1", + "equipmentType": "AP", + "deviceMode": "standaloneAP", + "gettingIP": "dhcp", + "staticIP": null, + "staticIpMaskCidr": null, + "staticIpGw": null, + "gettingDNS": "dhcp", + "staticDnsIp1": null, + "staticDnsIp2": null, + "peerInfoList": [], + "deviceName": "Default Device Name", + "locationData": null, + "locallyConfiguredMgmtVlan": 0, + "locallyConfigured": false, + "deploymentType": "CEILING", + "syntheticClientEnabled": null, + "frameReportThrottleEnabled": true, + "antennaType": "OMNI", + "costSavingEventsEnabled": true, + "forwardMode": "BRIDGE", + "radioMap": { + "is2dot4GHz": { + "model_type": "ElementRadioConfiguration", + "radioType": "is2dot4GHz", + "channelNumber": 6, + "manualChannelNumber": 6, + "backupChannelNumber": 11, + "autoChannelSelection": false, + "channelBandwidth": "is20MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 6 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 6 }, - "is5GHzL" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is5GHzL", - "channelNumber" : 36, - "manualChannelNumber" : 36, - "backupChannelNumber" : 44, - "autoChannelSelection" : true, - "channelBandwidth" : "is80MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "is5GHzU": { + "model_type": "ElementRadioConfiguration", + "radioType": "is5GHzU", + "channelNumber": 149, + "manualChannelNumber": 149, + "backupChannelNumber": 154, + "autoChannelSelection": false, + "channelBandwidth": "is80MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 36 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 149 }, - "is5GHzU" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is5GHzU", - "channelNumber" : 149, - "manualChannelNumber" : 149, - "backupChannelNumber" : 154, - "autoChannelSelection" : true, - "channelBandwidth" : "is80MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "is5GHzL": { + "model_type": "ElementRadioConfiguration", + "radioType": "is5GHzL", + "channelNumber": 36, + "manualChannelNumber": 36, + "backupChannelNumber": 44, + "autoChannelSelection": false, + "channelBandwidth": "is80MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 149 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 36 } }, - "advancedRadioMap" : { - "is2dot4GHz" : { - "model_type" : "RadioConfiguration", - "radioType" : "is2dot4GHz", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeN", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "advancedRadioMap": { + "is2dot4GHz": { + "model_type": "RadioConfiguration", + "radioType": "is2dot4GHz", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeN", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 20, - "minLoadFactor" : 50 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 20, + "minLoadFactor": 50 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null }, - "is5GHzU" : { - "model_type" : "RadioConfiguration", - "radioType" : "is5GHzU", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeAC", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "is5GHzU": { + "model_type": "RadioConfiguration", + "radioType": "is5GHzU", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeAC", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 30, - "minLoadFactor" : 40 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 30, + "minLoadFactor": 40 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null }, - "is5GHzL" : { - "model_type" : "RadioConfiguration", - "radioType" : "is5GHzL", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeAC", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "is5GHzL": { + "model_type": "RadioConfiguration", + "radioType": "is5GHzL", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeAC", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 30, - "minLoadFactor" : 40 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 30, + "minLoadFactor": 40 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null } } }, - "latitude" : null, - "longitude" : null, - "serial" : "21P10C68818122", - "createdTimestamp" : 1590607072871, - "lastModifiedTimestamp" : 1590607073116 -} + "latitude": null, + "longitude": null, + "serial": "21P10C68818122", + "createdTimestamp": 1591653239821, + "lastModifiedTimestamp": 1591653241398 +} \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json index 31bf667..8420e24 100644 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json @@ -1,50 +1,54 @@ { - "model_type" : "Profile", - "id" : 3, - "customerId" : 2, - "profileType" : "equipment_ap", - "name" : "autoprovisionedApProfile", - "details" : { - "model_type" : "ApNetworkConfiguration", - "networkConfigVersion" : "AP-1", - "equipmentType" : "AP", - "vlanNative" : true, - "vlan" : 0, - "ntpServer" : { - "model_type" : "AutoOrManualString", - "auto" : true, - "value" : "pool.ntp.org" + "model_type": "Profile", + "id": 5, + "customerId": 2, + "profileType": "equipment_ap", + "name": "DefaultApProfile", + "details": { + "model_type": "ApNetworkConfiguration", + "networkConfigVersion": "AP-1", + "equipmentType": "AP", + "vlanNative": true, + "vlan": 0, + "ntpServer": { + "model_type": "AutoOrManualString", + "auto": true, + "value": "pool.ntp.org" }, - "syslogRelay" : null, - "rtlsSettings" : null, - "syntheticClientEnabled" : true, - "ledControlEnabled" : true, - "equipmentDiscovery" : false, - "radioMap" : { - "is5GHz" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "syslogRelay": null, + "rtlsSettings": null, + "syntheticClientEnabled": true, + "ledControlEnabled": true, + "equipmentDiscovery": false, + "radioMap": { + "is5GHz": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is2dot4GHz" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is2dot4GHz": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is5GHzU" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is5GHzU": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is5GHzL" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is5GHzL": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" } }, - "profileType" : "equipment_ap" + "profileType": "equipment_ap" }, - "createdTimestamp" : 1590607072994, - "lastModifiedTimestamp" : 1590607073083, - "childProfileIds" : [ 4, 5, 6 ] + "createdTimestamp": 1591653239947, + "lastModifiedTimestamp": 1591654336724, + "childProfileIds": [ + 6, + 7, + 8 + ] } \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileRadius.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileRadius.json new file mode 100644 index 0000000..322a581 --- /dev/null +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileRadius.json @@ -0,0 +1,34 @@ +[ +{ + "model_type": "Profile", + "id": 1, + "customerId": 2, + "profileType": "radius", + "name": "RadiusProfileOttawa", + "details": { + "model_type": "RadiusProfile", + "subnetConfiguration": null, + "serviceRegionMap": { + "Ottawa": { + "model_type": "RadiusServiceRegion", + "serverMap": { + "RadiusProfileOttawa": [ + { + "model_type": "RadiusServer", + "ipAddress": "Mikes-MacBook-Pro.local", + "secret": "testing123", + "authPort": 1812, + "timeout": null + } + ] + }, + "regionName": "Ottawa" + } + }, + "profileType": "radius" + }, + "createdTimestamp": 1591653174195, + "lastModifiedTimestamp": 1591653174195, + "childProfileIds": [] +} +] \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileSsid.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileSsid.json index 6648bc7..88df143 100644 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileSsid.json +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileSsid.json @@ -1,176 +1,184 @@ [ { - "model_type" : "Profile", - "id" : 4, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid", - "appliedRadios" : [ "is2dot4GHz" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 6, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-2g", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-2g", + "appliedRadios": [ + "is2dot4GHz" + ], + "ssidAdminState": "enabled", + "secureMode": "wpa2PSK", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": null, + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073026, - "lastModifiedTimestamp" : 1590607073026, - "childProfileIds" : [ ] + "createdTimestamp": 1591653239983, + "lastModifiedTimestamp": 1591653239983, + "childProfileIds": [] }, { - "model_type" : "Profile", - "id" : 5, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid-5l", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid-5l", - "appliedRadios" : [ "is5GHzL" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 7, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-5gl", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-5gl", + "appliedRadios": [ + "is5GHzL" + ], + "ssidAdminState": "enabled", + "secureMode": "wpaEAP", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": "RadiusProfileOttawa", + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073044, - "lastModifiedTimestamp" : 1590607073044, - "childProfileIds" : [ ] + "createdTimestamp": 1591653240017, + "lastModifiedTimestamp": 1591654215374, + "childProfileIds": [ + 1 + ] }, { - "model_type" : "Profile", - "id" : 6, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid-5u", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid-5u", - "appliedRadios" : [ "is5GHzU" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 8, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-5gu", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-5gu", + "appliedRadios": [ + "is5GHzU" + ], + "ssidAdminState": "enabled", + "secureMode": "wpa2PSK", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": null, + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073065, - "lastModifiedTimestamp" : 1590607073065, - "childProfileIds" : [ ] + "createdTimestamp": 1591654301763, + "lastModifiedTimestamp": 1591654301763, + "childProfileIds": [] } ] \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/config_2_ssids.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/config_2_ssids.json deleted file mode 100644 index c28975d..0000000 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/config_2_ssids.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "model_type" : "OpensyncAPConfig", - "radioConfig" : { - "model_type" : "OpensyncAPRadioConfig", - "country" : "CA", - "radioChannel24G" : 1, - "radioChannel5LG" : 44, - "radioChannel5HG" : 108 - }, - "ssidConfigs" : [ { - "model_type" : "OpensyncAPSsidConfig", - "radioType" : "is2dot4GHz", - "ssid" : "Connectus-local", - "encryption" : "WPA-PSK", - "key" : "12345678", - "mode" : "2", - "broadcast" : true - }, { - "model_type" : "OpensyncAPSsidConfig", - "radioType" : "is5GHzL", - "ssid" : "Connectus-local-5l", - "encryption" : "WPA-PSK", - "key" : "12345678", - "mode" : "2", - "broadcast" : true - } ] -} diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/EquipmentExample.json b/opensync-gateway-static-process/src/main/resources/app/opensync/EquipmentExample.json index fc1ee97..5eb69c5 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/EquipmentExample.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/EquipmentExample.json @@ -1,290 +1,293 @@ { - "model_type" : "Equipment", - "id" : 51, - "customerId" : 2, - "profileId" : 3, - "locationId" : 8, - "equipmentType" : "AP", - "inventoryId" : "Test_Client_21P10C68818122", - "name" : "Test_Client_21P10C68818122", - "details" : { - "model_type" : "ApElementConfiguration", - "sampleDetailsStr" : null, - "elementConfigVersion" : "AP-V1", - "equipmentType" : "AP", - "deviceMode" : "standaloneAP", - "gettingIP" : "dhcp", - "staticIP" : null, - "staticIpMaskCidr" : null, - "staticIpGw" : null, - "gettingDNS" : "dhcp", - "staticDnsIp1" : null, - "staticDnsIp2" : null, - "peerInfoList" : [ ], - "deviceName" : "Test_Client_21P10C68818122", - "locationData" : null, - "locallyConfiguredMgmtVlan" : 0, - "locallyConfigured" : false, - "deploymentType" : "CEILING", - "syntheticClientEnabled" : null, - "frameReportThrottleEnabled" : true, - "antennaType" : "OMNI", - "costSavingEventsEnabled" : true, - "forwardMode" : "BRIDGE", - "radioMap" : { - "is2dot4GHz" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is2dot4GHz", - "channelNumber" : 6, - "manualChannelNumber" : 6, - "backupChannelNumber" : 11, - "autoChannelSelection" : true, - "channelBandwidth" : "is20MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "model_type": "Equipment", + "id": 51, + "customerId": 2, + "profileId": 5, + "locationId": 8, + "equipmentType": "AP", + "inventoryId": "Test_Client_21P10C68818122", + "name": "Test_Client_21P10C68818122", + "details": { + "model_type": "ApElementConfiguration", + "equipmentModel": "EA8300-CA", + "elementConfigVersion": "AP-V1", + "equipmentType": "AP", + "deviceMode": "standaloneAP", + "gettingIP": "dhcp", + "staticIP": null, + "staticIpMaskCidr": null, + "staticIpGw": null, + "gettingDNS": "dhcp", + "staticDnsIp1": null, + "staticDnsIp2": null, + "peerInfoList": [], + "deviceName": "Default Device Name", + "locationData": null, + "locallyConfiguredMgmtVlan": 0, + "locallyConfigured": false, + "deploymentType": "CEILING", + "syntheticClientEnabled": null, + "frameReportThrottleEnabled": true, + "antennaType": "OMNI", + "costSavingEventsEnabled": true, + "forwardMode": "BRIDGE", + "radioMap": { + "is2dot4GHz": { + "model_type": "ElementRadioConfiguration", + "radioType": "is2dot4GHz", + "channelNumber": 6, + "manualChannelNumber": 6, + "backupChannelNumber": 11, + "autoChannelSelection": false, + "channelBandwidth": "is20MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 6 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 6 }, - "is5GHzL" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is5GHzL", - "channelNumber" : 36, - "manualChannelNumber" : 36, - "backupChannelNumber" : 44, - "autoChannelSelection" : true, - "channelBandwidth" : "is80MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "is5GHzU": { + "model_type": "ElementRadioConfiguration", + "radioType": "is5GHzU", + "channelNumber": 149, + "manualChannelNumber": 149, + "backupChannelNumber": 154, + "autoChannelSelection": false, + "channelBandwidth": "is80MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 36 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 149 }, - "is5GHzU" : { - "model_type" : "ElementRadioConfiguration", - "radioType" : "is5GHzU", - "channelNumber" : 149, - "manualChannelNumber" : 149, - "backupChannelNumber" : 154, - "autoChannelSelection" : true, - "channelBandwidth" : "is80MHz", - "bannedChannels" : [ ], - "rxCellSizeDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "is5GHzL": { + "model_type": "ElementRadioConfiguration", + "radioType": "is5GHzL", + "channelNumber": 36, + "manualChannelNumber": 36, + "backupChannelNumber": 44, + "autoChannelSelection": false, + "channelBandwidth": "is80MHz", + "bannedChannels": [], + "allowedChannels": [], + "rxCellSizeDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "probeResponseThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "probeResponseThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "clientDisconnectThresholdDb" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : -90 + "clientDisconnectThresholdDb": { + "model_type": "AutoOrManualValue", + "auto": true, + "value": -90 }, - "eirpTxPower" : { - "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "eirpTxPower": { + "model_type": "AutoOrManualValue", + "auto": false, + "value": 32 }, - "bestApEnabled" : null, - "neighbouringListApConfig" : { - "model_type" : "NeighbouringAPListConfiguration", - "minSignal" : -85, - "maxAps" : 25 + "bestApEnabled": null, + "neighbouringListApConfig": { + "model_type": "NeighbouringAPListConfiguration", + "minSignal": -85, + "maxAps": 25 }, - "minAutoCellSize" : -80, - "perimeterDetectionEnabled" : true, - "bestAPSteerType" : "both", - "deauthAttackDetection" : null, - "allowedChannelsPowerLevels" : [ ], - "activeChannel" : 149 + "minAutoCellSize": -80, + "perimeterDetectionEnabled": true, + "bestAPSteerType": "both", + "deauthAttackDetection": null, + "allowedChannelsPowerLevels": [], + "activeChannel": 36 } }, - "advancedRadioMap" : { - "is2dot4GHz" : { - "model_type" : "RadioConfiguration", - "radioType" : "is2dot4GHz", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeN", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "advancedRadioMap": { + "is2dot4GHz": { + "model_type": "RadioConfiguration", + "radioType": "is2dot4GHz", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeN", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 20, - "minLoadFactor" : 50 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 20, + "minLoadFactor": 50 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null }, - "is5GHzU" : { - "model_type" : "RadioConfiguration", - "radioType" : "is5GHzU", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeAC", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "is5GHzU": { + "model_type": "RadioConfiguration", + "radioType": "is5GHzU", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeAC", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 30, - "minLoadFactor" : 40 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 30, + "minLoadFactor": 40 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null }, - "is5GHzL" : { - "model_type" : "RadioConfiguration", - "radioType" : "is5GHzL", - "radioAdminState" : "enabled", - "fragmentationThresholdBytes" : 2346, - "rtsCtsThreshold" : 65535, - "autoChannelSelection" : "disabled", - "radioMode" : "modeAC", - "mimoMode" : "twoByTwo", - "wmmState" : "enabled", - "uapsdState" : "enabled", - "maxNumClients" : 100, - "stationIsolation" : "disabled", - "multicastRate" : "auto", - "managementRate" : "auto", - "activeScanSettings" : { - "model_type" : "ActiveScanSettings", - "enabled" : true, - "scanFrequencySeconds" : 10, - "scanDurationMillis" : 65 + "is5GHzL": { + "model_type": "RadioConfiguration", + "radioType": "is5GHzL", + "radioAdminState": "enabled", + "fragmentationThresholdBytes": 2346, + "rtsCtsThreshold": 65535, + "autoChannelSelection": "disabled", + "radioMode": "modeAC", + "mimoMode": "twoByTwo", + "wmmState": "enabled", + "uapsdState": "enabled", + "maxNumClients": 100, + "stationIsolation": "disabled", + "multicastRate": "auto", + "managementRate": "auto", + "activeScanSettings": { + "model_type": "ActiveScanSettings", + "enabled": true, + "scanFrequencySeconds": 10, + "scanDurationMillis": 65 }, - "channelHopSettings" : { - "model_type" : "ChannelHopSettings", - "noiseFloorThresholdInDB" : -75, - "noiseFloorThresholdTimeInSeconds" : 180, - "nonWifiThresholdInPercentage" : 50, - "nonWifiThresholdTimeInSeconds" : 180, - "obssHopMode" : "NON_WIFI" + "channelHopSettings": { + "model_type": "ChannelHopSettings", + "noiseFloorThresholdInDB": -75, + "noiseFloorThresholdTimeInSeconds": 180, + "nonWifiThresholdInPercentage": 50, + "nonWifiThresholdTimeInSeconds": 180, + "obssHopMode": "NON_WIFI" }, - "bestApSettings" : { - "model_type" : "RadioBestApSettings", - "mlComputed" : true, - "dropInSnrPercentage" : 30, - "minLoadFactor" : 40 + "bestApSettings": { + "model_type": "RadioBestApSettings", + "mlComputed": true, + "dropInSnrPercentage": 30, + "minLoadFactor": 40 }, - "forceScanDuringVoice" : "disabled", - "legacyBSSRate" : "enabled", - "beaconInterval" : 100, - "deauthAttackDetection" : null + "forceScanDuringVoice": "disabled", + "legacyBSSRate": "enabled", + "beaconInterval": 100, + "deauthAttackDetection": null } } }, - "latitude" : null, - "longitude" : null, - "serial" : "21P10C68818122", - "createdTimestamp" : 1590607072871, - "lastModifiedTimestamp" : 1590607073116 -} + "latitude": null, + "longitude": null, + "serial": "21P10C68818122", + "createdTimestamp": 1591653239821, + "lastModifiedTimestamp": 1591653241398 +} \ No newline at end of file diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json index 31bf667..8420e24 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json @@ -1,50 +1,54 @@ { - "model_type" : "Profile", - "id" : 3, - "customerId" : 2, - "profileType" : "equipment_ap", - "name" : "autoprovisionedApProfile", - "details" : { - "model_type" : "ApNetworkConfiguration", - "networkConfigVersion" : "AP-1", - "equipmentType" : "AP", - "vlanNative" : true, - "vlan" : 0, - "ntpServer" : { - "model_type" : "AutoOrManualString", - "auto" : true, - "value" : "pool.ntp.org" + "model_type": "Profile", + "id": 5, + "customerId": 2, + "profileType": "equipment_ap", + "name": "DefaultApProfile", + "details": { + "model_type": "ApNetworkConfiguration", + "networkConfigVersion": "AP-1", + "equipmentType": "AP", + "vlanNative": true, + "vlan": 0, + "ntpServer": { + "model_type": "AutoOrManualString", + "auto": true, + "value": "pool.ntp.org" }, - "syslogRelay" : null, - "rtlsSettings" : null, - "syntheticClientEnabled" : true, - "ledControlEnabled" : true, - "equipmentDiscovery" : false, - "radioMap" : { - "is5GHz" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "syslogRelay": null, + "rtlsSettings": null, + "syntheticClientEnabled": true, + "ledControlEnabled": true, + "equipmentDiscovery": false, + "radioMap": { + "is5GHz": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is2dot4GHz" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is2dot4GHz": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is5GHzU" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is5GHzU": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" }, - "is5GHzL" : { - "model_type" : "RadioProfileConfiguration", - "bestApEnabled" : true, - "bestAPSteerType" : "both" + "is5GHzL": { + "model_type": "RadioProfileConfiguration", + "bestApEnabled": true, + "bestAPSteerType": "both" } }, - "profileType" : "equipment_ap" + "profileType": "equipment_ap" }, - "createdTimestamp" : 1590607072994, - "lastModifiedTimestamp" : 1590607073083, - "childProfileIds" : [ 4, 5, 6 ] + "createdTimestamp": 1591653239947, + "lastModifiedTimestamp": 1591654336724, + "childProfileIds": [ + 6, + 7, + 8 + ] } \ No newline at end of file diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileRadius.json b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileRadius.json new file mode 100644 index 0000000..322a581 --- /dev/null +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileRadius.json @@ -0,0 +1,34 @@ +[ +{ + "model_type": "Profile", + "id": 1, + "customerId": 2, + "profileType": "radius", + "name": "RadiusProfileOttawa", + "details": { + "model_type": "RadiusProfile", + "subnetConfiguration": null, + "serviceRegionMap": { + "Ottawa": { + "model_type": "RadiusServiceRegion", + "serverMap": { + "RadiusProfileOttawa": [ + { + "model_type": "RadiusServer", + "ipAddress": "Mikes-MacBook-Pro.local", + "secret": "testing123", + "authPort": 1812, + "timeout": null + } + ] + }, + "regionName": "Ottawa" + } + }, + "profileType": "radius" + }, + "createdTimestamp": 1591653174195, + "lastModifiedTimestamp": 1591653174195, + "childProfileIds": [] +} +] \ No newline at end of file diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileSsid.json b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileSsid.json index 6648bc7..88df143 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileSsid.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileSsid.json @@ -1,176 +1,184 @@ [ { - "model_type" : "Profile", - "id" : 4, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid", - "appliedRadios" : [ "is2dot4GHz" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 6, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-2g", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-2g", + "appliedRadios": [ + "is2dot4GHz" + ], + "ssidAdminState": "enabled", + "secureMode": "wpa2PSK", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": null, + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073026, - "lastModifiedTimestamp" : 1590607073026, - "childProfileIds" : [ ] + "createdTimestamp": 1591653239983, + "lastModifiedTimestamp": 1591653239983, + "childProfileIds": [] }, { - "model_type" : "Profile", - "id" : 5, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid-5l", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid-5l", - "appliedRadios" : [ "is5GHzL" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 7, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-5gl", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-5gl", + "appliedRadios": [ + "is5GHzL" + ], + "ssidAdminState": "enabled", + "secureMode": "wpaEAP", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": "RadiusProfileOttawa", + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073044, - "lastModifiedTimestamp" : 1590607073044, - "childProfileIds" : [ ] + "createdTimestamp": 1591653240017, + "lastModifiedTimestamp": 1591654215374, + "childProfileIds": [ + 1 + ] }, { - "model_type" : "Profile", - "id" : 6, - "customerId" : 2, - "profileType" : "ssid", - "name" : "autoProvisionedSsid-5u", - "details" : { - "model_type" : "SsidConfiguration", - "ssid" : "autoProvisionedSsid-5u", - "appliedRadios" : [ "is5GHzU" ], - "ssidAdminState" : "enabled", - "secureMode" : "wpa2PSK", - "vlanId" : 1, - "keyStr" : "12345678", - "broadcastSsid" : "enabled", - "keyRefresh" : 0, - "noLocalSubnets" : false, - "radiusServiceName" : null, - "captivePortalId" : null, - "bandwidthLimitDown" : 0, - "bandwidthLimitUp" : 0, - "videoTrafficOnly" : false, - "radioBasedConfigs" : { - "is5GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "model_type": "Profile", + "id": 8, + "customerId": 2, + "profileType": "ssid", + "name": "DefaultSsid-5gu", + "details": { + "model_type": "SsidConfiguration", + "ssid": "Default-SSID-5gu", + "appliedRadios": [ + "is5GHzU" + ], + "ssidAdminState": "enabled", + "secureMode": "wpa2PSK", + "vlanId": 1, + "keyStr": "12345678", + "broadcastSsid": "enabled", + "keyRefresh": 0, + "noLocalSubnets": false, + "radiusServiceName": null, + "captivePortalId": null, + "bandwidthLimitDown": 0, + "bandwidthLimitUp": 0, + "videoTrafficOnly": false, + "radioBasedConfigs": { + "is5GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is2dot4GHz" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is2dot4GHz": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzU" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzU": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null }, - "is5GHzL" : { - "model_type" : "RadioBasedSsidConfiguration", - "enable80211r" : null, - "enable80211k" : null, - "enable80211v" : null + "is5GHzL": { + "model_type": "RadioBasedSsidConfiguration", + "enable80211r": null, + "enable80211k": null, + "enable80211v": null } }, - "bonjourGatewayProfileId" : null, - "enable80211w" : null, - "wepConfig" : null, - "forwardMode" : null, - "profileType" : "ssid" + "bonjourGatewayProfileId": null, + "enable80211w": null, + "wepConfig": null, + "forwardMode": null, + "profileType": "ssid" }, - "createdTimestamp" : 1590607073065, - "lastModifiedTimestamp" : 1590607073065, - "childProfileIds" : [ ] + "createdTimestamp": 1591654301763, + "lastModifiedTimestamp": 1591654301763, + "childProfileIds": [] } ] \ No newline at end of file diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/config_2_ssids.json b/opensync-gateway-static-process/src/main/resources/app/opensync/config_2_ssids.json index c28975d..401c918 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/config_2_ssids.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/config_2_ssids.json @@ -3,7 +3,7 @@ "radioConfig" : { "model_type" : "OpensyncAPRadioConfig", "country" : "CA", - "radioChannel24G" : 1, + "radioChannel24G" : 6, "radioChannel5LG" : 44, "radioChannel5HG" : 108 }, diff --git a/opensync-gateway-static-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) static.launch b/opensync-gateway-static-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) static.launch index ee01d1d..55863d6 100644 --- a/opensync-gateway-static-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) static.launch +++ b/opensync-gateway-static-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) static.launch @@ -11,7 +11,8 @@ + - + diff --git a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/ConnectusOvsdbClient.java b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/ConnectusOvsdbClient.java index bee53f0..4dd3841 100644 --- a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/ConnectusOvsdbClient.java +++ b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/ConnectusOvsdbClient.java @@ -186,15 +186,6 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface { String apId = clientCn + "_" + connectNodeInfo.serialNumber; OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId); - ovsdbDao.configureStats(ovsdbClient); - - // Check if device stats is configured in Wifi_Stats_Config table, - // provision it - // if needed - if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) { - ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats); - } - try { ovsdbDao.provisionBridgePortInterface(ovsdbClient); } @@ -209,6 +200,15 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface { ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig); ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig); } + + ovsdbDao.configureStats(ovsdbClient); + + // Check if device stats is configured in Wifi_Stats_Config table, + // provision it + // if needed + if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) { + ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats); + } // ovsdbDao.configureWifiInet(ovsdbClient); diff --git a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java index a8dd862..6a847b0 100644 --- a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java +++ b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java @@ -12,6 +12,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,6 +43,9 @@ import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiRadioConfigInf import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiStatsConfigInfo; import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiVifConfigInfo; import com.telecominfraproject.wlan.profile.models.Profile; +import com.telecominfraproject.wlan.profile.radius.models.RadiusProfile; +import com.telecominfraproject.wlan.profile.radius.models.RadiusServer; +import com.telecominfraproject.wlan.profile.radius.models.RadiusServiceRegion; import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration; import com.vmware.ovsdb.exception.OvsdbClientException; import com.vmware.ovsdb.protocol.methods.RowUpdate; @@ -70,6 +74,9 @@ public class OvsdbDao { @org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.managerAddr:3.88.149.10}") private String managerIpAddr; + @org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.region:Ottawa}") + public String region; + @org.springframework.beans.factory.annotation.Value("${connectus.ovsdb.listenPort:6640}") private int ovsdbListenPort; @@ -1973,18 +1980,46 @@ public class OvsdbDao { opensyncSecurityMode = "WPA-PSK"; } else if (ssidSecurityMode.equals("wep")) { opensyncSecurityMode = "WEP"; - } else if (ssidSecurityMode.equals("wepEAP")) { - opensyncSecurityMode = "WEP-EAP"; + } else if (ssidSecurityMode.equals("wpaEAP")) { + opensyncSecurityMode = "WPA-EAP"; + } security.put("encryption", opensyncSecurityMode); // key and mode is N/A for OPEN security if (!opensyncSecurityMode.equals("OPEN")) { - security.put("key", ssidConfig.getKeyStr()); - if (ssidSecurityMode.equals("wpa2PSK") || ssidSecurityMode.equals("wepEAP") - || ssidSecurityMode.equals("wpa2OnlyPSK")) { + if (ssidSecurityMode.equals("wpa2PSK") || ssidSecurityMode.equals("wpa2OnlyPSK")) { + security.put("key", ssidConfig.getKeyStr()); security.put("mode", "2"); + } else if (opensyncSecurityMode.equals("WPA-EAP")) { + security.put("mode", "2"); + // Has Radius ? + List radiusServiceList = new ArrayList(); + radiusServiceList = opensyncApConfig.getRadiusProfiles().stream() + .filter(p -> p.getName().equals((ssidConfig.getRadiusServiceName()))) + .collect(Collectors.toList()); + if (!radiusServiceList.isEmpty()) { + Profile profileRadius = radiusServiceList.get(0); + String region = opensyncApConfig.getEquipmentLocation().getName(); + List radiusServerList = new ArrayList(); + RadiusProfile radiusProfileDetails = ((RadiusProfile) profileRadius.getDetails()); + LOG.debug("Radius Profile Details {}", radiusProfileDetails.toPrettyString()); + RadiusServiceRegion radiusServiceRegion = radiusProfileDetails.findServiceRegion(region); + LOG.debug("Radius Service Region {}", radiusServiceRegion.toPrettyString()); + + radiusServerList = radiusServiceRegion + .findServerConfiguration(ssidConfig.getRadiusServiceName()); + if (!radiusServerList.isEmpty()) { + + RadiusServer rServer = radiusServerList.get(0); + security.put("radius_server_ip", rServer.getIpAddress().getHostAddress()); + security.put("radius_server_port", String.valueOf(rServer.getAuthPort())); + security.put("radius_server_secret", rServer.getSecret()); + + } + } } else { + security.put("key", ssidConfig.getKeyStr()); security.put("mode", "1"); } } @@ -2247,7 +2282,6 @@ public class OvsdbDao { try { List operations = new ArrayList<>(); - Map updateColumns = new HashMap<>(); Map thresholdMap = new HashMap<>(); thresholdMap.put("max_delay", 600); thresholdMap.put("util", 10); @@ -2256,15 +2290,15 @@ public class OvsdbDao { com.vmware.ovsdb.protocol.operation.notation.Map thresholds = com.vmware.ovsdb.protocol.operation.notation.Map .of(thresholdMap); -// provisionWifiStatsConfigDevice(getProvisionedWifiStatsConfigs(ovsdbClient), operations, updateColumns); + Map radioConfigs = getProvisionedWifiRadioConfigs(ovsdbClient); + provisionWifiStatsConfigSurvey(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations, + thresholds); - provisionWifiStatsConfigSurvey(getProvisionedWifiStatsConfigs(ovsdbClient), operations, thresholds); + provisionWifiStatsConfigNeighbor(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations); - provisionWifiStatsConfigNeighbor(getProvisionedWifiStatsConfigs(ovsdbClient), operations); + provisionWifiStatsConfigClient(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations); - provisionWifiStatsConfigClient(getProvisionedWifiStatsConfigs(ovsdbClient), operations); - - provisionWifiStatsRssi(getProvisionedWifiStatsConfigs(ovsdbClient), operations); + provisionWifiStatsRssi(radioConfigs, getProvisionedWifiStatsConfigs(ovsdbClient), operations); if (!operations.isEmpty()) { CompletableFuture fResult = ovsdbClient.transact(ovsdbName, operations); @@ -2284,66 +2318,130 @@ public class OvsdbDao { } } - private void provisionWifiStatsRssi(Map provisionedWifiStatsConfigs, - List operations) { - Map updateColumns; - Row row; - for (String band : new String[] { "2.4G", "5GL", "5GU" }) { - if (!provisionedWifiStatsConfigs.containsKey(band + "_rssi_on-chan")) { - updateColumns = new HashMap<>(); - updateColumns.put("radio_type", new Atom<>(band)); - updateColumns.put("reporting_count", new Atom<>(0)); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(10)); - updateColumns.put("stats_type", new Atom<>("rssi")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); - updateColumns.put("survey_type", new Atom<>("on-chan")); - row = new Row(updateColumns); + private void provisionWifiStatsRssi(Map radioConfigs, + Map provisionedWifiStatsConfigs, List operations) { + + radioConfigs.values().stream().forEach(rc -> { + if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_rssi")) { + // + Map rowColumns = new HashMap<>(); + Set channelSet = new HashSet(); + channelSet.add(Long.valueOf(rc.channel)); + rowColumns.put("channel_list", com.vmware.ovsdb.protocol.operation.notation.Set.of(channelSet)); + 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<>(30)); + rowColumns.put("report_type", new Atom<>("raw")); +// rowColumns.put("survey_type", new Atom<>("on-chan")); + + Row updateRow = new Row(rowColumns); + operations.add(new Insert(wifiStatsConfigDbTable, updateRow)); - operations.add(new Insert(wifiStatsConfigDbTable, row)); } - - } + }); } - private void provisionWifiStatsConfigNeighbor(Map provisionedWifiStatsConfigs, - List operations) { + private void provisionWifiStatsConfigNeighbor(Map radioConfigs, + Map provisionedWifiStatsConfigs, List operations) { Map updateColumns; Row row; + // For off channel, all allowed channels +// * 2412 MHz [1] (30.0 dBm) +// * 2417 MHz [2] (30.0 dBm) +// * 2422 MHz [3] (30.0 dBm) +// * 2427 MHz [4] (30.0 dBm) +// * 2432 MHz [5] (30.0 dBm) +// * 2437 MHz [6] (30.0 dBm) +// * 2442 MHz [7] (30.0 dBm) +// * 2447 MHz [8] (30.0 dBm) +// * 2452 MHz [9] (30.0 dBm) +// * 2457 MHz [10] (30.0 dBm) +// * 2462 MHz [11] (30.0 dBm) Set channelSet2g = new HashSet<>(); channelSet2g.add(1); +// channelSet2g.add(2); +// channelSet2g.add(3); +// channelSet2g.add(4); +// channelSet2g.add(5); channelSet2g.add(6); +// channelSet2g.add(7); +// channelSet2g.add(8); +// channelSet2g.add(9); +// channelSet2g.add(10); channelSet2g.add(11); + com.vmware.ovsdb.protocol.operation.notation.Set channels2g = com.vmware.ovsdb.protocol.operation.notation.Set .of(channelSet2g); Set channelSet5gl = new HashSet<>(); +// * 5180 MHz [36] (23.0 dBm) +// * 5200 MHz [40] (23.0 dBm) +// * 5220 MHz [44] (23.0 dBm) +// * 5240 MHz [48] (23.0 dBm) +// * 5260 MHz [52] (24.0 dBm) (radar detection) +// * 5280 MHz [56] (24.0 dBm) (radar detection) +// * 5300 MHz [60] (24.0 dBm) (radar detection) +// * 5320 MHz [64] (24.0 dBm) (radar detection) channelSet5gl.add(36); + channelSet5gl.add(40); channelSet5gl.add(44); - channelSet5gl.add(52); + channelSet5gl.add(48); +// channelSet5gl.add(52); +// channelSet5gl.add(56); +// channelSet5gl.add(60); +// channelSet5gl.add(64); com.vmware.ovsdb.protocol.operation.notation.Set channels5gl = com.vmware.ovsdb.protocol.operation.notation.Set .of(channelSet5gl); Set channelSet5gu = new HashSet<>(); - channelSet5gu.add(100); - channelSet5gu.add(108); - channelSet5gu.add(116); +// * 5500 MHz [100] (24.0 dBm) (radar detection) +// * 5520 MHz [104] (24.0 dBm) (radar detection) +// * 5540 MHz [108] (24.0 dBm) (radar detection) +// * 5560 MHz [112] (24.0 dBm) (radar detection) +// * 5580 MHz [116] (24.0 dBm) (radar detection) +// * 5600 MHz [120] (disabled) +// * 5620 MHz [124] (disabled) +// * 5640 MHz [128] (disabled) +// * 5660 MHz [132] (24.0 dBm) (radar detection) +// * 5680 MHz [136] (24.0 dBm) (radar detection) +// * 5700 MHz [140] (24.0 dBm) (radar detection) +// * 5720 MHz [144] (24.0 dBm) (radar detection) +// * 5745 MHz [149] (30.0 dBm) +// * 5765 MHz [153] (30.0 dBm) +// * 5785 MHz [157] (30.0 dBm) +// * 5805 MHz [161] (30.0 dBm) +// * 5825 MHz [165] (30.0 dBm) +// channelSet5gu.add(100); +// channelSet5gu.add(104); +// channelSet5gu.add(108); +// channelSet5gu.add(112); +// channelSet5gu.add(116); +// channelSet5gu.add(132); +// channelSet5gu.add(136); +// channelSet5gu.add(140); +// channelSet5gu.add(144); + channelSet5gu.add(149); + channelSet5gu.add(153); + channelSet5gu.add(157); + channelSet5gu.add(161); + channelSet5gu.add(165); + com.vmware.ovsdb.protocol.operation.notation.Set channels5gu = com.vmware.ovsdb.protocol.operation.notation.Set .of(channelSet5gu); if (!provisionedWifiStatsConfigs.containsKey("2.4G_neighbor_off-chan")) { - updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels2g); updateColumns.put("radio_type", new Atom<>("2.4G")); - updateColumns.put("reporting_interval", new Atom<>(120)); - updateColumns.put("sampling_interval", new Atom<>(0)); + updateColumns.put("reporting_interval", new Atom<>(1800)); + updateColumns.put("report_type", new Atom<>("raw")); + updateColumns.put("sampling_interval", new Atom<>(60)); updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); + updateColumns.put("survey_interval_ms", new Atom<>(30)); updateColumns.put("survey_type", new Atom<>("off-chan")); - // updateColumns.put("threshold", thresholds ); - row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); @@ -2354,13 +2452,12 @@ public class OvsdbDao { updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels5gl); updateColumns.put("radio_type", new Atom<>("5GL")); - updateColumns.put("reporting_interval", new Atom<>(120)); - updateColumns.put("sampling_interval", new Atom<>(0)); + updateColumns.put("reporting_interval", new Atom<>(1800)); + updateColumns.put("report_type", new Atom<>("raw")); + updateColumns.put("sampling_interval", new Atom<>(45)); updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); + updateColumns.put("survey_interval_ms", new Atom<>(30)); updateColumns.put("survey_type", new Atom<>("off-chan")); - // updateColumns.put("threshold", thresholds ); - row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); @@ -2371,72 +2468,43 @@ public class OvsdbDao { updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels5gu); updateColumns.put("radio_type", new Atom<>("5GU")); - updateColumns.put("reporting_interval", new Atom<>(120)); - updateColumns.put("sampling_interval", new Atom<>(0)); + updateColumns.put("reporting_interval", new Atom<>(1800)); + updateColumns.put("report_type", new Atom<>("raw")); + updateColumns.put("sampling_interval", new Atom<>(36)); updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); + updateColumns.put("survey_interval_ms", new Atom<>(30)); updateColumns.put("survey_type", new Atom<>("off-chan")); - // updateColumns.put("threshold", thresholds ); - row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); } - if (!provisionedWifiStatsConfigs.containsKey("5GU_neighbor_on-chan")) { - // - updateColumns = new HashMap<>(); - // updateColumns.put("channel_list", channels ); - updateColumns.put("radio_type", new Atom<>("5GU")); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(0)); - updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); - updateColumns.put("survey_type", new Atom<>("on-chan")); - // updateColumns.put("threshold", thresholds ); + radioConfigs.values().stream().forEach(rc -> { + if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_neighbor_on-chan")) { + // + Map rowColumns = new HashMap<>(); + Set channelSet = new HashSet(); + channelSet.add(Long.valueOf(rc.channel)); + rowColumns.put("channel_list", com.vmware.ovsdb.protocol.operation.notation.Set.of(channelSet)); + rowColumns.put("radio_type", new Atom<>(rc.freqBand)); + rowColumns.put("reporting_interval", new Atom<>(60)); + rowColumns.put("report_type", new Atom<>("raw")); + rowColumns.put("sampling_interval", new Atom<>(6)); + rowColumns.put("stats_type", new Atom<>("neighbor")); + rowColumns.put("survey_interval_ms", new Atom<>(30)); + rowColumns.put("survey_type", new Atom<>("on-chan")); - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); - // - } + Row updateRow = new Row(rowColumns); + operations.add(new Insert(wifiStatsConfigDbTable, updateRow)); - if (!provisionedWifiStatsConfigs.containsKey("5GL_neighbor_on-chan")) { - // - updateColumns = new HashMap<>(); - // updateColumns.put("channel_list", channels ); - updateColumns.put("radio_type", new Atom<>("5GL")); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(0)); - updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); - updateColumns.put("survey_type", new Atom<>("on-chan")); - // updateColumns.put("threshold", thresholds ); + } + }); - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); - // - } - - if (!provisionedWifiStatsConfigs.containsKey("2.4G_neighbor_on-chan")) { - // - updateColumns = new HashMap<>(); - // updateColumns.put("channel_list", channels ); - updateColumns.put("radio_type", new Atom<>("2.4G")); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(0)); - updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); - updateColumns.put("survey_type", new Atom<>("on-chan")); - // updateColumns.put("threshold", thresholds ); - - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); - // - } } - private void provisionWifiStatsConfigSurvey(Map provisionedWifiStatsConfigs, - List operations, com.vmware.ovsdb.protocol.operation.notation.Map thresholds) { + private void provisionWifiStatsConfigSurvey(Map radioConfigs, + Map provisionedWifiStatsConfigs, List operations, + com.vmware.ovsdb.protocol.operation.notation.Map thresholds) { Set channelSet2g = new HashSet<>(); channelSet2g.add(1); @@ -2447,167 +2515,122 @@ public class OvsdbDao { Set channelSet5gl = new HashSet<>(); channelSet5gl.add(36); + channelSet5gl.add(40); channelSet5gl.add(44); - channelSet5gl.add(52); + channelSet5gl.add(48); com.vmware.ovsdb.protocol.operation.notation.Set channels5gl = com.vmware.ovsdb.protocol.operation.notation.Set .of(channelSet5gl); Set channelSet5gu = new HashSet<>(); - channelSet5gu.add(100); - channelSet5gu.add(108); - channelSet5gu.add(116); + channelSet5gu.add(149); + channelSet5gu.add(153); + channelSet5gu.add(157); + channelSet5gu.add(161); + channelSet5gu.add(165); com.vmware.ovsdb.protocol.operation.notation.Set channels5gu = com.vmware.ovsdb.protocol.operation.notation.Set .of(channelSet5gu); Map updateColumns; Row row; - if (!provisionedWifiStatsConfigs.containsKey("2.4G_survey_on-chan")) { - // - updateColumns = new HashMap<>(); - updateColumns.put("radio_type", new Atom<>("2.4G")); - updateColumns.put("reporting_count", new Atom<>(0)); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(10)); - updateColumns.put("stats_type", new Atom<>("survey")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); - updateColumns.put("survey_type", new Atom<>("on-chan")); - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); - // - } + radioConfigs.values().stream().forEach(rc -> { + if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_survey_on-chan")) { - if (!provisionedWifiStatsConfigs.containsKey("5GL_survey_on-chan")) { - // - updateColumns = new HashMap<>(); - updateColumns.put("radio_type", new Atom<>("5GL")); - updateColumns.put("reporting_count", new Atom<>(0)); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(10)); - updateColumns.put("stats_type", new Atom<>("survey")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); - updateColumns.put("survey_type", new Atom<>("on-chan")); - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); - // - } + Map rowColumns = new HashMap<>(); + Set channelSet = new HashSet(); + channelSet.add(Long.valueOf(rc.channel)); + rowColumns.put("channel_list", com.vmware.ovsdb.protocol.operation.notation.Set.of(channelSet)); + rowColumns.put("radio_type", new Atom<>(rc.freqBand)); + rowColumns.put("reporting_interval", new Atom<>(60)); + rowColumns.put("report_type", new Atom<>("raw")); + rowColumns.put("sampling_interval", new Atom<>(6)); + rowColumns.put("stats_type", new Atom<>("survey")); + rowColumns.put("survey_interval_ms", new Atom<>(30)); + rowColumns.put("survey_type", new Atom<>("on-chan")); - if (!provisionedWifiStatsConfigs.containsKey("5GU_survey_on-chan")) { - updateColumns = new HashMap<>(); - updateColumns.put("radio_type", new Atom<>("5GU")); - updateColumns.put("reporting_count", new Atom<>(0)); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(10)); - updateColumns.put("stats_type", new Atom<>("survey")); - updateColumns.put("survey_interval_ms", new Atom<>(0)); - updateColumns.put("survey_type", new Atom<>("on-chan")); - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); - } + Row updateRow = new Row(rowColumns); + operations.add(new Insert(wifiStatsConfigDbTable, updateRow)); + + } + }); if (!provisionedWifiStatsConfigs.containsKey("2.4G_survey_off-chan")) { - // + updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels2g); updateColumns.put("radio_type", new Atom<>("2.4G")); - updateColumns.put("reporting_interval", new Atom<>(0)); - updateColumns.put("sampling_interval", new Atom<>(0)); + updateColumns.put("reporting_interval", new Atom<>(1800)); + updateColumns.put("report_type", new Atom<>("raw")); + updateColumns.put("sampling_interval", new Atom<>(60)); updateColumns.put("stats_type", new Atom<>("survey")); - updateColumns.put("survey_interval_ms", new Atom<>(10)); + updateColumns.put("survey_interval_ms", new Atom<>(30)); updateColumns.put("survey_type", new Atom<>("off-chan")); updateColumns.put("threshold", thresholds); row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); - // + } if (!provisionedWifiStatsConfigs.containsKey("5GL_survey_off-chan")) { - // + updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels5gl); updateColumns.put("radio_type", new Atom<>("5GL")); - updateColumns.put("reporting_interval", new Atom<>(0)); - updateColumns.put("sampling_interval", new Atom<>(0)); + updateColumns.put("reporting_interval", new Atom<>(1800)); + updateColumns.put("report_type", new Atom<>("raw")); + updateColumns.put("sampling_interval", new Atom<>(45)); updateColumns.put("stats_type", new Atom<>("survey")); - updateColumns.put("survey_interval_ms", new Atom<>(10)); + updateColumns.put("survey_interval_ms", new Atom<>(30)); updateColumns.put("survey_type", new Atom<>("off-chan")); updateColumns.put("threshold", thresholds); row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); - // + } if (!provisionedWifiStatsConfigs.containsKey("5GU_survey_off-chan")) { - // + updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels5gu); updateColumns.put("radio_type", new Atom<>("5GU")); - updateColumns.put("reporting_interval", new Atom<>(0)); - updateColumns.put("sampling_interval", new Atom<>(0)); + updateColumns.put("reporting_interval", new Atom<>(1800)); + updateColumns.put("report_type", new Atom<>("raw")); + updateColumns.put("sampling_interval", new Atom<>(30)); updateColumns.put("stats_type", new Atom<>("survey")); - updateColumns.put("survey_interval_ms", new Atom<>(10)); + updateColumns.put("survey_interval_ms", new Atom<>(30)); updateColumns.put("survey_type", new Atom<>("off-chan")); updateColumns.put("threshold", thresholds); row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); - // + } } -// private void provisionWifiStatsConfigDevice(Map provisionedWifiStatsConfigs, -// List operations, Map updateColumns) { -// Row row; -// if (!provisionedWifiStatsConfigs.containsKey("2.4G_device")) { -// updateColumns.put("radio_type", new Atom<>("2.4G")); -// updateColumns.put("reporting_interval", new Atom<>(900)); -// updateColumns.put("sampling_interval", new Atom<>(0)); -// updateColumns.put("stats_type", new Atom<>("device")); -// row = new Row(updateColumns); -// operations.add(new Insert(wifiStatsConfigDbTable, row)); -// } -// -// } + private void provisionWifiStatsConfigClient(Map radioConfigs, + Map provisionedWifiStatsConfigs, List operations) { - private void provisionWifiStatsConfigClient(Map provisionedWifiStatsConfigs, - List operations) { - Map updateColumns; - Row row; - if (!provisionedWifiStatsConfigs.containsKey("2.4G_client")) { - updateColumns = new HashMap<>(); - updateColumns.put("radio_type", new Atom<>("2.4G")); - updateColumns.put("reporting_count", new Atom<>(0)); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(10)); - updateColumns.put("stats_type", new Atom<>("client")); - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); - } + radioConfigs.values().stream().forEach(rc -> { + if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_client")) { + // + Map rowColumns = new HashMap<>(); + Set channelSet = new HashSet(); + channelSet.add(Long.valueOf(rc.channel)); + rowColumns.put("channel_list", com.vmware.ovsdb.protocol.operation.notation.Set.of(channelSet)); + rowColumns.put("radio_type", new Atom<>(rc.freqBand)); + rowColumns.put("reporting_interval", new Atom<>(60)); + rowColumns.put("report_type", new Atom<>("raw")); + rowColumns.put("sampling_interval", new Atom<>(6)); + rowColumns.put("stats_type", new Atom<>("client")); + rowColumns.put("survey_interval_ms", new Atom<>(30)); +// rowColumns.put("survey_type", new Atom<>("on-chan")); - if (!provisionedWifiStatsConfigs.containsKey("5GL_client")) { + Row updateRow = new Row(rowColumns); + operations.add(new Insert(wifiStatsConfigDbTable, updateRow)); - updateColumns = new HashMap<>(); - updateColumns.put("radio_type", new Atom<>("5GL")); - updateColumns.put("reporting_count", new Atom<>(0)); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(10)); - updateColumns.put("stats_type", new Atom<>("client")); - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); + } + }); - } - - if (!provisionedWifiStatsConfigs.containsKey("5GU_client")) { - - updateColumns = new HashMap<>(); - updateColumns.put("radio_type", new Atom<>("5GU")); - updateColumns.put("reporting_count", new Atom<>(0)); - updateColumns.put("reporting_interval", new Atom<>(60)); - updateColumns.put("sampling_interval", new Atom<>(10)); - updateColumns.put("stats_type", new Atom<>("client")); - row = new Row(updateColumns); - operations.add(new Insert(wifiStatsConfigDbTable, row)); - } } public String changeRedirectorAddress(OvsdbClient ovsdbClient, String apId, String newRedirectorAddress) {