get-license.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [role="xpack"]
  2. [[get-license]]
  3. === Get license API
  4. ++++
  5. <titleabbrev>Get license</titleabbrev>
  6. ++++
  7. This API enables you to retrieve licensing information.
  8. [discrete]
  9. ==== Request
  10. `GET /_license`
  11. [discrete]
  12. ==== Description
  13. This API returns information about the type of license, when it was issued, and
  14. when it expires, for example.
  15. For more information about the different types of licenses, see
  16. https://www.elastic.co/subscriptions.
  17. NOTE: If the master node is generating a new cluster state, the get license API
  18. may return a `404 Not Found` response. If you receive an unexpected `404`
  19. response after cluster startup, wait a short period and retry the request.
  20. [discrete]
  21. ==== Query Parameters
  22. `local`::
  23. (Boolean) Specifies whether to retrieve local information. The default value
  24. is `false`, which means the information is retrieved from the master node.
  25. `accept_enterprise`::
  26. (Boolean) If `true`, this parameter returns `enterprise` for Enterprise
  27. license types. If `false`, this parameter returns `platinum` for both
  28. `platinum` and `enterprise` license types. This behavior is maintained for
  29. backwards compatibility.
  30. deprecated::[7.6.0,"This parameter is deprecated and will always be set to `true` in 8.x."]
  31. [discrete]
  32. ==== Authorization
  33. You must have `monitor` cluster privileges to use this API.
  34. For more information, see <<security-privileges>>.
  35. [discrete]
  36. ==== Examples
  37. The following example provides information about a trial license:
  38. [source,console]
  39. --------------------------------------------------
  40. GET /_license
  41. --------------------------------------------------
  42. [source,console-result]
  43. --------------------------------------------------
  44. {
  45. "license" : {
  46. "status" : "active",
  47. "uid" : "cbff45e7-c553-41f7-ae4f-9205eabd80xx",
  48. "type" : "trial",
  49. "issue_date" : "2018-10-20T22:05:12.332Z",
  50. "issue_date_in_millis" : 1540073112332,
  51. "expiry_date" : "2018-11-19T22:05:12.332Z",
  52. "expiry_date_in_millis" : 1542665112332,
  53. "max_nodes" : 1000,
  54. "max_resource_units" : null,
  55. "issued_to" : "test",
  56. "issuer" : "elasticsearch",
  57. "start_date_in_millis" : -1
  58. }
  59. }
  60. --------------------------------------------------
  61. // TESTRESPONSE[s/"cbff45e7-c553-41f7-ae4f-9205eabd80xx"/$body.license.uid/]
  62. // TESTRESPONSE[s/"basic"/$body.license.type/]
  63. // TESTRESPONSE[s/"2018-10-20T22:05:12.332Z"/$body.license.issue_date/]
  64. // TESTRESPONSE[s/1540073112332/$body.license.issue_date_in_millis/]
  65. // TESTRESPONSE[s/"2018-11-19T22:05:12.332Z"/$body.license.expiry_date/]
  66. // TESTRESPONSE[s/1542665112332/$body.license.expiry_date_in_millis/]
  67. // TESTRESPONSE[s/1000/$body.license.max_nodes/]
  68. // TESTRESPONSE[s/"test"/$body.license.issued_to/]
  69. // TESTRESPONSE[s/"elasticsearch"/$body.license.issuer/]