get_rollup_index_caps.asciidoc 3.5 KB

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