update-license.asciidoc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[update-license]]
  4. === Update license API
  5. ++++
  6. <titleabbrev>Update license</titleabbrev>
  7. ++++
  8. This API enables you to update your license.
  9. [float]
  10. ==== Request
  11. `PUT /_license`
  12. [float]
  13. ==== Description
  14. You can update your license at runtime without shutting down your nodes.
  15. License updates take effect immediately. If the license you are installing does
  16. not support all of the features that were available with your previous license,
  17. however, you are notified in the response. You must then re-submit the API
  18. request with the `acknowledge` parameter set to `true`.
  19. For more information about the different types of licenses, see
  20. https://www.elastic.co/subscriptions.
  21. [float]
  22. ==== Query Parameters
  23. `acknowledge`::
  24. (boolean) Specifies whether you acknowledge the license changes. The default
  25. value is `false`.
  26. [float]
  27. ==== Request Body
  28. `licenses`::
  29. (array) A sequence of one or more JSON documents containing the license
  30. information.
  31. [float]
  32. ==== Authorization
  33. If {es} {security-features} are enabled, you need `manage` cluster privileges to
  34. install the license.
  35. If {es} {security-features} are enabled and you are installing a gold or platinum
  36. license, you must enable TLS on the transport networking layer before you
  37. install the license. See <<configuring-tls>>.
  38. [float]
  39. ==== Examples
  40. The following example updates to a basic license:
  41. [source,js]
  42. ------------------------------------------------------------
  43. POST /_license
  44. {
  45. "licenses": [
  46. {
  47. "uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
  48. "type":"basic",
  49. "issue_date_in_millis":1411948800000,
  50. "expiry_date_in_millis":1914278399999,
  51. "max_nodes":1,
  52. "issued_to":"issuedTo",
  53. "issuer":"issuer",
  54. "signature":"xx"
  55. }
  56. ]
  57. }
  58. ------------------------------------------------------------
  59. // CONSOLE
  60. // TEST[skip:license testing issues]
  61. NOTE: These values are invalid; you must substitute the appropriate content
  62. from your license file.
  63. You can alternatively use a `curl` command, for example:
  64. [source,js]
  65. [source,shell]
  66. ------------------------------------------------------------
  67. curl -XPUT -u <user> 'http://<host>:<port>/_license' -H "Content-Type: application/json" -d @license.json
  68. ------------------------------------------------------------
  69. // NOTCONSOLE
  70. On Windows machine, use the following command:
  71. [source,shell]
  72. ------------------------------------------------------------
  73. gc .\license.json | Invoke-WebRequest -uri http://<host>:<port>/_license -Credential elastic -Method Put -ContentType "application/json"
  74. ------------------------------------------------------------
  75. In these examples,
  76. * `<user>` is a user ID with the appropriate authority.
  77. * `<host>` is the hostname of the {es} node (`localhost` if executing
  78. locally)
  79. * `<port>` is the http port (defaults to `9200`)
  80. * `license.json` is the license JSON file
  81. NOTE: If your {es} node has SSL enabled on the HTTP interface, you must
  82. start your URL with `https://`
  83. If you previously had a license with more features than the basic license, you
  84. receive the following response:
  85. [source,js]
  86. ------------------------------------------------------------
  87. {
  88. "acknowledged": false,
  89. "license_status": "valid",
  90. "acknowledge": {
  91. "message": """This license update requires acknowledgement. To acknowledge the license, please read the following messages and update the license again, this time with the "acknowledge=true" parameter:""",
  92. "watcher": [
  93. "Watcher will be disabled"
  94. ],
  95. "logstash": [
  96. "Logstash will no longer poll for centrally-managed pipelines"
  97. ],
  98. "security": [
  99. "The following X-Pack security functionality will be disabled: ..." ]
  100. }
  101. }
  102. ------------------------------------------------------------
  103. // NOTCONSOLE
  104. To complete the update, you must re-submit the API request and set the
  105. `acknowledge` parameter to `true`. For example:
  106. [source,js]
  107. ------------------------------------------------------------
  108. POST /_license?acknowledge=true
  109. {
  110. "licenses": [
  111. {
  112. "uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
  113. "type":"basic",
  114. "issue_date_in_millis":1411948800000,
  115. "expiry_date_in_millis":1914278399999,
  116. "max_nodes":1,
  117. "issued_to":"issuedTo",
  118. "issuer":"issuer",
  119. "signature":"xx"
  120. }
  121. ]
  122. }
  123. ------------------------------------------------------------
  124. // CONSOLE
  125. // TEST[skip:license testing issues]
  126. Alternatively:
  127. [source,sh]
  128. ------------------------------------------------------------
  129. curl -XPUT -u elastic 'http://<host>:<port>/_license?acknowledge=true' -H "Content-Type: application/json" -d @license.json
  130. ------------------------------------------------------------
  131. // NOTCONSOLE
  132. For more information about the features that are disabled when you downgrade
  133. your license, see {xpack-ref}/license-expiration.html[License Expiration].