start-datafeed.asciidoc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-start-datafeed]]
  4. === Start {dfeeds-cap} API
  5. ++++
  6. <titleabbrev>Start {dfeeds-cap}</titleabbrev>
  7. ++++
  8. Starts one or more {dfeeds}.
  9. A {dfeed} must be started in order to retrieve data from {es}.
  10. A {dfeed} can be started and stopped multiple times throughout its lifecycle.
  11. ==== Request
  12. `POST _ml/datafeeds/<feed_id>/_start`
  13. ==== Description
  14. NOTE: Before you can start a {dfeed}, the job must be open. Otherwise, an error
  15. occurs.
  16. When you start a {dfeed}, you can specify a start time. This enables you to
  17. include a training period, providing you have this data available in {es}.
  18. If you want to analyze from the beginning of a dataset, you can specify any date
  19. earlier than that beginning date.
  20. If you do not specify a start time and the {dfeed} is associated with a new
  21. job, the analysis starts from the earliest time for which data is available.
  22. When you start a {dfeed}, you can also specify an end time. If you do so, the
  23. job analyzes data from the start time until the end time, at which point the
  24. analysis stops. This scenario is useful for a one-off batch analysis. If you
  25. do not specify an end time, the {dfeed} runs continuously.
  26. The `start` and `end` times can be specified by using one of the
  27. following formats: +
  28. - ISO 8601 format with milliseconds, for example `2017-01-22T06:00:00.000Z`
  29. - ISO 8601 format without milliseconds, for example `2017-01-22T06:00:00+00:00`
  30. - Seconds from the Epoch, for example `1390370400`
  31. Date-time arguments using either of the ISO 8601 formats must have a time zone
  32. designator, where Z is accepted as an abbreviation for UTC time.
  33. NOTE: When a URL is expected (for example, in browsers), the `+` used in time
  34. zone designators must be encoded as `%2B`.
  35. If the system restarts, any jobs that had {dfeeds} running are also restarted.
  36. When a stopped {dfeed} is restarted, it continues processing input data from
  37. the next millisecond after it was stopped. If new data was indexed for that
  38. exact millisecond between stopping and starting, it will be ignored.
  39. If you specify a `start` value that is earlier than the timestamp of the latest
  40. processed record, the {dfeed} continues from 1 millisecond after the timestamp
  41. of the latest processed record.
  42. ==== Path Parameters
  43. `feed_id` (required)::
  44. (string) Identifier for the {dfeed}
  45. ==== Request Body
  46. `end`::
  47. (string) The time that the {dfeed} should end. This value is exclusive.
  48. The default value is an empty string.
  49. `start`::
  50. (string) The time that the {dfeed} should begin. This value is inclusive.
  51. The default value is an empty string.
  52. `timeout`::
  53. (time) Controls the amount of time to wait until a {dfeed} starts.
  54. The default value is 20 seconds.
  55. ==== Authorization
  56. If {es} {security-features} are enabled, you must have `manage_ml`, or `manage`
  57. cluster privileges to use this API. For more information, see
  58. {stack-ov}/security-privileges.html[Security Privileges].
  59. ==== Security integration
  60. When {es} {security-features} are enabled, your {dfeed} remembers which roles the
  61. last user to create or update it had at the time of creation/update and runs the
  62. query using those same roles.
  63. ==== Examples
  64. The following example starts the `datafeed-it-ops-kpi` {dfeed}:
  65. [source,js]
  66. --------------------------------------------------
  67. POST _ml/datafeeds/datafeed-total-requests/_start
  68. {
  69. "start": "2017-04-07T18:22:16Z"
  70. }
  71. --------------------------------------------------
  72. // CONSOLE
  73. // TEST[skip:setup:server_metrics_openjob]
  74. When the {dfeed} starts, you receive the following results:
  75. [source,js]
  76. ----
  77. {
  78. "started": true
  79. }
  80. ----
  81. // TESTRESPONSE