Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: go/src/infra/tricium/service/workflow-launcher/handlers.go

Issue 2125603002: Adds initial Tricium service GAE configs (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Adds optional display of the request form Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 package handlers
2
3 import (
4 "html/template"
5 "net/http"
6
7 "appengine"
8 "appengine/taskqueue"
9 )
10
11 func init() {
12 http.HandleFunc("/workflow-launcher/status", statusPageHandler)
13 http.HandleFunc("/workflow-launcher/queue-handler", queueHandler)
14 }
15
16 var basePage = template.Must(template.ParseFiles("templates/base.html"))
17
18 func statusPageHandler(w http.ResponseWriter, r *http.Request) {
19 // TODO(emso): Add workflow launcher stats
20 data := map[string]interface{}{
21 "Msg": "Status of the Workflow Launcher ...",
22 }
23 basePage.Execute(w, data)
24 }
25
26 func queueHandler(w http.ResponseWriter, r *http.Request) {
27 ctx := appengine.NewContext(r)
28
29 // TODO(emso): Process request (merge configs, compute workflow) and lau nch workflow
30
31 // Enqueue workflow listener task
32 t := taskqueue.NewPOSTTask("/workflow-listener/queue-handler", map[strin g][]string{"name": {"Workflow Launched"}})
33 if _, err := taskqueue.Add(ctx, t, "workflow-listener-queue"); err != ni l {
34 http.Error(w, err.Error(), http.StatusInternalServerError)
35 return
36 }
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698