<?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: Unable to import templates in Nifi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384889#M245543</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/42173"&gt;@ckumar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Is there any way (api call) to directly import the templates into the nifi canvas&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/process-groups/{id}/templates/import&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;we got this api call in the nifi api doc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;doc - &lt;A href="https://nifi.apache.org/docs/nifi-docs/rest-api/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/rest-api/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This is not working for us&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 10:12:44 GMT</pubDate>
    <dc:creator>broobalaji</dc:creator>
    <dc:date>2024-03-12T10:12:44Z</dc:date>
    <item>
      <title>Unable to import templates in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384875#M245533</link>
      <description>&lt;P&gt;Hi Team,&amp;nbsp;&lt;BR /&gt;We have a usescase wherein we want to import the templates directly into nifi canvas using the rest apis provided by nifi we are hitting with the below error. If anyone faced this issue previously please assisst.&lt;/P&gt;&lt;P&gt;we are able to upload, download but import is not working&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the token&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;bearer=$(curl '&lt;A href="https://nifi-host:nifi-port/nifi-api/access/token" target="_blank" rel="noopener"&gt;https://nifi-host:nifi-port/nifi-api/access/token&lt;/A&gt;' --data 'username=username&amp;amp;password=password' --compressed --insecure)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;To import the template&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;curl -i -X -k POST -H "Content-Type: application/xml" -H "Authorization: Bearer $bearer" -F "template=@/root/tmp/template.xml" &lt;A href="https://nifi-host:nifi-port/nifi-api/process-groups/processor-group-id/templates/import" target="_blank" rel="noopener"&gt;https://nifi-host:nifi-port/nifi-api/process-groups/processor-group-id/templates/import&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Nifi version -&amp;nbsp;&lt;SPAN&gt;1.8.0.3.3.1.0-10&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN&gt;error -&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;HTTP 400 Bad Request&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 06:54:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384875#M245533</guid>
      <dc:creator>broobalaji</dc:creator>
      <dc:date>2024-03-12T06:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to import templates in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384882#M245536</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106080"&gt;@broobalaji&lt;/a&gt;,&amp;nbsp;Welcome to our community! To help you get the best possible answer, I have tagged in our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/31438"&gt;@TimothySpann&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/95503"&gt;@steven-matison&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/42173"&gt;@ckumar&lt;/a&gt;&amp;nbsp;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:05:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384882#M245536</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2024-03-12T09:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to import templates in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384883#M245537</link>
      <description>&lt;P&gt;If you have&amp;nbsp; to load the new template from the filesystem/local to the NiFi cluster, the following API call should be made with POST method&amp;nbsp;&lt;/P&gt;&lt;P&gt;nifi-api/process-groups/{pg-id}/templates/upload&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:22:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384883#M245537</guid>
      <dc:creator>ckumar</dc:creator>
      <dc:date>2024-03-12T09:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to import templates in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384889#M245543</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/42173"&gt;@ckumar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Is there any way (api call) to directly import the templates into the nifi canvas&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/process-groups/{id}/templates/import&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;we got this api call in the nifi api doc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;doc - &lt;A href="https://nifi.apache.org/docs/nifi-docs/rest-api/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/rest-api/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This is not working for us&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 10:12:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384889#M245543</guid>
      <dc:creator>broobalaji</dc:creator>
      <dc:date>2024-03-12T10:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to import templates in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384895#M245546</link>
      <description>&lt;P&gt;&amp;nbsp;The first step is to create a template, which can be&amp;nbsp; created within in NiFi cluster from another flow or uploaded from the filesystem, this action will load the templates under&amp;nbsp;&lt;/P&gt;&lt;P&gt;/nifi-api/flow/templates&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then use the below one to create a process group from a template.&amp;nbsp;&lt;BR /&gt;/process-groups/{id}/template-instance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;import is not the right API call, you can verify this from from web developer tool doing the same actions from UI.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 10:50:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384895#M245546</guid>
      <dc:creator>ckumar</dc:creator>
      <dc:date>2024-03-12T10:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to import templates in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384898#M245549</link>
      <description>&lt;P&gt;Thanks we were able to import the templates using the api calls&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider ed axm axn axo axp axq axr axs axt axu axv axw axx axy axz aya ayb ayc ayd aye ayf ayg ayh ayi ayj ayk ayl aym ayn ayo ayp ayq ayr ays ayt"&gt;curl -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer $bearer" -F "template=@/root/api_testing/template.xml" &lt;A class="fui-Link ___1rxvrpe f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1hu3pq6 f11qmguv f19f4twv f1tyq0we f1g0x7ka fhxju0i f1qch9an f1cnd47f fqv5qza f1vmzxwi f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn" title="https://nvmbddvv008842.bss.dev.jio.com:9091/nifi-api/process-groups/12b0d079-018e-1000-ffff-fffff11f0494/templates/upload" href="https://nvmbddvv008842.bss.dev.jio.com:9091/nifi-api/process-groups/12b0d079-018e-1000-ffff-fffff11f0494/templates/upload" target="_blank" rel="noreferrer noopener"&gt;https://host-ip:host-port/nifi-api/process-groups/process-group-id/templates/upload&lt;/A&gt; -k&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider ed axm axn axo axp axq axr axs axt axu axv axw axx axy axz aya ayb ayc ayd aye ayf ayg ayh ayi ayj ayk ayl aym ayn ayo ayp ayq ayr ays ayt"&gt;First we need to upload the template from local as it generates a id for the template which we can use for importing the template into the canvas&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider ed axm axn axo axp axq axr axs axt axu axv axw axx axy axz aya ayb ayc ayd aye ayf ayg ayh ayi ayj ayk ayl aym ayn ayo ayp ayq ayr ays ayt"&gt;For importing the template&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $bearer" -d '{"templateId":"template-id","originX":100,"originY":100}' &amp;nbsp;&lt;/SPAN&gt;&lt;A class="fui-Link ___1rxvrpe f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1hu3pq6 f11qmguv f19f4twv f1tyq0we f1g0x7ka fhxju0i f1qch9an f1cnd47f fqv5qza f1vmzxwi f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn" title="https://nvmbddvv008842.bss.dev.jio.com:9091/nifi-api/process-groups/12b0d079-018e-1000-ffff-fffff11f0494/template-instance" href="https://nvmbddvv008842.bss.dev.jio.com:9091/nifi-api/process-groups/12b0d079-018e-1000-ffff-fffff11f0494/template-instance" target="_blank" rel="noreferrer noopener"&gt;&lt;SPAN&gt;https://host-ip:host-port/nifi-api/process-groups/process-group-id/template-instance&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; -k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 11:43:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384898#M245549</guid>
      <dc:creator>broobalaji</dc:creator>
      <dc:date>2024-03-12T11:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to import templates in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384901#M245552</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106080"&gt;@broobalaji&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;HDF 1.8.0.3.3.1.0-10 was released way back in 2017.&amp;nbsp; I strongly recommend upgrading to a much newer release of CFM.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;NiFi Templates have been deprecated and are completely removed as of Apache NiFi 2.x releases.&amp;nbsp; Apache NiFi deprecated templates for a number of reasons:&lt;/P&gt;&lt;P&gt;1. Templates uploaded to NiFi (even if not instantiated/imported to the NiFi canvas reside within NiFi's heap memory space)&amp;nbsp;&lt;BR /&gt;2. Large uploaded templates or many uploaded templates can have a substantial impact on NiFi performance because of the amount of heap they can consume.&amp;nbsp; Simply increasing the size of NiFi's heap is also not the best solution to that heap usage as large heaps just lend themselves to longer stop-the-world garbage collections with the JVM.&amp;nbsp;&lt;BR /&gt;3. Apache NiFi deprecated and moved away from using xml based flow in favor of json flow definitions around the Apache NiFi 1.16 time frame.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Flow definitions (JSON files) can exported and imported without uploading them in to heap memory within NiFi.&lt;BR /&gt;&lt;BR /&gt;The above info aside....&lt;BR /&gt;It is best to use the developer tools available in your web browser to inspect/capture the rest-api call being made when you perform the same steps directly via the NiFi UI.&amp;nbsp; This makes it easy to understand the calls that need to be made in your automation.&amp;nbsp; I also encourage you if you continue to use templates to upload, import to UI, and then delete the uploaded template to minimize heap impact.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 13:22:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-import-templates-in-Nifi/m-p/384901#M245552</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-03-12T13:22:25Z</dc:date>
    </item>
  </channel>
</rss>

