nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Burgess <>
Subject Re: control nifi from REST API
Date Fri, 22 Jan 2016 12:57:02 GMT

This is certainly possible using the REST API and whichever language you prefer.  I have started
work on a Groovy-based project to do exactly this. It is called nifi-client and is on GitHub:

You can use it as a library (JAR) or perhaps more helpful is the “NiFi shell” which is
a Gradle task that starts groovysh with the library already loaded. From the GitHub project
directory type:

gradle —no-daemon shell

Then to connect to your instance you can do:
nifi = NiFi.bind('')

To get a map of templates (the map is name -> properties):

To upload a template from a file:
nifi.templates << '/Users/mburgess/datasets/GetUserData.xml’

To instantiate a template, fetch by name and call instantiate:

To export a template:
nifi.templates.’GetUserData’ >> ‘/path/to/export.xml'

To delete a template:

To get a map of processors (the map is name -> properties):

To get a list of processor names:

To start a processor, fetch by name and call start:
nifi.processors.'Fetch User Data'.start()

The above also works for stop(), enable(), and disable()

To get the current state of a processor:
nifi.processors.'Fetch User Data'.state

I haven’t added the ability to change individual properties of a processor yet (just the
state), but most of the other steps in your workflow should be covered.  I would love any
contributions or collaborations on this project if you are interested.


From:  <>
Reply-To:  <>
Date:  Friday, January 22, 2016 at 3:39 AM
To:  "" <>
Subject:  control nifi from REST API


I would like to control Nifi  by program an implement this:


1.      find the right template in the templates repository --> result T1

2.      instantiate the Template (T1)

3.      set properties on different processors contained in the topology T1

4.      start  T1

5.      stop T1 ( or be alerted when finished – I know it depends on the semantic of the
topology of T1)

6.      remove T1 from the Topology Manager 

7.      be ready to  loop to  step 1)


Please, do you think this workflow as implementable from java or groovy scripts making REST
API calls  J



Best regards








Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees
et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par
erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant
susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may
be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message
and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed
or falsified.
Thank you.

View raw message