Browse Source

En cours de développement

master
mls-361 9 months ago
parent
commit
ba2b0e5534
  1. 10
      internal/api/api.go

10
internal/api/api.go

@ -143,8 +143,8 @@ func (api *api) adminListLogger(r *jsonapi.Request) {
}
func (api *api) adminSetLoggerLevel(r *jsonapi.Request) {
loggerID := r.Param("logger")
if loggerID == "" {
id := r.Param("id")
if id == "" {
r.BadRequest(errors.New("logger identifier must not be empty")) ////////////////////////////////////////////////
return
}
@ -155,7 +155,7 @@ func (api *api) adminSetLoggerLevel(r *jsonapi.Request) {
return
}
if err := logger.SetLevel(loggerID, level); err != nil {
if err := logger.SetLevel(id, level); err != nil {
r.BadRequest(err)
return
}
@ -170,10 +170,12 @@ func Build(ccs *components.Components) {
router.POST("/api/job/create", api.debug(api.createJob))
router.GET("/api/job/next/:namespace", api.trace(api.nextJob))
router.PUT("/api/job/update", api.debug(api.updateJob))
//router.PUT("/api/job/:id/setrunafter/:duration", api.debug(api.setJobRunAfter))
router.POST("/api/workflow/create", api.debug(api.createWorkflow))
router.GET("/api/admin/logger/list", api.debug(api.adminListLogger))
router.PUT("/api/admin/logger/:logger/setlevel/:level", api.debug(api.adminSetLoggerLevel))
router.PUT("/api/admin/logger/:id/setlevel/:level", api.debug(api.adminSetLoggerLevel))
}
/*

Loading…
Cancel
Save