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