stephb9959
2023-03-02 09:10:29 -08:00
parent e2e5687b47
commit ecea2a1fb4
2 changed files with 18 additions and 1 deletions

View File

@@ -85,7 +85,8 @@ namespace OpenWifi {
ProvObjects::InventoryTag ExistingDevice;
auto SerialNumber = Poco::toLower(SerialNumberRaw);
if (!GetRecord("serialNumber", SerialNumber, ExistingDevice)) {
ProvObjects::InventoryTag NewDevice;
std::cout << __LINE__ << std::endl;
ProvObjects::InventoryTag NewDevice;
uint64_t Now = Utils::Now();
auto Tokens = Poco::StringTokenizer(ConnectionInfo, "@:");
@@ -113,7 +114,9 @@ namespace OpenWifi {
}
}
std::cout << __LINE__ << std::endl;
if (CreateRecord(NewDevice)) {
std::cout << __LINE__ << std::endl;
SerialNumberCache()->AddSerialNumber(SerialNumber, DeviceType);
std::string FullUUID;
if (!NewDevice.entity.empty()) {
@@ -143,6 +146,7 @@ namespace OpenWifi {
}
} else {
// Device already exists, do we need to modify anything?
std::cout << __LINE__ << std::endl;
bool modified = false;
if (ExistingDevice.deviceType != DeviceType) {
ExistingDevice.deviceType = DeviceType;
@@ -176,10 +180,13 @@ namespace OpenWifi {
modified = true;
}
std::cout << __LINE__ << std::endl;
if (modified) {
ExistingDevice.info.modified = Utils::Now();
std::cout << __LINE__ << std::endl;
StorageService()->InventoryDB().UpdateRecord("serialNumber", SerialNumber,
ExistingDevice);
std::cout << __LINE__ << std::endl;
}
}
return false;

View File

@@ -528,6 +528,14 @@ getvenuedevices() {
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() {
setrrm
curl ${FLAGS} -X GET "http://${OWRRM}/api/v1/algorithms" \
@@ -546,6 +554,7 @@ rrmprovider() {
jq < ${result_file}
}
notifications() {
if [[ -z "$1" ]]
then
@@ -664,6 +673,7 @@ case "$1" in
"deleteoverride") login; deleteoverride "$2"; logout;;
"venueupgraderevisions") login; venueupgraderevisions "$2"; logout;;
"getsystemconfiguration") login; getsystemconfiguration "$2"; logout;;
"getvenuesperrrm") login; getvenuesperrrm "$2"; logout;;
*) help ;;
esac