0

Good afternoon. I'm able to change the global policies for NiFi through REST API, however, I'm trying to edit the access policies for an ARBITRARY processor. I have no idea how to do so. Everything in the NiFi REST API website calls everything else a component (or maybe I'm misinterpreting...)

Anyway, I appreciate all the help/guidance!

1 Answers1

1

The NiFi UI uses the API behind the scenes to perform every action. You can set policies on process groups, remote process groups, processors, funnels, input & output ports, queues, controller services, and reporting tasks. Collectively, these resources are called "components".

If a policy is not set on a specific component, it inherits the policies set on the parent object (i.e. the process group containing it). You can override these policies directly at a granular level.

To set the policy for a specific component, use the POST /policies API. The easiest way to observe the explicit API invocation necessary is to use your browser's developer tools to record the calls made by the UI client while you manually perform the action and then use those API calls.

There are also other tools which make this process easier, such as the official NiFi CLI Toolkit and the (unofficial but very good) NiPyAPI.

NiFi Policies API description

Andy
  • 13,916
  • 1
  • 36
  • 78
  • Thank you for your help. So I can change a processor's access policies through /policies/{policy_id}? I thought I had to specify the processor in some fashion? – eps_del Jul 13 '20 at 16:03
  • Update: There is first a POST being sent when I get asked if I want to override the higher policy through the UI. Then I override the policy and PUT request is made (probably changing the actual policy?). Is it possible to not make the post and just jump straight to changing the policy? I appreciate your time and response! – eps_del Jul 13 '20 at 17:18
  • I believe if you know the policy id already (or are creating a new one), you can just perform the `PUT`. – Andy Jul 13 '20 at 18:46