2018-03-06 12:47:04 -05:00
[role="xpack"]
2018-06-20 11:17:11 -04:00
[testenv="basic"]
2018-03-06 12:47:04 -05:00
[[update-license]]
2018-12-20 13:23:28 -05:00
=== Update license API
++++
<titleabbrev>Update license</titleabbrev>
++++
2018-03-06 12:47:04 -05:00
2020-02-05 14:07:02 -05:00
Updates the license for your {es} cluster.
2018-03-06 12:47:04 -05:00
2019-11-14 07:59:56 -05:00
[[update-license-api-request]]
==== {api-request-title}
2018-03-06 12:47:04 -05:00
2019-11-14 07:59:56 -05:00
`PUT _license`
2018-03-06 12:47:04 -05:00
2019-11-14 07:59:56 -05:00
`POST _license`
[[update-license-api-prereqs]]
==== {api-prereq-title}
If {es} {security-features} are enabled, you need `manage` cluster privileges to
install the license.
If {es} {security-features} are enabled and you are installing a gold or platinum
license, you must enable TLS on the transport networking layer before you
install the license. See <<configuring-tls>>.
[[update-license-api-desc]]
==== {api-description-title}
2018-03-06 12:47:04 -05:00
2020-02-05 14:07:02 -05:00
You can update your license at runtime without shutting down your nodes. License
updates take effect immediately. If the license you are installing does not
support all of the features that were available with your previous license,
however, you are notified in the response. You must then re-submit the API
2018-03-06 12:47:04 -05:00
request with the `acknowledge` parameter set to `true`.
For more information about the different types of licenses, see
https://www.elastic.co/subscriptions.
2019-11-14 07:59:56 -05:00
[[update-license-api-query-params]]
==== {api-query-parms-title}
2018-03-06 12:47:04 -05:00
`acknowledge`::
2019-11-14 07:59:56 -05:00
(Optional, boolean)
Specifies whether you acknowledge the license changes. The default
2018-03-06 12:47:04 -05:00
value is `false`.
2019-11-14 07:59:56 -05:00
[[update-license-api-request-body]]
==== {api-request-body-title}
2018-03-06 12:47:04 -05:00
`licenses`::
2019-11-14 07:59:56 -05:00
(Required, array)
A sequence of one or more JSON documents containing the license information.
2018-03-06 12:47:04 -05:00
2019-11-14 07:59:56 -05:00
[[update-license-api-example]]
==== {api-examples-title}
2018-03-06 12:47:04 -05:00
The following example updates to a basic license:
2019-09-06 11:31:13 -04:00
[source,console]
2018-03-06 12:47:04 -05:00
------------------------------------------------------------
2019-11-14 07:59:56 -05:00
PUT _license
2018-03-06 12:47:04 -05:00
{
"licenses": [
{
"uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
"type":"basic",
"issue_date_in_millis":1411948800000,
"expiry_date_in_millis":1914278399999,
"max_nodes":1,
"issued_to":"issuedTo",
"issuer":"issuer",
"signature":"xx"
}
]
}
------------------------------------------------------------
// TEST[skip:license testing issues]
NOTE: These values are invalid; you must substitute the appropriate content
from your license file.
2019-04-04 11:37:08 -04:00
You can also install your license file using a `curl` command. Be sure to add
`@` before the license file path to instruct curl to treat it as an input file.
2018-03-06 12:47:04 -05:00
[source,shell]
------------------------------------------------------------
2018-11-28 08:24:35 -05:00
curl -XPUT -u <user> 'http://<host>:<port>/_license' -H "Content-Type: application/json" -d @license.json
2018-03-06 12:47:04 -05:00
------------------------------------------------------------
// NOTCONSOLE
2019-04-04 11:37:08 -04:00
On Windows, use the following command:
2018-03-06 12:47:04 -05:00
[source,shell]
------------------------------------------------------------
2019-03-25 09:00:03 -04:00
Invoke-WebRequest -uri http://<host>:<port>/_xpack/license -Credential elastic -Method Put -ContentType "application/json" -InFile .\license.json
2018-03-06 12:47:04 -05:00
------------------------------------------------------------
In these examples,
* `<user>` is a user ID with the appropriate authority.
2020-02-05 14:07:02 -05:00
* `<host>` is the hostname of any node in the {es} cluster (`localhost` if
executing locally)
2018-03-06 12:47:04 -05:00
* `<port>` is the http port (defaults to `9200`)
* `license.json` is the license JSON file
NOTE: If your {es} node has SSL enabled on the HTTP interface, you must
start your URL with `https://`
If you previously had a license with more features than the basic license, you
receive the following response:
[source,js]
------------------------------------------------------------
{
"acknowledged": false,
"license_status": "valid",
"acknowledge": {
"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:""",
"watcher": [
"Watcher will be disabled"
],
"logstash": [
"Logstash will no longer poll for centrally-managed pipelines"
],
"security": [
"The following X-Pack security functionality will be disabled: ..." ]
}
}
------------------------------------------------------------
2018-06-20 11:17:11 -04:00
// NOTCONSOLE
2018-03-06 12:47:04 -05:00
To complete the update, you must re-submit the API request and set the
`acknowledge` parameter to `true`. For example:
2019-09-06 11:31:13 -04:00
[source,console]
2018-03-06 12:47:04 -05:00
------------------------------------------------------------
2019-11-14 07:59:56 -05:00
PUT _license?acknowledge=true
2018-03-06 12:47:04 -05:00
{
"licenses": [
{
"uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
"type":"basic",
"issue_date_in_millis":1411948800000,
"expiry_date_in_millis":1914278399999,
"max_nodes":1,
"issued_to":"issuedTo",
"issuer":"issuer",
"signature":"xx"
}
]
}
------------------------------------------------------------
// TEST[skip:license testing issues]
Alternatively:
[source,sh]
------------------------------------------------------------
2018-11-28 08:24:35 -05:00
curl -XPUT -u elastic 'http://<host>:<port>/_license?acknowledge=true' -H "Content-Type: application/json" -d @license.json
2018-03-06 12:47:04 -05:00
------------------------------------------------------------
// NOTCONSOLE
2020-01-09 14:26:34 -05:00
For more information about the features that are disabled when your license
expires, see
{kibana-ref}/managing-licenses.html#license-expiration[License expiration].