get-license.asciidoc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. [float]
  10. ==== Request
  11. `GET /_license`
  12. [float]
  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. [float]
  19. ==== Query Parameters
  20. `local`::
  21. (boolean) Specifies whether to retrieve local information. The default value
  22. is `false`, which means the information is retrieved from the master node.
  23. [float]
  24. ==== Authorization
  25. You must have `monitor` cluster privileges to use this API.
  26. For more information, see <<security-privileges>>.
  27. [float]
  28. ==== Examples
  29. The following example provides information about a trial license:
  30. [source,console]
  31. --------------------------------------------------
  32. GET /_license
  33. --------------------------------------------------
  34. [source,console-result]
  35. --------------------------------------------------
  36. {
  37. "license" : {
  38. "status" : "active",
  39. "uid" : "cbff45e7-c553-41f7-ae4f-9205eabd80xx",
  40. "type" : "trial",
  41. "issue_date" : "2018-10-20T22:05:12.332Z",
  42. "issue_date_in_millis" : 1540073112332,
  43. "expiry_date" : "2018-11-19T22:05:12.332Z",
  44. "expiry_date_in_millis" : 1542665112332,
  45. "max_nodes" : 1000,
  46. "issued_to" : "test",
  47. "issuer" : "elasticsearch",
  48. "start_date_in_millis" : -1
  49. }
  50. }
  51. --------------------------------------------------
  52. // TESTRESPONSE[s/"cbff45e7-c553-41f7-ae4f-9205eabd80xx"/$body.license.uid/]
  53. // TESTRESPONSE[s/"basic"/$body.license.type/]
  54. // TESTRESPONSE[s/"2018-10-20T22:05:12.332Z"/$body.license.issue_date/]
  55. // TESTRESPONSE[s/1540073112332/$body.license.issue_date_in_millis/]
  56. // TESTRESPONSE[s/"2018-11-19T22:05:12.332Z"/$body.license.expiry_date/]
  57. // TESTRESPONSE[s/1542665112332/$body.license.expiry_date_in_millis/]
  58. // TESTRESPONSE[s/1000/$body.license.max_nodes/]
  59. // TESTRESPONSE[s/"test"/$body.license.issued_to/]
  60. // TESTRESPONSE[s/"elasticsearch"/$body.license.issuer/]