Package org.elasticsearch.client
Class LicenseClient
java.lang.Object
org.elasticsearch.client.LicenseClient
public final class LicenseClient
extends java.lang.Object
A wrapper for the
RestHighLevelClient that provides methods for
accessing the Elastic License-related methods
See the X-Pack Licensing APIs on elastic.co for more information.
-
Method Summary
Modifier and Type Method Description AcknowledgedResponsedeleteLicense(DeleteLicenseRequest request, RequestOptions options)Deletes license from the cluster.CancellabledeleteLicenseAsync(DeleteLicenseRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously deletes license from the cluster.GetBasicStatusResponsegetBasicStatus(RequestOptions options)Retrieve the license basic statusGetLicenseResponsegetLicense(GetLicenseRequest request, RequestOptions options)Returns the current license for the cluster.CancellablegetLicenseAsync(GetLicenseRequest request, RequestOptions options, ActionListener<GetLicenseResponse> listener)Asynchronously returns the current license for the cluster cluster.GetTrialStatusResponsegetTrialStatus(RequestOptions options)Retrieve the license trial statusPutLicenseResponseputLicense(PutLicenseRequest request, RequestOptions options)Updates license for the cluster.CancellableputLicenseAsync(PutLicenseRequest request, RequestOptions options, ActionListener<PutLicenseResponse> listener)Asynchronously updates license for the cluster.StartBasicResponsestartBasic(StartBasicRequest request, RequestOptions options)Initiates an indefinite basic license.CancellablestartBasicAsync(StartBasicRequest request, RequestOptions options, ActionListener<StartBasicResponse> listener)Asynchronously initiates an indefinite basic license.StartTrialResponsestartTrial(StartTrialRequest request, RequestOptions options)Starts a trial license on the cluster.CancellablestartTrialAsync(StartTrialRequest request, RequestOptions options, ActionListener<StartTrialResponse> listener)Asynchronously starts a trial license on the cluster.
-
Method Details
-
putLicense
public PutLicenseResponse putLicense(PutLicenseRequest request, RequestOptions options) throws java.io.IOExceptionUpdates license for the cluster.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
putLicenseAsync
public Cancellable putLicenseAsync(PutLicenseRequest request, RequestOptions options, ActionListener<PutLicenseResponse> listener)Asynchronously updates license for the cluster.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
getLicense
public GetLicenseResponse getLicense(GetLicenseRequest request, RequestOptions options) throws java.io.IOExceptionReturns the current license for the cluster.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
getLicenseAsync
public Cancellable getLicenseAsync(GetLicenseRequest request, RequestOptions options, ActionListener<GetLicenseResponse> listener)Asynchronously returns the current license for the cluster cluster.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
deleteLicense
public AcknowledgedResponse deleteLicense(DeleteLicenseRequest request, RequestOptions options) throws java.io.IOExceptionDeletes license from the cluster.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
deleteLicenseAsync
public Cancellable deleteLicenseAsync(DeleteLicenseRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously deletes license from the cluster.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
startTrial
public StartTrialResponse startTrial(StartTrialRequest request, RequestOptions options) throws java.io.IOExceptionStarts a trial license on the cluster.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
startTrialAsync
public Cancellable startTrialAsync(StartTrialRequest request, RequestOptions options, ActionListener<StartTrialResponse> listener)Asynchronously starts a trial license on the cluster.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
startBasic
public StartBasicResponse startBasic(StartBasicRequest request, RequestOptions options) throws java.io.IOExceptionInitiates an indefinite basic license.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
startBasicAsync
public Cancellable startBasicAsync(StartBasicRequest request, RequestOptions options, ActionListener<StartBasicResponse> listener)Asynchronously initiates an indefinite basic license.- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
getTrialStatus
Retrieve the license trial status- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
getBasicStatus
Retrieve the license basic status- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-