diff --git a/examples/example6.php b/examples/example6.php new file mode 100644 index 0000000..f1f33cd --- /dev/null +++ b/examples/example6.php @@ -0,0 +1,35 @@ +connect('111.111.111.111', 'LOGIN', 'PASSWORD')) { + # Get all current hosts + $API->write('/ip/dns/static/print'); + $ips = $API->read(); + + # delete them all ! + foreach($ips as $num => $ip_data) { + $API->write('/ip/dns/static/remove', false); + $API->write("=.id=" . $ip_data[".id"], true); + } + + #add some new + $API->comm("/ip/dns/static/add", array( + "name" => "jefkeklak", + "address" => "1.2.3.4", + "ttl" => "1m" + )); + + #show me what you got + $API->write('/ip/dns/static/print'); + $ips = $API->read(); + var_dump($ips); + $API->disconnect(); +}