]>
git.ipfire.org Git - thirdparty/pdns.git/blob - contrib/remotebackend-pipe-test.pl
2 ### This script is intended for testing/developing remotebackend scripts
3 ### To use, please install libjson-any-perl (JSON::Any) and libjson-xs-perl (JSON::XS)
4 ### (c) Aki Tuomi 2013 - Distributed under same license as PowerDNS Authoritative Server
11 ### CONFIGURATION SECTION
13 ## Full path to your remotebackend script
14 my $script = "/home/cmouse/projects/pdns-v6-autorev/rev.pl";
16 ## These are used to send initialize method before your actual code
17 my $initparams = { value
=> "foo", value2
=> "bar" };
24 my $pid = open2
($in,$out,$script);
26 my $j = JSON
::Any
->new;
32 print $j->encode({method
=> $meth, parameters
=> \
%p}),"\r\n";
33 print $out $j->encode({method
=> $meth, parameters
=> \
%p}),"\r\n";
41 rpc
'initialize', %$initparams;
45 ## this lets you call whatever method with simple parameters
48 # perl remotebackend-pipe-test.pl lookup qtype SOA qname powerdns.com
51 ## {"parameters":{"qname":"powerdns.com","qtype":"SOA"},"method":"lookup"}
52 ## on your remotebackend
60 ## Put whatever you want to run here. Or leave it empty if you
61 ## only want to use the command line
63 #rpc 'lookup', qname => 'powerdns.com', qtype => 'SOA';