Added automatical hook scheduling
This commit is contained in:
parent
e0628bc480
commit
463d2805b3
6 changed files with 124 additions and 28 deletions
20
webserver.go
20
webserver.go
|
|
@ -51,7 +51,7 @@ func initWebserver() (err error) {
|
|||
http.HandleFunc("/scripts/", actionScripts)
|
||||
http.HandleFunc("/scripts/update/{scriptID}", actionScriptUpdate)
|
||||
http.HandleFunc("/scripts/delete/{scriptID}", actionScriptDelete)
|
||||
http.HandleFunc("/hooks/search", actionScriptsSearch)
|
||||
http.HandleFunc("/scripts/search", actionScriptsSearch)
|
||||
http.HandleFunc("/hooks/update", actionHookUpdate)
|
||||
http.HandleFunc("/hooks/delete/{hookID}", actionHookDelete)
|
||||
http.HandleFunc("/hooks/schedule/{hookID}", actionHookSchedule)
|
||||
|
|
@ -173,6 +173,14 @@ func actionNodeUpdate(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
return
|
||||
}
|
||||
|
||||
// Recursively schedule hooks with automatic trigger.
|
||||
err = ScheduleHookRecursivelyUpwards(nodeID)
|
||||
if err != nil {
|
||||
err = werr.Wrap(err)
|
||||
httpError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
out := struct {
|
||||
OK bool
|
||||
}{
|
||||
|
|
@ -605,7 +613,7 @@ func actionScripts(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
}
|
||||
|
||||
out := struct {
|
||||
OK bool
|
||||
OK bool
|
||||
Scripts []Script
|
||||
}{
|
||||
true,
|
||||
|
|
@ -629,7 +637,7 @@ func actionScriptUpdate(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
}
|
||||
|
||||
out := struct {
|
||||
OK bool
|
||||
OK bool
|
||||
Script Script
|
||||
}{
|
||||
true,
|
||||
|
|
@ -678,7 +686,7 @@ func actionScriptsSearch(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
}
|
||||
|
||||
out := struct {
|
||||
OK bool
|
||||
OK bool
|
||||
Scripts []Script
|
||||
}{
|
||||
true,
|
||||
|
|
@ -763,7 +771,7 @@ func actionScriptExecutions(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
}
|
||||
|
||||
out := struct {
|
||||
OK bool
|
||||
OK bool
|
||||
ScriptExecutions []ScriptExecutionBrief
|
||||
}{
|
||||
true,
|
||||
|
|
@ -785,7 +793,7 @@ func actionScriptExecutionGet(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
}
|
||||
|
||||
out := struct {
|
||||
OK bool
|
||||
OK bool
|
||||
ScriptExecution ScriptExecution
|
||||
}{
|
||||
true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue