You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/12/02 12:24:44 UTC

[GitHub] [incubator-yunikorn-core] sunilgovind commented on a change in pull request #224: YUNIKORN-416: Add "applications" REST API to fetch list of applications

sunilgovind commented on a change in pull request #224:
URL: https://github.com/apache/incubator-yunikorn-core/pull/224#discussion_r534126809



##########
File path: pkg/webservice/handlers.go
##########
@@ -521,3 +522,49 @@ func updateConfiguration(conf string) (string, error) {
 	}
 	return "", fmt.Errorf("config plugin not found")
 }
+
+func getQueueApplications(w http.ResponseWriter, r *http.Request) {
+	vars := mux.Vars(r)
+	writeHeaders(w)
+	if len(vars) != 2 {
+		http.Error(w, "Mandatory parameters are missing in URL path. Please check the usage documentation", http.StatusBadRequest)
+		return
+	}
+	var queueName = vars["queue"]
+	if len(queueName) == 0 {
+		http.Error(w, "Queue is missing in URL path. Please check the usage documentation", http.StatusBadRequest)
+		return
+	}
+	queueErr := validateQueue(queueName)
+	if queueErr != nil {
+		http.Error(w, queueErr.Error(), http.StatusBadRequest)
+		return
+	}
+	var partitionExists = false
+	var queueExists = false
+	var appsDao []*dao.ApplicationDAOInfo
+	lists := schedulerContext.GetPartitionMapClone()
+	for _, partition := range lists {
+		if partition.Name == vars["partition"] {
+			partitionExists = true
+			appList := partition.GetApplications()

Review comment:
       @wilfred-s cud u please share your thought on this comment?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org