update-license.asciidoc 4.7 KB

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