Apache Nifi 简明教程
Apache NiFi - API
NiFi 提供了许多 API,可帮助开发人员通过任何其他工具或自定义开发的应用程序来更改并获取 NiFi 的信息。在本教程中,我们将使用谷歌 Chrome 中的 postman 应用程序来讲解一些示例。
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.
若要将 postman 添加到您的 Google Chrome,请访问下面提到的 URL,然后单击添加到 Chrome 按钮。您现在将看到一个添加到您 Google Chrome 的新应用程序。
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.
NiFi rest API 的当前版本是 1.8.0,文档位于下面提到的 URL 中。
The current version of NiFi rest API is 1.8.0 and the documentation is present in the below mentioned URL.
以下是使用最多的 NiFi rest API 模块:
Following are the most used NiFi rest API Modules −
-
[role="bare"]http://<nifi url>:<nifi port>/nifi-api/<*api-path*>
-
In case HTTPS is enabled [role="bare"]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. |
让我们现在考虑一个示例,并在 postman 上运行以获取有关运行的 NiFi 实例的详细信息。
Let us now consider an example and run on postman to get the details about the running NiFi instance.