| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 | --:api: rollup-get-rollup-caps:request: GetRollupCapsRequest:response: GetRollupCapsResponse--[role="xpack"][id="{upid}-x-pack-{api}"]=== Get Rollup Capabilities APIexperimental::[]The Get Rollup Capabilities API allows the user to query a target index pattern (`logstash-*`, etc)and determine if there are any rollup jobs that are/were configured to rollup that pattern.The API accepts a `GetRollupCapsRequest` object as a request and returns a `GetRollupCapsResponse`.[id="{upid}-x-pack-{api}-request"]==== Get Rollup Capabilities RequestA +{request}+ requires a single parameter: the target index or index pattern (e.g. `logstash-*`):["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[x-pack-{api}-request]--------------------------------------------------[id="{upid}-x-pack-{api}-execution"]==== ExecutionThe Get Rollup Capabilities API can be executed through a `RollupClient`instance. Such instance can be retrieved from a `RestHighLevelClient`using the `rollup()` method:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[x-pack-{api}-execute]--------------------------------------------------[id="{upid}-x-pack-{api}-response"]==== ResponseThe returned +{response}+ holds lists and maps of values which correspond to the capabilitiesof the target index/index pattern (what jobs were configured for the pattern, where the data is stored, whataggregations are available, etc). It provides essentially the same data as the original job configuration,just presented in a different manner.For example, if we had created a job with the following config:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[x-pack-{api}-setup]--------------------------------------------------The +{response}+ object would contain the same information, laid out in a slightly different manner:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[x-pack-{api}-response]--------------------------------------------------[id="{upid}-x-pack-{api}-async"]==== Asynchronous ExecutionThis request can be executed asynchronously:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[x-pack-{api}-execute-async]--------------------------------------------------<1> The +{request}+ to execute and the `ActionListener` to use whenthe execution completesThe asynchronous method does not block and returns immediately. Once it iscompleted the `ActionListener` is called back using the `onResponse` methodif the execution successfully completed or using the `onFailure` method ifit failed.A typical listener for +{response}+ looks like:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[x-pack-{api}-execute-listener]--------------------------------------------------<1> Called when the execution is successfully completed. The response isprovided as an argument<2> Called in case of failure. The raised exception is provided as an argument
 |