nipyapi icon indicating copy to clipboard operation
nipyapi copied to clipboard

Enable/Disable Processors with nipyapi

Open rei-ber opened this issue 4 years ago • 1 comments

  • 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.

rei-ber avatar Dec 21 '20 13:12 rei-ber

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

Chaffelson avatar Jan 14 '21 14:01 Chaffelson