You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by mohammed shambakey <sh...@gmail.com> on 2017/02/08 16:55:27 UTC

send contents of web page to a remote nifi instance

Hi

I'm sorry if the question is silly, but it is giving me a hard time. We
have a web page that contain some inputs (e.g., userid and other
parameters) and I want to sent these parameters to a remote nifi-instance.

I think I should use "handlHTTPRequst" processor at the remote instance,
but I'm not sure how the web page can specify the address of the
"handlHTTPRequest" processor at the remote NIFI site (e.g., we have the IP
address of the remote NIFI instance, but how to specify the address of the
"handleHTTPPequst" processor)?

I've seen some examples on NIFI docs about "hendleHTTPRequest" but they
don't have the web page to NIFI instance. I wonder if there are other
examples for this case?

Regards

-- 
Mohammed

Re: send contents of web page to a remote nifi instance

Posted by mohammed shambakey <sh...@gmail.com>.
Hi

I sent multiple files, besides other information, to a remote NIFI
instance. The remote NIFI instance receives the HTTP request as follows:

-----------------------------16842747222614868992046715641
Content-Disposition: form-data; name="script";
filename="Generate_GPM_JPDF_example.py"
Content-Type: text/x-python

<HERE THE BODY OF Generate_GPM_JPDF_example.py SCRIPT>

-----------------------------16842747222614868992046715641
Content-Disposition: form-data; name="script"; filename="draw_JPDF.py"
Content-Type: text/x-python

<HERE THE BODY OF draw_JPDF.py SCRIPT>


-----------------------------16842747222614868992046715641
Content-Disposition: form-data; name="submit_script"

Submit
-----------------------------16842747222614868992046715641--

I'm trying to use NIFI to write contents of python scripts locally.
besides, I should write down other information in the form (will be added
later) to a local configuration file. I think I should use "extracttext"
and "splittext" processors, but I can't figure out how? or there is some
other way (beside using script files to extract required information)?

Regards

On Wed, Feb 8, 2017 at 7:19 PM, mohammed shambakey <sh...@gmail.com>
wrote:

> Thanks Matt
>
> On Wed, Feb 8, 2017 at 3:22 PM, Matt Burgess <ma...@apache.org> wrote:
>
>> Mohammed,
>>
>> HandleHttpRequest [1] allows you to specify the listening port as well
>> as Allowed Paths. Using the hostname/IP of the NiFi instance, along
>> with the Listening Port and Allowed Paths, creates an endpoint to
>> which you can issue HTTP commands (GET, PUT, POST -- all can be
>> allowed or denied via the processor properties). I think under the
>> hood the processor spawns Jetty with the configured properties to
>> accept the request(s).
>>
>> So for a hostname of "nifi.mydomain.com", with a listening port of
>> 8989 and an Allowed Path of /sendParameters, you could POST to
>> http://nifi.mydomain.com:8989/sendParameters and the (running)
>> HandleHttpRequest processor would accept it. Check the documentation
>> and example Hello_NiFi_Web_Service [2] for usage patterns, such as
>> using a downstream HandleHttpResponse processor in order to return a
>> response from the request.
>>
>> Regards,
>> Matt
>>
>> [1] https://nifi.apache.org/docs/nifi-docs/components/org.apache
>> .nifi.processors.standard.HandleHttpRequest/index.html
>> [2] https://cwiki.apache.org/confluence/display/NIFI/Example+
>> Dataflow+Templates
>>
>> On Wed, Feb 8, 2017 at 11:55 AM, mohammed shambakey
>> <sh...@gmail.com> wrote:
>> > Hi
>> >
>> > I'm sorry if the question is silly, but it is giving me a hard time. We
>> have
>> > a web page that contain some inputs (e.g., userid and other parameters)
>> and
>> > I want to sent these parameters to a remote nifi-instance.
>> >
>> > I think I should use "handlHTTPRequst" processor at the remote
>> instance, but
>> > I'm not sure how the web page can specify the address of the
>> > "handlHTTPRequest" processor at the remote NIFI site (e.g., we have the
>> IP
>> > address of the remote NIFI instance, but how to specify the address of
>> the
>> > "handleHTTPPequst" processor)?
>> >
>> > I've seen some examples on NIFI docs about "hendleHTTPRequest" but they
>> > don't have the web page to NIFI instance. I wonder if there are other
>> > examples for this case?
>> >
>> > Regards
>> >
>> > --
>> > Mohammed
>>
>
>
>
> --
> Mohammed
>



