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 move a processor in the canvas (changing its position field) without deleting and creating it anew in the new position #328

Open
noamg1911 opened this issue Jul 20, 2023 · 1 comment
Milestone

Comments

@noamg1911
Copy link

  • Nipyapi version: 0.19.1
  • NiFi version: 1.18
  • NiFi-Registry version:
  • Python version: 3.9
  • Operating System: Windows/Linux (RHEL)

Description

I have tried excessively to change a processor's position on the canvas, but to no avail. The update_processor function won't accept the position field, and according to your documentation I can't change it manually. I'd like to know if there's a way of moving the processor without the obvious workaround of deleting it and creating it in the new position (i.e. while it's still working).

What I Did

Unfortunately I don't have the output because I work in a private network environment. The error it gave was something about the version of the processor. If you'd like me to write it in a more accurate manner I can do that but I don't really see how this will help.

Urgency

Somewhat urgent, it's stopping the expected update to the prod environment.
Thanks!

@Chaffelson
Copy link
Owner

So I had a bunch of trouble with this when I first implemented it, because NiFi wants the location to be supplied in a very specific manner.
If you look at the create_processor function within canvas.py, it wants a LocationDTO object with x and y as Floats, but it also looks like that's a separate field to the update that we usually pass into the update_processor function.

body=nipyapi.nifi.ProcessorEntity(
              revision={'version': 0},
              component=nipyapi.nifi.ProcessorDTO(
                  position=nipyapi.nifi.PositionDTO(
                      x=float(location[0]),
                      y=float(location[1])
                  ),
                  type=processor.type,
                  name=processor_name,
                  config=target_config
              )
          )

Where config=target_config in the create function, we apply the update in the update function.

Probably what needs to be done is the ProcessorEntity object needs to be inspected by someone to see where the location change is applied. I usually do this by examining the payload of the update request in dev tools when doing it in the browser, then that will need to be added as an option in the update_processor function here

@Chaffelson Chaffelson added this to the 0.20 milestone Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants