get-inference-trained-model.asciidoc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. Required privileges which should be added to a custom role:
  21. * cluster: `monitor_ml`
  22. For more information, see <<security-privileges>> and <<built-in-roles>>.
  23. [[ml-get-inference-desc]]
  24. ==== {api-description-title}
  25. You can get information for multiple trained models in a single API request by
  26. using a comma-separated list of model IDs or a wildcard expression.
  27. [[ml-get-inference-path-params]]
  28. ==== {api-path-parms-title}
  29. `<model_id>`::
  30. (Optional, string)
  31. include::{docdir}/ml/ml-shared.asciidoc[tag=model-id]
  32. [[ml-get-inference-query-params]]
  33. ==== {api-query-parms-title}
  34. `allow_no_match`::
  35. (Optional, boolean)
  36. include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-match]
  37. `decompress_definition`::
  38. (Optional, boolean)
  39. include::{docdir}/ml/ml-shared.asciidoc[tag=decompress-definition]
  40. `from`::
  41. (Optional, integer)
  42. include::{docdir}/ml/ml-shared.asciidoc[tag=from]
  43. `include_model_definition`::
  44. (Optional, boolean)
  45. include::{docdir}/ml/ml-shared.asciidoc[tag=include-model-definition]
  46. `size`::
  47. (Optional, integer)
  48. include::{docdir}/ml/ml-shared.asciidoc[tag=size]
  49. [[ml-get-inference-response-codes]]
  50. ==== {api-response-codes-title}
  51. `400`::
  52. If `include_model_definition` is `true`, this code indicates that more than
  53. one models match the ID pattern.
  54. `404` (Missing resources)::
  55. If `allow_no_match` is `false`, this code indicates that there are no
  56. resources that match the request or only partial matches for the request.
  57. [[ml-get-inference-example]]
  58. ==== {api-examples-title}
  59. The following example gets configuration information for all the trained models:
  60. [source,console]
  61. --------------------------------------------------
  62. GET _ml/inference/
  63. --------------------------------------------------
  64. // TEST[skip:TBD]