<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
</head><body><p>Thanks Dan - I should have been more clear, I wanted to be sure that deleting from the ACS simply deleted the device until the next time the inform interval came around on the CPE side.</p><p>I have tested with an SPA-122 here, and after deleting it it's not shown up again...</p><p>Kris <br></p><div class="io-ox-signature"></div><blockquote type="cite">On November 7, 2016 at 11:55 PM Dan Morphis <dan@milkcarton.com> wrote:<br><br><div>Check in is controlled by the InformInterval on the cpe.<br><br>-dan</div><div><br>On Nov 7, 2016, at 3:35 PM, Kris Germann <<a href="mailto:kgermann@portal.net.co">kgermann@portal.net.co</a>> wrote:<br><br></div><blockquote type="cite"><div>Thank you very much!<div class=""><br class=""></div><div class="">Is there a process that happens once a device is deleted from GenieACS - ie. is there a delay period in which a connection is re-established between the CPE and the server or is it simply when the connection is repolled again.</div><div class=""><br class=""></div><div class="">Though there are 3000+ test devices on here I wish to clear, I have a few ‘production’ ones.</div><div class=""><br class=""></div><div class="">Kris</div><div class=""><br class=""><div><blockquote type="cite"><div class="">On Nov 7, 2016, at 6:47 PM, Dan Morphis <<a href="mailto:dan@milkcarton.com" class="">dan@milkcarton.com</a>> wrote:</div><br class="ox-22394d1359-Apple-interchange-newline"><div class=""><div dir="ltr" class="">With a little bit of scripting, this would be trivial to do. You could use perl, php, python, or bash with awk, or even <a href="https://stedolan.github.io/jq/" class="">jq</a>.<div class=""><br class=""></div><div class="">Here is something I whipped together that can easily be modified to delete all tasks/devices/presets/files. It requires jq. If you want to change the script to perform the work instead of echoing the command to the console, delete the echo on line 28</div><div class=""><br class=""></div><div class=""><pre style="font-family: hack; font-size: 9pt;" class=""><span style="font-weight: bold;" class="">#!/usr/bin/env bash<br class=""></span><span style="font-weight: bold;" class=""><br class=""></span>SERVER=192.168.7.80<br class="">COLLECTION=devices<br class="">DATA=`curl http://<span style="color: #000080; font-weight: bold;" class="">$</span>{SERVER}:7557/<span style="color: #000080; font-weight: bold;" class="">$</span>{COLLECTION}?projection=_id | jq -r <span style="color: #008000; font-weight: bold;" class="">'.[]._id'</span>`<br class=""><br class=""><span style="color: #c57633; font-weight: bold;" class="">urlencode</span>() {<br class=""> <span style="color: #808080; font-style: italic;" class=""># urlencode <string><br class=""></span> old_lc_collate=$LC_COLLATE<br class=""> LC_COLLATE=C<br class=""><br class=""> <span style="color: #0b0c95;" class="">local </span>length=<span style="color: #008000; font-weight: bold;" class="">"${#1}"<br class=""></span> <span style="color: #000080; font-weight: bold;" class="">for (( </span>i = <span style="color: #0000ff;" class="">0</span>; i < length; i++ <span style="color: #000080; font-weight: bold;" class="">))</span>; <span style="color: #000080; font-weight: bold;" class="">do<br class=""></span> <span style="color: #0b0c95;" class="">local </span>c=<span style="color: #008000; font-weight: bold;" class="">"${1:i:1}"<br class=""></span> <span style="color: #000080; font-weight: bold;" class="">case </span>$c <span style="color: #000080; font-weight: bold;" class="">in<br class=""></span> [a-zA-Z0-9.~_-]) <span style="color: #0b0c95;" class="">printf </span><span style="color: #008000; font-weight: bold;" class="">"$c" </span><span style="color: #000080; font-weight: bold;" class="">;;<br class=""></span> *) <span style="color: #0b0c95;" class="">printf </span><span style="color: #008000; font-weight: bold;" class="">'%%%02X' "'$c" </span><span style="color: #000080; font-weight: bold;" class="">;;<br class=""></span><span style="color: #000080; font-weight: bold;" class=""> esac<br class=""></span><span style="color: #000080; font-weight: bold;" class=""> done<br class=""></span><span style="color: #000080; font-weight: bold;" class=""><br class=""></span> LC_COLLATE=$old_lc_collate<br class="">}<br class=""><br class=""><span style="color: #808080; font-style: italic;" class="">#echo $DATA<br class=""></span><span style="color: #808080; font-style: italic;" class=""><br class=""></span><span style="color: #000080; font-weight: bold;" class="">for </span>id <span style="color: #000080; font-weight: bold;" class="">in </span>$DATA; <span style="color: #000080; font-weight: bold;" class="">do<br class=""></span> i=<span style="color: #000080; font-weight: bold;" class="">$</span>( <span style="color: #c57633; font-style: italic;" class="">urlencode </span>$id )<br class=""> <span style="color: #0b0c95;" class="">echo </span>curl <span style="color: #008000; font-weight: bold;" class="">"<a href="http://${server}:7557/${COLLECTION}/${i}" class="">http://${SERVER}:7557/${COLLECTION}/${i}</a>" </span>-X DELETE<br class=""><span style="color: #000080; font-weight: bold;" class="">done</span></pre><pre style="font-family: hack; font-size: 9pt;" class=""><span style="color: #000080; font-weight: bold;" class=""><br class=""></span></pre></div></div><div class="ox-22394d1359-gmail_extra"><br class=""><div class="ox-22394d1359-gmail_quote">On Sat, Nov 5, 2016 at 12:37 PM, Kris Germann <span class=""><<a href="mailto:kgermann@portal.net.co" target="_blank" class="">kgermann@portal.net.co</a>></span> wrote:<br class=""><blockquote><div style="word-wrap: break-word;" class="">Thank you,<div class=""><br class=""></div><div class="">To be clear, this means I need to run:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: #00d900;" class=""><span class="">root@config:/opt/genieacs# curl -i '<a href="http://localhost:7557/devices/XXXX" target="_blank" class="">http://localhost:7557/<wbr class=""/>devices/XXXX</a>' -X DELETE</span></div></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">Where XXXX is the unique device_id for each of the devices in my ACS - is there any way I can make this a little easier, I have a few instances with 80 - 5000 devices in each.</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">Kris</span></div><div class=""><div class="ox-22394d1359-h5"><div class=""><span class=""><br class=""></span></div><div class=""><div class=""><blockquote type="cite"><div class="">On Nov 1, 2016, at 3:49 PM, Oliver Kraitschy <<a href="mailto:okraits@arcor.de" target="_blank" class="">okraits@arcor.de</a>> wrote:</div><br class="ox-22394d1359-m_1959365256937891028Apple-interchange-newline"><div class=""><div class="">Hello Kris,<br class=""><br class="">you have to iterate over all devices and send a delete request for each one<br class="">of them.<br class=""><br class="">You can use the API for that:<br class=""><br class=""><a href="https://github.com/zaidka/genieacs/wiki/API-Reference" target="_blank" class="">https://github.com/zaidka/<wbr class=""/>genieacs/wiki/API-Reference</a><br class=""><br class="">Or you can do it more easily with the python API:<br class=""><br class=""><a href="https://github.com/TDT-GmbH/python-genieacs" target="_blank" class="">https://github.com/TDT-GmbH/<wbr class=""/>python-genieacs</a><br class=""><br class="">Greetings,<br class="">Oliver<br class=""><br class="">On Tue, Nov 01, 2016 at 12:24:41PM -0400, Kris Germann wrote:<br class=""><blockquote type="cite">I find myself in the unique position of having tested too many devices, so I<br class="">have about 110 devices I need to delete...<br class=""><br class="">Is there a 'destroy all' function I could incorporate?<br class=""><br class=""></blockquote><br class=""><blockquote type="cite">______________________________<wbr class=""/>_________________<br class="">Users mailing list<br class=""><a href="mailto:Users@lists.genieacs.com" target="_blank" class="">Users@lists.genieacs.com</a><br class=""><a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank" class="">http://lists.genieacs.com/<wbr class=""/>mailman/listinfo/users</a><br class=""></blockquote><br class="">______________________________<wbr class=""/>_________________<br class="">Users mailing list<br class=""><a href="mailto:Users@lists.genieacs.com" target="_blank" class="">Users@lists.genieacs.com</a><br class=""><a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank" class="">http://lists.genieacs.com/<wbr class=""/>mailman/listinfo/users</a><br class=""></div></div></blockquote></div><br class=""></div></div></div></div><br class="">______________________________<wbr class=""/>_________________<br class=""> Users mailing list<br class=""> <a href="mailto:Users@lists.genieacs.com" class="">Users@lists.genieacs.com</a><br class=""> <a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank" class="">http://lists.genieacs.com/<wbr class=""/>mailman/listinfo/users</a><br class=""> <br class=""></blockquote></div><br class=""></div>_______________________________________________<br class="">Users mailing list<br class=""><a href="mailto:Users@lists.genieacs.com" class="">Users@lists.genieacs.com</a><br class=""><a href="http://lists.genieacs.com/mailman/listinfo/users">http://lists.genieacs.com/mailman/listinfo/users</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote><blockquote type="cite"><div>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.genieacs.com">Users@lists.genieacs.com</a><br><a href="http://lists.genieacs.com/mailman/listinfo/users">http://lists.genieacs.com/mailman/listinfo/users</a><br></div></blockquote></blockquote><p><br> </p><blockquote type="cite">_______________________________________________<br>Users mailing list<br>Users@lists.genieacs.com<br>http://lists.genieacs.com/mailman/listinfo/users<br></blockquote></body></html>