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