/
keywords.go
73 lines (69 loc) · 1.58 KB
/
keywords.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
71
72
73
package restaskhost
import (
"embed"
"github.com/opensvc/om3/core/keywords"
"github.com/opensvc/om3/util/converters"
)
var (
//go:embed text
fs embed.FS
Keywords = []keywords.Keyword{
{
Option: "schedule",
DefaultOption: "run_schedule",
Attr: "Schedule",
Scopable: true,
Text: keywords.NewText(fs, "text/kw/schedule"),
Example: "00:00-01:00 mon",
},
{
Option: "timeout",
Attr: "Timeout",
Converter: converters.Duration,
Scopable: true,
Text: keywords.NewText(fs, "text/kw/timeout"),
Example: "5m",
},
{
Option: "snooze",
Attr: "Snooze",
Converter: converters.Duration,
Scopable: true,
Example: "10m",
Text: keywords.NewText(fs, "text/kw/snooze"),
},
{
Option: "log",
Attr: "LogOutputs",
Converter: converters.Bool,
Text: keywords.NewText(fs, "text/kw/log"),
},
{
Option: "command",
Attr: "RunCmd",
Scopable: true,
Text: keywords.NewText(fs, "text/kw/command"),
},
{
Option: "on_error",
Attr: "OnErrorCmd",
Scopable: true,
Example: "/srv/{name}/data/scripts/task_on_error.sh",
Text: keywords.NewText(fs, "text/kw/on_error"),
},
{
Option: "check",
Attr: "Check",
Candidates: []string{"last_run", ""},
Scopable: true,
Example: "last_run",
Text: keywords.NewText(fs, "text/kw/check"),
},
{
Option: "confirmation",
Attr: "Confirmation",
Converter: converters.Bool,
Text: keywords.NewText(fs, "text/kw/confirmation"),
},
}
)