Skip to content

Commit 9e0a724

Browse files
Add missing doc file and javadoc format fixes
1 parent bef2d0f commit 9e0a724

File tree

2 files changed

+66
-10
lines changed

2 files changed

+66
-10
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/MachineLearningClient.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ public PutDatafeedResponse putDatafeed(PutDatafeedRequest request, RequestOption
468468
* For additional info
469469
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html">ML PUT datafeed documentation</a>
470470
*
471-
* @param request The request containing the {@link org.elasticsearch.client.ml.datafeed.DatafeedConfig} settings
472-
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
471+
* @param request The request containing the {@link org.elasticsearch.client.ml.datafeed.DatafeedConfig} settings
472+
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
473473
* @param listener Listener to be notified upon request completion
474474
*/
475475
public void putDatafeedAsync(PutDatafeedRequest request, RequestOptions options, ActionListener<PutDatafeedResponse> listener) {
@@ -485,11 +485,11 @@ public void putDatafeedAsync(PutDatafeedRequest request, RequestOptions options,
485485
* Gets one or more Machine Learning datafeed configuration info.
486486
*
487487
* <p>
488-
* For additional info
489-
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html"></a>
490-
* </p>
488+
* For additional info
489+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html">ML GET datafeed documentation</a>
490+
*
491491
* @param request {@link GetDatafeedRequest} Request containing a list of datafeedId(s) and additional options
492-
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
492+
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
493493
* @return {@link GetDatafeedResponse} response object containing
494494
* the {@link org.elasticsearch.client.ml.datafeed.DatafeedConfig} objects and the number of jobs found
495495
* @throws IOException when there is a serialization issue sending the request or receiving the response
@@ -506,11 +506,11 @@ public GetDatafeedResponse getDatafeed(GetDatafeedRequest request, RequestOption
506506
* Gets one or more Machine Learning datafeed configuration info, asynchronously.
507507
*
508508
* <p>
509-
* For additional info
510-
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html"></a>
511-
* </p>
509+
* For additional info
510+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html">ML GET datafeed documentation</a>
511+
*
512512
* @param request {@link GetDatafeedRequest} Request containing a list of datafeedId(s) and additional options
513-
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
513+
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
514514
* @param listener Listener to be notified with {@link GetDatafeedResponse} upon request completion
515515
*/
516516
public void getDatafeedAsync(GetDatafeedRequest request, RequestOptions options, ActionListener<GetDatafeedResponse> listener) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[[java-rest-high-x-pack-ml-get-datafeed]]
2+
=== Get Datafeed API
3+
4+
The Get Datafeed API provides the ability to get {ml} datafeeds in the cluster.
5+
It accepts a `GetDatafeedRequest` object and responds
6+
with a `GetDatafeedResponse` object.
7+
8+
[[java-rest-high-x-pack-ml-get-datafeed-request]]
9+
==== Get Datafeed Request
10+
11+
A `GetDatafeedRequest` object gets can have any number of `datafeedId` entries.
12+
However, they all must be non-null. An empty list is the same as requesting for all datafeeds.
13+
14+
["source","java",subs="attributes,callouts,macros"]
15+
--------------------------------------------------
16+
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-datafeed-request]
17+
--------------------------------------------------
18+
<1> Constructing a new request referencing existing `datafeedIds`, can contain wildcards
19+
<2> Whether to ignore if a wildcard expression matches no datafeeds.
20+
(This includes `_all` string or when no datafeeds have been specified)
21+
22+
[[java-rest-high-x-pack-ml-get-datafeed-execution]]
23+
==== Execution
24+
25+
The request can be executed through the `MachineLearningClient` contained
26+
in the `RestHighLevelClient` object, accessed via the `machineLearningClient()` method.
27+
28+
["source","java",subs="attributes,callouts,macros"]
29+
--------------------------------------------------
30+
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-datafeed-execute]
31+
--------------------------------------------------
32+
<1> The count of retrieved datafeeds
33+
<2> The retrieved datafeeds
34+
35+
[[java-rest-high-x-pack-ml-get-datafeed-execution-async]]
36+
==== Asynchronous Execution
37+
38+
The request can also be executed asynchronously:
39+
40+
["source","java",subs="attributes,callouts,macros"]
41+
--------------------------------------------------
42+
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-datafeed-execute-async]
43+
--------------------------------------------------
44+
<1> The `GetDatafeedRequest` to execute and the `ActionListener` to use when
45+
the execution completes
46+
47+
The method does not block and returns immediately. The passed `ActionListener` is used
48+
to notify the caller of completion. A typical `ActionListener` for `GetDatafeedResponse` may
49+
look like
50+
51+
["source","java",subs="attributes,callouts,macros"]
52+
--------------------------------------------------
53+
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-datafeed-listener]
54+
--------------------------------------------------
55+
<1> `onResponse` is called back when the action is completed successfully
56+
<2> `onFailure` is called back when some unexpected error occurs

0 commit comments

Comments
 (0)