github.com/hernad/nomad@v1.6.112/ui/tests/utils/generate-raw-json-job.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 export const JOB_JSON = { 7 Shallow: false, 8 CreateRecommendations: true, 9 WithTaskServices: false, 10 WithGroupServices: false, 11 WithRescheduling: false, 12 NoHostVolumes: false, 13 NoFailedPlacements: false, 14 FailedPlacements: false, 15 NoDeployments: false, 16 ActiveDeployment: false, 17 NoActiveDeployment: false, 18 CreateAllocations: true, 19 ModifyIndex: 1201, 20 CreateIndex: 0, 21 Meta: null, 22 ChildrenCount: 1, 23 Datacenters: ['cl12'], 24 Status: 'running', 25 AllAtOnce: true, 26 Priority: 73, 27 Type: 'service', 28 Region: 'global', 29 ResourceSpec: null, 30 GroupsCount: 2, 31 SubmitTime: 1676365074506000000, 32 Version: 1, 33 ID: 'hdd-panel-0', 34 Name: 'hdd-panel-0', 35 Namespace: 'namespace-1', 36 NamespaceID: 'namespace-1', 37 TaskGroups: [ 38 { 39 ResourceSpec: null, 40 Shallow: false, 41 CreateRecommendations: true, 42 WithTaskServices: false, 43 WithServices: false, 44 WithRescheduling: false, 45 CreateAllocations: true, 46 Volumes: { 47 mazie: { 48 Name: 'mazie', 49 Type: 'host', 50 Source: 'claire', 51 ReadOnly: false, 52 }, 53 leora: { 54 Name: 'leora', 55 Type: 'host', 56 Source: 'jamil', 57 ReadOnly: false, 58 }, 59 }, 60 WithScaling: false, 61 EphemeralDisk: { 62 Sticky: true, 63 SizeMB: 5000, 64 Migrate: false, 65 }, 66 Count: 2, 67 Name: 'pixel-g-0', 68 ID: '1', 69 Services: null, 70 Tasks: [ 71 { 72 TaskGroupID: '1', 73 Lifecycle: null, 74 OriginalResources: { 75 Cpu: { 76 CpuShares: 250, 77 }, 78 Memory: { 79 MemoryMB: 1024, 80 MemoryMaxMB: 8192, 81 }, 82 Disk: { 83 DiskMB: 0, 84 }, 85 Networks: [ 86 { 87 Device: 'eth4', 88 CIDR: '', 89 IP: '116.206.32.192', 90 MBits: 10, 91 Mode: 'bridge', 92 ReservedPorts: [], 93 DynamicPorts: [ 94 { 95 Label: 'sensor', 96 Value: 43123, 97 To: 29512, 98 }, 99 ], 100 }, 101 { 102 Device: 'eth3', 103 CIDR: '', 104 IP: '172.75.114.89', 105 MBits: 10, 106 Mode: 'host', 107 ReservedPorts: [], 108 DynamicPorts: [ 109 { 110 Label: 'firewall', 111 Value: 43343, 112 To: 38426, 113 }, 114 { 115 Label: 'pixel', 116 Value: 16314, 117 To: 13304, 118 }, 119 ], 120 }, 121 { 122 Device: 'eth5', 123 CIDR: '', 124 IP: '194.36.199.184', 125 MBits: 10, 126 Mode: 'host', 127 ReservedPorts: [ 128 { 129 Label: 'program', 130 Value: 48937, 131 To: 14717, 132 }, 133 ], 134 DynamicPorts: [ 135 { 136 Label: 'interface', 137 Value: 44940, 138 To: 22631, 139 }, 140 ], 141 }, 142 ], 143 Ports: [ 144 { 145 Label: 'transmitter', 146 Value: 40616, 147 To: 38744, 148 HostIP: 'c760:161f:5d3e:d49a:b973:1234:7835:07bd', 149 }, 150 ], 151 }, 152 Resources: { 153 CPU: 250, 154 MemoryMB: 1024, 155 MemoryMaxMB: 8192, 156 DiskMB: 0, 157 }, 158 Driver: 'java', 159 Name: 'task-hard-drive-0', 160 JobID: '', 161 VolumeMounts: [ 162 { 163 Volume: 'leora', 164 Destination: '/Andreanne_Gulgowski94/jordane/#442118', 165 PropagationMode: '', 166 ReadOnly: true, 167 }, 168 { 169 Volume: 'mazie', 170 Destination: '/Nicholaus43/erna/#377517', 171 PropagationMode: '', 172 ReadOnly: true, 173 }, 174 ], 175 GroupNames: [], 176 WithServices: false, 177 CreateRecommendations: true, 178 ID: '1', 179 Services: [], 180 }, 181 { 182 TaskGroupID: '1', 183 Lifecycle: { 184 Hook: 'prestart', 185 Sidecar: false, 186 }, 187 OriginalResources: { 188 Cpu: { 189 CpuShares: 250, 190 }, 191 Memory: { 192 MemoryMB: 2048, 193 MemoryMaxMB: 0, 194 }, 195 Disk: { 196 DiskMB: 0, 197 }, 198 Networks: [ 199 { 200 Device: 'eth0', 201 CIDR: '', 202 IP: '124.146.107.83', 203 MBits: 10, 204 Mode: 'bridge', 205 ReservedPorts: [], 206 DynamicPorts: [ 207 { 208 Label: 'alarm', 209 Value: 6224, 210 To: 42238, 211 }, 212 { 213 Label: 'transmitter', 214 Value: 37450, 215 To: 15365, 216 }, 217 ], 218 }, 219 { 220 Device: 'eth2', 221 CIDR: '', 222 IP: '175.247.90.51', 223 MBits: 10, 224 Mode: 'host', 225 ReservedPorts: [ 226 { 227 Label: 'bandwidth', 228 Value: 20203, 229 To: 15316, 230 }, 231 ], 232 DynamicPorts: [ 233 { 234 Label: 'circuit', 235 Value: 18394, 236 To: 37087, 237 }, 238 { 239 Label: 'protocol', 240 Value: 22008, 241 To: 12761, 242 }, 243 ], 244 }, 245 { 246 Device: 'eth0', 247 CIDR: '', 248 IP: '21.58.85.37', 249 MBits: 10, 250 Mode: 'bridge', 251 ReservedPorts: [], 252 DynamicPorts: [ 253 { 254 Label: 'circuit', 255 Value: 12116, 256 To: 53021, 257 }, 258 { 259 Label: 'application', 260 Value: 43516, 261 To: 19386, 262 }, 263 ], 264 }, 265 ], 266 Ports: [ 267 { 268 Label: 'bandwidth', 269 Value: 50493, 270 To: 58903, 271 HostIP: '7534:4ef6:c704:0e86:643b:7311:2dab:b933', 272 }, 273 ], 274 }, 275 Resources: { 276 CPU: 250, 277 MemoryMB: 2048, 278 MemoryMaxMB: 0, 279 DiskMB: 0, 280 }, 281 Driver: 'qemu', 282 Name: 'task-transmitter-1', 283 JobID: '', 284 VolumeMounts: [ 285 { 286 Volume: 'mazie', 287 Destination: '/Sylvan79/marjorie/#407369', 288 PropagationMode: '', 289 ReadOnly: false, 290 }, 291 { 292 Volume: 'leora', 293 Destination: '/Jeanie.Thiel75/ross/#365510', 294 PropagationMode: '', 295 ReadOnly: false, 296 }, 297 ], 298 GroupNames: [], 299 WithServices: false, 300 CreateRecommendations: true, 301 ID: '2', 302 Services: [], 303 }, 304 ], 305 }, 306 { 307 ResourceSpec: null, 308 Shallow: false, 309 CreateRecommendations: true, 310 WithTaskServices: false, 311 WithServices: false, 312 WithRescheduling: false, 313 CreateAllocations: true, 314 Volumes: { 315 mazie: { 316 Name: 'mazie', 317 Type: 'host', 318 Source: 'claire', 319 ReadOnly: false, 320 }, 321 leora: { 322 Name: 'leora', 323 Type: 'host', 324 Source: 'jamil', 325 ReadOnly: false, 326 }, 327 }, 328 WithScaling: true, 329 EphemeralDisk: { 330 Sticky: false, 331 SizeMB: 500, 332 Migrate: false, 333 }, 334 Count: 2, 335 Name: 'protocol-g-1', 336 ID: '2', 337 Scaling: { 338 Min: 1, 339 Max: 5, 340 Policy: false, 341 }, 342 Services: null, 343 Tasks: [ 344 { 345 TaskGroupID: '2', 346 Lifecycle: { 347 Hook: 'prestart', 348 Sidecar: true, 349 }, 350 OriginalResources: { 351 Cpu: { 352 CpuShares: 4000, 353 }, 354 Memory: { 355 MemoryMB: 4096, 356 MemoryMaxMB: 8192, 357 }, 358 Disk: { 359 DiskMB: 0, 360 }, 361 Networks: [ 362 { 363 Device: 'eth1', 364 CIDR: '', 365 IP: '203.214.83.7', 366 MBits: 10, 367 Mode: 'bridge', 368 ReservedPorts: [], 369 DynamicPorts: [ 370 { 371 Label: 'bus', 372 Value: 58731, 373 To: 43657, 374 }, 375 { 376 Label: 'firewall', 377 Value: 31480, 378 To: 57357, 379 }, 380 ], 381 }, 382 ], 383 Ports: [ 384 { 385 Label: 'circuit', 386 Value: 53773, 387 To: 33492, 388 HostIP: '55b9:739b:f8cb:591f:238c:6ec3:e925:defc', 389 }, 390 ], 391 }, 392 Resources: { 393 CPU: 4000, 394 MemoryMB: 4096, 395 MemoryMaxMB: 8192, 396 DiskMB: 0, 397 }, 398 Driver: 'docker', 399 Name: 'task-firewall-2', 400 JobID: '', 401 VolumeMounts: [ 402 { 403 Volume: 'mazie', 404 Destination: '/Wanda21/ronaldo/#315877', 405 PropagationMode: '', 406 ReadOnly: false, 407 }, 408 ], 409 GroupNames: [], 410 WithServices: false, 411 CreateRecommendations: true, 412 ID: '3', 413 Services: [], 414 }, 415 { 416 TaskGroupID: '2', 417 Lifecycle: { 418 Hook: 'poststart', 419 Sidecar: false, 420 }, 421 OriginalResources: { 422 Cpu: { 423 CpuShares: 2000, 424 }, 425 Memory: { 426 MemoryMB: 1024, 427 MemoryMaxMB: 0, 428 }, 429 Disk: { 430 DiskMB: 0, 431 }, 432 Networks: [ 433 { 434 Device: 'eth1', 435 CIDR: '', 436 IP: '126.161.123.8', 437 MBits: 10, 438 Mode: 'bridge', 439 ReservedPorts: [ 440 { 441 Label: 'alarm', 442 Value: 52478, 443 To: 11878, 444 }, 445 ], 446 DynamicPorts: [ 447 { 448 Label: 'application', 449 Value: 5543, 450 To: 22670, 451 }, 452 { 453 Label: 'port', 454 Value: 19767, 455 To: 17311, 456 }, 457 ], 458 }, 459 { 460 Device: 'eth0', 461 CIDR: '', 462 IP: '12.228.2.247', 463 MBits: 10, 464 Mode: 'bridge', 465 ReservedPorts: [], 466 DynamicPorts: [], 467 }, 468 { 469 Device: 'eth1', 470 CIDR: '', 471 IP: '71.92.163.164', 472 MBits: 10, 473 Mode: 'bridge', 474 ReservedPorts: [], 475 DynamicPorts: [], 476 }, 477 ], 478 Ports: [ 479 { 480 Label: 'pixel', 481 Value: 32161, 482 To: 25929, 483 HostIP: 'b778:a055:4422:e3ca:fd2d:e5e8:464d:8f2b', 484 }, 485 ], 486 }, 487 Resources: { 488 CPU: 2000, 489 MemoryMB: 1024, 490 MemoryMaxMB: 0, 491 DiskMB: 0, 492 }, 493 Driver: 'qemu', 494 Name: 'task-microchip-3', 495 JobID: '', 496 VolumeMounts: [ 497 { 498 Volume: 'mazie', 499 Destination: '/Vella.OReilly/dudley/#4b403a', 500 PropagationMode: '', 501 ReadOnly: true, 502 }, 503 { 504 Volume: 'leora', 505 Destination: '/Tressa_Brown/ian/#6d666c', 506 PropagationMode: '', 507 ReadOnly: false, 508 }, 509 ], 510 GroupNames: [], 511 WithServices: false, 512 CreateRecommendations: true, 513 ID: '4', 514 Services: [], 515 }, 516 ], 517 }, 518 ], 519 JobSummary: { 520 GroupNames: ['pixel-g-0', 'protocol-g-1'], 521 Summary: { 522 'pixel-g-0': { 523 Queued: 10, 524 Complete: 10, 525 Failed: 6, 526 Running: 7, 527 Starting: 4, 528 Lost: 8, 529 Unknown: 1, 530 }, 531 'protocol-g-1': { 532 Queued: 4, 533 Complete: 7, 534 Failed: 2, 535 Running: 0, 536 Starting: 7, 537 Lost: 3, 538 Unknown: 5, 539 }, 540 }, 541 Namespace: 'namespace-1', 542 ID: '1', 543 JobID: 'hdd-panel-0', 544 }, 545 Specification: { 546 Definition: 547 'job "docs" {\n namespace = "madness"\n group "example" {\n task "server" {\n service {\n tags = ["leader", "mysql"]\n\n port = "db"\n\n meta {\n meta = "for your service"\n }\n\n check {\n type = "tcp"\n port = "db"\n interval = "10s"\n timeout = "2s"\n }\n\n check {\n type = "script"\n name = "check_table"\n command = "/usr/local/bin/check_mysql_table_status"\n args = ["--verbose"]\n interval = "60s"\n timeout = "5s"\n\n check_restart {\n limit = 3\n grace = "90s"\n ignore_warnings = false\n }\n }\n }\n }\n }\n}\n', 548 Type: 'hcl', 549 Variables: { 550 datacenters: ['west'], 551 external_port: 4000, 552 }, 553 }, 554 };