<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Can we empty all the queues inside a process-group level by calling only one rest-api ?  What  are the other function we can do at prosess group level directly by using only one rest-api call in nifi version 1.5.0 ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/305596#M222516</link>
    <description>&lt;P&gt;great job dude, thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Nov 2020 21:37:52 GMT</pubDate>
    <dc:creator>pipe</dc:creator>
    <dc:date>2020-11-08T21:37:52Z</dc:date>
    <item>
      <title>Can we empty all the queues inside a process-group level by calling only one rest-api ?  What  are the other function we can do at prosess group level directly by using only one rest-api call in nifi version 1.5.0 ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/200704#M162722</link>
      <description>&lt;P&gt;I faced this problem during deletion of a process group via rest-api code  &lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 13:18:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/200704#M162722</guid>
      <dc:creator>damineesao93</dc:creator>
      <dc:date>2018-02-04T13:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can we empty all the queues inside a process-group level by calling only one rest-api ?  What  are the other function we can do at prosess group level directly by using only one rest-api call in nifi version 1.5.0 ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/200705#M162723</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/63207/damineesao93.html" nodeid="63207" target="_blank"&gt;@Daminee Sao&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;There is no restapi call supported in nifi that can clear off all the queues inside the process group level, all the &lt;STRONG&gt;drop requests&lt;/STRONG&gt; rest api call expects &lt;STRONG&gt;connection id(queue id)&lt;/STRONG&gt; to be included in call.&lt;/P&gt;&lt;P&gt;But by making use of &lt;STRONG&gt;Process Group Connections&lt;/STRONG&gt; and &lt;STRONG&gt;Drop Requests RestApi &lt;/STRONG&gt;call we can clear off all the queues inside the process group.&lt;/P&gt;&lt;PRE&gt;curl -i -X GET {nifi-ip-address}/nifi-api/process-groups/{id}/connections //to get all the connections in the process group
curl -i -X POST {nifi-ip-address}/nifi-api/flowfile-queues/{connection-id}/drop-requests //drop all flowfiles for the specific connection&lt;/PRE&gt;&lt;P&gt;Below are the process group level rest-api calls&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="59433-processgroup-restapi.png" style="width: 2657px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17512i0D79197FA28795E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="59433-processgroup-restapi.png" alt="59433-processgroup-restapi.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;refer to below link for more api calls supported on process group level.&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/rest-api/index.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://nifi.apache.org/docs/nifi-docs/rest-api/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;i have my nifi instance running on &lt;STRONG&gt;localhost&lt;/STRONG&gt; &lt;STRONG&gt;port&lt;/STRONG&gt; 9090 and my &lt;STRONG&gt;process group id&lt;/STRONG&gt; is &lt;STRONG&gt;619a2801-0161-1000-a4c2-95e4430e977f&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;once i make below rest api call will result all the connections that i'm having in the specific process group&lt;/P&gt;&lt;PRE&gt;curl -i -X GET &lt;A href="http://localhost:9090/nifi-api/process-groups/619a2801-0161-1000-a4c2-95e4430e977f/connections" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:9090/nifi-api/process-groups/619a2801-0161-1000-a4c2-95e4430e977f/connections&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;i'm having 2 connection id's(&lt;STRONG&gt;58629c69-0161-1000-b2e4-254f8afcde9c&lt;/STRONG&gt;,&lt;STRONG&gt;619d132e-0161-1000-f689-198ce61282da&lt;/STRONG&gt;)inside my process group.&lt;/P&gt;&lt;P&gt;To drop all requests in this connections, call drop requests api&lt;/P&gt;&lt;PRE&gt;curl -i -X POST &lt;A href="http://localhost:9090/nifi-api/flowfile-queues/58629c69-0161-1000-b2e4-254f8afcde9c/drop-requests" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:9090/nifi-api/flowfile-queues/58629c69-0161-1000-b2e4-254f8afcde9c/drop-requests&lt;/A&gt;
curl -i -X POST &lt;A href="http://localhost:9090/nifi-api/flowfile-queues/619d132e-0161-1000-f689-198ce61282da/drop-requests" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:9090/nifi-api/flowfile-queues/619d132e-0161-1000-f689-198ce61282da/drop-requests&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;Write a script that can extract all connection id's from connections api call and loop the connection id's in drop requests api call.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(or)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;By using NiFi &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;GenerateFlowfile //trigger flow
InvokeHTTP //by using get method we are going to get json flowfile with all connections as content.
SplitJson //split on $.connections to get each connection as individual flowfile
EvaluateJsonPath //extract $.id from json message and keep as flowfile attribute
InvokeHTTP //by using post method use the extracted attribute and make a call to drop requests &lt;A href="http://localhost:9090/nifi-api/flowfile-queues/${connection_id}/drop-requests" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:9090/nifi-api/flowfile-queues/${connection_id}/drop-requests&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="59435-flow.png" style="width: 1914px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17513i982D912FAA68B312/image-size/medium?v=v2&amp;amp;px=400" role="button" title="59435-flow.png" alt="59435-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have attached the xml file of the above flow save and use the flow make changes as per your needs.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/59434-drop-requests-167593.xml" target="_blank"&gt;drop-requests-167593.xml&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:39:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/200705#M162723</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T05:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can we empty all the queues inside a process-group level by calling only one rest-api ?  What  are the other function we can do at prosess group level directly by using only one rest-api call in nifi version 1.5.0 ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/200706#M162724</link>
      <description>&lt;P&gt;@Shu&lt;BR /&gt;Great description and thanks for the example. It works just the way I need!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 21:58:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/200706#M162724</guid>
      <dc:creator>justenji</dc:creator>
      <dc:date>2019-01-11T21:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can we empty all the queues inside a process-group level by calling only one rest-api ?  What  are the other function we can do at prosess group level directly by using only one rest-api call in nifi version 1.5.0 ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/200707#M162725</link>
      <description>&lt;P&gt;The following would purge all queues indiscriminately from NiFi using the python library &lt;A rel="noopener noreferrer noopener noreferrer" href="https://github.com/Chaffelson/nipyapi" target="_blank"&gt;nipyapi&lt;/A&gt; (assuming no auth)&lt;/P&gt;&lt;PRE&gt;import nipyapi
nipyapi.config.nifi_config.host = 'http://nifi:8080/nifi-api
#Queues can be large - increase timeout
nipyapi.config.short_max_wait = 3600
for queue in nipyapi.canvas.list_all_connections():
    print("clearing flow files from connection: " + queue.id, end=': ')
    print("Successful") if nipyapi.canvas.purge_connection(queue.id) else print("Unsuccessful")&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2019 05:42:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/200707#M162725</guid>
      <dc:creator>matthew_gaetano</dc:creator>
      <dc:date>2019-03-02T05:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can we empty all the queues inside a process-group level by calling only one rest-api ?  What  are the other function we can do at prosess group level directly by using only one rest-api call in nifi version 1.5.0 ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/305596#M222516</link>
      <description>&lt;P&gt;great job dude, thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 21:37:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-we-empty-all-the-queues-inside-a-process-group-level-by/m-p/305596#M222516</guid>
      <dc:creator>pipe</dc:creator>
      <dc:date>2020-11-08T21:37:52Z</dc:date>
    </item>
  </channel>
</rss>

