-
Notifications
You must be signed in to change notification settings - Fork 0
/
node_status.go
70 lines (66 loc) · 1.09 KB
/
node_status.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package workflowmodel
type NodeStatus uint
const (
Unknown NodeStatus = iota
Suspended
Complete
Queued
Submitted
Active
Aborted
Shutdown
Halted
Running
)
func GetNodeStatus(status string) NodeStatus {
switch status {
case "suspended", "sus":
return Suspended
case "complete", "com":
return Complete
case "queued", "que":
return Queued
case "submitted", "sub":
return Submitted
case "active", "act":
return Active
case "aborted", "abo":
return Aborted
case "SHUTDOWN", "shu":
return Shutdown
case "HALTED", "hal":
return Halted
case "RUNNING":
return Running
case "unknown", "unk":
return Unknown
default:
return Unknown
}
}
func (status NodeStatus) String() string {
switch status {
case Suspended:
return "suspended"
case Complete:
return "complete"
case Queued:
return "queued"
case Submitted:
return "submitted"
case Active:
return "active"
case Aborted:
return "aborted"
case Shutdown:
return "SHUTDOWN"
case Halted:
return "HALTED"
case Running:
return "RUNNING"
case Unknown:
return "unknown"
default:
return "unknown"
}
}