get-license.asciidoc 2.4 KB

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