nipyapi
nipyapi copied to clipboard
Enable/Disable Processors with nipyapi
- Nipyapi version: 0.16.1
- NiFi version: 1.11.4
- NiFi-Registry version: -
- Python version: 3.8.4
- Operating System: Debian Buster
Description
If I try to start a disabled processor with schedule_processor(pg, True)
and I get ValueError: Processor is disabled
. I found out, how to enable it, but it would be nice to have it as an api method. Is there any plan to integrate a method for? Or is there any other way to do it?
What I Did
This is my workaround:
import nipyapi
pg = nipyapi.canvas.get_processor('PGName')[0]
pg.component.state = 'STOPPED'
nipyapi.nifi.ProcessorsApi().update_processor(pg.id, pg)
nipyapi.canvas.schedule_processor(pg, True)
Urgency
Due to an existing workaround, it is not critical.
This seems like a good idea, we could add a switch to the function something like autoEnable=False by default, and if you set it to True then any disabled Controllers would be helpfully started for you