put-datafeed.asciidoc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --
  2. :api: put-datafeed
  3. :request: PutDatafeedRequest
  4. :response: PutDatafeedResponse
  5. --
  6. [id="{upid}-{api}"]
  7. === Put Datafeed API
  8. The Put Datafeed API can be used to create a new {ml} datafeed
  9. in the cluster. The API accepts a +{request}+ object
  10. as a request and returns a +{response}+.
  11. [id="{upid}-{api}-request"]
  12. ==== Put Datafeed Request
  13. A +{request}+ requires the following argument:
  14. ["source","java",subs="attributes,callouts,macros"]
  15. --------------------------------------------------
  16. include-tagged::{doc-tests-file}[{api}-request]
  17. --------------------------------------------------
  18. <1> The configuration of the {ml} datafeed to create
  19. [id="{upid}-{api}-config"]
  20. ==== Datafeed Configuration
  21. The `DatafeedConfig` object contains all the details about the {ml} datafeed
  22. configuration.
  23. A `DatafeedConfig` requires the following arguments:
  24. ["source","java",subs="attributes,callouts,macros"]
  25. --------------------------------------------------
  26. include-tagged::{doc-tests-file}[{api}-config]
  27. --------------------------------------------------
  28. <1> The datafeed ID and the job ID
  29. <2> The indices that contain the data to retrieve and feed into the job
  30. ==== Optional Arguments
  31. The following arguments are optional:
  32. ["source","java",subs="attributes,callouts,macros"]
  33. --------------------------------------------------
  34. include-tagged::{doc-tests-file}[{api}-config-set-chunking-config]
  35. --------------------------------------------------
  36. <1> Specifies how data searches are split into time chunks.
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests-file}[{api}-config-set-frequency]
  40. --------------------------------------------------
  41. <1> The interval at which scheduled queries are made while the datafeed runs in real time.
  42. ["source","java",subs="attributes,callouts,macros"]
  43. --------------------------------------------------
  44. include-tagged::{doc-tests-file}[{api}-config-set-query]
  45. --------------------------------------------------
  46. <1> A query to filter the search results by. Defaults to the `match_all` query.
  47. ["source","java",subs="attributes,callouts,macros"]
  48. --------------------------------------------------
  49. include-tagged::{doc-tests-file}[{api}-config-set-query-delay]
  50. --------------------------------------------------
  51. <1> The time interval behind real time that data is queried.
  52. ["source","java",subs="attributes,callouts,macros"]
  53. --------------------------------------------------
  54. include-tagged::{doc-tests-file}[{api}-config-set-delayed-data-check-config]
  55. --------------------------------------------------
  56. <1> Sets the delayed data check configuration.
  57. The window must be larger than the Job's bucket size, but smaller than 24 hours,
  58. and span less than 10,000 buckets.
  59. Defaults to `null`, which causes an appropriate window span to be calculated when
  60. the datafeed runs.
  61. The default `check_window` span calculation is the max between `2h` or `8 * bucket_span`.
  62. To explicitly disable, pass `DelayedDataCheckConfig.disabledDelayedDataCheckConfig()`.
  63. ["source","java",subs="attributes,callouts,macros"]
  64. --------------------------------------------------
  65. include-tagged::{doc-tests-file}[{api}-config-set-script-fields]
  66. --------------------------------------------------
  67. <1> Allows the use of script fields.
  68. ["source","java",subs="attributes,callouts,macros"]
  69. --------------------------------------------------
  70. include-tagged::{doc-tests-file}[{api}-config-set-scroll-size]
  71. --------------------------------------------------
  72. <1> The `size` parameter used in the searches.
  73. include::../execution.asciidoc[]
  74. [id="{upid}-{api}-response"]
  75. ==== Response
  76. The returned +{response}+ returns the full representation of
  77. the new {ml} datafeed if it has been successfully created. This will
  78. contain the creation time and other fields initialized using
  79. default values:
  80. ["source","java",subs="attributes,callouts,macros"]
  81. --------------------------------------------------
  82. include-tagged::{doc-tests-file}[{api}-response]
  83. --------------------------------------------------
  84. <1> The created datafeed