nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Burgess <mattyb...@apache.org>
Subject Re: Download Multiple Files from Queue
Date Mon, 10 Oct 2016 13:10:06 GMT
Manish,

This is possible via the REST API [1]:

1) Identify the UUID of the connection you're interested in. This can
be done manually using the UI (right-click on the connection, choose
Configure, then on the Settings tab there is an "Id" field. You can
also use the flow API
(nifi-api/flow/process-groups/<process_group_id>) to get all the
components for the Process Group and find the connections in the JSON
response.

2) Request the queue details with a POST to
nifi-api/flowfile-queues/<connection_id>/listing-requests. This is an
asynchronous operation, you'll get a response with (among other
things) an ID for the request, a URI and a "finished" property. Once
finished is true, you can do a GET on the URI from the response, which
looks like:
 nifi-api/flowfile-queues/<connection_id>/listing-requests/<listing_request_id>

3) The response from the listing request (with ID) contains a
flowFileSummaries array. Each element is an object that contains
(among other things) the filename, the file size, and the URI to use
for access to the file. To get the contents, do a GET on the URI plus
/content on the end:
nifi-api/flowfile-queues/<connection_id>/flowfiles/<flow_file_id>/content

A "Download All" button on the Queue Listing dialog (with
corresponding REST API endpoint) could be pretty helpful, perhaps by
providing a ZIP with the flow files (with some naming convention like
filename_uuid or something). Please feel free to write a Jira [2] to
suggest this feature.

Regards,
Matt

[1] https://nifi.apache.org/docs/nifi-docs/rest-api/index.html
[2] https://issues.apache.org/jira/browse/NIFI/

On Mon, Oct 10, 2016 at 7:42 AM, Manish Gupta 8 <mgupta50@sapient.com> wrote:
> Hello Everyone,
>
>
>
> Is there a way I can download multiple flow files from a queue at once (from
> UI) or may be programmatically? If it’s not possible now, I think this
> feature should definitely be added J
>
>
>
> Regards,
>
> Manish
>
>

Mime
View raw message