get-inference-trained-model.asciidoc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[get-inference]]
  4. === Get {infer} trained model API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {infer} trained model</titleabbrev>
  8. ++++
  9. Retrieves configuration information for a trained {infer} model.
  10. experimental[]
  11. [[ml-get-inference-request]]
  12. ==== {api-request-title}
  13. `GET _ml/inference/` +
  14. `GET _ml/inference/<model_id>` +
  15. `GET _ml/inference/_all` +
  16. `GET _ml/inference/<model_id1>,<model_id2>` +
  17. `GET _ml/inference/<model_id_pattern*>`
  18. [[ml-get-inference-prereq]]
  19. ==== {api-prereq-title}
  20. If the {es} {security-features} are enabled, you must have the following
  21. privileges:
  22. * cluster: `monitor_ml`
  23. For more information, see <<security-privileges>> and <<built-in-roles>>.
  24. [[ml-get-inference-desc]]
  25. ==== {api-description-title}
  26. You can get information for multiple trained models in a single API request by
  27. using a comma-separated list of model IDs or a wildcard expression.
  28. [[ml-get-inference-path-params]]
  29. ==== {api-path-parms-title}
  30. `<model_id>`::
  31. (Optional, string)
  32. include::{docdir}/ml/ml-shared.asciidoc[tag=model-id]
  33. [[ml-get-inference-query-params]]
  34. ==== {api-query-parms-title}
  35. `allow_no_match`::
  36. (Optional, boolean)
  37. include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-match]
  38. `decompress_definition`::
  39. (Optional, boolean)
  40. include::{docdir}/ml/ml-shared.asciidoc[tag=decompress-definition]
  41. `from`::
  42. (Optional, integer)
  43. include::{docdir}/ml/ml-shared.asciidoc[tag=from]
  44. `include_model_definition`::
  45. (Optional, boolean)
  46. include::{docdir}/ml/ml-shared.asciidoc[tag=include-model-definition]
  47. `size`::
  48. (Optional, integer)
  49. include::{docdir}/ml/ml-shared.asciidoc[tag=size]
  50. `tags`::
  51. (Optional, string)
  52. include::{docdir}/ml/ml-shared.asciidoc[tag=tags]
  53. [role="child_attributes"]
  54. [[ml-get-inference-results]]
  55. ==== {api-response-body-title}
  56. `trained_model_configs`::
  57. (array)
  58. include::{docdir}/ml/ml-shared.asciidoc[tag=trained-model-configs]
  59. [[ml-get-inference-response-codes]]
  60. ==== {api-response-codes-title}
  61. `400`::
  62. If `include_model_definition` is `true`, this code indicates that more than
  63. one models match the ID pattern.
  64. `404` (Missing resources)::
  65. If `allow_no_match` is `false`, this code indicates that there are no
  66. resources that match the request or only partial matches for the request.
  67. [[ml-get-inference-example]]
  68. ==== {api-examples-title}
  69. The following example gets configuration information for all the trained models:
  70. [source,console]
  71. --------------------------------------------------
  72. GET _ml/inference/
  73. --------------------------------------------------
  74. // TEST[skip:TBD]