mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-06 21:58:02 +00:00
adding includeProvisioned parameter to GET devices REST call to get non provisioned APs easily
Signed-off-by: Bhavesh Patel <bhavesh.patel@kinarasystems.com>
This commit is contained in:
committed by
Ivan Chvets
parent
fcdb7423ef
commit
b055711993
@@ -86,7 +86,7 @@ namespace OpenWifi {
|
||||
auto serialOnly = GetBoolParameter(RESTAPI::Protocol::SERIALONLY, false);
|
||||
auto deviceWithStatus = GetBoolParameter(RESTAPI::Protocol::DEVICEWITHSTATUS, false);
|
||||
auto completeInfo = GetBoolParameter("completeInfo", false);
|
||||
auto nonProvisioned = HasParameter("nonProvisioned", Arg);
|
||||
auto includeProvisioned = GetBoolParameter("includeProvisioned", true);
|
||||
|
||||
if(!platform.empty() && (platform!="ap" && platform!="switch" && platform!="all")) {
|
||||
return BadRequest(RESTAPI::Errors::MissingOrInvalidParameters);
|
||||
@@ -132,7 +132,7 @@ namespace OpenWifi {
|
||||
}
|
||||
} else if (serialOnly) {
|
||||
std::vector<std::string> SerialNumbers;
|
||||
StorageService()->GetDeviceSerialNumbers(QB_.Offset, QB_.Limit, SerialNumbers, OrderBy, platform, nonProvisioned);
|
||||
StorageService()->GetDeviceSerialNumbers(QB_.Offset, QB_.Limit, SerialNumbers, OrderBy, platform, includeProvisioned);
|
||||
Poco::JSON::Array Objects;
|
||||
for (const auto &i : SerialNumbers) {
|
||||
Objects.add(i);
|
||||
@@ -150,7 +150,7 @@ namespace OpenWifi {
|
||||
RetObj.set("serialNumbers", Objects);
|
||||
} else {
|
||||
std::vector<GWObjects::Device> Devices;
|
||||
StorageService()->GetDevices(QB_.Offset, QB_.Limit, Devices, OrderBy, platform, nonProvisioned);
|
||||
StorageService()->GetDevices(QB_.Offset, QB_.Limit, Devices, OrderBy, platform, includeProvisioned);
|
||||
Poco::JSON::Array Objects;
|
||||
for (const auto &i : Devices) {
|
||||
Poco::JSON::Object Obj;
|
||||
|
||||
Reference in New Issue
Block a user