From eead92fc3d7c61d9e72819c4be87a4736e05933e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 26 Feb 2020 11:19:38 +0100 Subject: [PATCH 1/6] [DOCS] Adds trainedmodel.asciidoc to cat folder. --- docs/reference/cat/traindemodel.asciidoc | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/reference/cat/traindemodel.asciidoc diff --git a/docs/reference/cat/traindemodel.asciidoc b/docs/reference/cat/traindemodel.asciidoc new file mode 100644 index 0000000000000..708da37c240c9 --- /dev/null +++ b/docs/reference/cat/traindemodel.asciidoc @@ -0,0 +1,9 @@ +[role="xpack"] +[testenv="platinum"] +[[cat-trained-model]] +=== cat trained model API +++++ +cat trained model +++++ + +Returns configuration and usage information about inference trained models. \ No newline at end of file From 80e1cbc5035501a8a32572cf62337aac9ad842c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 26 Feb 2020 11:21:53 +0100 Subject: [PATCH 2/6] [DOCS] Adds cat trained model API docs to cat API list. --- docs/reference/cat.asciidoc | 2 ++ .../cat/{traindemodel.asciidoc => trainedmodel.asciidoc} | 0 2 files changed, 2 insertions(+) rename docs/reference/cat/{traindemodel.asciidoc => trainedmodel.asciidoc} (100%) diff --git a/docs/reference/cat.asciidoc b/docs/reference/cat.asciidoc index d1040d000c583..5390cf1f1dcb3 100644 --- a/docs/reference/cat.asciidoc +++ b/docs/reference/cat.asciidoc @@ -255,6 +255,8 @@ include::cat/tasks.asciidoc[] include::cat/thread_pool.asciidoc[] +include::cat/trainedmodel.asciidoc[] + include::cat/shards.asciidoc[] include::cat/segments.asciidoc[] diff --git a/docs/reference/cat/traindemodel.asciidoc b/docs/reference/cat/trainedmodel.asciidoc similarity index 100% rename from docs/reference/cat/traindemodel.asciidoc rename to docs/reference/cat/trainedmodel.asciidoc From 16b28dcbe034e1e7fd02d05e2eada06fcb523101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 26 Feb 2020 16:04:58 +0100 Subject: [PATCH 3/6] [DOCS] Adds cat trained model API documentation. --- docs/reference/cat/trainedmodel.asciidoc | 131 ++++++++++++++++++++++- 1 file changed, 130 insertions(+), 1 deletion(-) diff --git a/docs/reference/cat/trainedmodel.asciidoc b/docs/reference/cat/trainedmodel.asciidoc index 708da37c240c9..88766d733f18c 100644 --- a/docs/reference/cat/trainedmodel.asciidoc +++ b/docs/reference/cat/trainedmodel.asciidoc @@ -6,4 +6,133 @@ cat trained model ++++ -Returns configuration and usage information about inference trained models. \ No newline at end of file +Returns configuration and usage information about {infer} trained models. + + +[[cat-trained-model-request]] +==== {api-request-title} + +`GET /_cat/ml/trained_models` + + +[[cat-trained-model-prereqs]] +==== {api-prereq-title} + +If the {es} {security-features} are enabled, you must have the following +privileges: + +* cluster: `monitor_ml` + +For more information, see <> and +{ml-docs}/setup.html[Set up {ml-features}]. + + +//// +[[cat-trained-model-desc]] +==== {api-description-title} +TBD +//// + + +[[cat-trained-model-query-params]] +==== {api-query-parms-title} + +include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format] + +include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h] + +include::{docdir}/rest-api/common-parms.asciidoc[tag=help] + +include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s] + +include::{docdir}/rest-api/common-parms.asciidoc[tag=time] + +include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v] + + +[[cat-trained-model-results]] +==== {api-response-body-title} + +`create_time`:: +The time when the trained model was created. To retrieve this information, +specify the `ct` column in the `h` query parameter. + +`created_by`:: +Information on the creator of the trained model. To retrieve this information, +specify the `c` or the `createdBy` column in the `h` query parameter. + +`data_frame_analytics_id`:: +Identifier for the {dfanalytics-job} that created the model. Only displayed if +it is still available. To retrieve this information, specify the `df` or the +`dataFrameAnalytics` column in the `h` query parameter. + +`description`:: +The description of the trained model. To retrieve this information, specify the +`d` column in the `h` query parameter. + +`heap_size`:: +The estimated heap size to keep the trained model in memory. To retrieve this +information, specify the `hs` or the `modelHeapSize` column in the `h` query +parameter. + +`id`:: +Idetifier for the trained model. To retrieve this information, specify the `id` +column in the `h` query parameter. + +`ingest.count`:: +The total number of documents that are processed by the model. To retrieve this +information, specify the `ic` or the `ingestCount` column in the `h` query +parameter. + +`ingest.current`:: +The total number of document that are currently being handled by the trained +model. To retrieve this information, specify the `icurr` or the `ingestCurrent` +column in the `h` query parameter. + +`ingest.failed`:: +The total number of failed ingest attempts with the trained model. To retrieve +this information, specify the `if` or the `ingestFailed` column in the `h` query +parameter. + +`ingest.pipelines`:: +The total number of ingest pipelines that are referencing the trained model. To +retrieve this information, specify the `ip` or the `ingestPipelines` column in +the `h` query parameter. + +`ingest.time`:: +The total time that is spent processing documents with the trained model. To +retrieve this information, specify the `it` or the `ingestTime` column in the +`h` query parameter. + +`license`:: +The license level of the trained model. To retrieve this information, specify +the `l` column in the `h` query parameter. + +`operations`:: +The estimated number of operations to use the trained model. This number helps +measuring the computational complexity of the model. To retrieve this +information, specify the `o` or the `modelOperations` column in the `h` query +parameter. + +`version`:: +The {es} version number in which the trained model was created. To retrieve this +information, specify the `v` column in the `h` query parameter. + + +[[cat-trained-model-example]] +==== {api-examples-title} + +[source,console] +-------------------------------------------------- +GET _cat/ml/trained_models?h=c,o,l,ct,v&v +-------------------------------------------------- +// TEST[skip:kibana sample data] + +[source,console-result] +---- +id created_by operations license create_time version +ddddd-1580216177138 _xpack 196 PLATINUM 2020-01-28T12:56:17.138Z 8.0.0 +flight-regress-1580215685537 _xpack 102 PLATINUM 2020-01-28T12:48:05.537Z 8.0.0 +lang_ident_model_1 _xpack 39629 BASIC 2019-12-05T12:28:34.594Z 7.6.0 +---- +// TESTRESPONSE[skip:kibana sample data] From 66710d9a6c090bc38eded636edf6c455bd65f579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 26 Feb 2020 16:07:59 +0100 Subject: [PATCH 4/6] Changes documentation URL in cat.ml_trained_models.json. --- .../test/resources/rest-api-spec/api/cat.ml_trained_models.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/cat.ml_trained_models.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/cat.ml_trained_models.json index c22ea1e095e87..77875d03a2f78 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/cat.ml_trained_models.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/cat.ml_trained_models.json @@ -1,7 +1,7 @@ { "cat.ml_trained_models":{ "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html" + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html" }, "stability":"stable", "url":{ From 040546e369d60728b0158e718007a3920c448f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 26 Feb 2020 16:55:57 +0100 Subject: [PATCH 5/6] [DOCS] Adds bytes option to the list of query params. --- docs/reference/cat/trainedmodel.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/reference/cat/trainedmodel.asciidoc b/docs/reference/cat/trainedmodel.asciidoc index 88766d733f18c..f9b56614bd851 100644 --- a/docs/reference/cat/trainedmodel.asciidoc +++ b/docs/reference/cat/trainedmodel.asciidoc @@ -37,6 +37,8 @@ TBD [[cat-trained-model-query-params]] ==== {api-query-parms-title} +include::{docdir}/rest-api/common-parms.asciidoc[tag=bytes] + include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format] include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h] From 4421db482589ac434629a7d8eaa95db2a0603bf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Thu, 27 Feb 2020 11:30:59 +0100 Subject: [PATCH 6/6] [DOCS] Reformats query parameters. --- docs/reference/cat/trainedmodel.asciidoc | 106 ++++++++++------------- 1 file changed, 46 insertions(+), 60 deletions(-) diff --git a/docs/reference/cat/trainedmodel.asciidoc b/docs/reference/cat/trainedmodel.asciidoc index f9b56614bd851..679133157cd4d 100644 --- a/docs/reference/cat/trainedmodel.asciidoc +++ b/docs/reference/cat/trainedmodel.asciidoc @@ -30,7 +30,6 @@ For more information, see <> and //// [[cat-trained-model-desc]] ==== {api-description-title} -TBD //// @@ -42,83 +41,69 @@ include::{docdir}/rest-api/common-parms.asciidoc[tag=bytes] include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format] include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h] ++ +If you do not specify which columns to include, the API returns the default +columns. If you explicitly specify one or more columns, it returns only the +specified columns. ++ +Valid columns are: -include::{docdir}/rest-api/common-parms.asciidoc[tag=help] +`create_time`, `ct`::: +The time when the trained model was created. -include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s] +`created_by`, `c`, `createdBy`::: +Information on the creator of the trained model. -include::{docdir}/rest-api/common-parms.asciidoc[tag=time] - -include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v] +`data_frame_analytics_id`, `df`, `dataFrameAnalytics`::: +Identifier for the {dfanalytics-job} that created the model. Only displayed if +it is still available. +`description`, `d`::: +The description of the trained model. -[[cat-trained-model-results]] -==== {api-response-body-title} +`heap_size`, `hs`, `modelHeapSize`::: +(Default) +The estimated heap size to keep the trained model in memory. -`create_time`:: -The time when the trained model was created. To retrieve this information, -specify the `ct` column in the `h` query parameter. +`id`::: +(Default) +Idetifier for the trained model. -`created_by`:: -Information on the creator of the trained model. To retrieve this information, -specify the `c` or the `createdBy` column in the `h` query parameter. +`ingest.count`, `ic`, `ingestCount`::: +The total number of documents that are processed by the model. -`data_frame_analytics_id`:: -Identifier for the {dfanalytics-job} that created the model. Only displayed if -it is still available. To retrieve this information, specify the `df` or the -`dataFrameAnalytics` column in the `h` query parameter. +`ingest.current`, `icurr`, `ingestCurrent`::: +The total number of document that are currently being handled by the trained +model. -`description`:: -The description of the trained model. To retrieve this information, specify the -`d` column in the `h` query parameter. +`ingest.failed`, `if`, `ingestFailed`::: +The total number of failed ingest attempts with the trained model. -`heap_size`:: -The estimated heap size to keep the trained model in memory. To retrieve this -information, specify the `hs` or the `modelHeapSize` column in the `h` query -parameter. +`ingest.pipelines`, `ip`, `ingestPipelines`::: +(Default) +The total number of ingest pipelines that are referencing the trained model. -`id`:: -Idetifier for the trained model. To retrieve this information, specify the `id` -column in the `h` query parameter. +`ingest.time`, `it`, `ingestTime`::: +The total time that is spent processing documents with the trained model. -`ingest.count`:: -The total number of documents that are processed by the model. To retrieve this -information, specify the `ic` or the `ingestCount` column in the `h` query -parameter. +`license`, `l`::: +The license level of the trained model. -`ingest.current`:: -The total number of document that are currently being handled by the trained -model. To retrieve this information, specify the `icurr` or the `ingestCurrent` -column in the `h` query parameter. - -`ingest.failed`:: -The total number of failed ingest attempts with the trained model. To retrieve -this information, specify the `if` or the `ingestFailed` column in the `h` query -parameter. +`operations`, `o`, `modelOperations`::: +(Default) +The estimated number of operations to use the trained model. This number helps +measuring the computational complexity of the model. -`ingest.pipelines`:: -The total number of ingest pipelines that are referencing the trained model. To -retrieve this information, specify the `ip` or the `ingestPipelines` column in -the `h` query parameter. +`version`, `v`::: +The {es} version number in which the trained model was created. -`ingest.time`:: -The total time that is spent processing documents with the trained model. To -retrieve this information, specify the `it` or the `ingestTime` column in the -`h` query parameter. +include::{docdir}/rest-api/common-parms.asciidoc[tag=help] -`license`:: -The license level of the trained model. To retrieve this information, specify -the `l` column in the `h` query parameter. +include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s] -`operations`:: -The estimated number of operations to use the trained model. This number helps -measuring the computational complexity of the model. To retrieve this -information, specify the `o` or the `modelOperations` column in the `h` query -parameter. +include::{docdir}/rest-api/common-parms.asciidoc[tag=time] -`version`:: -The {es} version number in which the trained model was created. To retrieve this -information, specify the `v` column in the `h` query parameter. +include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v] [[cat-trained-model-example]] @@ -130,6 +115,7 @@ GET _cat/ml/trained_models?h=c,o,l,ct,v&v -------------------------------------------------- // TEST[skip:kibana sample data] + [source,console-result] ---- id created_by operations license create_time version