Friday, February 22, 2019

Apache NiFi - API

NiFi offers a large number of API, which helps developers to make changes and get information of NiFi from any other tool or custom developed applications. In this tutorial, we will use postman app in google chrome to explain some examples.
To add postmantoyour Google Chrome, go to the below mentioned URL and click add to chrome button. You will now see a new app added toyour Google Chrome.
The current version of NiFi rest API is 1.8.0 and the documentation is present in the below mentioned URL.
Following are the most used NiFi rest API Modules −
  • http://<nifi url>:<nifi port>/nifi-api/<api-path>
  • In case HTTPS is enabled https://<nifi url>:<nifi port>/nifi-api/<api-path>
S.No.API module Nameapi-pathDescription
1Access/accessTo authenticate user and get access token from NiFi.
2Controller/controllerTo manage the cluster and create reporting task.
3Controller Services/controller-servicesIt is used to manage controller services and update controller service references.
4Reporting Tasks/reporting-tasksTo manage reporting tasks.
5Flow/flowTo get the data flow metadata and  component status and query history
6Process Groups/process-groupsTo upload and instantiate a template and create components.
7Processors/processorsTo create and schedule a processor and set its properties.
8Connections/connectionsTo create a connection, set queue priority and update connection destination
9FlowFile Queues/flowfile-queuesTo view queue contents, download flowfile content, and empty queue.
10Remote Process Groups/remote-process-groupsTo create a remote group and enable transmission.
11Provenance/provenanceTo query provenance, and search event lineage.
Let us now consider an example and run on postman to get the details about the running NiFi instance.

Request

GET http://localhost:8080/nifi-api/flow/about

Response

{
   "about": {
      "title": "NiFi",
      "version": "1.7.1",
      "uri": "http://localhost:8080/nifi-api/",
      "contentViewerUrl": "../nifi-content-viewer/",
      "timezone": "SGT",
      "buildTag": "nifi-1.7.1-RC1",
      "buildTimestamp": "07/12/2018 12:54:43 SGT"
   }
}

No comments:

Post a Comment

Popular Posts