diff --git a/build b/build index dec2bf5..b5045cc 100644 --- a/build +++ b/build @@ -1 +1 @@ -19 \ No newline at end of file +21 \ No newline at end of file diff --git a/openapi/owprov.yaml b/openapi/owprov.yaml index 55705ef..a3b032b 100644 --- a/openapi/owprov.yaml +++ b/openapi/owprov.yaml @@ -2066,19 +2066,12 @@ paths: default: false required: false - in: query - description: return the list of devices under RRM + description: return the list of devices for a subscriber name: subscriber schema: type: string format: uuid required: false - - in: query - description: return RRM settings for a specific device - name: rrmSettings - schema: - type: boolean - default: false - required: false - in: query description: return the resolved configuration for a specific device name: resolveConfig @@ -2144,6 +2137,13 @@ paths: type: string format: uuid required: false + - in: query + description: return RRM settings for a specific device + name: rrmSettings + schema: + type: boolean + default: false + required: false responses: 200: description: Succesful retrieve configuratiopn or part of the configuration @@ -2416,6 +2416,14 @@ paths: type: boolean default: false required: false + - in: query + description: list venues that use a specific RRM vendor + name: RRMvendor + schema: + type: string + example: + - this is the shortname of the RRM vendor + required: false responses: 200: description: Return a list of venues. diff --git a/src/APConfig.cpp b/src/APConfig.cpp index e696b26..b1cd2fe 100644 --- a/src/APConfig.cpp +++ b/src/APConfig.cpp @@ -132,11 +132,10 @@ namespace OpenWifi { if (StorageService()->InventoryDB().GetRecord("serialNumber", SerialNumber_, D)) { if (!D.deviceConfiguration.empty()) { - std::cout << "Adding device specific configuration: " - << D.deviceConfiguration.size() << std::endl; + // std::cout << "Adding device specific configuration: " << D.deviceConfiguration.size() << std::endl; AddConfiguration(D.deviceConfiguration); } else { - std::cout << "No device specific configuration." << std::endl; + // std::cout << "No device specific configuration." << std::endl; } if (!D.entity.empty()) { AddEntityConfig(D.entity); @@ -196,8 +195,7 @@ namespace OpenWifi { ReplaceVariablesInObject(OriginalSection, ExpandedSection); Configuration->set(SectionName, ExpandedSection); } else { - std::cout << " --- unknown element type --- " - << O->get(SectionName).toString() << std::endl; + poco_warning(Logger(), fmt::format("Unknown config element type: {}",O->get(SectionName).toString())); } } else { if (Explain_) { @@ -248,8 +246,7 @@ namespace OpenWifi { "channel", std::strtoull(col.parameterValue.c_str(), nullptr, 10)); } - std::cout << "Setting channel in radio " << RadioIndex - << std::endl; + // std::cout << "Setting channel in radio " << RadioIndex << std::endl; if (Explain_) { Poco::JSON::Object ExObj; ExObj.set("from-name", "overrides"); diff --git a/src/RESTAPI/RESTAPI_venue_list_handler.cpp b/src/RESTAPI/RESTAPI_venue_list_handler.cpp index 3baaffa..52d5884 100644 --- a/src/RESTAPI/RESTAPI_venue_list_handler.cpp +++ b/src/RESTAPI/RESTAPI_venue_list_handler.cpp @@ -7,5 +7,14 @@ #include "StorageService.h" namespace OpenWifi { - void RESTAPI_venue_list_handler::DoGet() { return ListHandler("venues", DB_, *this); } + void RESTAPI_venue_list_handler::DoGet() { + auto RRMvendor = GetParameter("RRMvendor",""); + if(RRMvendor.empty()) { + return ListHandler("venues", DB_, *this); + } + VenueDB::RecordVec Venues; + auto Where = fmt::format(" deviceRules LIKE '%{}%' ", RRMvendor); + DB_.GetRecords(QB_.Offset, QB_.Limit, Venues, Where, " ORDER BY name "); + return ReturnObject("venues",Venues); + } } // namespace OpenWifi \ No newline at end of file diff --git a/src/storage/storage_inventory.cpp b/src/storage/storage_inventory.cpp index 1e97acb..7f6ef56 100644 --- a/src/storage/storage_inventory.cpp +++ b/src/storage/storage_inventory.cpp @@ -85,7 +85,7 @@ namespace OpenWifi { ProvObjects::InventoryTag ExistingDevice; auto SerialNumber = Poco::toLower(SerialNumberRaw); if (!GetRecord("serialNumber", SerialNumber, ExistingDevice)) { - ProvObjects::InventoryTag NewDevice; + ProvObjects::InventoryTag NewDevice; uint64_t Now = Utils::Now(); auto Tokens = Poco::StringTokenizer(ConnectionInfo, "@:"); @@ -127,11 +127,9 @@ namespace OpenWifi { if (!FullUUID.empty()) { if (SDK::GW::Device::SetVenue(nullptr, NewDevice.serialNumber, FullUUID)) { - // std::cout << "Set GW done " << SerialNumber << std::endl; Logger().information(Poco::format("%s: GW set entity/venue property.", NewDevice.serialNumber)); } else { - // std::cout << "Could not set GW " << SerialNumber << std::endl; Logger().information(Poco::format( "%s: could not set GW entity/venue property.", NewDevice.serialNumber)); } @@ -178,7 +176,7 @@ namespace OpenWifi { if (modified) { ExistingDevice.info.modified = Utils::Now(); - StorageService()->InventoryDB().UpdateRecord("serialNumber", SerialNumber, + StorageService()->InventoryDB().UpdateRecord("id", ExistingDevice.info.id, ExistingDevice); } } diff --git a/test_scripts/curl/cli b/test_scripts/curl/cli index ae2f258..a45f37e 100755 --- a/test_scripts/curl/cli +++ b/test_scripts/curl/cli @@ -528,6 +528,14 @@ getvenuedevices() { jq < ${result_file} } +getvenuesperrrm() { + curl ${FLAGS} -X GET "https://${OWPROV}/api/v1/venue?RRMvendor=$1" \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer ${token}" \ + -H "Accept: application/json" > ${result_file} + jq < ${result_file} +} + listrrmalgos() { setrrm curl ${FLAGS} -X GET "http://${OWRRM}/api/v1/algorithms" \ @@ -546,6 +554,7 @@ rrmprovider() { jq < ${result_file} } + notifications() { if [[ -z "$1" ]] then @@ -664,6 +673,7 @@ case "$1" in "deleteoverride") login; deleteoverride "$2"; logout;; "venueupgraderevisions") login; venueupgraderevisions "$2"; logout;; "getsystemconfiguration") login; getsystemconfiguration "$2"; logout;; + "getvenuesperrrm") login; getvenuesperrrm "$2"; logout;; *) help ;; esac