I'm not sure if this is helpful to compare to what you are trying to
do, but in the CLI that is soon to be released with 1.6.0, we have a
similar command for "pg-start".

Here is how it is implemented:

https://github.com/apache/nifi/blob/master/nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/command/nifi/pg/PGStart.java#L58-L63

Here is the implementation of the method where it makes the PUT to
/flow/process-groups/{id} :

https://github.com/apache/nifi/blob/master/nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/client/nifi/impl/JerseyFlowClient.java#L146-L153

Keep in mind this will only start components that are in a valid state
to be started... any processors that have validation errors cannot be
started, and also controller services need to be started separately.


On Fri, Apr 6, 2018 at 2:14 PM, Vitaly Krivoy
<[email protected]> wrote:
> Thank you for replying Matt. It’s not secured. Not yet. I am still in the
> early stages of developing a prototype. The PUT/flow/process-groups/{id}
> API description says that the Components object is optional and if one is
> not provided, all processing group components will be started. Until now I
> was relying on this spec. But then I thought that perhaps this only works
> for native NiFi GUI REST calls because some token is being passed that is
> not passed from my program. (I don’t see it in Developers Tools, but I might
> be something in HTTP envelope, that I am not aware of). For other API calls
> revision object is required. Maybe it is the case here as well. I am in the
> middle of implementing it to test it out.
>
>
>
> From: Matt Gilman [mailto:[email protected]]
> Sent: Friday, April 06, 2018 1:30 PM
> To: [email protected]
> Subject: Re: PUT/flow/process-groups/{id} API
>
>
>
> Vitaly,
>
>
>
> That endpoint will start/stop every component the requesting user has access
> to. Is your instance secured? If so please ensure that your including
> necessary authentication details. For instance, if your using client
> certificate in your browser be sure you request in your Java program uses a
> similar SSL context.
>
>
>
> Matt
>
> Sent from my iPhone
>
>
> On Apr 6, 2018, at 11:15 AM, Vitaly Krivoy <[email protected]>
> wrote:
>
> When I start a group from NiFi UI and I examine the request in Chrome
> Developers Tools, it is identical to the one that I send from a Java
> program. What gives?
>
>
>
> From: Vitaly Krivoy [mailto:[email protected]]
> Sent: Thursday, April 05, 2018 5:49 PM
> To: [email protected]
> Subject: PUT/flow/process-groups/{id} API
>
>
>
> I am trying to use PUT/flow/process-groups/{id} to start a processing group
> from a Java program, but nothing is happening.  I set state RUNNING in
> ScheduleComponentsEntity and when an API call returns it shows the state in
> the returned object as RUNNING. But I see on the canvas that the group was
> not launched. Yet I can start a group in NiFi GUI by right clicking on the
> group and selecting start. What am I missing? Thanks.
>
>
>
> STATEMENT OF CONFIDENTIALITY The information contained in this email message
> and any attachments may be confidential and legally privileged and is
> intended for the use of the addressee(s) only. If you are not an intended
> recipient, please: (1) notify me immediately by replying to this message;
> (2) do not use, disseminate, distribute or reproduce any part of the message
> or any attachment; and (3) destroy all copies of this message and any
> attachments.
>
>
>
> STATEMENT OF CONFIDENTIALITY The information contained in this email message
> and any attachments may be confidential and legally privileged and is
> intended for the use of the addressee(s) only. If you are not an intended
> recipient, please: (1) notify me immediately by replying to this message;
> (2) do not use, disseminate, distribute or reproduce any part of the message
> or any attachment; and (3) destroy all copies of this message and any
> attachments.
>
>
>
> STATEMENT OF CONFIDENTIALITY The information contained in this email message
> and any attachments may be confidential and legally privileged and is
> intended for the use of the addressee(s) only. If you are not an intended
> recipient, please: (1) notify me immediately by replying to this message;
> (2) do not use, disseminate, distribute or reproduce any part of the message
> or any attachment; and (3) destroy all copies of this message and any
> attachments.

Reply via email to