comparison pkg/controllers/routes.go @ 722:815f5e2ed974

Added simple endpoint to view system logs. api/system/log/{service}/{file} allows to retrieve the raw log file content for a selected set of services (currently "apache2" and "postgresql"). The result is a JSON with two fields: "path:" contains the fully qualified path of the retrieved log file in the servers file system and "content:" provides the verbatim content of the requested log file.
author Sascha Wilde <wilde@intevation.de>
date Fri, 21 Sep 2018 18:01:39 +0200
parents 3e9f0070c33e
children fdff2de616ad
comparison
equal deleted inserted replaced
721:ca82698349b7 722:815f5e2ed974
40 })).Methods(http.MethodPut) 40 })).Methods(http.MethodPut)
41 41
42 api.Handle("/users/{user}", sysAdmin(&JSONHandler{ 42 api.Handle("/users/{user}", sysAdmin(&JSONHandler{
43 Handle: deleteUser, 43 Handle: deleteUser,
44 })).Methods(http.MethodDelete) 44 })).Methods(http.MethodDelete)
45
46 // System Management
47 api.Handle("/system/log/{service}/{file}", sysAdmin(&JSONHandler{
48 Handle: showSystemLog,
49 NoConn: true,
50 })).Methods(http.MethodGet)
45 51
46 // Password resets. 52 // Password resets.
47 api.Handle("/users/passwordreset", &JSONHandler{ 53 api.Handle("/users/passwordreset", &JSONHandler{
48 Input: func() interface{} { return new(models.PWResetUser) }, 54 Input: func() interface{} { return new(models.PWResetUser) },
49 Handle: passwordResetRequest, 55 Handle: passwordResetRequest,