mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 09:42:38 +00:00
Adding configuration block management.
This commit is contained in:
102
test_scripts/curl/cfg1.json
Normal file
102
test_scripts/curl/cfg1.json
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"name" : "newbigconfig" ,
|
||||
"deviceTypes" : ["*"] ,
|
||||
"configuration" : [
|
||||
{ "name" : "radio_section ",
|
||||
"weight" : 100 ,
|
||||
"configuration" : {
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{ "name" : "iface_section",
|
||||
"weight" : 0,
|
||||
"configuration" :
|
||||
{
|
||||
"interfaces": [
|
||||
{
|
||||
"name": "WAN",
|
||||
"role": "upstream",
|
||||
"services": [ "lldp" ],
|
||||
"ethernet": [
|
||||
{
|
||||
"select-ports": [
|
||||
"WAN*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"ipv4": {
|
||||
"addressing": "dynamic"
|
||||
},
|
||||
"ssids": [
|
||||
{
|
||||
"name": "OpenWifi",
|
||||
"wifi-bands": [
|
||||
"2G", "5G"
|
||||
],
|
||||
"bss-mode": "ap",
|
||||
"encryption": {
|
||||
"proto": "psk2",
|
||||
"key": "OpenWifi",
|
||||
"ieee80211w": "optional"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "LAN",
|
||||
"role": "downstream",
|
||||
"services": [ "ssh", "lldp" ],
|
||||
"ethernet": [
|
||||
{
|
||||
"select-ports": [
|
||||
"LAN*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"ipv4": {
|
||||
"addressing": "static",
|
||||
"subnet": "192.168.1.1/24",
|
||||
"dhcp": {
|
||||
"lease-first": 10,
|
||||
"lease-count": 100,
|
||||
"lease-time": "6h"
|
||||
}
|
||||
}
|
||||
}
|
||||
]}
|
||||
},
|
||||
{ "name" : "metrics_section",
|
||||
"weight" : 0,
|
||||
"configuration" :
|
||||
{
|
||||
"metrics": {
|
||||
"statistics": {
|
||||
"interval": 120,
|
||||
"types": [ "ssids", "lldp", "clients" ]
|
||||
},
|
||||
"health": {
|
||||
"interval": 120
|
||||
},
|
||||
"wifi-frames": {
|
||||
"filters": [ "probe", "auth" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -319,6 +319,15 @@ addconfigmetrics() {
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
addconfigfile() {
|
||||
curl ${FLAGS} -X POST "https://${OWPROV}/api/v1/configurations/1" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer ${token}" \
|
||||
-H "accept: application/json" \
|
||||
-d @"$1" > ${result_file}
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
getconfig() {
|
||||
curl ${FLAGS} "https://${OWPROV}/api/v1/configurations/$1" \
|
||||
-H "Content-Type: application/json" \
|
||||
@@ -403,6 +412,7 @@ case "$1" in
|
||||
"setentityconfig") login; setentityconfig "$2" "$3"; logout;;
|
||||
"adddeviceconfig") login; adddeviceconfig "$2" "$3"; logout;;
|
||||
"addconfigmetrics") login; addconfigmetrics "$2" ; logout;;
|
||||
"addconfigfile") login; addconfigfile "$2" ; logout;;
|
||||
*) help ;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user