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

Side by Side Diff: scheduler/appengine/presentation/state.go

Issue 2946343004: scheduler: add rpcs for actions on job and invocation. (Closed)
Patch Set: review Created 3 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
« no previous file with comments | « scheduler/appengine/presentation/acl.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package presentation 5 package presentation
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 9
10 "golang.org/x/net/context" 10 "golang.org/x/net/context"
11 11
12 "github.com/luci/luci-go/common/logging" 12 "github.com/luci/luci-go/common/logging"
13 "github.com/luci/luci-go/scheduler/appengine/catalog" 13 "github.com/luci/luci-go/scheduler/appengine/catalog"
14 "github.com/luci/luci-go/scheduler/appengine/engine" 14 "github.com/luci/luci-go/scheduler/appengine/engine"
15 "github.com/luci/luci-go/scheduler/appengine/task" 15 "github.com/luci/luci-go/scheduler/appengine/task"
16 ) 16 )
17 17
18 // PublicStateKind defines state of the job which is exposed in UI and API 18 // PublicStateKind defines state of the job which is exposed in UI and API
19 // instead of internal engine.StateKind which is kept as an implementation 19 // instead of internal engine.StateKind which is kept as an implementation
20 // detail. 20 // detail.
21 type PublicStateKind string 21 type PublicStateKind string
22 22
23 // When a PublicStateKind is added/removed/updated, update scheduler api proto
24 // doc for `JobState`.
23 const ( 25 const (
24 PublicStateDisabled PublicStateKind = "DISABLED" 26 PublicStateDisabled PublicStateKind = "DISABLED"
25 PublicStateOverrun PublicStateKind = "OVERRUN" 27 PublicStateOverrun PublicStateKind = "OVERRUN"
26 PublicStatePaused PublicStateKind = "PAUSED" 28 PublicStatePaused PublicStateKind = "PAUSED"
27 PublicStateRetrying PublicStateKind = "RETRYING" 29 PublicStateRetrying PublicStateKind = "RETRYING"
28 PublicStateRunning PublicStateKind = "RUNNING" 30 PublicStateRunning PublicStateKind = "RUNNING"
29 PublicStateScheduled PublicStateKind = "SCHEDULED" 31 PublicStateScheduled PublicStateKind = "SCHEDULED"
30 PublicStateStarting PublicStateKind = "STARTING" 32 PublicStateStarting PublicStateKind = "STARTING"
31 PublicStateSuspended PublicStateKind = "SUSPENDED" 33 PublicStateSuspended PublicStateKind = "SUSPENDED"
32 PublicStateWaiting PublicStateKind = "WAITING" 34 PublicStateWaiting PublicStateKind = "WAITING"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 taskDef, err := cat.UnmarshalTask(j.Task) 90 taskDef, err := cat.UnmarshalTask(j.Task)
89 if err != nil { 91 if err != nil {
90 logging.WithError(err).Warningf(ctx, "Failed to unmarshal task p roto for %s", j.JobID) 92 logging.WithError(err).Warningf(ctx, "Failed to unmarshal task p roto for %s", j.JobID)
91 return task.Traits{}, err 93 return task.Traits{}, err
92 } 94 }
93 if manager := cat.GetTaskManager(taskDef); manager != nil { 95 if manager := cat.GetTaskManager(taskDef); manager != nil {
94 return manager.Traits(), nil 96 return manager.Traits(), nil
95 } 97 }
96 return task.Traits{}, nil 98 return task.Traits{}, nil
97 } 99 }
OLDNEW
« no previous file with comments | « scheduler/appengine/presentation/acl.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698