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