SearchStax Cloud API – Custom JARs


Overview

SearchStax provides an API supporting the creation, deletion and management of SearchStax Cloud deployments.

Premium Clients Only!

The Custom JAR API suite is available to our premium clients only, as noted on our Pricing page.

This page describes how to add and manage custom JAR files using API methods.

JAR size limit!

The API can handle JAR files up to 75 MB. If this is a problem, submit a support ticket.

Restart Solr Nodes!

After uploading a custom Jar, you must restart the Solr nodes to load the contents of the JAR file. The API does not automatically restart the Solr nodes.

The API can be accessed through any tool that assembles HTTP requests and dispatch them to a server. Among these would be the Python coreapi package, the Postman tool, and cURL. For Windows, use PowerShell 7+.

Account Owner, Admin, or Technical Contact

To run the SearchStax Provisioning API, you must be the account Owner, an account Admin, or a Technical Contact. See SearchStax User Roles.

Symbols enclosed in carets (< and >) such as <username> are metavariables. Substitute your local values when you encounter them in the examples.

Contents:

Related Pages:

JARs

account > deployment > solr > custom-jars > list

This method lists the JAR files of a deployment or server.

GET https://app.searchstax.com/api/rest/v2/account/<account_name>/deployment/<uid>/solr/custom-jars/?server_sn=<server_number>&page=<page_number>

where <account_name> is the name of the tenant account, and <uid> is the ID of the deployment.

<server_number> is the optional number of the Solr server within the deployment (usually 4 or 5). If unstated, the method addresses all Solr servers.

<page_number> is the optional page of the results list. Default is 1.

This method uses Token authentication.

There is no request body.

When invoked from Linux (Bash script):

curl --request GET "https://app.searchstax.com/api/rest/v2/account/<account_name>/deployment/<uid>/solr/custom-jars/?server_sn=<server-number>&page=<page_number>" 
  --header "Authorization: Token <token>"

When invoked from Windows (PowerShell script):

$ACCOUNT = "AccountName"
$uid = "ss123456"
$SID = "4"
$PAGE = "1"

$RESULT = Invoke-RestMethod -Method Get -Headers $headers `
         -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/custom-jars/?server_sn=$SID&page=$PAGE" 

$RESULT = $RESULT | ConvertTo-Json

The response is a list of JSON documents identifying the deployment and its current set of JAR files:

[
  {
    "server_sn": 4,
    "jars": []
  },
  {
    "server_sn": 5,
    "jars": [
      "jarfile.jar"
    ]
  }
]



account > deployment > solr > custom-jars > create

This method uploads a custom JAR file to a deployment or a server. The JAR will be replaced if it already exists.

POST https://app.searchstax.com/api/rest/v2/account/<account_name>/deployment/<uid>/solr/custom-jars/?server_sn=<server_number>

where <account_name> is the name of the tenant account, <uid> is the ID of the deployment, and <server_number> is the optional number of the Solr server within the deployment (usually 4 or 5). If unspecified, the method will address all Solr servers.

This method uses Token authentication.

The request body should be a “multipart/form-data” encoded object, containing the following items:

ParameterDescriptionExample
file
required
string
Path to load JAR file.“file=@jarfile.jar”

When invoked from Linux (Bash script):

curl -i -X POST -H "Authorization: Token <Token>" -H "Content-Type: multipart/form-data" -F "file=@jarfile.jar" https://staging.searchstax.com/api/rest/v2/account/staging/deployment/ss123456/solr/custom-jars/

When invoked from Windows (PowerShell script), use a version of PowerShell that supports multipart-form data, such as Powershell 7.0+. To determine what version of PowerShell you are running, evaluate $PSVersionTable.PSVersion.

$ACCOUNT = "AccountName"
$uid = "ss123456"
$SID = "4"

$form = @{
    file = Get-Item -Path '$JARFILE'
}

# Assuming the JAR file is in the same directory as this script. 

$RESULTS = Invoke-RestMethod -Method Post -Form $form -Headers $headers `
          -uri "https://app.searchstax.co/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/custom-jars/" 
$RESULTS = $RESULTS | ConvertTo-Json

Write-Host $RESULTS


The response is a list of JSON documents identifying the deployment and its current set of JAR files:

[
  {
    "server_sn": 4,
    "jars": [
      "jarfile.jar"
    ]
  },
  {
    "server_sn": 5,
    "jars": [
      "jarfile.jar"
    ]
  }
]


account > deployment > solr > custom-jars > delete

This method deletes a JAR from a deployment or a server.

DELETE https://app.searchstax.com/api/rest/v2/account/<account_name>/deployment/<uid>/solr/custom-jars/<jar-name>/?server_sn=<server_number>

where <account_name> is the name of the tenant account, <uid> is the ID of the deployment, <jar-name> is the name of the JAR file, and <server_number> is the optional number of the Solr server within the deployment (usually 4 or 5). If not specified, the method addresses all Solr servers.

This method uses Token authentication.

There is no request body.

When invoked from Linux (Bash script):

curl --request DELETE "https://app.searchstax.com/api/rest/v2/account/<account_name>/deployment/<uid>/solr/custom-jars/<jar-name>/?server_sn=<server_number>" 
  --header "Authorization: Token <token>" 
}"

When invoked from Windows (PowerShell script):

$ACCOUNT = "AccountName"
$uid = "ss123456"
$sid = "4"

$RESULT = Invoke-RestMethod -Method DELETE `
         -Headers $headers `
         -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/custom-jars/<jar-name>/?server_sn=$sid" 

$RESULT = $RESULT | ConvertTo-Json

The response is a JSON document confirming the deletion:

{
  "success": "true"
}

Questions?

Do not hesitate to contact the SearchStax Support Desk.

Was this article helpful?
YesNo