Get IP geolocation database configuration API

Get IP geolocation database configuration API

New API reference

For the most up-to-date API details, refer to Ingest APIs.

Returns information about one or more IP geolocation database configurations.

  1. resp = client.perform_request(
  2. "GET",
  3. "/_ingest/ip_location/database/my-database-id",
  4. )
  5. print(resp)
  1. const response = await client.transport.request({
  2. method: "GET",
  3. path: "/_ingest/ip_location/database/my-database-id",
  4. });
  5. console.log(response);
  1. GET /_ingest/ip_location/database/my-database-id

Request

GET /_ingest/ip_location/database/<database>

GET /_ingest/ip_location/database

Prerequisites

  • If the Elasticsearch security features are enabled, you must have the manage cluster privilege to use this API.

Path parameters

<database>

(Optional, string) Comma-separated list of database configuration IDs to retrieve. Wildcard (*) expressions are supported.

To get all database configurations, omit this parameter or use *.

Query parameters

master_timeout

(Optional, time units) Period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. Defaults to 30s. Can also be set to -1 to indicate that the request should never timeout.

Examples

Get information for a specific IP geolocation database configuration

  1. resp = client.perform_request(
  2. "GET",
  3. "/_ingest/ip_location/database/my-database-id",
  4. )
  5. print(resp)
  1. const response = await client.transport.request({
  2. method: "GET",
  3. path: "/_ingest/ip_location/database/my-database-id",
  4. });
  5. console.log(response);
  1. GET /_ingest/ip_location/database/my-database-id

The API returns the following response:

  1. {
  2. "databases" : [
  3. {
  4. "id" : "my-database-id",
  5. "version" : 1,
  6. "modified_date_millis" : 1723040276114,
  7. "database" : {
  8. "name" : "GeoIP2-Domain",
  9. "maxmind" : {
  10. "account_id" : "1234567"
  11. }
  12. }
  13. }
  14. ]
  15. }