Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
stephb9959
2022-06-20 15:48:27 -07:00
2 changed files with 10 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ namespace OpenWifi{
for (const auto &i: V.children) {
ProvObjects::Venue V2;
if (StorageService()->VenueDB().GetRecord("id", i, V2)) {
std::copy(V2.devices.begin(),V2.devices.end(),std::back_inserter(R));
auto LowerDevs = GetDevices(V2, GetChildren);
std::copy(LowerDevs.begin(), LowerDevs.end(), std::back_inserter(R));
}

View File

@@ -499,6 +499,14 @@ listvenues() {
jq < ${result_file}
}
getvenuedevices() {
curl ${FLAGS} -X GET "https://${OWPROV}/api/v1/venue/$1?getDevices=true&getChildren=true" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \
-H "Accept: application/json" > ${result_file}
jq < ${result_file}
}
shopt -s nocasematch
case "$1" in
"login") login; echo "You are logged in..." ; logout ;;
@@ -546,6 +554,7 @@ case "$1" in
"getsignup") login; getsignup $2; logout;;
"getsubdevs") login; getsubdevs $2; logout;;
"listvenues") login; listvenues $2; logout;;
"getvenuedevices") login; getvenuedevices $2; logout;;
*) help ;;
esac