put-datafeed.asciidoc 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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-script-fields]
  55. --------------------------------------------------
  56. <1> Allows the use of script fields.
  57. ["source","java",subs="attributes,callouts,macros"]
  58. --------------------------------------------------
  59. include-tagged::{doc-tests-file}[{api}-config-set-scroll-size]
  60. --------------------------------------------------
  61. <1> The `size` parameter used in the searches.
  62. include::../execution.asciidoc[]
  63. [id="{upid}-{api}-response"]
  64. ==== Response
  65. The returned +{response}+ returns the full representation of
  66. the new {ml} datafeed if it has been successfully created. This will
  67. contain the creation time and other fields initialized using
  68. default values:
  69. ["source","java",subs="attributes,callouts,macros"]
  70. --------------------------------------------------
  71. include-tagged::{doc-tests-file}[{api}-response]
  72. --------------------------------------------------
  73. <1> The created datafeed