I have been able to run my rest calls and get json data returned. I do
have a process for creating Json objects from those responses, but I see
there is the nifi API has object classes for successful returns.
For example, the /controller/about call returns a JSON with two entries
(revision and about) and according to the Rest API doc it could also be
an AboutEntity that has two properties with the same respective names.
But when I look at the About entity, it doesn't have a constructor to
use a JSON string to set the property values and create an instance of
the entity.
Is there a recommended approach for getting the response as the
respective Entity object for the rest call?
Also, I've tried some attempts to test Nifi's persistence when a data
flow is active. But I think the data flow I've created is too small or
simple as by the time I've disabled power the to mission, the data flow
has successfully run it's course. Are there any recommendations for ways
to test what happens to data within a data flow when nifi is suddenly
terminated?
I know there are four repositories in use, does the data in a data flow
get stored in any of these repositories when transitioning between
processors within a data flow? Does Nifi continue where it left off when
possible?
John
On 9/2/15 11:34 AM, Aldrin Piri wrote:
> John,
>
> The API lives at /nifi-api, so the address you are looking for would
> be http://localhost:8080/nifi-api/controller/about
>
> Please let us know if you have any additional questions or stumbling
> blocks. Thanks!
>
> Aldrin Piri
>
> Sent from my mobile device.
>
>
> On Wed, Sep 2, 2015 at 10:16 AM, John McMahon
> <jmcmahon@bericotechnologies.com
> <mailto:jmcmahon@bericotechnologies.com>> wrote:
>
> Greetings all,
>
> I have started looking into Apache Nifi. I was interested in using
> the Rest API and after I started my instance of Nifi, I wanted to
> test it.
>
> My Nifi is located at localhost:8080/nifi. I am using Rest Web
> Service Client on Chrome
>
> I set the method to GET and the URL to
> http://localhost:8080/nifi/controller/about
>
> I think this is a good rest call to use since the Authorization is
> Ready Only and the data shouldn't be anything critical.
>
> I get the the following response:
>
> 404, Not Found
> Date: Wed, 02 Sep 2015 15:08:44 GMT
> Cache-Control: must-revalidate,no-cache,no-store,
> must-revalidate,no-cache,no-store
> X-UA-Compatible: IE=edge
> Server: Jetty(9.2.11.v20150529)
> Content-Length: 305
> Content-Type: text/html; charset=ISO-8859-1
>
> *Time taken*(in milliseconds): 52
>
> Mind you, I don't have any users entered into Nifi's user list.
> This is currently just a barebones Nifi instance.
>
> I don't know why the response contains IE=edge as I do not have
> that software on my Mac.
>
> Is the path I entered for URL incorrect? Then I set the URL to
> http://localhost:8080/controller/about
>
> and it returned a response code of 200, however in the Raw
> Response I got the following message about mistyping and
> recommending I add "/nifi" to the path:
>
> <!DOCTYPE html>
> <html>
>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <link rel="shortcut icon" href="../nifi/images/nifi16.ico"/>
> <title>NiFi</title>
> <link href="/nifi/css/message-pane.css" rel="stylesheet"
> type="text/css" />
> <link href="/nifi/css/message-page.css" rel="stylesheet"
> type="text/css" />
> </head>
>
> <body class="message-pane">
> <div class="message-pane-message-box">
> <p class="message-pane-title">
> Did you mean: <a href="/nifi/">/nifi</a>
> </p>
> <p class="message-pane-content">You may have mistyped...</p>
> </div>
> </body>
> </html>
>
>
|