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:
@@ -85,6 +85,7 @@ namespace OpenWifi {
|
|||||||
ProvObjects::InventoryTag ExistingDevice;
|
ProvObjects::InventoryTag ExistingDevice;
|
||||||
auto SerialNumber = Poco::toLower(SerialNumberRaw);
|
auto SerialNumber = Poco::toLower(SerialNumberRaw);
|
||||||
if (!GetRecord("serialNumber", SerialNumber, ExistingDevice)) {
|
if (!GetRecord("serialNumber", SerialNumber, ExistingDevice)) {
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
ProvObjects::InventoryTag NewDevice;
|
ProvObjects::InventoryTag NewDevice;
|
||||||
uint64_t Now = Utils::Now();
|
uint64_t Now = Utils::Now();
|
||||||
|
|
||||||
@@ -113,7 +114,9 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
if (CreateRecord(NewDevice)) {
|
if (CreateRecord(NewDevice)) {
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
SerialNumberCache()->AddSerialNumber(SerialNumber, DeviceType);
|
SerialNumberCache()->AddSerialNumber(SerialNumber, DeviceType);
|
||||||
std::string FullUUID;
|
std::string FullUUID;
|
||||||
if (!NewDevice.entity.empty()) {
|
if (!NewDevice.entity.empty()) {
|
||||||
@@ -143,6 +146,7 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Device already exists, do we need to modify anything?
|
// Device already exists, do we need to modify anything?
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
if (ExistingDevice.deviceType != DeviceType) {
|
if (ExistingDevice.deviceType != DeviceType) {
|
||||||
ExistingDevice.deviceType = DeviceType;
|
ExistingDevice.deviceType = DeviceType;
|
||||||
@@ -176,10 +180,13 @@ namespace OpenWifi {
|
|||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
if (modified) {
|
if (modified) {
|
||||||
ExistingDevice.info.modified = Utils::Now();
|
ExistingDevice.info.modified = Utils::Now();
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
StorageService()->InventoryDB().UpdateRecord("serialNumber", SerialNumber,
|
StorageService()->InventoryDB().UpdateRecord("serialNumber", SerialNumber,
|
||||||
ExistingDevice);
|
ExistingDevice);
|
||||||
|
std::cout << __LINE__ << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -528,6 +528,14 @@ getvenuedevices() {
|
|||||||
jq < ${result_file}
|
jq < ${result_file}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getvenuesperrrm() {
|
||||||
|
curl ${FLAGS} -X GET "https://${OWPROV}/api/v1/venue?RRMvendor=$1" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Authorization: Bearer ${token}" \
|
||||||
|
-H "Accept: application/json" > ${result_file}
|
||||||
|
jq < ${result_file}
|
||||||
|
}
|
||||||
|
|
||||||
listrrmalgos() {
|
listrrmalgos() {
|
||||||
setrrm
|
setrrm
|
||||||
curl ${FLAGS} -X GET "http://${OWRRM}/api/v1/algorithms" \
|
curl ${FLAGS} -X GET "http://${OWRRM}/api/v1/algorithms" \
|
||||||
@@ -546,6 +554,7 @@ rrmprovider() {
|
|||||||
jq < ${result_file}
|
jq < ${result_file}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
notifications() {
|
notifications() {
|
||||||
if [[ -z "$1" ]]
|
if [[ -z "$1" ]]
|
||||||
then
|
then
|
||||||
@@ -664,6 +673,7 @@ case "$1" in
|
|||||||
"deleteoverride") login; deleteoverride "$2"; logout;;
|
"deleteoverride") login; deleteoverride "$2"; logout;;
|
||||||
"venueupgraderevisions") login; venueupgraderevisions "$2"; logout;;
|
"venueupgraderevisions") login; venueupgraderevisions "$2"; logout;;
|
||||||
"getsystemconfiguration") login; getsystemconfiguration "$2"; logout;;
|
"getsystemconfiguration") login; getsystemconfiguration "$2"; logout;;
|
||||||
|
"getvenuesperrrm") login; getvenuesperrrm "$2"; logout;;
|
||||||
*) help ;;
|
*) help ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user