mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-30 10:12:29 +00:00
Adding tree import.
This commit is contained in:
@@ -228,7 +228,7 @@ namespace OpenWifi{
|
|||||||
if(!ExistingObject.venue.empty()) {
|
if(!ExistingObject.venue.empty()) {
|
||||||
Storage()->VenueDB().DeleteDevice("id",ExistingObject.venue,ExistingObject.info.id);
|
Storage()->VenueDB().DeleteDevice("id",ExistingObject.venue,ExistingObject.info.id);
|
||||||
} else if(!ExistingObject.entity.empty()) {
|
} else if(!ExistingObject.entity.empty()) {
|
||||||
Storage()->EntityDB().DeleteDevice("id",ExistingObject.venue,ExistingObject.info.id);
|
Storage()->EntityDB().DeleteDevice("id",ExistingObject.entity,ExistingObject.info.id);
|
||||||
}
|
}
|
||||||
ExistingObject.venue.clear();
|
ExistingObject.venue.clear();
|
||||||
ExistingObject.entity.clear();
|
ExistingObject.entity.clear();
|
||||||
|
|||||||
@@ -200,8 +200,18 @@ addunassignedtag() {
|
|||||||
jq < ${result_file}
|
jq < ${result_file}
|
||||||
}
|
}
|
||||||
|
|
||||||
assigntag() {
|
assigntagentity() {
|
||||||
payload="{\"serialNumber\" : \"$1\", \"deviceType\" : \"linksys_ea8300\" ,\"entity\" : \"$2\"}";
|
payload="{\"serialNumber\" : \"$1\", \"entity\" : \"$2\"}";
|
||||||
|
curl ${FLAGS} -X PUT "https://${OWPROV}/api/v1/inventory/$1" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Authorization: Bearer ${token}" \
|
||||||
|
-H "accept: application/json" \
|
||||||
|
-d "$payload" > ${result_file}
|
||||||
|
jq < ${result_file}
|
||||||
|
}
|
||||||
|
|
||||||
|
assigntagvenue() {
|
||||||
|
payload="{\"serialNumber\" : \"$1\", \"venue\" : \"$2\"}";
|
||||||
curl ${FLAGS} -X PUT "https://${OWPROV}/api/v1/inventory/$1" \
|
curl ${FLAGS} -X PUT "https://${OWPROV}/api/v1/inventory/$1" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Bearer ${token}" \
|
-H "Authorization: Bearer ${token}" \
|
||||||
@@ -357,6 +367,8 @@ case "$1" in
|
|||||||
"listconfigs") login; listconfigs ; logout;;
|
"listconfigs") login; listconfigs ; logout;;
|
||||||
"getconfig") login; getconfig "$2"; logout;;
|
"getconfig") login; getconfig "$2"; logout;;
|
||||||
"deleteconfig") login; deleteconfig "$2"; logout;;
|
"deleteconfig") login; deleteconfig "$2"; logout;;
|
||||||
|
"assigntagentity") login; assigntagentity "$2" "$3"; logout;;
|
||||||
|
"assigntagvenue") login; assigntagvenue "$2" "$3"; logout;;
|
||||||
"setentityconfig") login; setentityconfig "$2" "$3"; logout;;
|
"setentityconfig") login; setentityconfig "$2" "$3"; logout;;
|
||||||
*) help ;;
|
*) help ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user