You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Chris Ruegger <ch...@gmail.com> on 2019/01/22 11:23:02 UTC

Start processor group from Rest API?

Hello,
i am using Apache Nifi version 1.8

I want to be able to script starting up and shutting down process groups
from the REST
API so I can automate things.  I've created a process group and defined  a
flow within that.

I see that there is an API to update the run-state for an individual
processor, but I don't
see one for the process group.  I would not want to have to startup each
processor in the
process group individually if I can avoid that. Screen shots below.
(MyProcessGroup contains the other processors QueryDatabaseTable, etc). I
have not wired them up yet but assume I will have them all wired.

I want to just startup "My Process Group"
How can I do this with the Rest-APi?
Thanks!

[image: image.png]

[image: image.png]


-- 
----------------------------------------------------------------------------------------------------------------------------------------
Simplicity is the ultimate sophistication
--Leonardo DaVinci

www.rueggerconsultingllc.com

Re: Start processor group from Rest API?

Posted by Bryan Bende <bb...@gmail.com>.
Also keep in mind that "starting" a process group is really just a
short-cut for starting anything with in the process group that is eligible
to be started.

You could have a process group with a 100 processors that are all invalid
and can't be started, and you can still call start on the process group,
just nothing will actually be started.

On Tue, Jan 22, 2019 at 7:26 AM Daniel Chaffelson <ch...@gmail.com>
wrote:

> Hi Chris,
> Have you looked at NiPyAPI?
> You can use canvas.py/schedule_process_group for your request.
> If you don't want to use python automation, you can look at the code to
> see the API commands required.
>
> https://nipyapi.readthedocs.io/en/latest/nipyapi-docs/nipyapi.html
>
> On Tue, 22 Jan 2019, 11:23 Chris Ruegger <chris.ruegger@gmail.com wrote:
>
>>
>> Hello,
>> i am using Apache Nifi version 1.8
>>
>> I want to be able to script starting up and shutting down process groups
>> from the REST
>> API so I can automate things.  I've created a process group and defined
>> a flow within that.
>>
>> I see that there is an API to update the run-state for an individual
>> processor, but I don't
>> see one for the process group.  I would not want to have to startup each
>> processor in the
>> process group individually if I can avoid that. Screen shots below.
>> (MyProcessGroup contains the other processors QueryDatabaseTable, etc). I
>> have not wired them up yet but assume I will have them all wired.
>>
>> I want to just startup "My Process Group"
>> How can I do this with the Rest-APi?
>> Thanks!
>>
>> [image: image.png]
>>
>> [image: image.png]
>>
>>
>> --
>>
>> ----------------------------------------------------------------------------------------------------------------------------------------
>> Simplicity is the ultimate sophistication
>> --Leonardo DaVinci
>>
>> www.rueggerconsultingllc.com
>>
>>
>

Re: Start processor group from Rest API?

Posted by Daniel Chaffelson <ch...@gmail.com>.
Hi Chris,
Have you looked at NiPyAPI?
You can use canvas.py/schedule_process_group for your request.
If you don't want to use python automation, you can look at the code to see
the API commands required.

https://nipyapi.readthedocs.io/en/latest/nipyapi-docs/nipyapi.html

On Tue, 22 Jan 2019, 11:23 Chris Ruegger <chris.ruegger@gmail.com wrote:

>
> Hello,
> i am using Apache Nifi version 1.8
>
> I want to be able to script starting up and shutting down process groups
> from the REST
> API so I can automate things.  I've created a process group and defined  a
> flow within that.
>
> I see that there is an API to update the run-state for an individual
> processor, but I don't
> see one for the process group.  I would not want to have to startup each
> processor in the
> process group individually if I can avoid that. Screen shots below.
> (MyProcessGroup contains the other processors QueryDatabaseTable, etc). I
> have not wired them up yet but assume I will have them all wired.
>
> I want to just startup "My Process Group"
> How can I do this with the Rest-APi?
> Thanks!
>
> [image: image.png]
>
> [image: image.png]
>
>
> --
>
> ----------------------------------------------------------------------------------------------------------------------------------------
> Simplicity is the ultimate sophistication
> --Leonardo DaVinci
>
> www.rueggerconsultingllc.com
>
>

Re: Start processor group from Rest API?

Posted by Bryan Bende <bb...@gmail.com>.
Thanks for mentioning that Charlie, we need to add a CLI command to enable
transmission on RPGs :)

On Tue, Jan 22, 2019 at 7:36 PM Charlie Meyer <
charlie.meyer@civitaslearning.com> wrote:

