yunikorn-core
yunikorn-core copied to clipboard
[YUNIKORN-2461] Add new RESTful API to get queue applications filtered by state
What is this PR for?
In YUNIKORN-2235, an API to retrieve applications by state in partition was added. However, there is currently no API serving the same purpose at the queue level. This PR add a new RESTful API that allows filtering applications by state at queue level, which unifies API behavior.
What type of PR is it?
- [ ] - Bug Fix
- [x] - Improvement
- [ ] - Feature
- [ ] - Documentation
- [ ] - Hot Fix
- [ ] - Refactoring
Todos
N/A
What is the Jira issue?
How should this be tested?
It has been checked locally by make test
.
Screenshots (if appropriate)
N/A
Questions:
N/A
Codecov Report
Attention: Patch coverage is 66.66667%
with 14 lines
in your changes are missing coverage. Please review.
Project coverage is 76.97%. Comparing base (
cf838f9
) to head (507da8b
). Report is 6 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
pkg/webservice/handlers.go | 66.66% | 9 Missing and 5 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #861 +/- ##
==========================================
- Coverage 77.00% 76.97% -0.03%
==========================================
Files 97 97
Lines 12002 12040 +38
==========================================
+ Hits 9242 9268 +26
- Misses 2422 2430 +8
- Partials 338 342 +4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I have another thought. Since we only have 'active' applications in queue, how about extend the existing 'queue applications' api?
Extend
- http://localhost:9889/ws/v1/partition/default/queue/root.default/applications
to
- http://localhost:9889/ws/v1/partition/default/queue/root.default/applications?running.
Keep using query parameter to filter out 'new', 'accepted', 'running', 'completing', 'failing', 'resuming'.
@targetoee could you rebase this patch to master?
@targetoee could you rebase this PR?
After contacting @targetoee and obtaining his consent, I will proceed to complete this issue.
I also agree with @chenyulin0719's suggestion.
I believe the API path /partition/{partitionName}/queue/{queueName}/applications/{state}?status={status}
might be a more suitable approach.
This structure maintains better consistency with the non-queue version: /partition/{partitionName}/applications/{state}?status={status}
I'd appreciate hearing everyone's thoughts on this proposal. @pbacsko, WDYT?
@blueBlue0102 Thanks for taking over this Jira. As we discussed, In YUNIKORN-2235, we have below new APIs.
- http://localhost:9889/ws/v1/partition/default/applications/completed
- http://localhost:9889/ws/v1/partition/default/applications/rejected
- http://localhost:9889/ws/v1/partition/default/applications/active
- http://localhost:9889/ws/v1/partition/default/applications/active?status=running
This Jira (YUNIKORN-2461) should be implemented in the consistent way:
- http://localhost:9889/ws/v1/partition/default/queue/root.default/applications/{state}?status={status}
(My previous comment could be ignored)
Please proceed and update the original description in this Jira. Thanks.
close this PR as duplicate to #938