get_rollup_index_caps.asciidoc 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. --
  2. :api: rollup-get-rollup-index-caps
  3. :request: GetRollupIndexCapsRequest
  4. :response: GetRollupIndexCapsResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-x-pack-{api}"]
  8. === Get Rollup Index Capabilities API
  9. experimental::[]
  10. The Get Rollup Index Capabilities API allows the user to determine if a concrete index or index pattern contains
  11. stored rollup jobs and data. If it contains data stored from rollup jobs, the capabilities of those jobs
  12. are returned. The API accepts a `GetRollupIndexCapsRequest` object as a request and returns a `GetRollupIndexCapsResponse`.
  13. [id="{upid}-x-pack-{api}-request"]
  14. ==== Get Rollup Index Capabilities Request
  15. A +{request}+ requires a single parameter: the target index or index pattern (e.g. `rollup-foo`):
  16. ["source","java",subs="attributes,callouts,macros"]
  17. --------------------------------------------------
  18. include-tagged::{doc-tests-file}[x-pack-{api}-request]
  19. --------------------------------------------------
  20. [id="{upid}-x-pack-{api}-execution"]
  21. ==== Execution
  22. The Get Rollup Index Capabilities API can be executed through a `RollupClient`
  23. instance. Such instance can be retrieved from a `RestHighLevelClient`
  24. using the `rollup()` method:
  25. ["source","java",subs="attributes,callouts,macros"]
  26. --------------------------------------------------
  27. include-tagged::{doc-tests-file}[x-pack-{api}-execute]
  28. --------------------------------------------------
  29. [id="{upid}-x-pack-{api}-response"]
  30. ==== Response
  31. The returned +{response}+ holds lists and maps of values which correspond to the capabilities
  32. of the rollup index/index pattern (what jobs are stored in the index, their capabilities, what
  33. aggregations are available, etc). Because multiple jobs can be stored in one index, the
  34. response may include several jobs with different configurations.
  35. The capabilities are essentially the same as the original job configuration, just presented in a different
  36. manner. For example, if we had created a job with the following config:
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests-file}[x-pack-{api}-setup]
  40. --------------------------------------------------
  41. The +{response}+ object would contain the same information, laid out in a slightly different manner:
  42. ["source","java",subs="attributes,callouts,macros"]
  43. --------------------------------------------------
  44. include-tagged::{doc-tests-file}[x-pack-{api}-response]
  45. --------------------------------------------------
  46. [id="{upid}-x-pack-{api}-async"]
  47. ==== Asynchronous Execution
  48. This request can be executed asynchronously:
  49. ["source","java",subs="attributes,callouts,macros"]
  50. --------------------------------------------------
  51. include-tagged::{doc-tests-file}[x-pack-{api}-execute-async]
  52. --------------------------------------------------
  53. <1> The +{request}+ to execute and the `ActionListener` to use when
  54. the execution completes
  55. The asynchronous method does not block and returns immediately. Once it is
  56. completed the `ActionListener` is called back using the `onResponse` method
  57. if the execution successfully completed or using the `onFailure` method if
  58. it failed.
  59. A typical listener for +{response}+ looks like:
  60. ["source","java",subs="attributes,callouts,macros"]
  61. --------------------------------------------------
  62. include-tagged::{doc-tests-file}[x-pack-{api}-execute-listener]
  63. --------------------------------------------------
  64. <1> Called when the execution is successfully completed. The response is
  65. provided as an argument
  66. <2> Called in case of failure. The raised exception is provided as an argument