mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 17:52:28 +00:00
Change of version API
This commit is contained in:
@@ -619,6 +619,24 @@ components:
|
||||
note:
|
||||
type: string
|
||||
|
||||
SystemInfoResults:
|
||||
type: object
|
||||
properties:
|
||||
version:
|
||||
type: string
|
||||
uptime:
|
||||
type: integer
|
||||
format: integer64
|
||||
start:
|
||||
type: integer
|
||||
format: integer64
|
||||
os:
|
||||
type: string
|
||||
processors:
|
||||
type: integer
|
||||
hostname:
|
||||
type: string
|
||||
|
||||
Dashboard:
|
||||
type: object
|
||||
properties:
|
||||
@@ -2061,8 +2079,7 @@ paths:
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- version
|
||||
- times
|
||||
- info
|
||||
required: true
|
||||
|
||||
responses:
|
||||
@@ -2071,7 +2088,8 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TagValuePair'
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/SystemInfoResults'
|
||||
403:
|
||||
$ref: '#/components/responses/Unauthorized'
|
||||
404:
|
||||
|
||||
@@ -69,6 +69,10 @@ namespace OpenWifi::RESTAPI::Protocol {
|
||||
static const char * COMMANDUUID = "commandUUID";
|
||||
static const char * FIRMWARES = "firmwares";
|
||||
static const char * TOPIC = "topic";
|
||||
static const char * HOST = "host";
|
||||
static const char * OS = "os";
|
||||
static const char * HOSTNAME = "hostname";
|
||||
static const char * PROCESSORS = "processors";
|
||||
static const char * REASON = "reason";
|
||||
static const char * FILEUUID = "uuid";
|
||||
static const char * USERID = "userId";
|
||||
@@ -122,6 +126,8 @@ namespace OpenWifi::RESTAPI::Protocol {
|
||||
static const char * PASSWORDPOLICY = "passwordPolicy";
|
||||
static const char * FORGOTPASSWORD = "forgotPassword";
|
||||
static const char * ME = "me";
|
||||
static const char * TELEMETRY = "telemetry";
|
||||
static const char * INTERVAL = "interval";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -79,29 +79,18 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
void RESTAPI_system_command::DoGet() {
|
||||
auto Command = GetParameter(RESTAPI::Protocol::COMMAND, "");
|
||||
if (!Poco::icompare(Command, RESTAPI::Protocol::VERSION)) {
|
||||
std::string Arg;
|
||||
if(HasParameter("command",Arg) && Arg=="info") {
|
||||
Poco::JSON::Object Answer;
|
||||
Answer.set(RESTAPI::Protocol::TAG, RESTAPI::Protocol::VERSION);
|
||||
Answer.set(RESTAPI::Protocol::VALUE, Daemon()->Version());
|
||||
Answer.set(RESTAPI::Protocol::VERSION, Daemon()->Version());
|
||||
Answer.set(RESTAPI::Protocol::UPTIME, Daemon()->uptime().totalSeconds());
|
||||
Answer.set(RESTAPI::Protocol::START, Daemon()->startTime().epochTime());
|
||||
Answer.set(RESTAPI::Protocol::OS, Poco::Environment::osName());
|
||||
Answer.set(RESTAPI::Protocol::PROCESSORS, Poco::Environment::processorCount());
|
||||
Answer.set(RESTAPI::Protocol::HOSTNAME, Poco::Environment::nodeName());
|
||||
ReturnObject(Answer);
|
||||
return;
|
||||
}
|
||||
if (!Poco::icompare(Command, RESTAPI::Protocol::TIMES)) {
|
||||
Poco::JSON::Array Array;
|
||||
Poco::JSON::Object Answer;
|
||||
Poco::JSON::Object UpTimeObj;
|
||||
UpTimeObj.set(RESTAPI::Protocol::TAG,RESTAPI::Protocol::UPTIME);
|
||||
UpTimeObj.set(RESTAPI::Protocol::VALUE, Daemon()->uptime().totalSeconds());
|
||||
Poco::JSON::Object StartObj;
|
||||
StartObj.set(RESTAPI::Protocol::TAG,RESTAPI::Protocol::START);
|
||||
StartObj.set(RESTAPI::Protocol::VALUE, Daemon()->startTime().epochTime());
|
||||
Array.add(UpTimeObj);
|
||||
Array.add(StartObj);
|
||||
Answer.set(RESTAPI::Protocol::TIMES, Array);
|
||||
ReturnObject(Answer);
|
||||
return;
|
||||
}
|
||||
BadRequest("Unsupported or missing parameters.");
|
||||
BadRequest("Unknown command.");
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ class SubSystemServer : public Poco::Util::Application::Subsystem {
|
||||
virtual void Stop() = 0;
|
||||
|
||||
protected:
|
||||
std::recursive_mutex Mutex_{};
|
||||
std::recursive_mutex Mutex_;
|
||||
Poco::Logger &Logger_;
|
||||
std::string Name_;
|
||||
std::vector<PropertiesFileServerEntry> ConfigServersList_;
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace OpenWifi::Utils {
|
||||
if(input.length() % 4)
|
||||
throw std::runtime_error("Invalid base64 length!");
|
||||
|
||||
std::size_t padding{};
|
||||
std::size_t padding=0;
|
||||
|
||||
if(input.length())
|
||||
{
|
||||
@@ -162,7 +162,7 @@ namespace OpenWifi::Utils {
|
||||
std::vector<byte> decoded;
|
||||
decoded.reserve(((input.length() / 4) * 3) - padding);
|
||||
|
||||
std::uint32_t temp{};
|
||||
std::uint32_t temp=0;
|
||||
auto it = input.begin();
|
||||
|
||||
while(it < input.end())
|
||||
|
||||
Reference in New Issue
Block a user