Closed kkebb closed 5 years ago
Hi @kkebb thanks for taking the time to evaluate the project!
I have considered something like what you describe, however it requires enforcing unique names within NiFi. This is doable via the API, but would take a bit of effort to design how to manage name conflicts and that sort of thing. If you were to accept that the NiPy will throw an exception if it encounters a duplicate then it would be much easier to achieve.
It should currently be possible to retrieve and action on a template by name: nipyapi.templates.get_template_by_name('Name) If you then had the template name match the process_group name, you could pg = nypiapi.canvas.get_process_group('Name') nypuapi.canvas.schedule_process_group(pg.id, True)
I actually would like to revisit and rework the template functions for the next release, firstly to bring them into consistency with the commands used elsewhere in the package (they were one of the first things I wrote, and my understanding of the NiFi API has moved on greatly since then), and to provide better handling of upload/download of templates. I might also advise that, if you can, moving to use of NiFi-1.5.0 with Flow Versioning is a far superior experience than using Templates.
Per your addendum, I have just implemented features for this in the current master! canvas.purge_process_group canvas.get_connections canvas.purge_connections
for a convenience method, you can even use nipyapi.canvas.delete_process_group with the force option, which will attempt to stop, purge connections, remove templates, then delete a PG. If you wish for examples of how these are used within the project, take a look at tests/conftest.py, where I use all these commands to generate the fixtures to test all the other commands.
These features are obviously quite new and could do with more testing if you have the time :)
Hi @kkebb PR #52 contains many enhancements towards the features you describe here and will soon hopefully be merged into master and released as version 0.8.0
If you have the time to review it against your ideas that would be great
Hey @Chaffelson thanks for the prompt responses and PR. I will definitely get back to you as soon as possible 👍
Hey @Chaffelson so I briefly had a chance to play with the new features you added today, I am going to continue playing with it over the next couple of weeks (I have a day job so it's not easy keeping up) but will try to get you the feedback you need asap. In the mean time, I don't think the template feature set that I am looking for is included in the current state of the library, but I am still playing around with it so I can't make a final call yet. will keep you posted :)
All good @kkebb let me know when you have more thoughts on the topic and I'll leave this issue open as a question in the meantime.
This is a very rich python library for managing NiFi. While reading through it I found that we can retrieve, instantiate, upload, and export templates. However is it also possible to do the following?
multiple template management orchestration The idea is to administer multiple templates on the canvas by storing their state programmatically. The reason we need to store it's state programmatically is that NiFi REST API doesn't support following template functions. 1:) start template by template instance name 2:) stop template by template instance name
Also, On a different note, is it possible to do the following. 1:) clear the canvas 2:) clear/empty the queues of the connections by connection ID
I can contribute in case you agree with the idea and it's not implemented yet.