-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YUNIKORN-2461] Add new RESTful API to get queue applications filtered by state #861
Conversation
e310243
to
673c762
Compare
Codecov ReportAttention: Patch coverage is
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 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
However, this PR accept
Instead of this
I don't like the mismatch here.
I have another thought. Extend to Keep using query parameter to filter out 'new', 'accepted', 'running', 'completing', 'failing', 'resuming'. |
@targetoee could you rebase this patch to master? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
|
||
switch status { | ||
case "Rejected": | ||
buildJSONErrorResponse(w, "Queue does not involve rejected state applications.", http.StatusBadRequest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better approach:
switch status {
case "rejected", "completed":
buildJSONErrorResponse(w, fmt.Sprintf("Unsupported application state in queue: %s", status), http.StatusBadRequest)
return
default:
...
}
} | ||
partition := vars.ByName("partition") | ||
queueName := vars.ByName("queue") | ||
status := vars.ByName("status") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be converted to full lowercase with strings.ToLower().
@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'd appreciate hearing everyone's thoughts on this proposal. @pbacsko, WDYT? |
@blueBlue0102 Thanks for taking over this Jira.
This Jira (YUNIKORN-2461) should be implemented in the consistent way: (My previous comment could be ignored) Please proceed and update the original description in this Jira. Thanks. |
close this PR as duplicate to #938 |
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?
Todos
N/A
What is the Jira issue?
YUNIKORN-2461
How should this be tested?
It has been checked locally by
make test
.Screenshots (if appropriate)
N/A
Questions:
N/A