code: public boolean isExistingPipeline(String pipelineName) throws IOException {
          logger.debug("is existing pipeline [{}]", pipelineName);
          try {
              return client.ingest().getPipeline(new GetPipelineRequest(pipelineName), RequestOptions.DEFAULT).isFound();
          } catch (ElasticsearchStatusException e) {
              if (e.status().getStatus() == 404) {
                  return false;
              }
              throw new IOException(e);
          }
      }
docs: Check if a pipeline exists
  @param pipelineName pipeline name
  @return true if the pipeline exists, false otherwise
  @throws IOException In case of error