> Also worth noting, the call to start a PG via the REST API does not enable
> transmission on any remote process groups. For projects I am working on, we
> have abstracted the start process group call in our swagger-facade to start
> controller services, start processors, then enable transmission on remote
> process groups. We use a Java Swagger generated client which works
> fantastically
>
> -Charlie
>
> On Tue, Jan 22, 2019 at 6:10 PM Andrew Grande <ap...@gmail.com> wrote:
>
>> Take a look at
>> https://github.com/apache/nifi/blob/master/nifi-toolkit/nifi-toolkit-cli/README.md
>>
>> There are more than a few options not to reinvent the wheel.
>>
>> Also, keep in mind that nontrivial flows would require controller
>> services. These are enabled before a PG can be started. Again, both options
>> suggested in this thread can do this.
>>
>> Good luck!
>> Andrew
>>
>> On Tue, Jan 22, 2019, 3:23 AM Chris Ruegger <ch...@gmail.com>
>> wrote:
>>
>>>
>>> Hello,
>>> i am using Apache Nifi version 1.8
>>>
>>> I want to be able to script starting up and shutting down process groups
>>> from the REST
>>> API so I can automate things.  I've created a process group and defined
>>> a flow within that.
>>>
>>> I see that there is an API to update the run-state for an individual
>>> processor, but I don't
>>> see one for the process group.  I would not want to have to startup each
>>> processor in the
>>> process group individually if I can avoid that. Screen shots below.
>>> (MyProcessGroup contains the other processors QueryDatabaseTable, etc). I
>>> have not wired them up yet but assume I will have them all wired.
>>>
>>> I want to just startup "My Process Group"
>>> How can I do this with the Rest-APi?
>>> Thanks!
>>>
>>> [image: image.png]
>>>
>>> [image: image.png]
>>>
>>>
>>>
>>> --
>>>
>>> ----------------------------------------------------------------------------------------------------------------------------------------
>>> Simplicity is the ultimate sophistication
>>> --Leonardo DaVinci
>>>
>>> www.rueggerconsultingllc.com
>>>
>>>
>>

Re: Start processor group from Rest API?

Posted by Charlie Meyer <ch...@civitaslearning.com>.
Also worth noting, the call to start a PG via the REST API does not enable
transmission on any remote process groups. For projects I am working on, we
have abstracted the start process group call in our swagger-facade to start
controller services, start processors, then enable transmission on remote
process groups. We use a Java Swagger generated client which works
fantastically

-Charlie

On Tue, Jan 22, 2019 at 6:10 PM Andrew Grande <ap...@gmail.com> wrote:

> Take a look at
> https://github.com/apache/nifi/blob/master/nifi-toolkit/nifi-toolkit-cli/README.md
>
> There are more than a few options not to reinvent the wheel.
>
> Also, keep in mind that nontrivial flows would require controller
> services. These are enabled before a PG can be started. Again, both options
> suggested in this thread can do this.
>
> Good luck!
> Andrew
>
> On Tue, Jan 22, 2019, 3:23 AM Chris Ruegger <ch...@gmail.com>
> wrote:
>
>>
>> Hello,
>> i am using Apache Nifi version 1.8
>>
>> I want to be able to script starting up and shutting down process groups
>> from the REST
>> API so I can automate things.  I've created a process group and defined
>> a flow within that.
>>
>> I see that there is an API to update the run-state for an individual
>> processor, but I don't
>> see one for the process group.  I would not want to have to startup each
>> processor in the
>> process group individually if I can avoid that. Screen shots below.
>> (MyProcessGroup contains the other processors QueryDatabaseTable, etc). I
>> have not wired them up yet but assume I will have them all wired.
>>
>> I want to just startup "My Process Group"
>> How can I do this with the Rest-APi?
>> Thanks!
>>
>> [image: image.png]
>>
>> [image: image.png]
>>
>>
>>
>> --
>>
>> ----------------------------------------------------------------------------------------------------------------------------------------
>> Simplicity is the ultimate sophistication
>> --Leonardo DaVinci
>>
>> www.rueggerconsultingllc.com
>>
>>
>

Re: Start processor group from Rest API?

Posted by Andrew Grande <ap...@gmail.com>.
Take a look at
https://github.com/apache/nifi/blob/master/nifi-toolkit/nifi-toolkit-cli/README.md

There are more than a few options not to reinvent the wheel.

Also, keep in mind that nontrivial flows would require controller services.
These are enabled before a PG can be started. Again, both options suggested
in this thread can do this.

Good luck!
Andrew

On Tue, Jan 22, 2019, 3:23 AM Chris Ruegger <ch...@gmail.com> wrote:

>
> Hello,
> i am using Apache Nifi version 1.8
>
> I want to be able to script starting up and shutting down process groups
> from the REST
> API so I can automate things.  I've created a process group and defined  a
> flow within that.
>
> I see that there is an API to update the run-state for an individual
> processor, but I don't
> see one for the process group.  I would not want to have to startup each
> processor in the
> process group individually if I can avoid that. Screen shots below.
> (MyProcessGroup contains the other processors QueryDatabaseTable, etc). I
> have not wired them up yet but assume I will have them all wired.
>
> I want to just startup "My Process Group"
> How can I do this with the Rest-APi?
> Thanks!
>
> [image: image.png]
>
> [image: image.png]
>
>
>
> --
>
> ----------------------------------------------------------------------------------------------------------------------------------------
> Simplicity is the ultimate sophistication
> --Leonardo DaVinci
>
> www.rueggerconsultingllc.com
>
>