mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 17:52:28 +00:00
Adding 'updateAllDevices' for venu configuration push.
This commit is contained in:
@@ -2061,6 +2061,12 @@ paths:
|
||||
type: string
|
||||
format: uuid
|
||||
required: true
|
||||
- in: query
|
||||
name: updateAllDevices
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
required: false
|
||||
requestBody:
|
||||
description: Information used to modify the new venue
|
||||
content:
|
||||
@@ -2069,8 +2075,13 @@ paths:
|
||||
$ref: '#/components/schemas/Venue'
|
||||
|
||||
responses:
|
||||
200:
|
||||
$ref: '#/components/schemas/Venue'
|
||||
description: Return venue information or list of serial number updated
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/Venue'
|
||||
- $ref: '#/components/schemas/SerialNumberList'
|
||||
403:
|
||||
$ref: '#/components/responses/Unauthorized'
|
||||
404:
|
||||
|
||||
@@ -200,6 +200,15 @@ namespace OpenWifi{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
auto updateAllDevices = GetBoolParameter("updateAllDevices");
|
||||
if(updateAllDevices) {
|
||||
ProvObjects::SerialNumberList SNL;
|
||||
|
||||
Poco::JSON::Object Answer;
|
||||
SNL.to_json(Answer);
|
||||
return ReturnObject(Answer);
|
||||
}
|
||||
|
||||
auto RawObject = ParseStream();
|
||||
ProvObjects::Venue NewObject;
|
||||
if (!NewObject.from_json(RawObject)) {
|
||||
|
||||
@@ -649,6 +649,20 @@ namespace OpenWifi::ProvObjects {
|
||||
return false;
|
||||
}
|
||||
|
||||
void SerialNumberList::to_json(Poco::JSON::Object &Obj) const {
|
||||
RESTAPI_utils::field_to_json( Obj,"serialNumbers",serialNumbers);
|
||||
}
|
||||
|
||||
bool SerialNumberList::from_json(const Poco::JSON::Object::Ptr &Obj) {
|
||||
try {
|
||||
RESTAPI_utils::field_from_json( Obj,"serialNumbers",serialNumbers);
|
||||
return true;
|
||||
} catch(...) {
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void MapList::to_json(Poco::JSON::Object &Obj) const {
|
||||
RESTAPI_utils::field_to_json( Obj,"list",list);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,13 @@ namespace OpenWifi::ProvObjects {
|
||||
bool from_json(const Poco::JSON::Object::Ptr &Obj);
|
||||
};
|
||||
|
||||
struct SerialNumberList {
|
||||
Types::UUIDvec_t serialNumbers;
|
||||
|
||||
void to_json(Poco::JSON::Object &Obj) const;
|
||||
bool from_json(const Poco::JSON::Object::Ptr &Obj);
|
||||
};
|
||||
|
||||
struct ManagementPolicyEntry {
|
||||
Types::UUIDvec_t users;
|
||||
Types::UUIDvec_t resources;
|
||||
|
||||
Reference in New Issue
Block a user