Skip to main content
MattWho
MattWhoAnswer
Titanium ⭐️⭐️⭐️
February 25, 2020

@nishank_paras 

 

You can use the invokeHTTP processor to fetch your file.  Here is an example:
Screen Shot 2020-02-25 at 2.15.36 PM.png

The above example fetches the Apache nifi-toolkit-1.11.3-bin.tar.gz file.

You can then construct a dataflow using other processors to manipulate as you want or simply just connect to another invokeHTTP processor that instead of "GET" uses "PUT" to put your file "nn.csv" at the new http endpoint.

 

Hope this helps you,

Matt

 

5 replies

MattWho
Titanium ⭐️⭐️⭐️
Titanium ⭐️⭐️⭐️
February 18, 2020

@nishank_paras 

 

First we need to asks questions to better understand the http cloud endpoint:

How do you currently accomplish this task outside of NiFi?
Is it possible to connect via a terminal/command prompt to get the file from the http cloud server?
Does the http cloud service have a rest-api for getting data from it?

 

My first thought would be the invokeHTTP processor to get your file from the http cloud server...
Then use an UpdateAttribute processor to change the "filename" attribute value on the NiFi FlowFile created by the invokeHTTTP processor...
 You did not mention what you want to do with this file once you have retrieved it ad renamed it in NiFi.  Are you trying to write it back to the same http cloud service?  Are you trying to write the file to another service/endpoint?  Are you writing it to a local directory?

 

Then we can start to look at what processors NiFi may have available to accomplish the same methods.

 

Hope this helps get you started,

Matt

Translate
nishank_paras
Silver ⭐️⭐️⭐️
February 19, 2020

@MattWho 

i am trying to save it to a remote server

 

yes this task can be done using shell scripting 

Translate
MattWho
Titanium ⭐️⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️⭐️
February 25, 2020

@nishank_paras 

 

You can use the invokeHTTP processor to fetch your file.  Here is an example:
Screen Shot 2020-02-25 at 2.15.36 PM.png

The above example fetches the Apache nifi-toolkit-1.11.3-bin.tar.gz file.

You can then construct a dataflow using other processors to manipulate as you want or simply just connect to another invokeHTTP processor that instead of "GET" uses "PUT" to put your file "nn.csv" at the new http endpoint.

 

Hope this helps you,

Matt

 

Translate
Vj1989
Gold ⭐️
February 19, 2020

You may use below commands for this. 

 

wget http://77.17.6.166/tls/file/nn.csv

scp nn.csv username@77.17.6.122:/tls/file/hello.csv

Translate
nishank_paras
Silver ⭐️⭐️⭐️
February 20, 2020

this is shell scripting i need to do this in nifi

@Vj1989 

Translate