Security API
Add IP Access Rule
Grant access to a specific IP address for a particular Solr handler on your Opensolr Index. Use IP-based rules to restrict who can query or update your index.
Endpoint
GET https://opensolr.com/solr_manager/api/add_ip
Parameters
| Parameter | Status | Description |
|---|---|---|
email | Required | Your Opensolr registration email address |
api_key | Required | Your Opensolr API key |
core_name | Required | The name of the index you wish to add an IP rule to |
ip | Required | The IP address you wish to grant access (e.g., 15.24.53.123) |
handler | Required | The Solr URI handler to apply the rule to (e.g., /update, /select) |
IP rules are applied per handler. For example, you can restrict
/update to your server's IP while leaving /select open for public search queries.Code Examples
cURL
curl -s "https://opensolr.com/solr_manager/api/add_ip?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_solr_core&ip=15.24.53.123&handler=/update"
PHP
$params = http_build_query([ 'email' => 'YOUR_EMAIL', 'api_key' => 'YOUR_API_KEY', 'core_name' => 'my_solr_core', 'ip' => '15.24.53.123', 'handler' => '/update', ]); $response = file_get_contents("https://opensolr.com/solr_manager/api/add_ip?{$params}"); $result = json_decode($response, true); print_r($result);
Python
import requests response = requests.get("https://opensolr.com/solr_manager/api/add_ip", params={ "email": "YOUR_EMAIL", "api_key": "YOUR_API_KEY", "core_name": "my_solr_core", "ip": "15.24.53.123", "handler": "/update", }) print(response.json())
Related Documentation
Update HTTP AuthSet or update HTTP Basic Auth credentials for your index.
Add IP Access RuleGrant access to specific IPs for your Solr endpoints.
Get IP ListRetrieve all IP access rules configured for your index.
Remove IP AccessRevoke IP-based access rules from your index.
Need help securing your Opensolr Indexes? We are here to help.
Contact Support