API - Delete a Dedicated Environment

Cluster Management
Cluster Management API

Delete a Dedicated Environment

Tears down a dedicated environment you provisioned (one of your cluster_owned_environments in get_env): every server in it and its load balancer are decommissioned by a background job. Shared Opensolr environments cannot be deleted.

Endpoint

GET https://opensolr.com/solr_manager/api/delete_environment

Parameters

ParameterStatusDescription
emailRequiredYour Opensolr registration email address
api_keyRequiredYour Opensolr API key (master key, or a scoped key that allows this endpoint)
env_nameRequiredThe environment tag name exactly as returned by get_env (cluster_owned_environments[].server_identifier)

How It Works

Ownership of the environment is checked first; a mismatch answers Not Owner! and nothing is queued. Otherwise a delete_env job is created and processed by the Opensolr job runner, which removes the servers, the load balancer and their DNS records and stops billing for them. Indexes still living in that environment are destroyed with it — move or back them up first (create_backup, then replicate_index into another environment).

Irreversible. There is no undo once the job runs. The call itself only queues the job; use the control panel’s Environments page to watch its progress.

Response

KeyTypeDescription
on successHTTP 200 with an empty body — the deletion job has been queued
on errorPlain-text Not Owner! followed by Please fix the errors above! when the environment is not yours or the name is unknown

Code Examples

$_ cURL

curl -s "https://opensolr.com/solr_manager/api/delete_environment?email=YOUR_EMAIL&api_key=YOUR_API_KEY&env_name=MY-ENV-TAG"

PHP PHP

$q = http_build_query(['email' => 'YOUR_EMAIL', 'api_key' => 'YOUR_API_KEY', 'env_name' => 'MY-ENV-TAG']);
echo file_get_contents("https://opensolr.com/solr_manager/api/delete_environment?{$q}");

Py Python

import requests

r = requests.get("https://opensolr.com/solr_manager/api/delete_environment",
                 params={"email": "YOUR_EMAIL", "api_key": "YOUR_API_KEY", "env_name": "MY-ENV-TAG"}, timeout=30)
print(r.text)

Example Response

(empty body  job queued)

# or, when the environment is not yours:
Not Owner!
Please fix the errors above!

Use Cases

  • Tear down a temporary load-test or staging environment from CI when the run ends
  • Decommission a region you no longer serve
  • Clean up after migrating indexes to a newer Solr environment

Related Documentation

Need help with the Opensolr API? We are here to help.

Contact Support