start-datafeed.asciidoc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --
  2. :api: start-datafeed
  3. :request: StartDatafeedRequest
  4. :response: StartDatafeedResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Start {dfeed} API
  9. Starts a {ml} {dfeed} in the cluster. It accepts a +{request}+ object and
  10. responds with a +{response}+ object.
  11. [id="{upid}-{api}-request"]
  12. ==== Start {dfeed} request
  13. A +{request}+ object is created referencing a non-null `datafeedId`.
  14. All other fields are optional for the request.
  15. ["source","java",subs="attributes,callouts,macros"]
  16. --------------------------------------------------
  17. include-tagged::{doc-tests-file}[{api}-request]
  18. --------------------------------------------------
  19. <1> Constructing a new request referencing an existing `datafeedId`.
  20. ==== Optional arguments
  21. The following arguments are optional.
  22. ["source","java",subs="attributes,callouts,macros"]
  23. --------------------------------------------------
  24. include-tagged::{doc-tests-file}[{api}-request-options]
  25. --------------------------------------------------
  26. <1> Set when the {dfeed} should end, the value is exclusive.
  27. May be an epoch seconds, epoch millis or an ISO 8601 string.
  28. "now" is a special value that indicates the current time.
  29. If you do not specify an end time, the {dfeed} runs continuously.
  30. <2> Set when the {dfeed} should start, the value is inclusive.
  31. May be an epoch seconds, epoch millis or an ISO 8601 string.
  32. If you do not specify a start time and the {dfeed} is associated with a new job,
  33. the analysis starts from the earliest time for which data is available.
  34. <3> Set the timeout for the request
  35. [id="{upid}-{api}-response"]
  36. ==== Start {dfeed} response
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests-file}[{api}-response]
  40. --------------------------------------------------
  41. <1> `isStarted()` from the +{response}+ is always `true` if the {dfeed} was
  42. started successfully. (An exception would be thrown instead if the {dfeed}
  43. was not started successfully.)
  44. <2> `getNode()` returns the node that the {dfeed} was assigned to. If the
  45. {dfeed} is allowed to open lazily and has not yet been assigned to a node
  46. then an empty string is returned. If `getNode()` returns `null` then
  47. the server is an old version that does not return node information.
  48. include::../execution.asciidoc[]