Error line :
File "C:\Users\nitin.jaiswal\OneDrive\Qentelli\Sypder-Anaconda-Nipi-Automation\untitled0.py", line 20, in
IndexError: list index out of range
I am unsure why you aren't using canvas.list_all_controllers and filtering to the controller you need here?
You may also want to use nipyapi.utils.set_endpoint to connect to the NiFi environment.
Description
I want to create controller in apache nifi using python script to automate the process.
What I Did
-- coding: utf-8 --
""" Created on Mon Oct 12 16:42:29 2020
@author: nitin.jaiswal """
import nipyapi import requests import json nipyapi.config.nifi_config.host = 'http://localhost:8080/nifi/' nipyapi.canvas.get_controller('DistributedMapCacheClientService', identifier_type='name', bool_response=False)
Enable Controler
headers = {'Content-Type': 'application/json'} url = 'http://localhost:8080/nifi-api/flow/process-groups/'+nipyapi.canvas.get_root_pg_id()+'/controller-services' r = requests.get(url) reponse = json.loads(r.text)
controllerId = reponse['controllerServices'][0]['id']
nipyapi.canvas.schedule_controller(controllerId, 'True', refresh=False)
Error line : File "C:\Users\nitin.jaiswal\OneDrive\Qentelli\Sypder-Anaconda-Nipi-Automation\untitled0.py", line 20, in
IndexError: list index out of range
create_controller - Copy.txt
Urgency
it is blocking production work and system has been getting on hold. I am unable to detect duplicate