[luci] Unable to query uci via json-rpc

Charles Leclerc charles at la-mouette.net
Sun Oct 24 19:54:48 CEST 2010


  Hi everyone,

I'm trying to get an json-rpc working, but I'm stuck with the uci calls. 
Before submitting a ticket, I want ti be sure that I'm doing it right. 
The other modules work fine (iI've tried uvl, sys and ipkg with success).

Here is the details of a successful exchange :

url : http://welcome/cgi-bin/luci/rpc/auth
query : {"method":"login","params":["root","xxx"]}
answer : 
{"id":null,"result":"c67ed189864f5acccbb9c27300b1a1bc","error":null}
url : 
http://welcome/cgi-bin/luci/rpc/ipkg?auth=c67ed189864f5acccbb9c27300b1a1bc
query : {"method":"installed","params":["luci-admin-rpc"]}
answer : {"id":null,"result":true,"error":null}

So far so good.

Next I tried to do a get_all on config dhcp :

url : http://welcome/cgi-bin/luci/rpc/auth
query : {"method":"login","params":["root","xxx"]}
answer : 
{"id":null,"result":"584f6c3d7ae00ce7f25cf3bb262d1a38","error":null}
url : 
http://welcome/cgi-bin/luci/rpc/uci?auth=584f6c3d7ae00ce7f25cf3bb262d1a38
query : {"method":"get_all","params":["dhcp"]}
answer : {"id":null,"result":null,"error":{"message":"Invalid 
params.","data":"invalid argument count","code":-32602}}

No matter the form or the number of arguments (I've tried many 
combinations), the server always returns "invalid argument count". Maybe 
I get all mixed up between packages, configs, section or options, I 
don't know. I just want to change my firewall configuration from a 
client program ... Perhaps ther's a better way ?

Thanks for your answers !

Charlie


More information about the luci mailing list