-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjob.go
58 lines (52 loc) · 2.29 KB
/
job.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
/*
* chronos-client
* Copyright (c) 2015 Yieldbot, Inc.
* For the full copyright and license information, please view the LICENSE.txt file.
*/
package client
// Job represents Chronos job configuration
type Job struct {
// REF: https://mesos.github.io/chronos/docs/api.html#job-configuration
Name string `json:"name"`
Description string `json:"description"`
Command string `json:"command"`
Arguments []string `json:"arguments"`
Shell bool `json:"shell"`
Epsilon string `json:"epsilon"`
Executor string `json:"executor"`
ExecutorFlags string `json:"executorFlags"`
Retries int `json:"retries"`
Owner string `json:"owner"`
OwnerName string `json:"ownerName"`
Async bool `json:"async"`
SuccessCount int `json:"successCount"`
ErrorCount int `json:"errorCount"`
LastSuccess string `json:"lastSuccess"`
LastError string `json:"lastError"`
Cpus float64 `json:"cpus"`
Mem float64 `json:"mem"`
Disk float64 `json:"disk"`
Disabled bool `json:"disabled"`
Uris []string `json:"uris"`
Schedule string `json:"schedule"`
ScheduleTimeZone string `json:"scheduleTimeZone"`
Parents []string `json:"parents"`
RunAsUser string `json:"runAsUser"`
Container *JobContainer `json:"container"`
DataJob bool `json:"dataJob"`
EnvironmentVariables []*EnvVars `json:"environmentVariables"`
Constraints [][]string `json:"constraints"`
}
// JobContainer represents Chronos job container field
type JobContainer struct {
Type string `json:"type"`
Image string `json:"image"`
ForcePullImage bool `json:"forcePullImage"`
Network string `json:"network"`
Volumes []interface{} `json:"arguments"`
}
// EnvVars represents Chronos job environmentVariables field
type EnvVars struct {
Name string `json:"name"`
Value string `json:"value"`
}