Rishabhg
Rishabhg

Reputation: 118

Not able to perform any calls to nifi using nipyapi

I am trying to work with nipyapi but any function I run gives me an error.

Here's the code for config :

import nipyapi
nipyapi.config.nifi_config.host = 'https://localhost:8443/nifi-api'
nipyapi.config.nifi_config.username = 'admin'
nipyapi.config.nifi_config.password = 'qwertyadmin1'
nipyapi.config.registry_config.host = 'https://localhost:18080/nifi-registry'

The code which is giving error :

root = nipyapi.canvas.get_root_pg_id()

I get a bunch of warnings and then the error, Here's an example warning :

2022-03-24 23:28:16,876 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine('\x15\x03\x03\x00\x02\x02P'))': /nifi-api/flow/process-groups/root/status
2022-03-24 23:28:16,876 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine('\x15\x03\x03\x00\x02\x02P'))': /nifi-api/flow/process-groups/root/status

The error :

MaxRetryError: HTTPConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /nifi-api/flow/process-groups/root/status (Caused by ProtocolError('Connection aborted.', BadStatusLine('\x15\x03\x03\x00\x02\x02P')))

P.S. I am trying to create a user-friendly interface which allows users with no knowledge of nifi, to build dynamic pipelines based on their requirement. Would Also love to hear your thoughts whether it would be possible with nipyapi or not. I am optimistic though.

Upvotes: 0

Views: 738

Answers (1)

JurajS
JurajS

Reputation: 1

I had the same problem. Try to use connection from https://chamila.dev/blog/2021-07-18_ci-cd-for-apache-nifi-02-automation-with-nipyapi/ It works for me.

Upvotes: 0

Related Questions