nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mohammed shambakey <shambak...@gmail.com>
Subject Re: send contents of web page to a remote nifi instance
Date Thu, 09 Feb 2017 15:59:00 GMT
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 <shambakey1@gmail.com>
wrote:

> Thanks Matt
>
> On Wed, Feb 8, 2017 at 3:22 PM, Matt Burgess <mattyb149@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
>> <shambakey1@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

Mime
View raw message