less than 1 minute read

I wanted to work with some old nifi xml templates in DataFlow which requires new nifi json flow definition files. To get these templates converted I had to import them to an operational nifi, drag them onto the screen, and download the flow definition file I needed. This seemed like a job for NiFi, not for me. Since templates are going away, I would suspect someday to see the upload template feature to go away in future nifi releases. This potentially leaves a gap that I realized I could build an API to fill.

Enter NIFI Rest API docs

After a few working sessions I was able to come up with a nifi api using HandleHttpRequest/HandleHttpResponse with 4 internal Nifi Rest API calls using InvokeHttp. You simply post an XML file to this api and the api will respond with HTTP 200 and the JSON flow definition file.

Foo

You can find the Flow Definition File for my flow here:

NiFi_Template_XML_to_Flow_Definition_JSON

Tags:

Categories:

Updated: