mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 17:52:28 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include <StorageService.h>
|
||||
#include <RadiusEndpointTypes/OrionWifi.h>
|
||||
#include <RadiusEndpointTypes/GlobalReach.h>
|
||||
#include <sdks/SDK_gw.h>
|
||||
#include <RESTObjects/RESTAPI_GWobjects.h>
|
||||
|
||||
namespace OpenWifi {
|
||||
class RadiusEndpointUpdater {
|
||||
@@ -163,7 +165,14 @@ namespace OpenWifi {
|
||||
RadiusConfig.set("pools", RadiusPools);
|
||||
RadiusConfig.stringify(std::cout,4,2);
|
||||
|
||||
AppServiceRegistry().Set("radiusEndpointLastUpdate", Utils::Now());
|
||||
GWObjects::RadiusProxyPoolList NewPools;
|
||||
if(SDK::GW::RADIUS::SetConfiguration(nullptr,RadiusConfig,NewPools)) {
|
||||
AppServiceRegistry().Set("radiusEndpointLastUpdate", Utils::Now());
|
||||
return true;
|
||||
}
|
||||
Error = "Could not update the controller.";
|
||||
ErrorNum = 1;
|
||||
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
|
||||
@@ -254,13 +254,10 @@ namespace OpenWifi::SDK::GW {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SetConfiguration(RESTAPIHandler *client, const GWObjects::RadiusProxyPoolList &Pools,
|
||||
bool SetConfiguration(RESTAPIHandler *client, const Poco::JSON::Object &Configuration,
|
||||
GWObjects::RadiusProxyPoolList &NewPools) {
|
||||
Poco::JSON::Object Body;
|
||||
Pools.to_json(Body);
|
||||
|
||||
OpenWifi::OpenAPIRequestPut R(OpenWifi::uSERVICE_GATEWAY,
|
||||
"/api/v1/radiusProxyConfig", {}, Body,
|
||||
"/api/v1/radiusProxyConfig", {}, Configuration,
|
||||
60000);
|
||||
auto CallResponse = Poco::makeShared<Poco::JSON::Object>();
|
||||
auto ResponseStatus =
|
||||
@@ -271,6 +268,13 @@ namespace OpenWifi::SDK::GW {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SetConfiguration(RESTAPIHandler *client, const GWObjects::RadiusProxyPoolList &Pools,
|
||||
GWObjects::RadiusProxyPoolList &NewPools) {
|
||||
Poco::JSON::Object Body;
|
||||
Pools.to_json(Body);
|
||||
return SetConfiguration(client,Body,NewPools);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace OpenWifi::SDK::GW
|
||||
|
||||
@@ -42,5 +42,7 @@ namespace OpenWifi::SDK::GW {
|
||||
bool GetConfiguration(RESTAPIHandler *client, GWObjects::RadiusProxyPoolList &Pools);
|
||||
bool SetConfiguration(RESTAPIHandler *client, const GWObjects::RadiusProxyPoolList &Pools,
|
||||
GWObjects::RadiusProxyPoolList &NewPools);
|
||||
bool SetConfiguration(RESTAPIHandler *client, const Poco::JSON::Object &Configuration,
|
||||
GWObjects::RadiusProxyPoolList &NewPools);
|
||||
}
|
||||
} // namespace OpenWifi::SDK::GW
|
||||
|
||||
Reference in New Issue
Block a user