blueBlue0102 commented on code in PR #938:
URL: https://github.com/apache/yunikorn-core/pull/938#discussion_r1710767910
##########
pkg/webservice/handlers.go:
##########
@@ -898,6 +898,56 @@ func getPartitionRules(w http.ResponseWriter, r
*http.Request) {
}
}
+func getQueueApplicationsByState(w http.ResponseWriter, r *http.Request) {
+ writeHeaders(w)
+ vars := httprouter.ParamsFromContext(r.Context())
+ if vars == nil {
+ buildJSONErrorResponse(w, MissingParamsName,
http.StatusBadRequest)
+ return
+ }
+
+ partition := vars.ByName("partition")
+ queueName := vars.ByName("queue")
+ appState := strings.ToLower(vars.ByName("state"))
+ status := strings.ToLower(r.URL.Query().Get("status"))
+
+ queueErr := validateQueue(queueName)
+ if queueErr != nil {
+ buildJSONErrorResponse(w, queueErr.Error(),
http.StatusBadRequest)
+ return
+ }
+ partitionContext :=
schedulerContext.GetPartitionWithoutClusterID(partition)
+ if partitionContext == nil {
+ buildJSONErrorResponse(w, PartitionDoesNotExists,
http.StatusNotFound)
+ return
+ }
+ queue := partitionContext.GetQueue(queueName)
+ if queue == nil {
+ buildJSONErrorResponse(w, QueueDoesNotExists,
http.StatusNotFound)
+ return
+ }
+ if appState != "active" {
+ buildJSONErrorResponse(w, fmt.Sprintf("The provided state is
invalid: %s", appState), http.StatusBadRequest)
Review Comment:
Good idea. The adjustment has been made.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]