Reputation: 603
I managed to get at Kerberos ticket and perform some task with canvas object, but I still face some issues. I have wrapped the code into a class and have those 2 functions
The first function getBulletinBoard
retrieves all messages in the bulletin board from NiFi in it works fine:
def getBulletinBoard(self):
canvas_id = canvas.get_bulletin_board()
return canvas_id
The second function Stop Processor should stop a processor doesn't work, I have hardcorded my processor id into this for test reason and tried various thing to make it work.
def stopProcessor(self):
try:
canvas.schedule_processor('d73136a7-6b8d-1914-a511-3c5acb2b5515',scheduled=False)
except nifi.rest.ApiException as e:
print(e.body)
return None
The output for StopProcessor
function is
Traceback (most recent call last):
File "c:\Temp\nifi-rest\test1.py", line 176, in <module>
n.stopProcessor()
File "c:\Temp\nifi-rest\test1.py", line 162, in stopProcessor
canvas.schedule_processor('d73136a7-6b8d-1914-a511- 3c5acb2b5515',scheduled=False)
File "C:\python3.6_32\lib\site-packages\nipyapi\canvas.py", line 528, in schedule_processor
assert isinstance(processor, nipyapi.nifi.ProcessorEntity)
AssertionError
I cannot figure out why this doesn't work.
Upvotes: 0
Views: 736
Reputation: 1269
Posting as an Answer so the question can be closed:
The error in your code in your latest edit is that schedule_processor expects to be passed a nifi.ProcessorEntity object, and you are giving it a UUID string from the processor.
Please try getting the Processor object using a call like:
nipyapi.canvas.get_processor('d73136a7-6b8d-1914-a511-3c5acb2b5515', 'id')
In future, you can use the 'help' command on any call to see what parameters it is expecting, and the same information is available in http://nipyapi.readthedocs.io/
Upvotes: 1