Changes
Draft:Monitoring via JSON-RPC (view source)
Revision as of 15:27, 9 November 2017
, 15:27, 9 November 2017→uci set
curl -d "{\"jsonrpc\":\"2.0\", \"id\":1, \"method\":\"call\", \"params\": [\"9704f676709d9dedc98d7718c4e3e7d2\", \"uci\", \"set\", {\"config\":\"<span style=color:orange>network</span>\", \"type\":\"<span style=color:orange>interface</span>\", \"match\": {\"ipaddr\":\"<span style=color:red>192.168.1.1</span>\"}, \"values\": {\"ipaddr\":"<span style=color:green>192.168.56.1</span>\"} } ] }" http://<span style=color:black>192.168.1.1</span>/ubus
curl -d "{\"jsonrpc\":\"2.0\", \"id\":1, \"method\":\"call\", \"params\": [\"9704f676709d9dedc98d7718c4e3e7d2\", \"uci\", \"set\", {\"config\":\"<span style=color:orange>network</span>\", \"type\":\"<span style=color:orange>interface</span>\", \"match\": {\"ipaddr\":\"<span style=color:red>192.168.1.1</span>\"}, \"values\": {\"ipaddr\":"<span style=color:green>192.168.56.1</span>\"} } ] }" http://<span style=color:black>192.168.1.1</span>/ubus
curl -d "{\"jsonrpc\":\"2.0\", \"id\":1, \"method\":\"call\", \"params\":[\"590bde71578da2fabfe77ba86c00e4e5\", \"uci\", \"set\", { \"config\":\"network\", \"type\":\"interface\", \"match\":{\"ipaddr\":\"192.168.1.1\"}, \"values\":{\"ipaddr\":\"192.168.56.1\"} } ] }" http://192.168.1.1/ubus
The sections highlighted in orange describe the config file's name and section (in this case, network config and interface section). Highlighted in red is the exact part of the config file that you wish to change (in this case, the router's LAN IP address, '''ipaddr'''). Finally, highlighted in green is the value that is to replace the old value (in this case, change the router's LAN IP address to 192.168.56.1). If the issued command was a success, you should see a Response like this:
The sections highlighted in orange describe the config file's name and section (in this case, network config and interface section). Highlighted in red is the exact part of the config file that you wish to change (in this case, the router's LAN IP address, '''ipaddr'''). Finally, highlighted in green is the value that is to replace the old value (in this case, change the router's LAN IP address to 192.168.56.1). If the issued command was a success, you should see a Response like this: