Hello Peetha,
For the Openvpn configuration config file can be found under /etc/config/openvpn. In config file not all config sections and options are present already, you will need to add sections and options using UCI commands.
UCI command to add the Openvpn client are:
uci set openvpn.tunnelX=openvpn
uci set openvpn.tunnelX.enable='1'
After adding the section and options you will need to commit the changes using <uci commit> command.
Follow link to know about the UCI command using the link:
https://wiki.teltonika-networks.com/view/UCI_command_usage#Summary
For using UCI commands with JSON you can replace the set command with add or add_list command in your example:
Follow link for more details on using UCI command with JSON
https://wiki.teltonika-networks.com/view/RUT240_Monitoring_via_JSON-RPC_windows
Below is the example for using UCI command with JSON:
To Create Openvpn Client:
{
"jsonrpc":"2.0", "id":1, "method":"call", "params":
[
" session_id ", "uci", "add",
{
"config":"openvpn", "type":"openvpn", "name":"client _name"
}
]
}
To Create options in the File:
{
"jsonrpc":"2.0", "id":2, "method":"call", "params":
[
"0898ad57301f9df308b606e482e3a4d7", "uci", "set",
{
"config":"openvpn", "section":"client _name", "type":"openvpn", "values":
{
"keepalive":"10 120",
"dev":"tunX",
"persist_tun":"1",
"type":"client",
"_name":"client _name"
}
}
]
}
Next you will need to commit and reload changes.
Follow link for more details:
https://wiki.teltonika-networks.com/view/RUT240_Monitoring_via_JSON-RPC_windows#UCI_COMMIT
Regards,
Shivang