get-job-model-snapshot-upgrade-stats.asciidoc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. [role="xpack"]
  2. [[ml-get-job-model-snapshot-upgrade-stats]]
  3. = Get {anomaly-job} model snapshot upgrade statistics API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Get model snapshot upgrade statistics</titleabbrev>
  7. ++++
  8. Retrieves usage information for {anomaly-job} model snapshot upgrades.
  9. [[ml-get-job-model-snapshot-upgrade-stats-request]]
  10. == {api-request-title}
  11. `GET _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_upgrade/_stats` +
  12. `GET _ml/anomaly_detectors/<job_id>,<job_id>/model_snapshots/_all/_upgrade/_stats` +
  13. `GET _ml/anomaly_detectors/_all/model_snapshots/_all/_upgrade/_stats`
  14. [[ml-get-job-model-snapshot-upgrade-stats-prereqs]]
  15. == {api-prereq-title}
  16. Requires the `monitor_ml` cluster privilege. This privilege is included in the
  17. `machine_learning_user` built-in role.
  18. [[ml-get-job-model-snapshot-upgrade-stats-desc]]
  19. == {api-description-title}
  20. {anomaly-detect-cap} job model snapshot upgrades are ephemeral. Only
  21. upgrades that are in progress at the time this API is called will be
  22. returned.
  23. [[ml-get-job-model-snapshot-upgrade-stats-path-parms]]
  24. == {api-path-parms-title}
  25. `<job_id>`::
  26. (string)
  27. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection-wildcard]
  28. `<snapshot_id>`::
  29. (string)
  30. Identifier for the model snapshot.
  31. +
  32. You can get statistics for multiple {anomaly-job} model snapshot upgrades in a
  33. single API request by using a comma-separated list of snapshot IDs. You can also
  34. use wildcard expressions or `_all`.
  35. [[ml-get-job-model-snapshot-upgrade-stats-query-parms]]
  36. == {api-query-parms-title}
  37. `allow_no_match`::
  38. (Optional, Boolean)
  39. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-match-jobs]
  40. [role="child_attributes"]
  41. [[ml-get-job-model-snapshot-upgrade-stats-results]]
  42. == {api-response-body-title}
  43. The API returns an array of {anomaly-job} model snapshot upgrade status objects.
  44. All of these properties are informational; you cannot update their values.
  45. `assignment_explanation`::
  46. (string)
  47. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=assignment-explanation-datafeeds]
  48. `job_id`::
  49. (string)
  50. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  51. `node`::
  52. (object)
  53. Contains properties for the node that runs the upgrade task. This information is
  54. available only for upgrade tasks that are assigned to a node.
  55. +
  56. --
  57. [%collapsible%open]
  58. ====
  59. `attributes`:::
  60. (object)
  61. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-attributes]
  62. `ephemeral_id`:::
  63. (string)
  64. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-ephemeral-id]
  65. `id`:::
  66. (string)
  67. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-id]
  68. `name`:::
  69. (string)
  70. The node name. For example, `0-o0tOo`.
  71. `transport_address`:::
  72. (string)
  73. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-transport-address]
  74. ====
  75. --
  76. `snapshot_id`::
  77. (string)
  78. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-snapshot-id]
  79. `state`::
  80. (string)
  81. One of `loading_old_state`, `saving_new_state`, `stopped` or `failed`.
  82. [[ml-get-job-model-snapshot-upgrade-stats-response-codes]]
  83. == {api-response-codes-title}
  84. `404` (Missing resources)::
  85. If `allow_no_match` is `false`, this code indicates that there are no
  86. resources that match the request or only partial matches for the request.
  87. [[ml-get-job-model-snapshot-upgrade-stats-example]]
  88. == {api-examples-title}
  89. [source,console]
  90. --------------------------------------------------
  91. GET _ml/anomaly_detectors/low_request_rate/model_snapshots/_all/_upgrade/_stats
  92. --------------------------------------------------
  93. // TEST[skip:it will be too difficult to get a reliable response in docs tests]
  94. The API returns the following results:
  95. [source,console-result]
  96. ----
  97. {
  98. "count" : 1,
  99. "model_snapshot_upgrades" : [
  100. {
  101. "job_id" : "low_request_rate",
  102. "snapshot_id" : "1828371",
  103. "state" : "saving_new_state",
  104. "node" : {
  105. "id" : "7bmMXyWCRs-TuPfGJJ_yMw",
  106. "name" : "node-0",
  107. "ephemeral_id" : "hoXMLZB0RWKfR9UPPUCxXX",
  108. "transport_address" : "127.0.0.1:9300",
  109. "attributes" : {
  110. "ml.machine_memory" : "17179869184",
  111. "ml.max_open_jobs" : "512"
  112. }
  113. },
  114. "assignment_explanation" : ""
  115. }
  116. ]
  117. }
  118. ----
  119. // TESTRESPONSE[s/"7bmMXyWCRs-TuPfGJJ_yMw"/$body.$_path/]
  120. // TESTRESPONSE[s/"node-0"/$body.$_path/]
  121. // TESTRESPONSE[s/"hoXMLZB0RWKfR9UPPUCxXX"/$body.$_path/]
  122. // TESTRESPONSE[s/"127.0.0.1:9300"/$body.$_path/]
  123. // TESTRESPONSE[s/"17179869184"/$body.datafeeds.0.node.attributes.ml\\.machine_memory/]