I develop in Java. Thinking of switching to Kotlin (rather than Scala).
Here is how the relevant code looks in my NifiRestClient, which uses Swagger 
generated REST client to access NiFi REST API.

      /*
      * List all NiFi processors in this release
      */
      public List<String> listAllProcessors() {
            List<String> processors = new ArrayList<>();

            try {
                  flowApi.getProcessorTypes()
                           .getProcessorTypes()
                           .forEach(dto -> {
                                        // get processor short type from class 
name
                                        String type = dto.getType();
                                        type = 
type.substring(type.lastIndexOf('.') + 1);
                                        processors.add(type);
                                          }
                                 );
            } catch (Exception ae) {
                  printApiException("NifiRestClient#listAllProcessors", ae);
                  throw new IllegalArgumentException("Failed to obtain a list 
of all available NiFi processors");
            }
            processors.sort(Comparator.naturalOrder());
            return processors;
      }



}

From: Daniel Chaffelson <chaffel...@gmail.com>
Sent: Tuesday, November 13, 2018 7:57 AM
To: users@nifi.apache.org
Subject: Re: Easiest way to list all NiFi processors in a release.

There is also a shortcut function NiPyApi for this, as it is handy when 
procedurally deploying flows:
https://nipyapi.readthedocs.io/en/latest/_modules/nipyapi/canvas.html#list_all_processor_types

On Mon, Nov 12, 2018 at 6:23 PM Pierre Villard 
<pierre.villard...@gmail.com<mailto:pierre.villard...@gmail.com>> wrote:
Hi Vitaly,

Yes there is one [1]: GET on /flow/processor-types

Easiest way to find out is to use the developer tool of your browser. Anything 
viewable/doable in the NiFi UI is a doable through REST API endpoints.

[1] https://nifi.apache.org/docs/nifi-docs/rest-api/

Thanks,
Pierre

Le lun. 12 nov. 2018 à 18:36, Vitaly Krivoy 
<vitaly_kri...@jhancock.com<mailto:vitaly_kri...@jhancock.com>> a écrit :
Is there a REST API to list all NiFi processors in a current NiFi release? 
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.

Reply via email to