Adding tree import.

This commit is contained in:
stephb9959
2021-09-07 20:37:09 -07:00
parent 19e512729d
commit 16919203de
2 changed files with 12 additions and 1 deletions

View File

@@ -268,6 +268,16 @@ locationcount() {
jq < ${result_file}
}
addconfig() {
payload="{ \"name\" : \"$1\", \"deviceTypes\" : [\"*\"], \"configuration\" : [ { \"name\" : \"radios\" , \"weight\" : 100, \"radios\": [{ \"band\": \"5G\", \"channel\": 52, \"channel-mode\": \"HE\", \"channel-width\": 80, \"country\": \"CA\" }, { \"band\": \"2G\", \"channel\": 11, \"channel-mode\": \"HE\", \"channel-width\": 20, \"country\": \"CA\" }] }"
curl ${FLAGS} -X POST "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}
}
shopt -s nocasematch
case "$1" in
"login") login; help ; logout ;;
@@ -288,6 +298,7 @@ case "$1" in
"locationcount") login; locationcount ; logout;;
"getunassignedtags") login; getunassignedtags ; logout;;
"importtree") login; importtree $2; logout;;
"addconfig") login; addconfig $2; logout;;
*) help ;;
esac