-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
jobs.mdx
2689 lines (2304 loc) · 73.6 KB
/
jobs.mdx
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
layout: api
page_title: Jobs - HTTP API
description: The /jobs endpoints are used to query for and interact with jobs.
---
# Jobs HTTP API
The `/jobs` endpoints are used to query for and interact with jobs.
## List Jobs
This endpoint lists all known jobs in the system registered with Nomad.
| Method | Path | Produces |
| ------ | ---------- | ------------------ |
| `GET` | `/v1/jobs` | `application/json` |
The table below shows this endpoint's support for
[blocking queries](/nomad/api-docs#blocking-queries) and
[required ACLs](/nomad/api-docs#acls).
| Blocking Queries | ACL Required |
| ---------------- | --------------------- |
| `YES` | `namespace:list-jobs` |
### Parameters
- `prefix` `(string: "")` - Specifies a string to filter jobs on based on
an index prefix. This is specified as a query string parameter.
- `next_token` `(string: "")` - This endpoint supports paging. The `next_token`
parameter accepts a string which identifies the next expected job. This value
can be obtained from the `X-Nomad-NextToken` header from the previous
response.
- `per_page` `(int: 0)` - Specifies a maximum number of jobs to return for this
request. If omitted, the response is not paginated. The value of the
`X-Nomad-NextToken` header of the last response can be used as the
`next_token` of the next request to fetch additional pages.
- `filter` `(string: "")` - Specifies the [expression](/nomad/api-docs#filtering)
used to filter the results. Consider using pagination or a query parameter to
reduce resource used to serve the request.
- `namespace` `(string: "default")` - Specifies the target namespace. Specifying
`*` would return all jobs across all the authorized namespaces.
- `meta` `(bool: false)` - If set, jobs returned will include a [meta](/nomad/docs/job-specification/meta) field containing key-value pairs provided in the job specification's `meta` block.
### Sample Request
```shell-session
$ curl https://localhost:4646/v1/jobs
```
```shell-session
$ curl https://localhost:4646/v1/jobs?prefix=team
```
```shell-session
$ curl https://localhost:4646/v1/jobs?namespace=*&prefix=team
```
### Sample Response
```json
[
{
"ID": "example",
"ParentID": "",
"Name": "example",
"Type": "service",
"Priority": 50,
"Status": "pending",
"StatusDescription": "",
"JobSummary": {
"JobID": "example",
"Namespace": "default",
"Summary": {
"cache": {
"Queued": 1,
"Complete": 1,
"Failed": 0,
"Running": 0,
"Starting": 0,
"Lost": 0
}
},
"Children": {
"Pending": 0,
"Running": 0,
"Dead": 0
},
"CreateIndex": 52,
"ModifyIndex": 96
},
"CreateIndex": 52,
"ModifyIndex": 93,
"JobModifyIndex": 52
}
]
```
## Create Job
This endpoint creates (aka "registers") a new job in the system.
| Method | Path | Produces |
| ------ | ---------- | ------------------ |
| `POST` | `/v1/jobs` | `application/json` |
The table below shows this endpoint's support for
[blocking queries](/nomad/api-docs#blocking-queries) and
[required ACLs](/nomad/api-docs#acls).
| Blocking Queries | ACL Required |
| ---------------- | --------------------------------------------------------------------------------- |
| `NO` | `namespace:submit-job`<br />`namespace:sentinel-override` if `PolicyOverride` set |
### Parameters
- `Job` `(Job: <required>)` - Specifies the JSON definition of the job.
- `Submission` `(JobSubmission: <optional>)` - Specifies the original HCL/HCL2/JSON
definition of the job. This data is useful for reference only, it is not considered
for the actual scheduling of `Job`.
- `EnforceIndex` `(bool: false)` - If set, the job will only be registered if the
passed `JobModifyIndex` matches the current job's index. If the index is zero,
the register only occurs if the job is new. This paradigm allows check-and-set
style job updating.
- `EvalPriority` `(int: 0)` - Override the priority of the evaluations produced
as a result of this job registration. By default, this is set to the priority
of the job.
- `JobModifyIndex` `(int: 0)` - Specifies the `JobModifyIndex` to enforce the
current job is at.
- `PolicyOverride` `(bool: false)` - If set, any soft mandatory Sentinel
policies will be overridden. This allows a job to be registered when it would
be denied by policy.
- `PreserveCounts` `(bool: false)` - If set, existing task group counts are
preserved, over those specified in the new job spec.
### Sample Payload
```json
{
"Job": {
"Datacenters": ["dc1"],
"ID": "cache",
"NodePool": "prod",
"TaskGroups": [
{
"Name": "cache",
"Networks": [
{
"DynamicPorts": [
{
"Label": "db",
"To": 6379
}
]
}
],
"Services": [
{
"Name": "redis-cache",
"PortLabel": "db"
}
],
"Tasks": [
{
"Config": {
"image": "redis:7",
"ports": ["db"]
},
"Driver": "docker",
"Name": "redis"
}
]
}
]
}
}
```
### Sample Request
```shell-session
$ curl \
--request POST \
--data @payload.json \
https://localhost:4646/v1/jobs
```
### Sample Response
```json
{
"EvalID": "",
"EvalCreateIndex": 0,
"JobModifyIndex": 109,
"Warnings": "",
"Index": 0,
"LastContact": 0,
"KnownLeader": false
}
```
## Parse Job
This endpoint will parse a HCL jobspec and produce the equivalent JSON encoded
job.
| Method | Path | Produces |
| ------ | ---------------- | ------------------ |
| `POST` | `/v1/jobs/parse` | `application/json` |
The table below shows this endpoint's support for
[blocking queries](/nomad/api-docs#blocking-queries) and
[required ACLs](/nomad/api-docs#acls).
| Blocking Queries | ACL Required |
| ---------------- | ------------------------------------------------- |
| `NO` | `namespace:parse-job`<br />`namespace:submit-job` |
### Parameters
- `namespace` `(string: "default")` - Specifies the target namespace. If ACL is
enabled, this value must match a namespace that the token is allowed to
access. This is specified as a query string parameter.
- `JobHCL` `(string: <required>)` - Specifies the HCL definition of the job
encoded in a JSON string.
- `Canonicalize` `(bool: false)` - Flag to enable setting any unset fields to
their default values.
- `Variables` `(string: "")` - Specifies HCL2 variables to use during parsing of
the job in the var file format.
- `VariableFlags` `(map[string]string: nil)` - Specifies HCL2 variables to use
during parsing of the job in key = value format.
- `HCLv1` `(bool: false)` - Use the legacy v1 HCL parser.
### Sample Payload
```json
{
"JobHCL": "job \"example\" {\n type = \"service\"\n group \"cache\" {}\n}",
"Canonicalize": true
}
```
You can use a tool such as [`jq`](https://stedolan.github.io/jq/) to generate
the payload from a local HCL file:
```shell-session
$ jq -Rsc '{ JobHCL: ., Canonicalize: true }' example.nomad.hcl > payload.json
```
### Sample Request
```shell-session
$ curl \
--request POST \
--data @payload.json \
https://localhost:4646/v1/jobs/parse
```
### Sample Response
```json
{
"AllAtOnce": false,
"Constraints": null,
"Affinities": null,
"CreateIndex": 0,
"Datacenters": null,
"ID": "my-job",
"JobModifyIndex": 0,
"Meta": null,
"Migrate": null,
"ModifyIndex": 0,
"Name": "my-job",
"Namespace": "default",
"NodePool": "prod",
"ParameterizedJob": null,
"ParentID": "",
"Payload": null,
"Periodic": null,
"Priority": 50,
"Region": "global",
"Reschedule": null,
"Stable": false,
"Status": "",
"StatusDescription": "",
"Stop": false,
"SubmitTime": null,
"TaskGroups": null,
"Type": "service",
"Update": null,
"VaultToken": "",
"Version": 0
}
```
## Read Job
This endpoint reads information about a single job for its specification and
status.
| Method | Path | Produces |
| ------ | ----------------- | ------------------ |
| `GET` | `/v1/job/:job_id` | `application/json` |
The table below shows this endpoint's support for
[blocking queries](/nomad/api-docs#blocking-queries) and
[required ACLs](/nomad/api-docs#acls).
| Blocking Queries | ACL Required |
| ---------------- | -------------------- |
| `YES` | `namespace:read-job` |
### Parameters
- `:job_id` `(string: <required>)` - Specifies the ID of the job. This is
specified as part of the path.
- `namespace` `(string: "default")` - Specifies the namespace of the job. If not specified,
defaults to "default". This is specified as a URL query parameter.
### Sample Request
```shell-session
$ curl \
https://localhost:4646/v1/job/my-job
```
```shell-session
$ curl \
https://localhost:4646/v1/job/my-job?namespace=apps
```
### Sample Response
```json
{
"Region": "global",
"Namespace": "apps",
"ID": "example",
"ParentID": "",
"Name": "example",
"Type": "batch",
"Priority": 50,
"AllAtOnce": false,
"Datacenters": ["dc1"],
"NodePool": "prod",
"Constraints": [
{
"LTarget": "${attr.kernel.name}",
"RTarget": "linux",
"Operand": "="
}
],
"TaskGroups": [
{
"Name": "cache",
"Count": 1,
"Constraints": [
{
"LTarget": "${attr.os.signals}",
"RTarget": "SIGUSR1",
"Operand": "set_contains"
}
],
"Affinities": [
{
"LTarget": "${meta.datacenter}",
"RTarget": "dc1",
"Operand": "=",
"Weight": 50
}
],
"RestartPolicy": {
"Attempts": 10,
"Interval": 300000000000,
"Delay": 25000000000,
"Mode": "delay"
},
"Tasks": [
{
"Config": {
"command": "env",
"image": "alpine"
},
"Driver": "docker",
"Lifecycle": {
"Hook": "prestart",
"Sidecar": false
},
"Name": "init",
"Resources": {
"CPU": 100,
"MemoryMB": 300
}
},
{
"Name": "redis",
"Driver": "docker",
"User": "foo-user",
"Config": {
"image": "redis:latest",
"port_map": [
{
"db": 6379
}
]
},
"Env": {
"foo": "bar",
"baz": "pipe"
},
"Services": [
{
"Name": "cache-redis",
"PortLabel": "db",
"Tags": ["global", "cache"],
"Checks": [
{
"Name": "alive",
"Type": "tcp",
"Command": "",
"Args": null,
"Path": "",
"Protocol": "",
"PortLabel": "",
"Interval": 10000000000,
"Timeout": 2000000000,
"InitialStatus": ""
}
]
}
],
"Vault": null,
"Templates": [
{
"SourcePath": "local/config.conf.tpl",
"DestPath": "local/config.conf",
"EmbeddedTmpl": "",
"ChangeMode": "signal",
"ChangeSignal": "SIGUSR1",
"Splay": 5000000000,
"Perms": ""
}
],
"Constraints": null,
"Affinities": null,
"Resources": {
"CPU": 500,
"MemoryMB": 256,
"DiskMB": 0,
"Networks": [
{
"Device": "",
"CIDR": "",
"IP": "",
"MBits": 10,
"ReservedPorts": [
{
"Label": "rpc",
"Value": 25566
}
],
"DynamicPorts": [
{
"Label": "db",
"Value": 0
}
]
}
]
},
"DispatchPayload": {
"File": "config.json"
},
"Meta": {
"foo": "bar",
"baz": "pipe"
},
"KillTimeout": 5000000000,
"LogConfig": {
"Disabled": false,
"MaxFiles": 10,
"MaxFileSizeMB": 10
},
"Artifacts": [
{
"GetterSource": "http://foo.com/artifact.tar.gz",
"GetterOptions": {
"checksum": "md5:c4aa853ad2215426eb7d70a21922e794"
},
"RelativeDest": "local/"
}
],
"Leader": false
}
],
"EphemeralDisk": {
"Sticky": false,
"SizeMB": 300,
"Migrate": false
},
"Meta": {
"foo": "bar",
"baz": "pipe"
}
}
],
"Update": {
"Stagger": 10000000000,
"MaxParallel": 1
},
"Periodic": {
"Enabled": true,
"Spec": "* * * * *",
"SpecType": "cron",
"ProhibitOverlap": true
},
"ParameterizedJob": {
"Payload": "required",
"MetaRequired": ["foo"],
"MetaOptional": ["bar"]
},
"Payload": null,
"Meta": {
"foo": "bar",
"baz": "pipe"
},
"VaultToken": "",
"Status": "running",
"StatusDescription": "",
"CreateIndex": 7,
"ModifyIndex": 7,
"JobModifyIndex": 7
}
```
#### Field Reference
- `Status`: The job's current state. It can have one of the following values:
- `pending`: The job is currently waiting on scheduling.
- `running`: The job has non-terminal allocations.
- `dead`: All of the job's allocations and evaluations are terminal.
- `Type`: The type of job in terms of scheduling. It can have one of the following values:
- `service`: Allocations are intended to remain alive.
- `batch`: Allocations are intended to exit.
- `system`: Each client in the datacenter and node pool gets an allocation.
## Read Job Submission
This endpoint reads original source information about a specific version of a single
job. The data this endpoint provides is only available if it was provided with the
original job during job registration. Only the most recent 6 job source files are
retained.
| Method | Path | Produces |
| ------ | ------------------------------ | ------------------ |
|`GET` | `/v1/job/:job_id/submission` | `application/json` |
### Parameters
- `:job_id` `(string: <required>)` - Specifies the ID of the job. This is
specified as part of the path.
- `version` `(int: <required>)` - Specifies the version number of the job for which
to retrieve the original source information. This is specified as a query string
parameter.
- `namespace` `(string: "default")` - Specifies the target namespace. If ACL is
enabled, this value must match a namespace that the token is allowed to access.
This is specified as a query string parameter.
### Sample Request
```shell-session
nomad operator api /v1/job/my-job/submission?version=42
```
### Sample Response
```json
{
"Format": "hcl2",
"JobIndex": 11,
"JobID": "myjob",
"Namespace": "default",
"Source": "variable \"X\" {\n type = string\n}\n\nvariable \"Y\" {\n type = number\n}\n\nvariable \"Z\" {\n type = bool\n}\n \njob \"myjob\" {\n type = \"sysbatch\"\n \n meta {\n nomad_discard_job_source = false\n }\n\n group \"group\" {\n task \"task\" {\n driver = \"raw_exec\"\n\n config {\n command = \"echo\"\n args = [\"X ${var.X}, Y ${var.Y}, Z ${var.Z}\"]\n }\n\n resources {\n cpu = 10\n memory = 16\n }\n }\n }\n}\n",
"VariableFlags": {
"Z": "true",
"X": "x",
"Y": "2"
},
"Variables": "",
"Version": 0
}
```
#### Field Reference
- `JobID`: The ID of the job associated with the original job file.
- `Format`: The file format of the original job file. One of `hcl2`, `hcl1`, or `json`.
- `Source`: The literal content of the original job file.
- `VariableFlags`: The key-value pairs of HCL variables as submitted via `-var` command
line arguments when submitting the job via CLI.
- `Variables`: The content of the variables form when submitting the job via the WebUI.
- `Version`: The version of the job this submission source is associated with.
## List Job Versions
This endpoint reads information about all versions of a job.
| Method | Path | Produces |
| ------ | -------------------------- | ------------------ |
| `GET` | `/v1/job/:job_id/versions` | `application/json` |
The table below shows this endpoint's support for
[blocking queries](/nomad/api-docs#blocking-queries) and
[required ACLs](/nomad/api-docs#acls).
| Blocking Queries | ACL Required |
| ---------------- | -------------------- |
| `YES` | `namespace:read-job` |
### Parameters
- `diffs` `(bool: false)` - Specifies if the Diffs field should be populated,
containing the structured diff between the current and last job version.
- `:job_id` `(string: <required>)` - Specifies the ID of the job. This is
specified as part of the path.
- `namespace` `(string: "default")` - Specifies the target namespace. If ACL is
enabled, this value must match a namespace that the token is allowed to
access. This is specified as a query string parameter.
### Sample Request
```shell-session
$ curl \
https://localhost:4646/v1/job/my-job/versions
```
### Sample Response
```json
{
"Diffs": null,
"Index": 51,
"KnownLeader": true,
"LastContact": 0,
"Versions": [
{
"Affinities": null,
"AllAtOnce": false,
"Constraints": null,
"ConsulToken": "",
"CreateIndex": 44,
"Datacenters": ["dc1"],
"Dispatched": false,
"ID": "example",
"JobModifyIndex": 44,
"Meta": null,
"ModifyIndex": 51,
"Multiregion": null,
"Name": "example",
"Namespace": "default",
"NomadTokenID": "",
"NodePool": "prod",
"ParameterizedJob": null,
"ParentID": "",
"Payload": null,
"Periodic": null,
"Priority": 50,
"Region": "global",
"Spreads": null,
"Stable": true,
"Status": "running",
"StatusDescription": "",
"Stop": false,
"SubmitTime": 1608304897537638400,
"TaskGroups": [
{
"Affinities": null,
"Constraints": null,
"Count": 1,
"EphemeralDisk": {
"Migrate": false,
"SizeMB": 300,
"Sticky": false
},
"MaxClientDisconnect": 300000000000,
"Meta": null,
"Migrate": {
"HealthCheck": "checks",
"HealthyDeadline": 300000000000,
"MaxParallel": 1,
"MinHealthyTime": 10000000000
},
"Name": "cache",
"Networks": [
{
"CIDR": "",
"DNS": null,
"Device": "",
"DynamicPorts": [
{
"HostNetwork": "default",
"Label": "db",
"To": 6379,
"Value": 0
}
],
"IP": "",
"MBits": 0,
"Mode": "",
"ReservedPorts": null
}
],
"ReschedulePolicy": {
"Attempts": 0,
"Delay": 30000000000,
"DelayFunction": "exponential",
"Interval": 0,
"MaxDelay": 3600000000000,
"Unlimited": true
},
"RestartPolicy": {
"Attempts": 2,
"Delay": 15000000000,
"Interval": 1800000000000,
"Mode": "fail"
},
"Scaling": null,
"Services": null,
"ShutdownDelay": null,
"Spreads": null,
"StopAfterClientDisconnect": null,
"Tasks": [
{
"Affinities": null,
"Artifacts": null,
"CSIPluginConfig": null,
"Config": {
"image": "redis:7",
"ports": ["db"]
},
"Constraints": null,
"DispatchPayload": null,
"Driver": "docker",
"Env": null,
"KillSignal": "",
"KillTimeout": 5000000000,
"Kind": "",
"Leader": false,
"Lifecycle": null,
"LogConfig": {
"Disabled": false,
"MaxFileSizeMB": 10,
"MaxFiles": 10
},
"Meta": null,
"Name": "redis",
"Resources": {
"CPU": 500,
"Devices": null,
"DiskMB": 0,
"IOPS": 0,
"MemoryMB": 256,
"Networks": null
},
"RestartPolicy": {
"Attempts": 2,
"Delay": 15000000000,
"Interval": 1800000000000,
"Mode": "fail"
},
"ScalingPolicies": null,
"Services": null,
"ShutdownDelay": 0,
"Templates": null,
"User": "",
"Vault": null,
"VolumeMounts": null
}
],
"Update": {
"AutoPromote": false,
"AutoRevert": false,
"Canary": 0,
"HealthCheck": "checks",
"HealthyDeadline": 300000000000,
"MaxParallel": 1,
"MinHealthyTime": 10000000000,
"ProgressDeadline": 600000000000,
"Stagger": 30000000000
},
"Volumes": null
}
],
"Type": "service",
"Update": {
"AutoPromote": false,
"AutoRevert": false,
"Canary": 0,
"HealthCheck": "",
"HealthyDeadline": 0,
"MaxParallel": 1,
"MinHealthyTime": 0,
"ProgressDeadline": 0,
"Stagger": 30000000000
},
"VaultNamespace": "",
"VaultToken": "",
"Version": 0
}
]
}
```
```shell-session
$ curl \
https://localhost:4646/v1/job/my-job/versions?diffs=true
```
```json
{
"Diffs": [
{
"Fields": null,
"ID": "example",
"Objects": null,
"TaskGroups": [
{
"Fields": null,
"Name": "cache",
"Objects": null,
"Tasks": [
{
"Annotations": null,
"Fields": [
{
"Annotations": null,
"Name": "Env[foo]",
"New": "bar",
"Old": "",
"Type": "Added"
}
],
"Name": "redis",
"Objects": null,
"Type": "Edited"
}
],
"Type": "Edited",
"Updates": null
}
],
"Type": "Edited"
}
],
"Index": 26,
"KnownLeader": true,
"LastContact": 0,
"Versions": [
{
"Affinities": null,
"AllAtOnce": false,
"Constraints": null,
"ConsulToken": "",
"CreateIndex": 10,
"Datacenters": [
"dc1"
],
"Dispatched": false,
"ID": "example",
"JobModifyIndex": 16,
"Meta": null,
"ModifyIndex": 26,
"Multiregion": null,
"Name": "example",
"Namespace": "default",
"NodePool": "prod",
"NomadTokenID": "",
"ParameterizedJob": null,
"ParentID": "",
"Payload": null,
"Periodic": null,
"Priority": 50,
"Region": "global",
"Spreads": null,
"Stable": true,
"Status": "running",
"StatusDescription": "",
"Stop": false,
"SubmitTime": 1608316675000588800,
"TaskGroups": [
{
"Affinities": null,
"Constraints": null,
"Count": 1,
"EphemeralDisk": {
"Migrate": false,
"SizeMB": 300,
"Sticky": false
},
"MaxClientDisconnect": null,
"Meta": null,
"Migrate": {
"HealthCheck": "checks",
"HealthyDeadline": 300000000000,
"MaxParallel": 1,
"MinHealthyTime": 10000000000
},
"Name": "cache",
"Networks": [
{
"CIDR": "",
"DNS": null,
"Device": "",
"DynamicPorts": [
{
"HostNetwork": "default",
"Label": "db",
"To": 6379,
"Value": 0
}
],
"IP": "",
"MBits": 0,
"Mode": "",
"ReservedPorts": null
}
],
"ReschedulePolicy": {
"Attempts": 0,
"Delay": 30000000000,
"DelayFunction": "exponential",
"Interval": 0,
"MaxDelay": 3600000000000,
"Unlimited": true
},
"RestartPolicy": {
"Attempts": 2,
"Delay": 15000000000,
"Interval": 1800000000000,
"Mode": "fail"
},
"Scaling": null,
"Services": null,
"ShutdownDelay": null,
"Spreads": null,
"StopAfterClientDisconnect": null,
"Tasks": [
{
"Affinities": null,
"Artifacts": null,
"CSIPluginConfig": null,
"Config": {
"image": "redis:7",
"ports": [
"db"
]
},
"Constraints": null,
"DispatchPayload": null,
"Driver": "docker",
"Env": {
"foo": "bar"
},
"KillSignal": "",
"KillTimeout": 5000000000,
"Kind": "",
"Leader": false,
"Lifecycle": null,
"LogConfig": {
"Disabled": false,
"MaxFileSizeMB": 10,
"MaxFiles": 10
},
"Meta": null,
"Name": "redis",
"Resources": {
"CPU": 500,
"Devices": null,
"DiskMB": 0,
"IOPS": 0,
"MemoryMB": 256,