Hi
In https://cloud.onion.io/, when you are in Device Explorer App, the browser make a request to https://api.onion.io/v1/devices/[devide-id]/file/exec with JSON POST params { "command": "ubus", "params": [ "-v", "list" ] }
to query API objects and methods (and with good auth token).
So to get complete list of available API services
, commands
and params
(with expected type
), execute ubus -v list
in the omega shell.
In my Omega2+ (0.1.9 b149) i have:
root@Omega-XXXX:~# ubus -v list
'dhcp' @9de6b875
"ipv4leases":{}
"ipv6leases":{}
'file' @88fe19bc
"read":{"path":"String","base64":"Boolean"}
"write":{"path":"String","data":"String","append":"Boolean","mode":"Integer","base64":"Boolean"}
"list":{"path":"String"}
"stat":{"path":"String"}
"md5":{"path":"String"}
"exec":{"command":"String","params":"Array","env":"Table"}
'i2c_exp' @9715ff56
"pwm-exp":{"command":"String","params":"Table"}
"relay-exp":{"command":"String","params":"Table"}
"oled-exp":{"command":"String","option":"String","params":"Table"}
"status":{}
'iwinfo' @2518fe83
"devices":{}
"info":{"device":"String"}
"scan":{"device":"String"}
"assoclist":{"device":"String","mac":"String"}
"freqlist":{"device":"String"}
"txpowerlist":{"device":"String"}
"countrylist":{"device":"String"}
"phyname":{"section":"String"}
'log' @8e44d751
"read":{"lines":"Integer","stream":"Boolean"}
"write":{"event":"String"}
'network' @a0d31090
"restart":{}
"reload":{}
"add_host_route":{"target":"String","v6":"Boolean","interface":"String"}
"get_proto_handlers":{}
"add_dynamic":{"name":"String"}
'network.device' @967b37d6
"status":{"name":"String"}
"set_alias":{"alias":"Array","device":"String"}
"set_state":{"name":"String","defer":"Boolean"}
'network.interface' @22b5dacb
"up":{}
"down":{}
"status":{}
"prepare":{}
"dump":{}
"add_device":{"name":"String","link-ext":"Boolean"}
"remove_device":{"name":"String","link-ext":"Boolean"}
"notify_proto":{}
"remove":{}
"set_data":{}
'network.interface.loopback' @a6f7dd81
"up":{}
"down":{}
"status":{}
"prepare":{}
"dump":{}
"add_device":{"name":"String","link-ext":"Boolean"}
"remove_device":{"name":"String","link-ext":"Boolean"}
"notify_proto":{}
"remove":{}
"set_data":{}
'network.interface.wan' @22ae2bbe
"up":{}
"down":{}
"status":{}
"prepare":{}
"dump":{}
"add_device":{"name":"String","link-ext":"Boolean"}
"remove_device":{"name":"String","link-ext":"Boolean"}
"notify_proto":{}
"remove":{}
"set_data":{}
'network.interface.wlan' @6c4c466f
"up":{}
"down":{}
"status":{}
"prepare":{}
"dump":{}
"add_device":{"name":"String","link-ext":"Boolean"}
"remove_device":{"name":"String","link-ext":"Boolean"}
"notify_proto":{}
"remove":{}
"set_data":{}
'network.interface.wwan' @22b2f540
"up":{}
"down":{}
"status":{}
"prepare":{}
"dump":{}
"add_device":{"name":"String","link-ext":"Boolean"}
"remove_device":{"name":"String","link-ext":"Boolean"}
"notify_proto":{}
"remove":{}
"set_data":{}
'network.wireless' @9d8e2591
"up":{}
"down":{}
"status":{}
"notify":{}
"get_validate":{}
'onion' @1a5fd088
"wifi-scan":{"device":"String"}
"wifi-setup":{"params":"Table"}
"oupgrade":{"params":"Table"}
"dir-list":{"directory":"String"}
"omega-led":{"set_trigger":"String","read_triggers":"Boolean"}
"fast-gpio":{"params":"Table"}
"i2c-scan":{}
"rgb-led":{"command":"String","params":"Table"}
"gpio":{"command":"String","params":"Table"}
"launch-process":{"command":"String"}
"status":{}
'onion-console' @762ce66b
"app-list":{}
"shellinabox":{"params":"Table"}
"status":{}
'onion-helper' @729df88d
"background":{"command":"String","params":"Array"}
"echo":{"message":"String"}
"write":{"path":"String","data":"String","append":"Boolean","mode":"Integer","base64":"Boolean"}
"download":{"url":"String","path":"String","background":"Boolean"}
'rpc-sys' @309860e6
"password_set":{"user":"String","password":"String"}
"upgrade_test":{}
"upgrade_start":{"keep":"Boolean"}
"upgrade_clean":{}
"factory":{}
"reboot":{}
'service' @485cfe4d
"set":{"name":"String","script":"String","instances":"Table","triggers":"Array","validate":"Array"}
"add":{"name":"String","script":"String","instances":"Table","triggers":"Array","validate":"Array"}
"list":{"name":"String","verbose":"Boolean"}
"delete":{"name":"String","instance":"String"}
"signal":{"name":"String","instance":"String","signal":"Integer"}
"update_start":{"name":"String"}
"update_complete":{"name":"String"}
"event":{"type":"String","data":"Table"}
"validate":{"package":"String","type":"String","service":"String"}
"get_data":{"name":"String","instance":"String","type":"String"}
'session' @0bc85bc7
"create":{"timeout":"Integer"}
"list":{"ubus_rpc_session":"String"}
"grant":{"ubus_rpc_session":"String","scope":"String","objects":"Array"}
"revoke":{"ubus_rpc_session":"String","scope":"String","objects":"Array"}
"access":{"ubus_rpc_session":"String","scope":"String","object":"String","function":"String"}
"set":{"ubus_rpc_session":"String","values":"Table"}
"get":{"ubus_rpc_session":"String","keys":"Array"}
"unset":{"ubus_rpc_session":"String","keys":"Array"}
"destroy":{"ubus_rpc_session":"String"}
"login":{"username":"String","password":"String","timeout":"Integer"}
'system' @39d2d5f9
"board":{}
"info":{}
"upgrade":{}
"reboot":{}
"watchdog":{"frequency":"Integer","timeout":"Integer","stop":"Boolean"}
"signal":{"pid":"Integer","signum":"Integer"}
"nandupgrade":{"path":"String"}
'uci' @81308949
"configs":{}
"get":{"config":"String","section":"String","option":"String","type":"String","match":"Table","ubus_rpc_session":"String"}
"state":{"config":"String","section":"String","option":"String","type":"String","match":"Table","ubus_rpc_session":"String"}
"add":{"config":"String","type":"String","name":"String","values":"Table","ubus_rpc_session":"String"}
"set":{"config":"String","section":"String","type":"String","match":"Table","values":"Table","ubus_rpc_session":"String"}
"delete":{"config":"String","section":"String","type":"String","match":"Table","option":"String","options":"Array","ubus_rpc_session":"String"}
"rename":{"config":"String","section":"String","option":"String","name":"String","ubus_rpc_session":"String"}
"order":{"config":"String","sections":"Array","ubus_rpc_session":"String"}
"changes":{"config":"String","ubus_rpc_session":"String"}
"revert":{"config":"String","ubus_rpc_session":"String"}
"commit":{"config":"String","ubus_rpc_session":"String"}
"apply":{"rollback":"Boolean","timeout":"Integer","ubus_rpc_session":"String"}
"confirm":{"ubus_rpc_session":"String"}
"rollback":{"ubus_rpc_session":"String"}
"reload_config":{}
As you can see, format is like:
'service' @39d2d5f9
"command": {
"param": "Type of the param"
}
Hope it helps