Automattic / Automattic/kue

Missing /jobs/type/:type kue json API

Open
#916 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

Is there a better way to achieve this?

Through JSON api what is the suggested way to fetch in a single call all /jobs/email or all backup /jobs/backup (no matter of their state)?

While building a KUE ui interface we tried to find such an API but we could not.

We settled for a "work-around" which requires 5 different JSON remote calls to /jobs/email/inactive, /jobs/email/active, /jobs/email/completed, /jobs/email/failed and /jobs/email/delayed and then we manually merge and sort back the 5 different list to get the complete result. We also had to put a state + '/0..10000' hard-coding there.

To understand what I mean please see getJobsByJobType(req, res) function from here https://github.com/distributev/the-app/blob/kue-jobs/server/api/jobs/jobs.controller.js

Is there a better way to achieve this?

![missing-kue-api](https://cloud.githubusercontent.com/assets/19224635/16554839/a72f9390-41d1-11e6-8906-56175b57e3a2.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Review Kue's JSON API routes for the existing /jobs/:type/:state endpoints and compare them with getJobsByJobType in the linked jobs.controller.js example. Determine the expected response, pagination, and ordering for a type-wide query across all states. Done means the API exposes a documented single-call way to retrieve all jobs of a type, with coverage for the relevant states.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.