<?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: In Apache Nifi Rest API, what is difference between Import and Upload? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226192#M188053</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/50211/tommylathrop.html" nodeid="50211"&gt;@Tommy Lathrop&lt;/A&gt;&lt;PRE&gt;Upload means Copying (or) uploading the template .XML file into the instance of NiFi.&lt;/PRE&gt;&lt;P&gt;Once the template is uploaded then the template is ready to be instantiated to the NiFi Canvas.&lt;/P&gt;&lt;PRE&gt;Import means Loading the copied (or) uploaded .XML file into NiFi Canvas(into root or process group).&lt;/PRE&gt;&lt;P&gt;Let's consider&lt;/P&gt;&lt;P&gt;You have created a flow in &lt;STRONG&gt;DEV env &lt;/STRONG&gt;and then you need to
promote this flow to &lt;STRONG&gt;PROD env&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;For this case we are going to create a Template in &lt;STRONG&gt;DEV env
first,&lt;/STRONG&gt; then &lt;STRONG&gt;download the template into local&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Then you are going to &lt;STRONG&gt;Upload the the template to PROD env
first&lt;/STRONG&gt; so the template will be available in PROD env now.&lt;/P&gt;&lt;P&gt;To add the &lt;STRONG&gt;uploaded template to the NiFi Canvas then you
need to import the template&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Dec 2017 02:47:51 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2017-12-19T02:47:51Z</dc:date>
    <item>
      <title>In Apache Nifi Rest API, what is difference between Import and Upload?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226191#M188052</link>
      <description />
      <pubDate>Tue, 19 Dec 2017 00:42:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226191#M188052</guid>
      <dc:creator>tommy_lathrop</dc:creator>
      <dc:date>2017-12-19T00:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: In Apache Nifi Rest API, what is difference between Import and Upload?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226192#M188053</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/50211/tommylathrop.html" nodeid="50211"&gt;@Tommy Lathrop&lt;/A&gt;&lt;PRE&gt;Upload means Copying (or) uploading the template .XML file into the instance of NiFi.&lt;/PRE&gt;&lt;P&gt;Once the template is uploaded then the template is ready to be instantiated to the NiFi Canvas.&lt;/P&gt;&lt;PRE&gt;Import means Loading the copied (or) uploaded .XML file into NiFi Canvas(into root or process group).&lt;/PRE&gt;&lt;P&gt;Let's consider&lt;/P&gt;&lt;P&gt;You have created a flow in &lt;STRONG&gt;DEV env &lt;/STRONG&gt;and then you need to
promote this flow to &lt;STRONG&gt;PROD env&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;For this case we are going to create a Template in &lt;STRONG&gt;DEV env
first,&lt;/STRONG&gt; then &lt;STRONG&gt;download the template into local&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Then you are going to &lt;STRONG&gt;Upload the the template to PROD env
first&lt;/STRONG&gt; so the template will be available in PROD env now.&lt;/P&gt;&lt;P&gt;To add the &lt;STRONG&gt;uploaded template to the NiFi Canvas then you
need to import the template&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 02:47:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226192#M188053</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2017-12-19T02:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: In Apache Nifi Rest API, what is difference between Import and Upload?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226193#M188054</link>
      <description>&lt;P&gt;Thank you &lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I was able to upload to my NiFi instance using following curl:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;curl -XPOST &lt;A href="http://&amp;lt;nifihost&amp;gt;/nifi-api/process-groups/&amp;lt;id&amp;gt;/templates/upload"&gt;http://&amp;lt;nifihost:nifiport&amp;gt;/nifi-api/process-groups/&amp;lt;id&amp;gt;/templates/upload&lt;/A&gt; -k -v -F template=@/path/to/template.xml&lt;/P&gt;&lt;P&gt;I am now tryin to import into NiFi Canvas but am unable to formulate the right command for this.  Can you help me with correct curl to import the uploaded template onto the canvas?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 04:44:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226193#M188054</guid>
      <dc:creator>tommy_lathrop</dc:creator>
      <dc:date>2017-12-19T04:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: In Apache Nifi Rest API, what is difference between Import and Upload?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226194#M188055</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/50211/tommylathrop.html" nodeid="50211"&gt;@Tommy Lathrop&lt;/A&gt;&lt;P&gt;To import the Template into NiFi Canvas we need to use specific syntax of curl command and template-instance&lt;/P&gt;&lt;PRE&gt;curl -i -X POST -H 'Content-Type:application/json' -d '{"originX": 2.0,"originY": 3.0,"templateId": "&amp;lt;template-id&amp;gt;"}' &lt;A href="http://localhost:8080/nifi-api/process-groups/&amp;lt;process-group-id&amp;gt;/template-instance" target="_blank"&gt;http://localhost:8080/nifi-api/process-groups/&amp;lt;process-group-id&amp;gt;/template-instance&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;Here is what i tried&lt;/P&gt;&lt;P&gt;I'm having a template in my Downloads folder&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;1.To upload a template from Downloads folder to NiFi i used below curl with upload method&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -X POST &lt;A href="http://localhost:8080/nifi-api/process-groups/226b1e5f-0160-1000-deb0-791f1a6f1f00/templates/upload" target="_blank"&gt;http://localhost:8080/nifi-api/process-groups/226b1e5f-0160-1000-deb0-791f1a6f1f00/templates/upload&lt;/A&gt; -k -v -F template=@/cygdrive/c/shu/Downloads/Count_Loop.xml&lt;/PRE&gt;&lt;P&gt;in the above curl i'm using &lt;STRONG&gt;POST&lt;/STRONG&gt; and my process group id is &lt;STRONG&gt;226b1e5f-0160-1000-deb0-791f1a6f1f00 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;??Why we need to specify process group id while uploading??&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Templates are owned by a process group (whether that is the root process group or one nested in the canvas). You can upload templates by making use of the '/process-groups/{id}/templates/upload' to upload a template to a particular process group.&lt;/P&gt;&lt;P&gt;Then i have given the path to the my Count_Loop.xml file and uploaded the template into NiFi Instance.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;2.Now we need to import the Uploaded Count_Loop.xml into NiFi canvas&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For this case we need to have our Template ID, For this id &lt;/P&gt;&lt;PRE&gt;Curl &lt;A href="http://localhost:8080/nifi-api/flow/templates" target="_blank"&gt;http://localhost:8080/nifi-api/flow/templates&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;Hit the above API and get the Template id for the Uploaded template for my case my template id is &lt;STRONG&gt;02a4b939-ac14-4fac-9f05-550cc521b317.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then we need to instantiate the template by using POST method and template-instance&lt;/P&gt;&lt;PRE&gt;POST
