@@ -70,12 +70,14 @@ func initHTTPHandlers() {
7070 http .Handle ("/" + ns + "/graph/coverage" , handlerWrapper (handleCoverageGraph ))
7171 http .Handle ("/" + ns + "/graph/coverage_heatmap" , handlerWrapper (handleCoverageHeatmap ))
7272 if nsConfig .Subsystems .Service != nil {
73+ http .Handle ("/" + ns + "/subsystems.json" , handlerWrapper (handleSubsystemsCoverageHeatmap ))
7374 http .Handle ("/" + ns + "/graph/coverage_subsystems_heatmap" , handlerWrapper (handleSubsystemsCoverageHeatmap ))
7475 }
7576 }
7677 http .Handle ("/" + ns + "/repos" , handlerWrapper (handleRepos ))
7778 http .Handle ("/" + ns + "/bug-summaries" , handlerWrapper (handleBugSummaries ))
7879 http .Handle ("/" + ns + "/subsystems" , handlerWrapper (handleSubsystemsList ))
80+ http .Handle ("/" + ns + "/managers" , handlerWrapper (handleManagersList ))
7981 http .Handle ("/" + ns + "/backports" , handlerWrapper (handleBackports ))
8082 http .Handle ("/" + ns + "/s/" , handlerWrapper (handleSubsystemPage ))
8183 http .Handle ("/" + ns + "/manager/" , handlerWrapper (handleManagerPage ))
@@ -1423,6 +1425,30 @@ func findBugByID(c context.Context, r *http.Request) (*Bug, error) {
14231425 return nil , fmt .Errorf ("mandatory parameter id/extid is missing" )
14241426}
14251427
1428+ func ssListJSON (service * subsystem.Service , w http.ResponseWriter ) error {
1429+ res := []string {}
1430+ for _ , subsystem := range service .List () {
1431+ res = append (res , subsystem .Name )
1432+ }
1433+ return json .NewEncoder (w ).Encode (res )
1434+ }
1435+
1436+ func handleManagersList (c context.Context , w http.ResponseWriter , r * http.Request ) error {
1437+ if r .FormValue ("json" ) != "1" {
1438+ return http .ErrNotSupported
1439+ }
1440+ hdr , err := commonHeader (c , r , w , "" )
1441+ if err != nil {
1442+ return err
1443+ }
1444+ managers , err := CachedManagerList (c , hdr .Namespace )
1445+ if err != nil {
1446+ return err
1447+ }
1448+ w .Header ().Set ("Content-Type" , "application/json" )
1449+ return json .NewEncoder (w ).Encode (managers )
1450+ }
1451+
14261452func handleSubsystemsList (c context.Context , w http.ResponseWriter , r * http.Request ) error {
14271453 hdr , err := commonHeader (c , r , w , "" )
14281454 if err != nil {
@@ -1436,6 +1462,10 @@ func handleSubsystemsList(c context.Context, w http.ResponseWriter, r *http.Requ
14361462 if service == nil {
14371463 return fmt .Errorf ("%w: the namespace does not have subsystems" , ErrClientBadRequest )
14381464 }
1465+ if r .FormValue ("json" ) == "1" {
1466+ w .Header ().Set ("Content-Type" , "application/json" )
1467+ return ssListJSON (service , w )
1468+ }
14391469 nonEmpty := r .FormValue ("all" ) != "true"
14401470 list := []* uiSubsystem {}
14411471 someHidden := false
0 commit comments