get-license.asciidoc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[get-license]]
  4. === Get License API
  5. This API enables you to retrieve licensing information.
  6. [float]
  7. ==== Request
  8. `GET /_xpack/license`
  9. [float]
  10. ==== Description
  11. This API returns information about the type of license, when it was issued, and
  12. when it expires, for example.
  13. For more information about the different types of licenses, see
  14. https://www.elastic.co/subscriptions.
  15. [float]
  16. ==== Query Parameters
  17. `local`::
  18. (boolean) Specifies whether to retrieve local information. The default value
  19. is `false`, which means the information is retrieved from the master node.
  20. [float]
  21. ==== Authorization
  22. You must have `monitor` cluster privileges to use this API.
  23. For more information, see
  24. {xpack-ref}/security-privileges.html[Security Privileges].
  25. [float]
  26. ==== Examples
  27. The following example provides information about a trial license:
  28. [source,js]
  29. --------------------------------------------------
  30. GET _xpack/license
  31. --------------------------------------------------
  32. // CONSOLE
  33. [source,js]
  34. --------------------------------------------------
  35. {
  36. "license" : {
  37. "status" : "active",
  38. "uid" : "cbff45e7-c553-41f7-ae4f-9205eabd80xx",
  39. "type" : "trial",
  40. "issue_date" : "2018-10-20T22:05:12.332Z",
  41. "issue_date_in_millis" : 1540073112332,
  42. "expiry_date" : "2018-11-19T22:05:12.332Z",
  43. "expiry_date_in_millis" : 1542665112332,
  44. "max_nodes" : 1000,
  45. "issued_to" : "test",
  46. "issuer" : "elasticsearch",
  47. "start_date_in_millis" : -1
  48. }
  49. }
  50. --------------------------------------------------
  51. // TESTRESPONSE[s/"cbff45e7-c553-41f7-ae4f-9205eabd80xx"/$body.license.uid/]
  52. // TESTRESPONSE[s/"basic"/$body.license.type/]
  53. // TESTRESPONSE[s/"2018-10-20T22:05:12.332Z"/$body.license.issue_date/]
  54. // TESTRESPONSE[s/1540073112332/$body.license.issue_date_in_millis/]
  55. // TESTRESPONSE[s/"2018-11-19T22:05:12.332Z"/$body.license.expiry_date/]
  56. // TESTRESPONSE[s/1542665112332/$body.license.expiry_date_in_millis/]
  57. // TESTRESPONSE[s/1000/$body.license.max_nodes/]
  58. // TESTRESPONSE[s/"test"/$body.license.issued_to/]
  59. // TESTRESPONSE[s/"elasticsearch"/$body.license.issuer/]