-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/hlrc ml docs cleanup (#34316)
* HLRC: ML Add preview datafeed api * Changing deprecation handling for parser * Removing some duplication in docs, will address other APIs in another PR * HLRC: ML Cleanup docs * updating get datafeed stats docs
- Loading branch information
Showing
26 changed files
with
809 additions
and
1,458 deletions.
There are no files selected for viewing
731 changes: 375 additions & 356 deletions
731
...h-level/src/test/java/org/elasticsearch/client/documentation/MlClientDocumentationIT.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,33 @@ | ||
[[java-rest-high-x-pack-ml-delete-calendar]] | ||
-- | ||
:api: delete-calendar | ||
:request: DeleteCalendarRequest | ||
:response: AcknowledgedResponse | ||
-- | ||
[id="{upid}-{api}"] | ||
=== Delete Calendar API | ||
Delete a {ml} calendar. | ||
The API accepts a `DeleteCalendarRequest` and responds | ||
with a `AcknowledgedResponse` object. | ||
The API accepts a +{request}+ and responds | ||
with a +{response}+ object. | ||
|
||
[[java-rest-high-x-pack-ml-delete-calendar-request]] | ||
[id="{upid}-{api}-request"] | ||
==== Delete Calendar Request | ||
|
||
A `DeleteCalendar` object requires a non-null `calendarId`. | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
--------------------------------------------------- | ||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-delete-calendar-request] | ||
include-tagged::{doc-tests-file}[{api}-request] | ||
--------------------------------------------------- | ||
<1> Constructing a new request referencing an existing Calendar | ||
|
||
[[java-rest-high-x-pack-ml-delete-calendar-response]] | ||
[id="{upid}-{api}-response"] | ||
==== Delete Calendar Response | ||
|
||
The returned `AcknowledgedResponse` object indicates the acknowledgement of the request: | ||
The returned +{response}+ object indicates the acknowledgement of the request: | ||
["source","java",subs="attributes,callouts,macros"] | ||
--------------------------------------------------- | ||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-delete-calendar-response] | ||
include-tagged::{doc-tests-file}[{api}-response] | ||
--------------------------------------------------- | ||
<1> `isAcknowledged` was the deletion request acknowledged or not | ||
|
||
[[java-rest-high-x-pack-ml-delete-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-delete-calendar-execute] | ||
-------------------------------------------------- | ||
|
||
[[java-rest-high-x-pack-ml-delete-calendar-async]] | ||
==== Delete Calendar Asynchronously | ||
|
||
This request can also be made asynchronously. | ||
["source","java",subs="attributes,callouts,macros"] | ||
--------------------------------------------------- | ||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-delete-calendar-execute-async] | ||
--------------------------------------------------- | ||
<1> The `DeleteCalendarRequest` to execute and the `ActionListener` to alert on completion or error. | ||
|
||
The deletion request returns immediately. Once the request is completed, the `ActionListener` is | ||
called back using the `onResponse` or `onFailure`. The latter indicates some failure occurred when | ||
making the request. | ||
|
||
A typical listener for a `DeleteCalendarRequest` could be defined as follows: | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
--------------------------------------------------- | ||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-delete-calendar-listener] | ||
--------------------------------------------------- | ||
<1> The action to be taken when it is completed | ||
<2> What to do when a failure occurs | ||
include::../execution.asciidoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,32 @@ | ||
[[java-rest-high-x-pack-ml-delete-datafeed]] | ||
-- | ||
:api: delete-datafeed | ||
:request: DeleteDatafeedRequest | ||
:response: AcknowledgedResponse | ||
-- | ||
[id="{upid}-delete-datafeed"] | ||
=== Delete Datafeed API | ||
|
||
[[java-rest-high-x-pack-machine-learning-delete-datafeed-request]] | ||
[id="{upid}-{api}-request"] | ||
==== Delete Datafeed Request | ||
|
||
A `DeleteDatafeedRequest` object requires a non-null `datafeedId` and can optionally set `force`. | ||
Can be executed as follows: | ||
A +{request}+ object requires a non-null `datafeedId` and can optionally set `force`. | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
--------------------------------------------------- | ||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-delete-ml-datafeed-request] | ||
include-tagged::{doc-tests-file}[{api}-request] | ||
--------------------------------------------------- | ||
<1> Use to forcefully delete a started datafeed; | ||
this method is quicker than stopping and deleting the datafeed. | ||
Defaults to `false`. | ||
|
||
[[java-rest-high-x-pack-machine-learning-delete-datafeed-response]] | ||
include::../execution.asciidoc[] | ||
|
||
[id="{upid}-{api}-response"] | ||
==== Delete Datafeed Response | ||
|
||
The returned `AcknowledgedResponse` object indicates the acknowledgement of the request: | ||
The returned +{response}+ object indicates the acknowledgement of the request: | ||
["source","java",subs="attributes,callouts,macros"] | ||
--------------------------------------------------- | ||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-delete-ml-datafeed-response] | ||
include-tagged::{doc-tests-file}[{api}-response] | ||
--------------------------------------------------- | ||
<1> `isAcknowledged` was the deletion request acknowledged or not | ||
|
||
[[java-rest-high-x-pack-machine-learning-delete-datafeed-async]] | ||
==== Delete Datafeed Asynchronously | ||
|
||
This request can also be made asynchronously. | ||
["source","java",subs="attributes,callouts,macros"] | ||
--------------------------------------------------- | ||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-delete-ml-datafeed-request-async] | ||
--------------------------------------------------- | ||
<1> The `DeleteDatafeedRequest` to execute and the `ActionListener` to alert on completion or error. | ||
|
||
The deletion request returns immediately. Once the request is completed, the `ActionListener` is | ||
called back using the `onResponse` or `onFailure`. The latter indicates some failure occurred when | ||
making the request. | ||
|
||
A typical listener for a `DeleteDatafeedRequest` could be defined as follows: | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
--------------------------------------------------- | ||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-delete-ml-datafeed-request-listener] | ||
--------------------------------------------------- | ||
<1> The action to be taken when it is completed | ||
<2> What to do when a failure occurs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.