Compare commits

...

13 Commits

Author SHA1 Message Date
TIP Automation User
5b703690b0 Chg: update image tag in helm values to v3.2.0 2024-10-04 15:54:26 +00:00
TIP Automation User
f8302ba9e1 Chg: update image tag in helm values to v3.2.0-RC3 2024-09-30 23:10:48 +00:00
i-chvets
62b99c2cb1 Merge pull request #389 from Telecominfraproject/version_update
WIFI-14165: release 3.2 version update
2024-09-30 11:02:38 -04:00
Ivan Chvets
79ab67db50 fix: release 3.2 version update
https://telecominfraproject.atlassian.net/browse/WIFI-14165

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-09-30 09:39:44 -04:00
TIP Automation User
5411b6b195 Chg: update image tag in helm values to v3.2.0-RC2 2024-09-27 17:09:29 +00:00
i-chvets
5ed98b724a Merge pull request #384 from Telecominfraproject/master
WIFI-14161: Release 3.2 sync with master
2024-09-27 11:46:07 -04:00
i-chvets
00bc77feea Merge pull request #385 from Telecominfraproject/WIFI-14134-fix_code_style_change
WIFI-14134: fix: file upload status - code style change
2024-09-27 10:59:14 -04:00
Ivan Chvets
4f00d77d2b fix: file upload status - code style change
https://telecominfraproject.atlassian.net/browse/WIFI-14134

Summary of changes:
- Code style change.

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-09-27 10:34:45 -04:00
i-chvets
c679d4ac40 Merge pull request #383 from Telecominfraproject/WIFI-14134-fix_file_upload_status
WIP: WIFI-14134: fix: file upload status
2024-09-26 21:33:56 -04:00
Ivan Chvets
4a150a9fcb fix: file upload status
https://telecominfraproject.atlassian.net/browse/WIFI-14134

Summary of changes:
- Return 202 in case of file pening upload.

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-09-26 16:07:19 -04:00
i-chvets
68f5bb42ff Merge pull request #380 from Telecominfraproject/master
WIFI-14165: Release 3.2 master sync
2024-09-26 11:08:09 -04:00
i-chvets
83eb603f0a Merge pull request #382 from Telecominfraproject/openapi-fix
WIFI-14165: Fix wrong port in openapi.yaml
2024-09-25 15:10:28 -04:00
TIP Automation User
5867b6a1c0 Chg: update image tag in helm values to v3.2.0-RC1 2024-09-11 17:50:49 +00:00
6 changed files with 30 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
project(owgw VERSION 3.1.0) project(owgw VERSION 3.2.0)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_STANDARD_REQUIRED True)

View File

@@ -9,7 +9,7 @@ fullnameOverride: ""
images: images:
owgw: owgw:
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
tag: master tag: v3.2.0
pullPolicy: Always pullPolicy: Always
# regcred: # regcred:
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io # registry: tip-tip-wlan-cloud-ucentral.jfrog.io

View File

