Add redux actions and reducer for scheduler entries

This commit is contained in:
Ken Hibino
2020-12-02 19:44:50 -08:00
parent fbbc414bdf
commit 3e5b145883
4 changed files with 119 additions and 0 deletions

View File

@@ -37,6 +37,10 @@ export interface ListDeadTasksResponse {
stats: Queue;
}
export interface ListSchedulerEntriesResponse {
entries: SchedulerEntry[];
}
export interface Queue {
queue: string;
paused: boolean;
@@ -97,6 +101,16 @@ export interface DeadTask extends BaseTask {
error_message: string;
}
export interface SchedulerEntry {
id: string;
spec: string;
task_type: string;
task_payload: { [key: string]: any };
options: string[];
next_enqueue_at: string;
prev_enqueue_at: string;
}
export interface PaginationOptions extends Record<string, number | undefined> {
size?: number; // size of the page
page?: number; // page number (1 being the first page)
@@ -213,3 +227,11 @@ export async function listDeadTasks(
});
return resp.data;
}
export async function listSchedulerEntries(): Promise<ListSchedulerEntriesResponse> {
const resp = await axios({
method: "get",
url: `${BASE_URL}/scheduler_entries`,
});
return resp.data;
}