NOTE: You are looking at documentation for an older release. For the latest information, see the current release documentation.
Update license API
editUpdate license API
editThis API enables you to update your license.
Request
editPUT _xpack/license
Description
editYou 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
request with the acknowledge
parameter set to true
.
For more information about the different types of licenses, see https://www.elastic.co/subscriptions.
Query Parameters
edit-
acknowledge
-
(boolean) Specifies whether you acknowledge the license changes. The default
value is
false
.
Request Body
edit-
licenses
- (array) A sequence of one or more JSON documents containing the license information.
Authorization
editIf Elasticsearch security features are enabled, you need manage
cluster privileges to
install the license.
If Elasticsearch 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 Encrypting communications in Elasticsearch.
Examples
editThe following example updates to a basic license:
POST _xpack/license { "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" } ] }
These values are invalid; you must substitute the appropriate content from your license file.
You can alternatively use a curl
command, for example:
curl -XPUT -u <user> 'http://<host>:<port>/_xpack/license' -H "Content-Type: application/json" -d @license.json
On Windows machine, use the following command:
gc .\license.json | Invoke-WebRequest -uri http://<host>:<port>/_xpack/license -Credential elastic -Method Put -ContentType "application/json"
In these examples,
-
<user>
is a user ID with the appropriate authority. -
<host>
is the hostname of the Elasticsearch node (localhost
if executing locally) -
<port>
is the http port (defaults to9200
) -
license.json
is the license JSON file
If your Elasticsearch 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:
{ "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: ..." ] } }
To complete the update, you must re-submit the API request and set the
acknowledge
parameter to true
. For example:
POST _xpack/license?acknowledge=true { "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" } ] }
Alternatively:
curl -XPUT -u elastic 'http://<host>:<port>/_xpack/license?acknowledge=true' -H "Content-Type: application/json" -d @license.json
For more information about the features that are disabled when you downgrade your license, see License expiration.