HLRC: ML PUT Calendar (#33362)

This commit is contained in:
David Kyle 2018-09-14 15:00:18 +01:00 committed by GitHub
parent bcbbbdf660
commit b04faa059b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1001 additions and 241 deletions

View file

@ -112,7 +112,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-buckets-l
<1> `onResponse` is called back when the action is completed successfully
<2> `onFailure` is called back when some unexpected error occurs
[[java-rest-high-snapshot-ml-get-buckets-response]]
[[java-rest-high-x-pack-ml-get-buckets-response]]
==== Get Buckets Response
The returned `GetBucketsResponse` contains the requested buckets:

View file

@ -70,7 +70,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-categorie
<1> `onResponse` is called back when the action is completed successfully
<2> `onFailure` is called back when some unexpected error occurs
[[java-rest-high-snapshot-ml-get-categories-response]]
[[java-rest-high-x-pack-ml-get-categories-response]]
==== Get Categories Response
The returned `GetCategoriesResponse` contains the requested categories:

View file

@ -99,7 +99,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influence
<1> `onResponse` is called back when the action is completed successfully
<2> `onFailure` is called back when some unexpected error occurs
[[java-rest-high-snapshot-ml-get-influencers-response]]
[[java-rest-high-x-pack-ml-get-influencers-response]]
==== Get Influencers Response
The returned `GetInfluencersResponse` contains the requested influencers:

View file

@ -94,7 +94,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-overall-b
<1> `onResponse` is called back when the action is completed successfully
<2> `onFailure` is called back when some unexpected error occurs
[[java-rest-high-snapshot-ml-get-overall-buckets-response]]
[[java-rest-high-x-pack-ml-get-overall-buckets-response]]
==== Get Overall Buckets Response
The returned `GetOverallBucketsResponse` contains the requested buckets:

View file

@ -100,7 +100,7 @@ include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-records-l
<1> `onResponse` is called back when the action is completed successfully
<2> `onFailure` is called back when some unexpected error occurs
[[java-rest-high-snapshot-ml-get-records-response]]
[[java-rest-high-x-pack-ml-get-records-response]]
==== Get Records Response
The returned `GetRecordsResponse` contains the requested records:

View file

@ -0,0 +1,65 @@
[[java-rest-high-x-pack-ml-put-calendar]]
=== Put Calendar API
Creates a new {ml} calendar.
The API accepts a `PutCalendarRequest` and responds
with a `PutCalendarResponse` object.
[[java-rest-high-x-pack-ml-get-calendars-request]]
==== Put Calendar Request
A `PutCalendarRequest` is constructed with a Calendar object
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-put-calendar-request]
--------------------------------------------------
<1> Create a request with the given Calendar
[[java-rest-high-x-pack-ml-put-calendar-response]]
==== Put Calendar Response
The returned `PutCalendarResponse` contains the created Calendar:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-put-calendar-response]
--------------------------------------------------
<1> The created Calendar
[[java-rest-high-x-pack-ml-put-calendar-execution]]
==== Execution
The request can be executed through the `MachineLearningClient` contained
in the `RestHighLevelClient` object, accessed via the `machineLearningClient()` method.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-put-calendar-execute]
--------------------------------------------------
[[java-rest-high-x-pack-ml-put-calendar-execution-async]]
==== Asynchronous Execution
The request can also be executed asynchronously:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-put-calendar-execute-async]
--------------------------------------------------
<1> The `PutCalendarResquest` 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 with the `onResponse` method
if the execution is successful or the `onFailure` method if the execution
failed.
A typical listener for `PutCalendarResponse` looks like:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-put-calendar-listener]
--------------------------------------------------
<1> `onResponse` is called back when the action is completed successfully
<2> `onFailure` is called back when some unexpected error occurs

View file

@ -230,6 +230,7 @@ The Java High Level REST Client supports the following Machine Learning APIs:
* <<java-rest-high-x-pack-ml-post-data>>
* <<java-rest-high-x-pack-ml-get-influencers>>
* <<java-rest-high-x-pack-ml-get-categories>>
* <<java-rest-high-x-pack-ml-put-calendar>>
include::ml/put-job.asciidoc[]
include::ml/get-job.asciidoc[]
@ -249,6 +250,7 @@ include::ml/get-records.asciidoc[]
include::ml/post-data.asciidoc[]
include::ml/get-influencers.asciidoc[]
include::ml/get-categories.asciidoc[]
include::ml/put-calendar.asciidoc[]
== Migration APIs