Apache-nifi-api

提供:Dev Guides
移動先:案内検索

Apache NiFi-API

NiFiは多数のAPIを提供します。これにより、開発者は、他のツールやカスタム開発アプリケーションからNiFiの情報を変更および取得できます。 このチュートリアルでは、いくつかの例を説明するためにgoogle chromeのpostmanアプリを使用します。

Google Chromeにpostmantoを追加するには、下記のURLにアクセスして[chromeに追加]ボタンをクリックします。 これで、Google Chromeに追加された新しいアプリが表示されます。

chromeウェブストア

NiFiレストAPIの現在のバージョンは1.8.0であり、ドキュメントは下記のURLにあります。

https://nifi.apache.org/docs/nifi-docs/rest-api/indexl

以下は、最も使用されるNiFiレストAPIモジュールです-

  • http://<nifi url>:<nifi port>/nifi-api/<* api-path *>
  • HTTPSが有効になっている場合 [<nifi|https://<nifi ] url>:<nifi port>/nifi-api/<* api-path *>
S.No. API module Name api-path Description
1 Access /access To authenticate user and get access token from NiFi.
2 Controller /controller To manage the cluster and create reporting task.
3 Controller Services /controller-services It is used to manage controller services and update controller service references.
4 Reporting Tasks /reporting-tasks To manage reporting tasks.
5 Flow /flow To get the data flow metadata and  component status and query history
6 Process Groups /process-groups To upload and instantiate a template and create components.
7 Processors /processors To create and schedule a processor and set its properties.
8 Connections /connections To create a connection, set queue priority and update connection destination
9 FlowFile Queues /flowfile-queues To view queue contents, download flowfile content, and empty queue.
10 Remote Process Groups /remote-process-groups To create a remote group and enable transmission.
11 Provenance /provenance To query provenance, and search event lineage.

ここで例を検討し、郵便配達員で実行して、実行中のNiFiインスタンスに関する詳細を取得しましょう。

要求

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

応答

{
   "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"
   }
}