/process-groups/{id}/template-instance&lt;/PRE&gt;&lt;P&gt;My command is as follows&lt;/P&gt;&lt;PRE&gt;curl -i -X POST -H 'Content-Type:application/json' -d '{"originX": 2.0,"originY": 3.0,"templateId": "02a4b939-ac14-4fac-9f05-550cc521b317"}' &lt;A href="http://localhost:8080/nifi-api/process-groups/226b1e5f-0160-1000-deb0-791f1a6f1f00/template-instance" target="_blank"&gt;http://localhost:8080/nifi-api/process-groups/226b1e5f-0160-1000-deb0-791f1a6f1f00/template-instance&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;i'm importing the uploaded &lt;STRONG&gt;Count_Loop.xml&lt;/STRONG&gt; into the P&lt;STRONG&gt;rocessGroupID&lt;/STRONG&gt; &lt;STRONG&gt;226b1e5f-0160-1000-deb0-791f1a6f1f00 &lt;/STRONG&gt; ,we got template id before so i'm using the &lt;STRONG&gt; TemplateID &lt;/STRONG&gt;&lt;B&gt;02a4b939-ac14-4fac-9f05-550cc521b317&lt;/B&gt; in the above curl method. &lt;/P&gt;&lt;P&gt;This template instance &lt;STRONG&gt;expects origin x, y and template id&lt;/STRONG&gt; for sure. If you are missing any of these parameters then it results &lt;STRONG&gt;Bad request error.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer&lt;/STRONG&gt;, That would be great help to Community users to find solution quickly for these kind of errors.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 12:30:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226194#M188055</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2017-12-19T12:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: In Apache Nifi Rest API, what is difference between Import and Upload?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226195#M188056</link>
      <description>&lt;P&gt;Thank you &lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 03:59:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226195#M188056</guid>
      <dc:creator>tommy_lathrop</dc:creator>
      <dc:date>2017-12-20T03:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: In Apache Nifi Rest API, what is difference between Import and Upload?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226196#M188057</link>
      <description>Is it always two step process for XML import, Can I not directly copy the flow or import to the flow to the canvas ?&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I understand in Upload and Import there will be always a template copy created for any flow that has to be imported to the canvas.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;I have one flow (xml), I will have to create ten copies/instance of this flow (with different source/target). &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I know we can import ten times from one template after uploading (one time) and then update the variables  again by Rest API.&lt;/P&gt;&lt;P&gt; But I want to update the parameters/variables in xml file itself and then directly import to canvas for some reasons. Is it possible ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 01:39:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Apache-Nifi-Rest-API-what-is-difference-between-Import/m-p/226196#M188057</guid>
      <dc:creator>agilajil</dc:creator>
      <dc:date>2019-04-05T01:39:51Z</dc:date>
    </item>
  </channel>
</rss>

