-
Notifications
You must be signed in to change notification settings - Fork 5
Mod_RPC
ates edited this page Dec 21, 2010
·
5 revisions
Provides interface to the Netspire to execute commands. BERT protocol is used for serialization data.
This should be added to the modules section of the netspire.conf:
{mod_rpc, [{listen, {inet, "0.0.0.0", 9876}}]}
Specify the listen address and the port.
It's shown a simple example how to retrieve the information about the status of the IP pools in a ruby language below
#!/usr/bin/ruby
require 'bertrpc'
svc = BERTRPC::Service.new('127.0.0.1', 9876)
svc.call.mod_ippool.info().each { |x|
puts "#{x}"
}
The result of the execution will be:
[t[:ippool_entry, t[192, 168, 1, 100], :main, 0]]
[t[:ippool_entry, t[192, 168, 1, 101], :main, 1292323386]]
[t[:ippool_entry, t[192, 168, 1, 102], :main, 0]]
[t[:ippool_entry, t[192, 168, 1, 103], :main, 0]]
[t[:ippool_entry, t[192, 168, 1, 104], :main, 0]]
[t[:ippool_entry, t[192, 168, 1, 105], :main, 0]]
[t[:ippool_entry, t[192, 168, 1, 106], :main, 0]]
[t[:ippool_entry, t[192, 168, 1, 107], :main, 0]]
You can find more information about BERT and BERT-RPC at http://bert-rpc.org