| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 | [[java-rest-high-x-pack-rollup-get-job]]=== Get Rollup Job APIThe Get Rollup Job API can be used to get one or all rollup jobs from thecluster. It accepts a `GetRollupJobRequest` object as a request and returnsa `GetRollupJobResponse`.[[java-rest-high-x-pack-rollup-get-rollup-job-request]]==== Get Rollup Job RequestA `GetRollupJobRequest` can be built without any parameters to get all of therollup jobs or with a job name to get a single job:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/RollupDocumentationIT.java[x-pack-rollup-get-rollup-job-request]--------------------------------------------------<1> Gets all jobs.<2> Gets `job_1`.[[java-rest-high-x-pack-rollup-get-rollup-job-execution]]==== ExecutionThe Get Rollup Job 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}/RollupDocumentationIT.java[x-pack-rollup-get-rollup-job-execute]--------------------------------------------------[[java-rest-high-x-pack-rollup-get-rollup-job-response]]==== ResponseThe returned `GetRollupJobResponse` includes a `JobWrapper` per returned jobwhich contains the configuration of the job, the job's current status, andstatistics about the job's past execution.["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/RollupDocumentationIT.java[x-pack-rollup-get-rollup-job-response]--------------------------------------------------<1> We only asked for a single job[[java-rest-high-x-pack-rollup-get-rollup-job-async]]==== Asynchronous ExecutionThis request can be executed asynchronously:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/RollupDocumentationIT.java[x-pack-rollup-get-rollup-job-execute-async]--------------------------------------------------<1> The `GetRollupJobRequest` 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 `GetRollupJobResponse` looks like:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/RollupDocumentationIT.java[x-pack-rollup-get-rollup-job-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
 |