-- 
Mohammed

Re: send contents of web page to a remote nifi instance

Posted by mohammed shambakey <sh...@gmail.com>.
Thanks Matt

On Wed, Feb 8, 2017 at 3:22 PM, Matt Burgess <ma...@apache.org> wrote:

> Mohammed,
>
> HandleHttpRequest [1] allows you to specify the listening port as well
> as Allowed Paths. Using the hostname/IP of the NiFi instance, along
> with the Listening Port and Allowed Paths, creates an endpoint to
> which you can issue HTTP commands (GET, PUT, POST -- all can be
> allowed or denied via the processor properties). I think under the
> hood the processor spawns Jetty with the configured properties to
> accept the request(s).
>
> So for a hostname of "nifi.mydomain.com", with a listening port of
> 8989 and an Allowed Path of /sendParameters, you could POST to
> http://nifi.mydomain.com:8989/sendParameters and the (running)
> HandleHttpRequest processor would accept it. Check the documentation
> and example Hello_NiFi_Web_Service [2] for usage patterns, such as
> using a downstream HandleHttpResponse processor in order to return a
> response from the request.
>
> Regards,
> Matt
>
> [1] https://nifi.apache.org/docs/nifi-docs/components/org.
> apache.nifi.processors.standard.HandleHttpRequest/index.html
> [2] https://cwiki.apache.org/confluence/display/NIFI/
> Example+Dataflow+Templates
>
> On Wed, Feb 8, 2017 at 11:55 AM, mohammed shambakey
> <sh...@gmail.com> wrote:
> > Hi
> >
> > I'm sorry if the question is silly, but it is giving me a hard time. We
> have
> > a web page that contain some inputs (e.g., userid and other parameters)
> and
> > I want to sent these parameters to a remote nifi-instance.
> >
> > I think I should use "handlHTTPRequst" processor at the remote instance,
> but
> > I'm not sure how the web page can specify the address of the
> > "handlHTTPRequest" processor at the remote NIFI site (e.g., we have the
> IP
> > address of the remote NIFI instance, but how to specify the address of
> the
> > "handleHTTPPequst" processor)?
> >
> > I've seen some examples on NIFI docs about "hendleHTTPRequest" but they
> > don't have the web page to NIFI instance. I wonder if there are other
> > examples for this case?
> >
> > Regards
> >
> > --
> > Mohammed
>



-- 
Mohammed

Re: send contents of web page to a remote nifi instance

Posted by Matt Burgess <ma...@apache.org>.
Mohammed,

HandleHttpRequest [1] allows you to specify the listening port as well
as Allowed Paths. Using the hostname/IP of the NiFi instance, along
with the Listening Port and Allowed Paths, creates an endpoint to
which you can issue HTTP commands (GET, PUT, POST -- all can be
allowed or denied via the processor properties). I think under the
hood the processor spawns Jetty with the configured properties to
accept the request(s).

So for a hostname of "nifi.mydomain.com", with a listening port of
8989 and an Allowed Path of /sendParameters, you could POST to
http://nifi.mydomain.com:8989/sendParameters and the (running)
HandleHttpRequest processor would accept it. Check the documentation
and example Hello_NiFi_Web_Service [2] for usage patterns, such as
using a downstream HandleHttpResponse processor in order to return a
response from the request.

Regards,
Matt

[1] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.HandleHttpRequest/index.html
[2] https://cwiki.apache.org/confluence/display/NIFI/Example+Dataflow+Templates

On Wed, Feb 8, 2017 at 11:55 AM, mohammed shambakey
<sh...@gmail.com> wrote:
> Hi
>
> I'm sorry if the question is silly, but it is giving me a hard time. We have
> a web page that contain some inputs (e.g., userid and other parameters) and
> I want to sent these parameters to a remote nifi-instance.
>
> I think I should use "handlHTTPRequst" processor at the remote instance, but
> I'm not sure how the web page can specify the address of the
> "handlHTTPRequest" processor at the remote NIFI site (e.g., we have the IP
> address of the remote NIFI instance, but how to specify the address of the
> "handleHTTPPequst" processor)?
>
> I've seen some examples on NIFI docs about "hendleHTTPRequest" but they
> don't have the web page to NIFI instance. I wonder if there are other
> examples for this case?
>
> Regards
>
> --
> Mohammed