Class ApiTool

java.lang.Object
org.apache.solr.cli.ToolBase
org.apache.solr.cli.ApiTool
All Implemented Interfaces:
Tool

public class ApiTool extends ToolBase
  • Constructor Details

    • ApiTool

      public ApiTool(ToolRuntime runtime)
      Used to send an arbitrary HTTP request to a Solr API endpoint.
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Tool
      Defines the interface to a Solr tool that can be run from this command-line app.
    • getOptions

      public List<org.apache.commons.cli.Option> getOptions()
    • runImpl

      public void runImpl(org.apache.commons.cli.CommandLine cli) throws Exception
      Specified by:
      runImpl in class ToolBase
      Throws:
      Exception
    • callGet

      protected String callGet(String url) throws Exception
      Throws:
      Exception
    • getSolrUrlFromUri

      public static String getSolrUrlFromUri(URI uri)
      Get Solr base url with port if present and root from URI
      Parameters:
      uri - Full Solr URI (e.g. http://localhost:8983/solr/admin/info/system)
      Returns:
      Solr base url with port and root (from above example http://localhost:8983/solr)
    • getSolrParamsFromUri

      public static org.apache.solr.common.params.ModifiableSolrParams getSolrParamsFromUri(URI uri)