SonicOS API on creating Routing Policy
Hi,
I am testing the SonicOS API with curl.
I can create objects without problem. However, the routing_policy API seems broken.
I got "No matching command found" on API return.
curl -k -i -X POST "https://192.168.3.1:58000/api/sonicos/route-policies/ipv4" -H "accept: application/Json" -H "Content-Type: application/Json" -d @kk.Json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 919 0 592 100 327 970 536 --:--:-- --:--:-- --:--:-- 1509HTTP/1.0 400 Bad Request
Server: SonicWALL
Expires: -1
Cache-Control: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
{
"status": {
"success": false
,"cli": {
"mode": "config_mode"
,"depth": 1
,"command": "route-policy interface x7 metric 20 source name Kushal_api2 destination group CHN_LAN service any gateway name SVN_Public"
,"configuring": true
,"pending_config": false
,"restart_required": "FALSE"
}
,"info": [
{
"level": "error"
,"code": "E_NO_MATCH"
,"message": "No matching command found."
}
]
}
}
what i missed in json file
@json
{
"route_policy": {
"ipv4": {
"interface": "x7",
"metric": 20,
"source": {
"name": "Kushal_api2"
},
"destination": {
"group":"CHN_LAN"
},
"service": {
"any": true
},
"gateway": {
"name": "SVN_Public"
},
"name": "Vidya",
"disable_on_interface_down": true,
"vpn_precedence": true,
"probe": "",
"tcp_acceleration":false
}
}
}
Answers
Can you update the firmware version you are running and the model?
Current version firmware: SonicOS Enhanced 6.5.4.5-53n
updated on 25th june 2020