mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Rest HL client: Add get license action (#32438)
Rest HL client: Add get license action Continues to use String instead of a more complex License class to hold the license text similarly to put license. Relates #29827
This commit is contained in:
parent
615aa85f4e
commit
e641fccfe3
11 changed files with 284 additions and 31 deletions
50
docs/java-rest/high-level/licensing/get-license.asciidoc
Normal file
50
docs/java-rest/high-level/licensing/get-license.asciidoc
Normal file
|
@ -0,0 +1,50 @@
|
|||
[[java-rest-high-get-license]]
|
||||
=== Get License
|
||||
|
||||
[[java-rest-high-get-license-execution]]
|
||||
==== Execution
|
||||
|
||||
The license can be added or updated using the `getLicense()` method:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/LicensingDocumentationIT.java[get-license-execute]
|
||||
--------------------------------------------------
|
||||
|
||||
[[java-rest-high-get-license-response]]
|
||||
==== Response
|
||||
|
||||
The returned `GetLicenseResponse` contains the license in the JSON format.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/LicensingDocumentationIT.java[get-license-response]
|
||||
--------------------------------------------------
|
||||
<1> The text of the license.
|
||||
|
||||
[[java-rest-high-get-license-async]]
|
||||
==== Asynchronous Execution
|
||||
|
||||
This request can be executed asynchronously:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/LicensingDocumentationIT.java[get-license-execute-async]
|
||||
--------------------------------------------------
|
||||
<1> The `GetLicenseRequest` to execute and the `ActionListener` to use when
|
||||
the execution completes
|
||||
|
||||
The asynchronous method does not block and returns immediately. Once it is
|
||||
completed the `ActionListener` is called back using the `onResponse` method
|
||||
if the execution successfully completed or using the `onFailure` method if
|
||||
it failed.
|
||||
|
||||
A typical listener for `GetLicenseResponse` looks like:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/LicensingDocumentationIT.java[get-license-execute-listener]
|
||||
--------------------------------------------------
|
||||
<1> Called when the execution is successfully completed. The response is
|
||||
provided as an argument
|
||||
<2> Called in case of failure. The raised exception is provided as an argument
|
Loading…
Add table
Add a link
Reference in a new issue