Check Running Jobs via API

How does one check the status of jobs currently running via the api without knowing the job id? The problem I am trying to solve: I can trigger acceleration refreshes when underlying sources are ready via the api, but i don’t have a way to know when they are done so that my other process that connect to Dremio can start.

Thanks!

1 Like

Hi @nrchade,

When triggering a manual refresh using the REST API, there is currently no way to get the job ids for the refreshes. The main reason is that reflections can be chained so multiple jobs need to be run (in succession) and we currently do not have a way using the REST API to monitor the progress of these refresh chains.

It is something we want to provide but there isn’t a concrete timeline for it.

I see, but no command to just get all currently running jobs independent of chained reflections?

That is currently not available as a stable REST API and is in our plans.

Update on this issue? thanks

Currently we solve it, with this querys:

   -- ver reflections activadas y su estado
    select *
    from sys.reflections r
    where r.status <> 'DISABLED';

-- ver tiempo total de reflections del dia actual
select *
from sys.refreshes r
where cast(job_start as date) = current_date ;

-- ver tiempo total acumulado de últimas refresh reflections

 SELECT SUM(dur)
    FROM (
             SELECT r.reflection_id,r.job_start,r.job_end, TIMESTAMPDIFF(SECOND,r.job_start,r.job_end) as dur,
                    row_number() OVER (PARTITION BY r.reflection_id ORDER BY job_start DESC) AS rn
             FROM sys.refreshes r
         )
    WHERE rn = 1;



-- ver tiempo total de intervalo entre inicio y fin de  refresh reflections
 SELECT MIN("job_start"),MAX(job_end),TIMESTAMPDIFF(SECOND, MIN("job_start"),MAX(job_end))
    FROM (
             SELECT r.reflection_id,r.job_start,r.job_end, TIMESTAMPDIFF(SECOND,r.job_end,r.job_start) as dur,
                    row_number() OVER (PARTITION BY r.reflection_id ORDER BY job_start DESC) AS rn
             FROM sys.refreshes r
         )
    WHERE rn = 1;

-- others
select * from sys.materializations;
select * FROM sys.refreshes r;