laysfire commented on code in PR #750:
URL: https://github.com/apache/yunikorn-core/pull/750#discussion_r1420046360
##########
pkg/webservice/handlers.go:
##########
@@ -619,6 +628,58 @@ func getQueueApplications(w http.ResponseWriter, r
*http.Request) {
}
}
+func getPartitionApplicationsByState(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")
+ appState := vars.ByName("state")
+
+ partitionContext :=
schedulerContext.GetPartitionWithoutClusterID(partition)
+ if partitionContext == nil {
+ buildJSONErrorResponse(w, PartitionDoesNotExists,
http.StatusNotFound)
+ return
+ }
+ stateErr := validateApplicationState(appState)
+ if stateErr != nil {
+ buildJSONErrorResponse(w, stateErr.Error(),
http.StatusBadRequest)
+ return
+ }
+ appIDs := partitionContext.GetAppsByState(appState)
+ appIDsDao := dao.ApplicationIDsDAOInfo{AppIDs: appIDs}
+ if err := json.NewEncoder(w).Encode(appIDsDao); err != nil {
+ buildJSONErrorResponse(w, err.Error(),
http.StatusInternalServerError)
+ }
+}
+
+func getPartitionApplication(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")
+ application := vars.ByName("application")
Review Comment:
partition = "" & application = "" will be handle by the following call
schedulerContext.GetPartitionWithoutClusterID(partition) and
partitionContext.GetApplication(application)
--
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]