Skip to content

Add endpoint to retrieve total count of DockerJob records#120

Merged
peppermint-juli merged 8 commits into
mainfrom
81-add-job-count-to-getjobs-api-endpoint-response
Jul 8, 2026
Merged

Add endpoint to retrieve total count of DockerJob records#120
peppermint-juli merged 8 commits into
mainfrom
81-add-job-count-to-getjobs-api-endpoint-response

Conversation

@peppermint-juli

@peppermint-juli peppermint-juli commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Closes #81

This pull request adds a new API endpoint to retrieve the total count of Docker jobs for a user. It introduces a backend method to efficiently query the count and exposes it through a REST API in the controller. The main changes are grouped below:

Backend functionality:

  • Added a new method queryUserDockerJobsCount in JOBM.java to query the total number of DockerJob records for a given user using a native SQL count query.

API/Controller updates:

  • Added a new REST endpoint /jobs/count in JOBMRESTController.java that returns the total number of DockerJob records for the authenticated user, handling exceptions and returning a JSON response.

Other:

  • Minor formatting/whitespace changes at the end of JOBM.java.

@peppermint-juli peppermint-juli linked an issue Jul 1, 2026 that may be closed by this pull request
@peppermint-juli
peppermint-juli marked this pull request as ready for review July 1, 2026 21:01
@peppermint-juli
peppermint-juli requested a review from dmedv July 1, 2026 21:02

@amitschang amitschang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor inline comment. And I guess there are some checkstyle violations introduced (causing the build fail). Even though there are a gazillion existing warnings, our approach so far has been to not increase when feasible.

…oints

- Consolidated job querying methods for better readability and maintainability.
- Enhanced error handling for job submission and querying.
- Improved logging for job actions to provide clearer insights.
- Added new endpoint for querying jobs queues.
- Updated method signatures and comments for clarity.
@peppermint-juli

Copy link
Copy Markdown
Contributor Author

Minor inline comment. And I guess there are some checkstyle violations introduced (causing the build fail). Even though there are a gazillion existing warnings, our approach so far has been to not increase when feasible.

I fixed all the warnings in the two files I modified.

@amitschang amitschang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Confirmed on dev deployment hitting:

curl https://dev.sites.idies.jhu.edu/arik/racm/jobm/rest/jobs/count -Hx-auth-token:...

returns

{"count":0}

@peppermint-juli
peppermint-juli merged commit 3df0024 into main Jul 8, 2026
3 checks passed
@peppermint-juli
peppermint-juli deleted the 81-add-job-count-to-getjobs-api-endpoint-response branch July 8, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add job count to GetJobs api endpoint response

2 participants