update-license.asciidoc 5.2 KB

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