mirror of
https://github.com/Telecominfraproject/wlan-cloud-userportal.git
synced 2025-11-02 03:27:48 +00:00
Fixing serial number...
This commit is contained in:
@@ -44,15 +44,15 @@ namespace OpenWifi {
|
||||
for(const auto &i:SubInfo->accessPoints.list) {
|
||||
if(i.macAddress == Mac) {
|
||||
if(Command == "reboot") {
|
||||
return SDK::GW::Device::Reboot(this, Mac, When);
|
||||
return SDK::GW::Device::Reboot(this, i.serialNumber, When);
|
||||
} else if(Command == "blink") {
|
||||
return SDK::GW::Device::LEDs(this, Mac, When, Duration, Pattern);
|
||||
return SDK::GW::Device::LEDs(this, i.serialNumber, When, Duration, Pattern);
|
||||
} else if(Command == "upgrade") {
|
||||
return SDK::GW::Device::Upgrade(this, Mac, When, ImageName, keepRedirector);
|
||||
return SDK::GW::Device::Upgrade(this, i.serialNumber, When, ImageName, keepRedirector);
|
||||
} else if(Command == "factory") {
|
||||
return SDK::GW::Device::Factory(this, Mac, When, keepRedirector);
|
||||
return SDK::GW::Device::Factory(this, i.serialNumber, When, keepRedirector);
|
||||
} else if(Command == "refresh") {
|
||||
return SDK::GW::Device::Refresh(this, Mac, When);
|
||||
return SDK::GW::Device::Refresh(this, i.serialNumber, When);
|
||||
} else {
|
||||
return BadRequest(RESTAPI::Errors::MissingOrInvalidParameters);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenWifi {
|
||||
// Get the last stats for this device
|
||||
// https://${OWGW}/api/v1/device/$1/statistics?lastOnly=true
|
||||
Types::StringPairVec QD{ { "lastOnly" , "true"}};
|
||||
std::string EndPoint{ "/api/v1/device/" + SerialNumber + "/statistics"};
|
||||
std::string EndPoint{ "/api/v1/device/" + i.serialNumber + "/statistics"};
|
||||
OpenAPIRequestGet Api(uSERVICE_GATEWAY, EndPoint, QD, 20000);
|
||||
|
||||
Poco::JSON::Object::Ptr CallResponse;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenWifi {
|
||||
// Get the last stats for this device
|
||||
// https://${OWGW}/api/v1/device/$1/statistics?lastOnly=true
|
||||
Types::StringPairVec QD{{"lastOnly", "true"}};
|
||||
std::string EndPoint{"/api/v1/device/" + SerialNumber + "/statistics"};
|
||||
std::string EndPoint{"/api/v1/device/" + i.serialNumber + "/statistics"};
|
||||
OpenAPIRequestGet Api(uSERVICE_GATEWAY, EndPoint, QD, 20000);
|
||||
|
||||
Poco::JSON::Object::Ptr CallResponse;
|
||||
|
||||
@@ -180,7 +180,14 @@ wiredclients() {
|
||||
}
|
||||
|
||||
signup() {
|
||||
curl ${FLAGS} -X POST "https://${target_service_endpoint}/api/v1/signup?email=stephane.bourque@gmail.com&serialNumber=24f5a207a130" \
|
||||
curl ${FLAGS} -X POST "https://${target_service_endpoint}/api/v1/signup?email=stephane.bourque%40gmail.com&macAddress=04f8f8fc3771" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{}" > ${result_file}
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
getsignup() {
|
||||
curl ${FLAGS} -X POST "https://${target_service_endpoint}/api/v1/signup?signupUUID=$1" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{}" > ${result_file}
|
||||
jq < ${result_file}
|
||||
@@ -200,6 +207,7 @@ case "$1" in
|
||||
"wificlients") login; wificlients "$2" ; logout ;;
|
||||
"wiredclients") login; wiredclients "$2" ; logout ;;
|
||||
"signup") signup ;;
|
||||
"getsignup") getsignup $2 ;;
|
||||
*) help ;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user