Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add reporting task in nifi using nipyapi #352

Open
prashant462 opened this issue May 27, 2024 · 9 comments
Open

Unable to add reporting task in nifi using nipyapi #352

prashant462 opened this issue May 27, 2024 · 9 comments

Comments

@prashant462
Copy link

prashant462 commented May 27, 2024

  • Nipyapi version: 0.20.0
  • NiFi version: 1.25.0
  • NiFi-Registry version: 1.25.0
  • Python version: 3.9.6
  • Operating System: MacOs

Description

I have a usecase where I have to add reporting task (PrometheusReportingTask) using nipyapi , but not getting any method to do that.

What I Did

I tried listing all controller types in nifi env using nipyapi.canvas.list_all_controller_types() but not getting any controller of type PrometheusReportingTask. But using nifi UI I am getting option to add the same.

Urgency

For my production nifi flows I have to implement this, Please let me know If there is any method for adding a PrometheusReportingTask using nipyapi or any workaround for this.
@Chaffelson

@ottobackwards
Copy link
Contributor

Can you say how you are calling the code? The parameters to the function?
What is the return value? Are you getting an error?
Have you tried calling without specifying any parameters?

@prashant462
Copy link
Author

prashant462 commented May 27, 2024

Hi @ottobackwards ,

I called the below method.
controller_types = nipyapi.canvas.list_all_controller_types()
for controller in controller_types:
print(controller.type + " : " + controller.description)
print("===============================\n")

The list I am getting is attached.
controller_types.txt

@ottobackwards
Copy link
Contributor

ottobackwards commented May 28, 2024

From what I can see the PrometheusRecordSink is the only Prometheus service, and it is returned:
https://nifi.apache.org/documentation/v1/
I'm not sure this is the right call

@ottobackwards
Copy link
Contributor

I think what you need is the flow api's get_reporting_task_types. This isn't exposed at the canvas layer yet.
@Chaffelson ?

@prashant462
Copy link
Author

From what I can see the PrometheusRecordSink is the only Prometheus service, and it is returned: https://nifi.apache.org/documentation/v1/ I'm not sure this is the right call

@ottobackwards, yeah in list of Prometheus services PrometheusRecordSink is only visible there which is not a reporting task.

@ottobackwards
Copy link
Contributor

@prashant462 : #352 (comment)

@prashant462
Copy link
Author

@ottobackwards
I tried with nipyapi.nifi.ControllerApi().create_reporting_task() it is working fine, this method not given in nipyapi docs .
But already provided in nipyapi code.

@ottobackwards
Copy link
Contributor

What I am saying is that you are using the wrong method to get all the Reporting task type names, it isn' t controller types, it is the get_reporting_task_types.

@prashant462
Copy link
Author

What I am saying is that you are using the wrong method to get all the Reporting task type names, it isn' t controller types, it is the get_reporting_task_types.

okkk , got it .
Thanks @ottobackwards for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants