put-ip-location-database.asciidoc 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. [[put-ip-location-database-api]]
  2. === Create or update IP geolocation database configuration API
  3. ++++
  4. <titleabbrev>Create or update IP geolocation database configuration</titleabbrev>
  5. ++++
  6. .New API reference
  7. [sidebar]
  8. --
  9. For the most up-to-date API details, refer to {api-es}/group/endpoint-ingest[Ingest APIs].
  10. --
  11. Creates or updates an IP geolocation database configuration.
  12. IMPORTANT: The Maxmind `account_id` shown below requires a license key. Because the license key is sensitive information,
  13. it is stored as a <<secure-settings,secure setting>> in {es} named `ingest.geoip.downloader.maxmind.license_key`. Only
  14. one Maxmind license key is currently allowed per {es} cluster. A valid license key must be in the secure settings in order
  15. to download from Maxmind. The license key setting does not take effect until all nodes are restarted or a
  16. <<cluster-nodes-reload-secure-settings, `reload_secure_settings`>> request is executed.
  17. [source,console]
  18. ----
  19. PUT _ingest/ip_location/database/my-database-1
  20. {
  21. "name": "GeoIP2-Domain",
  22. "maxmind": {
  23. "account_id": "1234567"
  24. }
  25. }
  26. ----
  27. // TEST[skip:we don't want to leak the enterprise-geoip-downloader task, which touching these APIs would cause. Therefore, skip this test.]
  28. IMPORTANT: The IPinfo configuration shown below requires a token. Because the token is sensitive information,
  29. it is stored as a <<secure-settings,secure setting>> in {es} named `ingest.ip_location.downloader.ipinfo.token`. Only
  30. one IPinfo token is currently allowed per {es} cluster. A valid token must be in the secure settings in order
  31. to download from IPinfo. The token setting does not take effect until all nodes are restarted or a
  32. <<cluster-nodes-reload-secure-settings, `reload_secure_settings`>> request is executed.
  33. [source,console]
  34. ----
  35. PUT _ingest/ip_location/database/my-database-2
  36. {
  37. "name": "standard_location",
  38. "ipinfo": {
  39. }
  40. }
  41. ----
  42. // TEST[skip:we don't want to leak the enterprise-geoip-downloader task, which touching these APIs would cause. Therefore, skip this test.]
  43. [[put-ip-location-database-api-request]]
  44. ==== {api-request-title}
  45. `PUT /_ingest/ip_location/database/<database>`
  46. [[put-ip-location-database-api-prereqs]]
  47. ==== {api-prereq-title}
  48. * If the {es} {security-features} are enabled, you must have the
  49. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  50. [[put-ip-location-database-api-path-params]]
  51. ==== {api-path-parms-title}
  52. `<database>`::
  53. +
  54. __
  55. (Required, string) ID of the database configuration to create or update.
  56. [[put-ip-location-database-api-query-params]]
  57. ==== {api-query-parms-title}
  58. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  59. [[put-ip-location-database-api-request-body]]
  60. ==== {api-request-body-title}
  61. // tag::ip-location-database-object[]
  62. `name`::
  63. (Required, string)
  64. The provider-assigned name of the IP geolocation database to download.
  65. `<provider>`::
  66. (Required, a provider object and its associated configuration)
  67. The configuration necessary to identify which IP geolocation provider to use to download
  68. the database, as well as any provider-specific configuration necessary for such downloading.
  69. +
  70. At present, the only supported providers are `maxmind` and `ipinfo`. The maxmind provider
  71. requires that an `account_id` (string) is configured. The ipinfo provider does not require
  72. additional configuration in the request body.
  73. // end::ip-location-database-object[]
  74. [[ip-location-database-configuration-licensing]]
  75. ==== Licensing
  76. Downloading databases from third party providers is a commercial feature that requires an
  77. appropriate license. For more information, refer to https://www.elastic.co/subscriptions.