<div dir="ltr">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/">jq</a>.<div><br></div><div>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><br></div><div><pre style="color:rgb(0,0,0);font-family:hack;font-size:9pt"><pre style="font-family:hack;font-size:9pt"><span style="font-weight:bold">#!/usr/bin/env bash<br></span><span style="font-weight:bold"><br></span>SERVER=192.168.7.80<br>COLLECTION=devices<br>DATA=`curl http://<span style="color:rgb(0,0,128);font-weight:bold">$</span>{SERVER}:7557/<span style="color:rgb(0,0,128);font-weight:bold">$</span>{COLLECTION}?projection=_id | jq -r <span style="color:rgb(0,128,0);font-weight:bold">'.[]._id'</span>`<br><br><span style="color:rgb(197,118,51);font-weight:bold">urlencode</span>() {<br> <span style="color:rgb(128,128,128);font-style:italic"># urlencode <string><br></span><span style="color:rgb(128,128,128);font-style:italic"> </span>old_lc_collate=$LC_COLLATE<br> LC_COLLATE=C<br><br> <span style="color:rgb(11,12,149)">local </span>length=<span style="color:rgb(0,128,0);font-weight:bold">"${#1}"<br></span><span style="color:rgb(0,128,0);font-weight:bold"> </span><span style="color:rgb(0,0,128);font-weight:bold">for (( </span>i = <span style="color:rgb(0,0,255)">0</span>; i < length; i++ <span style="color:rgb(0,0,128);font-weight:bold">))</span>; <span style="color:rgb(0,0,128);font-weight:bold">do<br></span><span style="color:rgb(0,0,128);font-weight:bold"> </span><span style="color:rgb(11,12,149)">local </span>c=<span style="color:rgb(0,128,0);font-weight:bold">"${1:i:1}"<br></span><span style="color:rgb(0,128,0);font-weight:bold"> </span><span style="color:rgb(0,0,128);font-weight:bold">case </span>$c <span style="color:rgb(0,0,128);font-weight:bold">in<br></span><span style="color:rgb(0,0,128);font-weight:bold"> </span>[a-zA-Z0-9.~_-]) <span style="color:rgb(11,12,149)">printf </span><span style="color:rgb(0,128,0);font-weight:bold">"$c" </span><span style="color:rgb(0,0,128);font-weight:bold">;;<br></span><span style="color:rgb(0,0,128);font-weight:bold"> </span>*) <span style="color:rgb(11,12,149)">printf </span><span style="color:rgb(0,128,0);font-weight:bold">'%%%02X' "'$c" </span><span style="color:rgb(0,0,128);font-weight:bold">;;<br></span><span style="color:rgb(0,0,128);font-weight:bold"> esac<br></span><span style="color:rgb(0,0,128);font-weight:bold"> done<br></span><span style="color:rgb(0,0,128);font-weight:bold"><br></span><span style="color:rgb(0,0,128);font-weight:bold"> </span>LC_COLLATE=$old_lc_collate<br>}<br><br><span style="color:rgb(128,128,128);font-style:italic">#echo $DATA<br></span><span style="color:rgb(128,128,128);font-style:italic"><br></span><span style="color:rgb(0,0,128);font-weight:bold">for </span>id <span style="color:rgb(0,0,128);font-weight:bold">in </span>$DATA; <span style="color:rgb(0,0,128);font-weight:bold">do<br></span><span style="color:rgb(0,0,128);font-weight:bold"> </span>i=<span style="color:rgb(0,0,128);font-weight:bold">$</span>( <span style="color:rgb(197,118,51);font-style:italic">urlencode </span>$id )<br> <span style="color:rgb(11,12,149)">echo </span>curl <span style="color:rgb(0,128,0);font-weight:bold">"http://${SERVER}:7557/${COLLECTION}/${i}" </span>-X DELETE<br><span style="color:rgb(0,0,128);font-weight:bold">done</span></pre><pre style="font-family:hack;font-size:9pt"><span style="color:rgb(0,0,128);font-weight:bold"><br></span></pre></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 5, 2016 at 12:37 PM, Kris Germann <span dir="ltr"><<a href="mailto:kgermann@portal.net.co" target="_blank">kgermann@portal.net.co</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Thank you,<div><br></div><div>To be clear, this means I need to run:</div><div><br></div><div><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)"><span style="font-variant-ligatures:no-common-ligatures">root@config:/opt/genieacs# curl -i '<a href="http://localhost:7557/devices/XXXX" target="_blank">http://localhost:7557/<wbr>devices/XXXX</a>' -X DELETE</span></div></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">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"><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">Kris</span></div></font></span><div><div class="h5"><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><div><blockquote type="cite"><div>On Nov 1, 2016, at 3:49 PM, Oliver Kraitschy <<a href="mailto:okraits@arcor.de" target="_blank">okraits@arcor.de</a>> wrote:</div><br class="m_1959365256937891028Apple-interchange-newline"><div><div>Hello Kris,<br><br>you have to iterate over all devices and send a delete request for each one<br>of them.<br><br>You can use the API for that:<br><br><a href="https://github.com/zaidka/genieacs/wiki/API-Reference" target="_blank">https://github.com/zaidka/<wbr>genieacs/wiki/API-Reference</a><br><br>Or you can do it more easily with the python API:<br><br><a href="https://github.com/TDT-GmbH/python-genieacs" target="_blank">https://github.com/TDT-GmbH/<wbr>python-genieacs</a><br><br>Greetings,<br>Oliver<br><br>On Tue, Nov 01, 2016 at 12:24:41PM -0400, Kris Germann wrote:<br><blockquote type="cite">I find myself in the unique position of having tested too many devices, so I<br>have about 110 devices I need to delete...<br><br>Is there a 'destroy all' function I could incorporate?<br><br></blockquote><br><blockquote type="cite">______________________________<wbr>_________________<br>Users mailing list<br><a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br><a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank">http://lists.genieacs.com/<wbr>mailman/listinfo/users</a><br></blockquote><br>______________________________<wbr>_________________<br>Users mailing list<br><a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br><a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank">http://lists.genieacs.com/<wbr>mailman/listinfo/users</a><br></div></div></blockquote></div><br></div></div></div></div><br>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.genieacs.com/<wbr>mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>