mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 02:58:00 +00:00
Add automatic configuration creation.
This commit is contained in:
@@ -98,7 +98,7 @@ namespace OpenWifi{
|
||||
std::ostringstream OS;
|
||||
Configuration->stringify(OS);
|
||||
Results.appliedConfiguration = OS.str();
|
||||
Poco::JSON::Object::Ptr Response;
|
||||
auto Response=Poco::makeShared<Poco::JSON::Object>();
|
||||
Logger().debug(Poco::format("%s: Sending configuration push.",Existing.serialNumber));
|
||||
if (SDK::GW::Device::Configure(this, SerialNumber, Configuration, Response)) {
|
||||
Logger().debug(Poco::format("%s: Sending configuration pushed.",Existing.serialNumber));
|
||||
@@ -259,6 +259,12 @@ namespace OpenWifi{
|
||||
}
|
||||
*/
|
||||
|
||||
std::string ErrorText;
|
||||
auto ObjectsCreated = CreateObjects(NewObject,*this,ErrorText);
|
||||
if(!ErrorText.empty()) {
|
||||
return BadRequest(ErrorText);
|
||||
}
|
||||
|
||||
__DBG__
|
||||
if(DB_.CreateRecord(NewObject)) {
|
||||
__DBG__
|
||||
@@ -414,6 +420,12 @@ namespace OpenWifi{
|
||||
Existing.state = NewObject.state;
|
||||
}
|
||||
|
||||
std::string ErrorText;
|
||||
auto ObjectsCreated = CreateObjects(NewObject,*this,ErrorText);
|
||||
if(!ErrorText.empty()) {
|
||||
return BadRequest(ErrorText);
|
||||
}
|
||||
|
||||
if(StorageService()->InventoryDB().UpdateRecord("id", Existing.info.id, Existing)) {
|
||||
MoveUsage(StorageService()->PolicyDB(),DB_,FromPolicy,ToPolicy,Existing.info.id);
|
||||
MoveUsage(StorageService()->LocationDB(),DB_,FromLocation,ToLocation,Existing.info.id);
|
||||
|
||||
Reference in New Issue
Block a user