[
https://issues.apache.org/jira/browse/NIFI-4332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16158700#comment-16158700
]
Bryan Bende commented on NIFI-4332:
-----------------------------------
I think a shell and a client library are two different things... A shell is an
application itself that uses a client library to talk to the REST API, where as
a client library is something that is language specific and can be embedded
into someone else's application.
In terms of a client, for Java users we already offer the nifi-client-dto
module which represents all of the entities that are input and output of the
REST API:
https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto
So for Java you can pair the nifi-client-dto with your HTTP library of choice
like Jersey client or commons HttpClient, and you basically have a Java client.
I don't think Apache NiFi should take on building clients in different
languages due to the support factor. It would require the committers/community
to actively maintain code across multiple programming languages, keeping each
one in sync in terms of features, and there will likely always be someone
wanting a client for a new language.
Providing a shell that made certain operations easy to execute from the command
line could make sense, and this could be implemented using whatever was decided
behind the scenes since the end user wouldn't know or care what language was
being used here.
There are already some concepts like this in the toolkit. For example, there is
a tool to connect and disconnect nodes from a cluster which can be executed
from a script:
https://github.com/apache/nifi/blob/master/nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/node-manager.sh
Which turns around and uses Groovy code to interact with the REST API:
https://github.com/apache/nifi/blob/master/nifi-toolkit/nifi-toolkit-admin/src/main/groovy/org/apache/nifi/toolkit/admin/nodemanager/NodeManagerTool.groovy
https://github.com/apache/nifi/tree/master/nifi-toolkit/nifi-toolkit-admin/src/main/groovy/org/apache/nifi/toolkit/admin/client
> Add NiFi Shell for interacting with NiFi REST API
> -------------------------------------------------
>
> Key: NIFI-4332
> URL: https://issues.apache.org/jira/browse/NIFI-4332
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Jeremy Dyer
> Assignee: Jeremy Dyer
>
> There are several permutations of nifi shells floating around on Github. The
> fact that so many of these exists tells me its a feature people want. I
> propose we add a NiFi shell to the official project that people can use for
> official interaction with the NiFi REST API. While shells are typically not
> written in Java I feel quite strongly in our case using Java would be the
> best fit. Using Java would allow us to use reflection on the "nifi-web-api"
> layer to reflected expected types, paths, responses, etc with minimal coding
> effort.
> I expect there will be many more features that can be added to this shell but
> as a minimal starting point the shell should allow an end user to interact
> with all of the NiFi REST API endpoints defined at
> https://nifi.apache.org/docs/nifi-docs/rest-api/index.html
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)