<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><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><meta http-equiv="Content-Type" content="text/html charset=utf-8">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" class=""><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="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=""><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:rgb(0,0,128);font-weight:bold" class="">$</span>{SERVER}:7557/<span style="color:rgb(0,0,128);font-weight:bold" class="">$</span>{COLLECTION}?projection=_id | jq -r <span style="color:rgb(0,128,0);font-weight:bold" class="">'.[]._id'</span>`<br class=""><br class=""><span style="color:rgb(197,118,51);font-weight:bold" class="">urlencode</span>() {<br class="">    <span style="color:rgb(128,128,128);font-style:italic" class=""># urlencode <string><br class=""></span><span style="color:rgb(128,128,128);font-style:italic" class="">    </span>old_lc_collate=$LC_COLLATE<br class="">    LC_COLLATE=C<br class=""><br class="">    <span style="color:rgb(11,12,149)" class="">local </span>length=<span style="color:rgb(0,128,0);font-weight:bold" class="">"${#1}"<br class=""></span><span style="color:rgb(0,128,0);font-weight:bold" class="">    </span><span style="color:rgb(0,0,128);font-weight:bold" class="">for (( </span>i = <span style="color:rgb(0,0,255)" class="">0</span>; i < length; i++ <span style="color:rgb(0,0,128);font-weight:bold" class="">))</span>; <span style="color:rgb(0,0,128);font-weight:bold" class="">do<br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class="">        </span><span style="color:rgb(11,12,149)" class="">local </span>c=<span style="color:rgb(0,128,0);font-weight:bold" class="">"${1:i:1}"<br class=""></span><span style="color:rgb(0,128,0);font-weight:bold" class="">        </span><span style="color:rgb(0,0,128);font-weight:bold" class="">case </span>$c <span style="color:rgb(0,0,128);font-weight:bold" class="">in<br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class="">            </span>[a-zA-Z0-9.~_-]) <span style="color:rgb(11,12,149)" class="">printf </span><span style="color:rgb(0,128,0);font-weight:bold" class="">"$c" </span><span style="color:rgb(0,0,128);font-weight:bold" class="">;;<br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class="">            </span>*) <span style="color:rgb(11,12,149)" class="">printf </span><span style="color:rgb(0,128,0);font-weight:bold" class="">'%%%02X' "'$c" </span><span style="color:rgb(0,0,128);font-weight:bold" class="">;;<br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class="">        esac<br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class="">    done<br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class=""><br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class="">    </span>LC_COLLATE=$old_lc_collate<br class="">}<br class=""><br class=""><span style="color:rgb(128,128,128);font-style:italic" class="">#echo $DATA<br class=""></span><span style="color:rgb(128,128,128);font-style:italic" class=""><br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class="">for </span>id <span style="color:rgb(0,0,128);font-weight:bold" class="">in </span>$DATA; <span style="color:rgb(0,0,128);font-weight:bold" class="">do<br class=""></span><span style="color:rgb(0,0,128);font-weight:bold" class="">    </span>i=<span style="color:rgb(0,0,128);font-weight:bold" class="">$</span>( <span style="color:rgb(197,118,51);font-style:italic" class="">urlencode </span>$id )<br class="">    <span style="color:rgb(11,12,149)" class="">echo </span>curl <span style="color:rgb(0,128,0);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:rgb(0,0,128);font-weight:bold" class="">done</span></pre><pre style="font-family:hack;font-size:9pt" class=""><span style="color:rgb(0,0,128);font-weight:bold" class=""><br class=""></span></pre></pre></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Nov 5, 2016 at 12:37 PM, Kris Germann <span dir="ltr" class=""><<a href="mailto:kgermann@portal.net.co" target="_blank" class="">kgermann@portal.net.co</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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;line-height:normal;font-family:Monaco;color:rgb(0,217,0);background-color:rgba(0,0,0,0.85098)" class=""><span style="font-variant-ligatures:no-common-ligatures" 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 style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" 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><span class="HOEnZb"><font color="#888888" class=""><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Kris</span></div></font></span><div class=""><div class="h5"><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div class=""><div class=""><blockquote type="cite" class=""><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="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" class="">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" 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=""></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" rel="noreferrer" 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><span>_______________________________________________</span><br><span>Users mailing list</span><br><span><a href="mailto:Users@lists.genieacs.com">Users@lists.genieacs.com</a></span><br><span><a href="http://lists.genieacs.com/mailman/listinfo/users">http://lists.genieacs.com/mailman/listinfo/users</a></span><br></div></blockquote></body></html>