-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[DOCS] Adds GET, GET stats and DELETE inference APIs #50224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4ed78bf
[DOCS] Adds GET, GET stats and DELETE inference APIs.
szabosteve a4307c6
[DOCS] Removes snippet.
szabosteve 3704b69
[DOCS] Adds included files to the index.
szabosteve f40c2a4
[DOCS] Fixes model-id definition.
szabosteve cc026a4
[DOCS] Addresses feedback.
szabosteve 655d897
Update docs/reference/ml/ml-shared.asciidoc
szabosteve 3fb85e0
Update docs/reference/ml/ml-shared.asciidoc
szabosteve 50f64a4
Update docs/reference/ml/ml-shared.asciidoc
szabosteve a01d64c
[DOCS] Addresses feedback.
szabosteve 4fb72c9
[DOCS] Fixes section link.
szabosteve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
docs/reference/ml/df-analytics/apis/delete-trained-model.asciidoc
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[role="xpack"] | ||
[testenv="basic"] | ||
[[delete-inference]] | ||
=== Delete trained model API | ||
[subs="attributes"] | ||
++++ | ||
<titleabbrev>Delete trained model</titleabbrev> | ||
++++ | ||
|
||
Deletes an existing trained {infer} model that is currently not referenced by an | ||
ingest pipeline. | ||
szabosteve marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
experimental[] | ||
|
||
|
||
[[ml-delete-inference-request]] | ||
==== {api-request-title} | ||
|
||
`DELETE _ml/inference/<model_id>` | ||
|
||
|
||
[[ml-delete-inference-prereq]] | ||
==== {api-prereq-title} | ||
|
||
* You must have `machine_learning_admin` built-in role to use this API. For more | ||
information, see <<security-privileges>> and <<built-in-roles>>. | ||
|
||
|
||
[[ml-delete-inference-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
`<model_id>`:: | ||
(Optional, string) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=model-id] | ||
|
||
|
||
[[ml-delete-inference-example]] | ||
==== {api-examples-title} | ||
|
||
The following example deletes the `regression-job-one-1574775307356` trained | ||
model: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
DELETE _ml/inference/regression-job-one-1574775307356 | ||
-------------------------------------------------- | ||
// TEST[skip:TBD] | ||
|
||
The API returns the following result: | ||
|
||
|
||
[source,console-result] | ||
---- | ||
{ | ||
"acknowledged" : true | ||
} | ||
---- | ||
|
||
|
134 changes: 134 additions & 0 deletions
134
docs/reference/ml/df-analytics/apis/get-trained-model-stats.asciidoc
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,134 @@ | ||
[role="xpack"] | ||
[testenv="basic"] | ||
[[get-inference-stats]] | ||
=== Get trained model statistics API | ||
[subs="attributes"] | ||
++++ | ||
<titleabbrev>Get trained model stats</titleabbrev> | ||
++++ | ||
|
||
Retrieves usage information for trained {infer} models. | ||
|
||
experimental[] | ||
|
||
|
||
[[ml-get-inference-stats-request]] | ||
==== {api-request-title} | ||
|
||
`GET _ml/inference/_stats` + | ||
|
||
`GET _ml/inference/_all/_stats` + | ||
|
||
`GET _ml/inference/<model_id>/_stats` + | ||
|
||
`GET _ml/inference/<model_id>,<model_id_2>/_stats` + | ||
|
||
`GET _ml/inference/<model_id_pattern*>,<model_id_2>/_stats` | ||
|
||
|
||
[[ml-get-inference-stats-prereq]] | ||
==== {api-prereq-title} | ||
|
||
* You must have `monitor_ml` privilege to use this API. For more information, | ||
see <<security-privileges>> and <<built-in-roles>>. | ||
|
||
|
||
[[ml-get-inference-stats-desc]] | ||
==== {api-description-title} | ||
|
||
You can get usage information for multiple trained models in a single API | ||
request by using a comma-separated list of model IDs or a wildcard expression. | ||
|
||
|
||
[[ml-get-inference-stats-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
`<model_id>`:: | ||
(Optional, string) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=model-id] | ||
|
||
|
||
[[ml-get-inference-stats-query-params]] | ||
==== {api-query-parms-title} | ||
|
||
`allow_no_match`:: | ||
(Optional, boolean) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-match] | ||
|
||
`from`:: | ||
(Optional, integer) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=from] | ||
|
||
`size`:: | ||
(Optional, integer) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=size] | ||
|
||
|
||
[[ml-get-inference-stats-response-codes]] | ||
==== {api-response-codes-title} | ||
|
||
`404` (Missing resources):: | ||
If `allow_no_match` is `false`, this code indicates that there are no | ||
resources that match the request or only partial matches for the request. | ||
|
||
|
||
[[ml-get-inference-stats-example]] | ||
==== {api-examples-title} | ||
|
||
The following example gets usage information for all the trained models: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
GET _ml/inference/_stats | ||
-------------------------------------------------- | ||
// TEST[skip:TBD] | ||
|
||
|
||
The API returns the following results: | ||
|
||
[source,console-result] | ||
---- | ||
{ | ||
"count": 2, | ||
"trained_model_stats": [ | ||
{ | ||
"model_id": "flight-delay-prediction-1574775339910", | ||
"pipeline_count": 0 | ||
}, | ||
{ | ||
"model_id": "regression-job-one-1574775307356", | ||
"pipeline_count": 1, | ||
"ingest": { | ||
"total": { | ||
"count": 178, | ||
"time_in_millis": 8, | ||
"current": 0, | ||
"failed": 0 | ||
}, | ||
"pipelines": { | ||
"flight-delay": { | ||
"count": 178, | ||
"time_in_millis": 8, | ||
"current": 0, | ||
"failed": 0, | ||
"processors": [ | ||
{ | ||
"inference": { | ||
"type": "inference", | ||
"stats": { | ||
"count": 178, | ||
"time_in_millis": 7, | ||
"current": 0, | ||
"failed": 0 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
---- | ||
// NOTCONSOLE |
92 changes: 92 additions & 0 deletions
92
docs/reference/ml/df-analytics/apis/get-trained-model.asciidoc
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
[role="xpack"] | ||
[testenv="basic"] | ||
[[get-inference]] | ||
=== Get trained model API | ||
[subs="attributes"] | ||
++++ | ||
<titleabbrev>Get trained model</titleabbrev> | ||
++++ | ||
|
||
Retrieves configuration information for a trained {infer} model. | ||
|
||
experimental[] | ||
|
||
|
||
[[ml-get-inference-request]] | ||
==== {api-request-title} | ||
|
||
`GET _ml/inference/` + | ||
|
||
`GET _ml/inference/<model_id>` + | ||
|
||
`GET _ml/inference/_all` + | ||
|
||
`GET _ml/inference/<model_id1>,<model_id2>` + | ||
|
||
`GET _ml/inference/<model_id_pattern*>` | ||
|
||
|
||
[[ml-get-inference-prereq]] | ||
==== {api-prereq-title} | ||
|
||
* You must have `monitor_ml` privilege to use this API. For more information, | ||
see <<security-privileges>> and <<built-in-roles>>. | ||
|
||
|
||
[[ml-get-inference-desc]] | ||
==== {api-description-title} | ||
|
||
You can get information for multiple trained models in a single API request by | ||
using a comma-separated list of model IDs or a wildcard expression. | ||
|
||
|
||
[[ml-get-inference-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
`<model_id>`:: | ||
(Optional, string) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=model-id] | ||
|
||
|
||
[[ml-get-inference-query-params]] | ||
==== {api-query-parms-title} | ||
|
||
`allow_no_match`:: | ||
(Optional, boolean) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-match] | ||
|
||
`decompress_definition`:: | ||
(Optional, boolean) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=decompress-definition] | ||
|
||
`from`:: | ||
(Optional, integer) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=from] | ||
|
||
`include_model_definition`:: | ||
(Optional, boolean) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=include-model-definition] | ||
|
||
`size`:: | ||
(Optional, integer) | ||
include::{docdir}/ml/ml-shared.asciidoc[tag=size] | ||
|
||
|
||
[[ml-get-inference-response-codes]] | ||
==== {api-response-codes-title} | ||
|
||
`404` (Missing resources):: | ||
If `allow_no_match` is `false`, this code indicates that there are no | ||
resources that match the request or only partial matches for the request. | ||
|
||
|
||
[[ml-get-inference-example]] | ||
==== {api-examples-title} | ||
|
||
The following example gets configuration information for all the trained models: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
GET _ml/inference/ | ||
-------------------------------------------------- | ||
// TEST[skip:TBD] |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.