update-license.asciidoc 5.2 KB

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