nifi-api-client-java

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>io.github</groupId>
    <artifactId>nifi-api-client-java</artifactId>
    <version>1.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "io.github:nifi-api-client-java:1.0.0"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

Getting Started

Please follow the installation instruction and execute the following Java code:


import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AccessApi;

import java.io.File;
import java.util.*;

public class AccessApiExample {

    public static void main(String[] args) {

        AccessApi apiInstance = new AccessApi();
        String username = "username_example"; // String | 
        String password = "password_example"; // String | 
        try {
            String result = apiInstance.createAccessToken(username, password);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccessApi#createAccessToken");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://localhost/nifi-api

Class Method HTTP request Description
AccessApi createAccessToken POST /access/token Creates a token for accessing the REST API via username/password
AccessApi createAccessTokenFromTicket POST /access/kerberos Creates a token for accessing the REST API via Kerberos ticket exchange / SPNEGO negotiation
AccessApi createDownloadToken POST /access/download-token Creates a single use access token for downloading FlowFile content.
AccessApi createUiExtensionToken POST /access/ui-extension-token Creates a single use access token for accessing a NiFi UI extension.
AccessApi getAccessStatus GET /access Gets the status the client's access
AccessApi getLoginConfig GET /access/config Retrieves the access configuration for this NiFi
ConnectionsApi deleteConnection DELETE /connections/{id} Deletes a connection
ConnectionsApi getConnection GET /connections/{id} Gets a connection
ConnectionsApi updateConnection PUT /connections/{id} Updates a connection
ControllerApi createControllerService POST /controller/controller-services Creates a new controller service
ControllerApi createReportingTask POST /controller/reporting-tasks Creates a new reporting task
ControllerApi deleteHistory DELETE /controller/history Purges history
ControllerApi deleteNode DELETE /controller/cluster/nodes/{id} Removes a node from the cluster
ControllerApi getCluster GET /controller/cluster Gets the contents of the cluster
ControllerApi getControllerConfig GET /controller/config Retrieves the configuration for this NiFi Controller
ControllerApi getNode GET /controller/cluster/nodes/{id} Gets a node in the cluster
ControllerApi updateControllerConfig PUT /controller/config Retrieves the configuration for this NiFi
ControllerApi updateNode PUT /controller/cluster/nodes/{id} Updates a node in the cluster
ControllerservicesApi clearState POST /controller-services/{id}/state/clear-requests Clears the state for a controller service
ControllerservicesApi getControllerService GET /controller-services/{id} Gets a controller service
ControllerservicesApi getControllerServiceReferences GET /controller-services/{id}/references Gets a controller service
ControllerservicesApi getPropertyDescriptor GET /controller-services/{id}/descriptors Gets a controller service property descriptor
ControllerservicesApi getState GET /controller-services/{id}/state Gets the state for a controller service
ControllerservicesApi removeControllerService DELETE /controller-services/{id} Deletes a controller service
ControllerservicesApi updateControllerService PUT /controller-services/{id} Updates a controller service
ControllerservicesApi updateControllerServiceReferences PUT /controller-services/{id}/references Updates a controller services references
CountersApi getCounters GET /counters Gets the current counters for this NiFi
CountersApi updateCounter PUT /counters/{id} Updates the specified counter. This will reset the counter value to 0
DatatransferApi commitInputPortTransaction DELETE /data-transfer/input-ports/{portId}/transactions/{transactionId} Commit or cancel the specified transaction
DatatransferApi commitOutputPortTransaction DELETE /data-transfer/output-ports/{portId}/transactions/{transactionId} Commit or cancel the specified transaction
DatatransferApi createPortTransaction POST /data-transfer/{portType}/{portId}/transactions Create a transaction to the specified output port or input port
DatatransferApi extendInputPortTransactionTTL PUT /data-transfer/input-ports/{portId}/transactions/{transactionId} Extend transaction TTL
DatatransferApi extendOutputPortTransactionTTL PUT /data-transfer/output-ports/{portId}/transactions/{transactionId} Extend transaction TTL
DatatransferApi receiveFlowFiles POST /data-transfer/input-ports/{portId}/transactions/{transactionId}/flow-files Transfer flow files to the input port
DatatransferApi transferFlowFiles GET /data-transfer/output-ports/{portId}/transactions/{transactionId}/flow-files Transfer flow files from the output port
FlowApi generateClientId GET /flow/client-id Generates a client id.
FlowApi getAboutInfo GET /flow/about Retrieves details about this NiFi to put in the About dialog
FlowApi getAction GET /flow/history/{id} Gets an action
FlowApi getBanners GET /flow/banners Retrieves the banners for this NiFi
FlowApi getBulletinBoard GET /flow/bulletin-board Gets current bulletins
FlowApi getBulletins GET /flow/controller/bulletins Retrieves Controller level bulletins
FlowApi getClusterSummary GET /flow/cluster/summary Gets the current status of this NiFi
FlowApi getComponentHistory GET /flow/history/components/{componentId} Gets configuration history for a component
FlowApi getConnectionStatus GET /flow/connections/{id}/status Gets status for a connection
FlowApi getConnectionStatusHistory GET /flow/connections/{id}/status/history Gets the status history for a connection
FlowApi getControllerServiceTypes GET /flow/controller-service-types Retrieves the types of controller services that this NiFi supports
FlowApi getControllerServicesFromController GET /flow/controller/controller-services Gets all controller services
FlowApi getControllerServicesFromGroup GET /flow/process-groups/{id}/controller-services Gets all controller services
FlowApi getControllerStatus GET /flow/status Gets the current status of this NiFi
FlowApi getCurrentUser GET /flow/current-user Retrieves the user identity of the user making the request
FlowApi getFlow GET /flow/process-groups/{id} Gets a process group
FlowApi getFlowConfig GET /flow/config Retrieves the configuration for this NiFi flow
FlowApi getInputPortStatus GET /flow/input-ports/{id}/status Gets status for an input port
FlowApi getOutputPortStatus GET /flow/output-ports/{id}/status Gets status for an output port
FlowApi getPrioritizers GET /flow/prioritizers Retrieves the types of prioritizers that this NiFi supports
FlowApi getProcessGroupStatus GET /flow/process-groups/{id}/status Gets the status for a process group
FlowApi getProcessGroupStatusHistory GET /flow/process-groups/{id}/status/history Gets status history for a remote process group
FlowApi getProcessorStatus GET /flow/processors/{id}/status Gets status for a processor
FlowApi getProcessorStatusHistory GET /flow/processors/{id}/status/history Gets status history for a processor
FlowApi getProcessorTypes GET /flow/processor-types Retrieves the types of processors that this NiFi supports
FlowApi getRemoteProcessGroupStatus GET /flow/remote-process-groups/{id}/status Gets status for a remote process group
FlowApi getRemoteProcessGroupStatusHistory GET /flow/remote-process-groups/{id}/status/history Gets the status history
FlowApi getReportingTaskTypes GET /flow/reporting-task-types Retrieves the types of reporting tasks that this NiFi supports
FlowApi getReportingTasks GET /flow/reporting-tasks Gets all reporting tasks
FlowApi getTemplates GET /flow/templates Gets all templates
FlowApi queryHistory GET /flow/history Gets configuration history
FlowApi scheduleComponents PUT /flow/process-groups/{id} Schedule or unschedule comopnents in the specified Process Group.
FlowApi searchCluster GET /flow/cluster/search-results Searches the cluster for a node with the specified address
FlowApi searchFlow GET /flow/search-results Performs a search against this NiFi using the specified search term
FlowfilequeuesApi createDropRequest POST /flowfile-queues/{id}/drop-requests Creates a request to drop the contents of the queue in this connection.
FlowfilequeuesApi createFlowFileListing POST /flowfile-queues/{id}/listing-requests Lists the contents of the queue in this connection.
FlowfilequeuesApi deleteListingRequest DELETE /flowfile-queues/{id}/listing-requests/{listing-request-id} Cancels and/or removes a request to list the contents of this connection.
FlowfilequeuesApi downloadFlowFileContent GET /flowfile-queues/{id}/flowfiles/{flowfile-uuid}/content Gets the content for a FlowFile in a Connection.
FlowfilequeuesApi getDropRequest GET /flowfile-queues/{id}/drop-requests/{drop-request-id} Gets the current status of a drop request for the specified connection.
FlowfilequeuesApi getFlowFile GET /flowfile-queues/{id}/flowfiles/{flowfile-uuid} Gets a FlowFile from a Connection.
FlowfilequeuesApi getListingRequest GET /flowfile-queues/{id}/listing-requests/{listing-request-id} Gets the current status of a listing request for the specified connection.
FlowfilequeuesApi removeDropRequest DELETE /flowfile-queues/{id}/drop-requests/{drop-request-id} Cancels and/or removes a request to drop the contents of this connection.
FunnelApi getFunnel GET /funnels/{id} Gets a funnel
FunnelApi removeFunnel DELETE /funnels/{id} Deletes a funnel
FunnelApi updateFunnel PUT /funnels/{id} Updates a funnel
InputportsApi getInputPort GET /input-ports/{id} Gets an input port
InputportsApi removeInputPort DELETE /input-ports/{id} Deletes an input port
InputportsApi updateInputPort PUT /input-ports/{id} Updates an input port
LabelsApi getLabel GET /labels/{id} Gets a label
LabelsApi removeLabel DELETE /labels/{id} Deletes a label
LabelsApi updateLabel PUT /labels/{id} Updates a label
OutputportsApi getOutputPort GET /output-ports/{id} Gets an output port
OutputportsApi removeOutputPort DELETE /output-ports/{id} Deletes an output port
OutputportsApi updateOutputPort PUT /output-ports/{id} Updates an output port
PoliciesApi createAccessPolicy POST /policies Creates an access policy
PoliciesApi getAccessPolicy GET /policies/{id} Gets an access policy
PoliciesApi getAccessPolicyForResource GET /policies/{action}/{resource} Gets an access policy for the specified action and resource
PoliciesApi removeAccessPolicy DELETE /policies/{id} Deletes an access policy
PoliciesApi updateAccessPolicy PUT /policies/{id} Updates a access policy
ProcessgroupsApi copySnippet POST /process-groups/{id}/snippet-instance Copies a snippet
ProcessgroupsApi createConnection POST /process-groups/{id}/connections Creates a connection
ProcessgroupsApi createControllerService POST /process-groups/{id}/controller-services Creates a new controller service
ProcessgroupsApi createFunnel POST /process-groups/{id}/funnels Creates a funnel
ProcessgroupsApi createInputPort POST /process-groups/{id}/input-ports Creates an input port
ProcessgroupsApi createLabel POST /process-groups/{id}/labels Creates a label
ProcessgroupsApi createOutputPort POST /process-groups/{id}/output-ports Creates an output port
ProcessgroupsApi createProcessGroup POST /process-groups/{id}/process-groups Creates a process group
ProcessgroupsApi createProcessor POST /process-groups/{id}/processors Creates a new processor
ProcessgroupsApi createRemoteProcessGroup POST /process-groups/{id}/remote-process-groups Creates a new process group
ProcessgroupsApi createTemplate POST /process-groups/{id}/templates Creates a template
ProcessgroupsApi getConnections GET /process-groups/{id}/connections Gets all connections
ProcessgroupsApi getFunnels GET /process-groups/{id}/funnels Gets all funnels
ProcessgroupsApi getInputPorts GET /process-groups/{id}/input-ports Gets all input ports
ProcessgroupsApi getLabels GET /process-groups/{id}/labels Gets all labels
ProcessgroupsApi getOutputPorts GET /process-groups/{id}/output-ports Gets all output ports
ProcessgroupsApi getProcessGroup GET /process-groups/{id} Gets a process group
ProcessgroupsApi getProcessGroups GET /process-groups/{id}/process-groups Gets all process groups
ProcessgroupsApi getProcessors GET /process-groups/{id}/processors Gets all processors
ProcessgroupsApi getRemoteProcessGroups GET /process-groups/{id}/remote-process-groups Gets all remote process groups
ProcessgroupsApi importTemplate POST /process-groups/{id}/templates/import Imports a template
ProcessgroupsApi instantiateTemplate POST /process-groups/{id}/template-instance Instantiates a template
ProcessgroupsApi removeProcessGroup DELETE /process-groups/{id} Deletes a process group
ProcessgroupsApi updateProcessGroup PUT /process-groups/{id} Updates a process group
ProcessgroupsApi uploadTemplate POST /process-groups/{id}/templates/upload Uploads a template
ProcessorsApi clearState POST /processors/{id}/state/clear-requests Clears the state for a processor
ProcessorsApi deleteProcessor DELETE /processors/{id} Deletes a processor
ProcessorsApi getProcessor GET /processors/{id} Gets a processor
ProcessorsApi getPropertyDescriptor GET /processors/{id}/descriptors Gets the descriptor for a processor property
ProcessorsApi getState GET /processors/{id}/state Gets the state for a processor
ProcessorsApi updateProcessor PUT /processors/{id} Updates a processor
ProvenanceApi deleteLineage DELETE /provenance/lineage/{id} Deletes a lineage query
ProvenanceApi deleteProvenance DELETE /provenance/{id} Deletes a provenance query
ProvenanceApi getLineage GET /provenance/lineage/{id} Gets a lineage query
ProvenanceApi getProvenance GET /provenance/{id} Gets a provenance query
ProvenanceApi getSearchOptions GET /provenance/search-options Gets the searchable attributes for provenance events
ProvenanceApi submitLineageRequest POST /provenance/lineage Submits a lineage query
ProvenanceApi submitProvenanceRequest POST /provenance Submits a provenance query
ProvenanceeventsApi getInputContent GET /provenance-events/{id}/content/input Gets the input content for a provenance event
ProvenanceeventsApi getOutputContent GET /provenance-events/{id}/content/output Gets the output content for a provenance event
ProvenanceeventsApi getProvenanceEvent GET /provenance-events/{id} Gets a provenance event
ProvenanceeventsApi submitReplay POST /provenance-events/replays Replays content from a provenance event
RemoteprocessgroupsApi getRemoteProcessGroup GET /remote-process-groups/{id} Gets a remote process group
RemoteprocessgroupsApi removeRemoteProcessGroup DELETE /remote-process-groups/{id} Deletes a remote process group
RemoteprocessgroupsApi updateRemoteProcessGroup PUT /remote-process-groups/{id} Updates a remote process group
RemoteprocessgroupsApi updateRemoteProcessGroupInputPort PUT /remote-process-groups/{id}/input-ports/{port-id} Updates a remote port
RemoteprocessgroupsApi updateRemoteProcessGroupOutputPort PUT /remote-process-groups/{id}/output-ports/{port-id} Updates a remote port
ReportingtasksApi clearState POST /reporting-tasks/{id}/state/clear-requests Clears the state for a reporting task
ReportingtasksApi getPropertyDescriptor GET /reporting-tasks/{id}/descriptors Gets a reporting task property descriptor
ReportingtasksApi getReportingTask GET /reporting-tasks/{id} Gets a reporting task
ReportingtasksApi getState GET /reporting-tasks/{id}/state Gets the state for a reporting task
ReportingtasksApi removeReportingTask DELETE /reporting-tasks/{id} Deletes a reporting task
ReportingtasksApi updateReportingTask PUT /reporting-tasks/{id} Updates a reporting task
ResourcesApi getResources GET /resources Gets the available resources that support access/authorization policies
SitetositeApi getPeers GET /site-to-site/peers Returns the available Peers and its status of this NiFi
SitetositeApi getSiteToSiteDetails GET /site-to-site Returns the details about this NiFi necessary to communicate via site to site
SnippetsApi createSnippet POST /snippets Creates a snippet
SnippetsApi deleteSnippet DELETE /snippets/{id} Deletes the components in a snippet and drops the snippet
SnippetsApi updateSnippet PUT /snippets/{id} Move's the components in this Snippet into a new Process Group and drops the snippet
SystemdiagnosticsApi getSystemDiagnostics GET /system-diagnostics Gets the diagnostics for the system NiFi is running on
TemplatesApi exportTemplate GET /templates/{id}/download Exports a template
TemplatesApi removeTemplate DELETE /templates/{id} Deletes a template
TenantsApi createUser POST /tenants/users Creates a user
TenantsApi createUserGroup POST /tenants/user-groups Creates a user group
TenantsApi getUser GET /tenants/users/{id} Gets a user
TenantsApi getUserGroup GET /tenants/user-groups/{id} Gets a user group
TenantsApi getUserGroups GET /tenants/user-groups Gets all user groups
TenantsApi getUsers GET /tenants/users Gets all users
TenantsApi removeUser DELETE /tenants/users/{id} Deletes a user
TenantsApi removeUserGroup DELETE /tenants/user-groups/{id} Deletes a user group
TenantsApi searchCluster GET /tenants/search-results Searches the cluster for a node with the specified address
TenantsApi updateUser PUT /tenants/users/{id} Updates a user
TenantsApi updateUserGroup PUT /tenants/user-groups/{id} Updates a user group

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization. Authentication schemes defined for the API:

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

[email protected]