@@ -22,9 +22,15 @@ namespace OpenWifi {
std::string FileType; std::string FileType;
std::string FileContent; std::string FileContent;
if (!StorageService()->GetAttachedFileContent(UUID, SerialNumber, FileContent, FileType) || FileContent.empty()) { int WaitingForFile = 0;
if (!StorageService()->GetAttachedFileContent(UUID, SerialNumber, FileContent, FileType, WaitingForFile) && !WaitingForFile) {
return NotFound(); return NotFound();
} }
else if (WaitingForFile) {
// waiting for file to be uploaded, return Accepted
return Accepted();
}
if (FileType == "pcap") { if (FileType == "pcap") {
SendFileContent(FileContent, "application/vnd.tcpdump.pcap", UUID + ".pcap"); SendFileContent(FileContent, "application/vnd.tcpdump.pcap", UUID + ".pcap");
} }

View File

@@ -243,7 +243,7 @@ namespace OpenWifi {
const std::string &Type); const std::string &Type);
bool CancelWaitFile(std::string &UUID, std::string &ErrorText); bool CancelWaitFile(std::string &UUID, std::string &ErrorText);
bool GetAttachedFileContent(std::string &UUID, const std::string &SerialNumber, bool GetAttachedFileContent(std::string &UUID, const std::string &SerialNumber,
std::string &FileContent, std::string &Type); std::string &FileContent, std::string &Type, int& WaitingForFile);
bool RemoveAttachedFile(std::string &UUID); bool RemoveAttachedFile(std::string &UUID);
bool SetCommandResult(std::string &UUID, std::string &Result); bool SetCommandResult(std::string &UUID, std::string &Result);
bool GetNewestCommands(std::string &SerialNumber, uint64_t HowMany, bool GetNewestCommands(std::string &SerialNumber, uint64_t HowMany,

View File

@@ -431,6 +431,11 @@ namespace OpenWifi {
} }
} }
inline void Accepted() {
PrepareResponse(Poco::Net::HTTPResponse::HTTP_ACCEPTED);
Response->send();
}
inline void SendCompressedTarFile(const std::string &FileName, const std::string &Content) { inline void SendCompressedTarFile(const std::string &FileName, const std::string &Content) {
Response->setStatus(Poco::Net::HTTPResponse::HTTPStatus::HTTP_OK); Response->setStatus(Poco::Net::HTTPResponse::HTTPStatus::HTTP_OK);
SetCommonHeaders(); SetCommonHeaders();

View File

@@ -647,18 +647,6 @@ namespace OpenWifi {
Sess.begin(); Sess.begin();
Poco::Data::Statement Statement(Sess); Poco::Data::Statement Statement(Sess);
std::string StatementStr;
// Get the existing command
StatementStr =
"UPDATE CommandList SET WaitingForFile=?, AttachDate=?, AttachSize=? WHERE UUID=?";
Statement << ConvertParams(StatementStr), Poco::Data::Keywords::use(WaitForFile),
Poco::Data::Keywords::use(Now), Poco::Data::Keywords::use(Size),
Poco::Data::Keywords::use(UUID);
Statement.execute();
Sess.commit();
if (Size < FileUploader()->MaxSize()) { if (Size < FileUploader()->MaxSize()) {
Poco::Data::BLOB TheBlob; Poco::Data::BLOB TheBlob;
@@ -681,6 +669,18 @@ namespace OpenWifi {
poco_warning(Logger(), fmt::format("File {} is too large.", UUID)); poco_warning(Logger(), fmt::format("File {} is too large.", UUID));
} }
Sess.commit(); Sess.commit();
// update CommandList here to ensure that file us uploaded
std::string StatementStr;
StatementStr =
"UPDATE CommandList SET WaitingForFile=?, AttachDate=?, AttachSize=? WHERE UUID=?";
Statement << ConvertParams(StatementStr), Poco::Data::Keywords::use(WaitForFile),
Poco::Data::Keywords::use(Now), Poco::Data::Keywords::use(Size),
Poco::Data::Keywords::use(UUID);
Statement.execute();
Sess.commit();
return true; return true;
} catch (const Poco::Exception &E) { } catch (const Poco::Exception &E) {
Logger().log(E); Logger().log(E);
@@ -689,7 +689,7 @@ namespace OpenWifi {
} }
bool Storage::GetAttachedFileContent(std::string &UUID, const std::string &SerialNumber, bool Storage::GetAttachedFileContent(std::string &UUID, const std::string &SerialNumber,
std::string &FileContent, std::string &Type) { std::string &FileContent, std::string &Type, int &WaitingForFile) {
try { try {
Poco::Data::BLOB L; Poco::Data::BLOB L;
/* /*
@@ -702,10 +702,10 @@ namespace OpenWifi {
Poco::Data::Statement Select1(Sess); Poco::Data::Statement Select1(Sess);
std::string TmpSerialNumber; std::string TmpSerialNumber;
std::string st1{"SELECT SerialNumber, Command FROM CommandList WHERE UUID=?"}; std::string st1{"SELECT SerialNumber, Command , WaitingForFile FROM CommandList WHERE UUID=?"};
std::string Command; std::string Command;
Select1 << ConvertParams(st1), Poco::Data::Keywords::into(TmpSerialNumber), Select1 << ConvertParams(st1), Poco::Data::Keywords::into(TmpSerialNumber),
Poco::Data::Keywords::into(Command), Poco::Data::Keywords::use(UUID); Poco::Data::Keywords::into(Command), Poco::Data::Keywords::into(WaitingForFile), Poco::Data::Keywords::use(UUID);
Select1.execute(); Select1.execute();
if (TmpSerialNumber != SerialNumber) { if (TmpSerialNumber != SerialNumber) {