Browse code

docs: fix NanoCPUs casing

While the field in the Go struct is named `NanoCPUs`, it has a JSON label to
use `NanoCpus`, which was added in the original pull request (not clear what
the reason was); 846baf1fd3efcbfbf9d3eb99e436ca9a59d3e185

Some notes:

- Golang processes field names case-insensitive, so when *using* the API,
both cases should work, but when inspecting a container, the field is
returned as `NanoCpus`.
- This only affects Containers.Resources. The `Limits` and `Reservation`
for SwarmKit services and SwarmKit "nodes" do not override the name
for JSON, so have the canonical (`NanoCPUs`) casing.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8e2343ffd4cdaec67688a36aa82651b75806657a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2021/02/10 21:02:27
Showing 18 changed files
... ...
@@ -416,7 +416,7 @@ definitions:
416 416
         format: "int64"
417 417
         minimum: 0
418 418
         maximum: 100
419
-      NanoCPUs:
419
+      NanoCpus:
420 420
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
421 421
         type: "integer"
422 422
         format: "int64"
... ...
@@ -2679,7 +2679,7 @@ paths:
2679 2679
                 MemorySwap: 0
2680 2680
                 MemoryReservation: 0
2681 2681
                 KernelMemory: 0
2682
-                NanoCPUs: 500000
2682
+                NanoCpus: 500000
2683 2683
                 CpuPercent: 80
2684 2684
                 CpuShares: 512
2685 2685
                 CpuPeriod: 100000
... ...
@@ -417,7 +417,7 @@ definitions:
417 417
         format: "int64"
418 418
         minimum: 0
419 419
         maximum: 100
420
-      NanoCPUs:
420
+      NanoCpus:
421 421
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
422 422
         type: "integer"
423 423
         format: "int64"
... ...
@@ -2684,7 +2684,7 @@ paths:
2684 2684
                 MemorySwap: 0
2685 2685
                 MemoryReservation: 0
2686 2686
                 KernelMemory: 0
2687
-                NanoCPUs: 500000
2687
+                NanoCpus: 500000
2688 2688
                 CpuPercent: 80
2689 2689
                 CpuShares: 512
2690 2690
                 CpuPeriod: 100000
... ...
@@ -1625,7 +1625,7 @@ definitions:
1625 1625
           Resources:
1626 1626
             type: "object"
1627 1627
             properties:
1628
-              NanoCPUs:
1628
+              NanoCpus:
1629 1629
                 type: "integer"
1630 1630
                 format: "int64"
1631 1631
               MemoryBytes:
... ...
@@ -2744,7 +2744,7 @@ paths:
2744 2744
                 MemorySwap: 0
2745 2745
                 MemoryReservation: 0
2746 2746
                 KernelMemory: 0
2747
-                NanoCPUs: 500000
2747
+                NanoCpus: 500000
2748 2748
                 CpuPercent: 80
2749 2749
                 CpuShares: 512
2750 2750
                 CpuPeriod: 100000
... ...
@@ -427,7 +427,7 @@ definitions:
427 427
         format: "int64"
428 428
         minimum: 0
429 429
         maximum: 100
430
-      NanoCPUs:
430
+      NanoCpus:
431 431
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
432 432
         type: "integer"
433 433
         format: "int64"
... ...
@@ -2834,7 +2834,7 @@ paths:
2834 2834
                 MemorySwap: 0
2835 2835
                 MemoryReservation: 0
2836 2836
                 KernelMemory: 0
2837
-                NanoCPUs: 500000
2837
+                NanoCpus: 500000
2838 2838
                 CpuPercent: 80
2839 2839
                 CpuShares: 512
2840 2840
                 CpuPeriod: 100000
... ...
@@ -431,7 +431,7 @@ definitions:
431 431
         format: "int64"
432 432
         minimum: 0
433 433
         maximum: 100
434
-      NanoCPUs:
434
+      NanoCpus:
435 435
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
436 436
         type: "integer"
437 437
         format: "int64"
... ...
@@ -2868,7 +2868,7 @@ paths:
2868 2868
                 MemorySwap: 0
2869 2869
                 MemoryReservation: 0
2870 2870
                 KernelMemory: 0
2871
-                NanoCPUs: 500000
2871
+                NanoCpus: 500000
2872 2872
                 CpuPercent: 80
2873 2873
                 CpuShares: 512
2874 2874
                 CpuPeriod: 100000
... ...
@@ -434,7 +434,7 @@ definitions:
434 434
         format: "int64"
435 435
         minimum: 0
436 436
         maximum: 100
437
-      NanoCPUs:
437
+      NanoCpus:
438 438
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
439 439
         type: "integer"
440 440
         format: "int64"
... ...
@@ -3074,7 +3074,7 @@ paths:
3074 3074
                 MemorySwap: 0
3075 3075
                 MemoryReservation: 0
3076 3076
                 KernelMemory: 0
3077
-                NanoCPUs: 500000
3077
+                NanoCpus: 500000
3078 3078
                 CpuPercent: 80
3079 3079
                 CpuShares: 512
3080 3080
                 CpuPeriod: 100000
... ...
@@ -435,7 +435,7 @@ definitions:
435 435
         format: "int64"
436 436
         minimum: 0
437 437
         maximum: 100
438
-      NanoCPUs:
438
+      NanoCpus:
439 439
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
440 440
         type: "integer"
441 441
         format: "int64"
... ...
@@ -3144,7 +3144,7 @@ paths:
3144 3144
                 MemorySwap: 0
3145 3145
                 MemoryReservation: 0
3146 3146
                 KernelMemory: 0
3147
-                NanoCPUs: 500000
3147
+                NanoCpus: 500000
3148 3148
                 CpuPercent: 80
3149 3149
                 CpuShares: 512
3150 3150
                 CpuPeriod: 100000
... ...
@@ -438,7 +438,7 @@ definitions:
438 438
         format: "int64"
439 439
         minimum: 0
440 440
         maximum: 100
441
-      NanoCPUs:
441
+      NanoCpus:
442 442
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
443 443
         type: "integer"
444 444
         format: "int64"
... ...
@@ -4387,7 +4387,7 @@ paths:
4387 4387
                 MemorySwap: 0
4388 4388
                 MemoryReservation: 0
4389 4389
                 KernelMemory: 0
4390
-                NanoCPUs: 500000
4390
+                NanoCpus: 500000
4391 4391
                 CpuPercent: 80
4392 4392
                 CpuShares: 512
4393 4393
                 CpuPeriod: 100000
... ...
@@ -443,7 +443,7 @@ definitions:
443 443
         format: "int64"
444 444
         minimum: 0
445 445
         maximum: 100
446
-      NanoCPUs:
446
+      NanoCpus:
447 447
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
448 448
         type: "integer"
449 449
         format: "int64"
... ...
@@ -4392,7 +4392,7 @@ paths:
4392 4392
                 MemorySwap: 0
4393 4393
                 MemoryReservation: 0
4394 4394
                 KernelMemory: 0
4395
-                NanoCPUs: 500000
4395
+                NanoCpus: 500000
4396 4396
                 CpuPercent: 80
4397 4397
                 CpuShares: 512
4398 4398
                 CpuPeriod: 100000
... ...
@@ -446,7 +446,7 @@ definitions:
446 446
         format: "int64"
447 447
         minimum: 0
448 448
         maximum: 100
449
-      NanoCPUs:
449
+      NanoCpus:
450 450
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
451 451
         type: "integer"
452 452
         format: "int64"
... ...
@@ -4421,7 +4421,7 @@ paths:
4421 4421
                 MemorySwap: 0
4422 4422
                 MemoryReservation: 0
4423 4423
                 KernelMemory: 0
4424
-                NanoCPUs: 500000
4424
+                NanoCpus: 500000
4425 4425
                 CpuPercent: 80
4426 4426
                 CpuShares: 512
4427 4427
                 CpuPeriod: 100000
... ...
@@ -436,7 +436,7 @@ definitions:
436 436
         format: "int64"
437 437
         minimum: 0
438 438
         maximum: 100
439
-      NanoCPUs:
439
+      NanoCpus:
440 440
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
441 441
         type: "integer"
442 442
         format: "int64"
... ...
@@ -4403,7 +4403,7 @@ paths:
4403 4403
                 MemorySwap: 0
4404 4404
                 MemoryReservation: 0
4405 4405
                 KernelMemory: 0
4406
-                NanoCPUs: 500000
4406
+                NanoCpus: 500000
4407 4407
                 CpuPercent: 80
4408 4408
                 CpuShares: 512
4409 4409
                 CpuPeriod: 100000
... ...
@@ -436,7 +436,7 @@ definitions:
436 436
         format: "int64"
437 437
         minimum: 0
438 438
         maximum: 100
439
-      NanoCPUs:
439
+      NanoCpus:
440 440
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
441 441
         type: "integer"
442 442
         format: "int64"
... ...
@@ -4416,7 +4416,7 @@ paths:
4416 4416
                 MemorySwap: 0
4417 4417
                 MemoryReservation: 0
4418 4418
                 KernelMemory: 0
4419
-                NanoCPUs: 500000
4419
+                NanoCpus: 500000
4420 4420
                 CpuPercent: 80
4421 4421
                 CpuShares: 512
4422 4422
                 CpuPeriod: 100000
... ...
@@ -436,7 +436,7 @@ definitions:
436 436
         format: "int64"
437 437
         minimum: 0
438 438
         maximum: 100
439
-      NanoCPUs:
439
+      NanoCpus:
440 440
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
441 441
         type: "integer"
442 442
         format: "int64"
... ...
@@ -4436,7 +4436,7 @@ paths:
4436 4436
                 MemorySwap: 0
4437 4437
                 MemoryReservation: 0
4438 4438
                 KernelMemory: 0
4439
-                NanoCPUs: 500000
4439
+                NanoCpus: 500000
4440 4440
                 CpuPercent: 80
4441 4441
                 CpuShares: 512
4442 4442
                 CpuPeriod: 100000
... ...
@@ -437,7 +437,7 @@ definitions:
437 437
         format: "int64"
438 438
         minimum: 0
439 439
         maximum: 100
440
-      NanoCPUs:
440
+      NanoCpus:
441 441
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
442 442
         type: "integer"
443 443
         format: "int64"
... ...
@@ -4490,7 +4490,7 @@ paths:
4490 4490
                 MemorySwap: 0
4491 4491
                 MemoryReservation: 0
4492 4492
                 KernelMemory: 0
4493
-                NanoCPUs: 500000
4493
+                NanoCpus: 500000
4494 4494
                 CpuPercent: 80
4495 4495
                 CpuShares: 512
4496 4496
                 CpuPeriod: 100000
... ...
@@ -505,7 +505,7 @@ definitions:
505 505
         format: "int64"
506 506
         minimum: 0
507 507
         maximum: 100
508
-      NanoCPUs:
508
+      NanoCpus:
509 509
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
510 510
         type: "integer"
511 511
         format: "int64"
... ...
@@ -5185,7 +5185,7 @@ paths:
5185 5185
                 MemorySwap: 0
5186 5186
                 MemoryReservation: 0
5187 5187
                 KernelMemory: 0
5188
-                NanoCPUs: 500000
5188
+                NanoCpus: 500000
5189 5189
                 CpuPercent: 80
5190 5190
                 CpuShares: 512
5191 5191
                 CpuPeriod: 100000
... ...
@@ -554,7 +554,7 @@ definitions:
554 554
         format: "int64"
555 555
         minimum: 0
556 556
         maximum: 100
557
-      NanoCPUs:
557
+      NanoCpus:
558 558
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
559 559
         type: "integer"
560 560
         format: "int64"
... ...
@@ -5308,7 +5308,7 @@ paths:
5308 5308
                 MemorySwap: 0
5309 5309
                 MemoryReservation: 0
5310 5310
                 KernelMemory: 0
5311
-                NanoCPUs: 500000
5311
+                NanoCpus: 500000
5312 5312
                 CpuPercent: 80
5313 5313
                 CpuShares: 512
5314 5314
                 CpuPeriod: 100000
... ...
@@ -560,7 +560,7 @@ definitions:
560 560
         format: "int64"
561 561
         minimum: 0
562 562
         maximum: 100
563
-      NanoCPUs:
563
+      NanoCpus:
564 564
         description: "CPU quota in units of 10<sup>-9</sup> CPUs."
565 565
         type: "integer"
566 566
         format: "int64"
... ...
@@ -5466,7 +5466,7 @@ paths:
5466 5466
                 MemorySwap: 0
5467 5467
                 MemoryReservation: 0
5468 5468
                 KernelMemory: 0
5469
-                NanoCPUs: 500000
5469
+                NanoCpus: 500000
5470 5470
                 CpuPercent: 80
5471 5471
                 CpuShares: 512
5472 5472
                 CpuPeriod: 100000
... ...
@@ -332,7 +332,7 @@ keywords: "API, Docker, rcli, REST, documentation"
332 332
 * `POST /services/create` and `POST /services/(id or name)/update` now accept a `rollback` value for `FailureAction`.
333 333
 * `POST /services/create` and `POST /services/(id or name)/update` now accept an optional `RollbackConfig` object which specifies rollback options.
334 334
 * `GET /services` now supports a `mode` filter to filter services based on the service mode (either `global` or `replicated`).
335
-* `POST /containers/(name)/update` now supports updating `NanoCPUs` that represents CPU quota in units of 10<sup>-9</sup> CPUs.
335
+* `POST /containers/(name)/update` now supports updating `NanoCpus` that represents CPU quota in units of 10<sup>-9</sup> CPUs.
336 336
 
337 337
 ## v1.27 API changes
338 338
 
... ...
@@ -388,7 +388,7 @@ keywords: "API, Docker, rcli, REST, documentation"
388 388
 * The `hostConfig` option now accepts the fields `CpuRealtimePeriod` and `CpuRtRuntime` to allocate cpu runtime to rt tasks when `CONFIG_RT_GROUP_SCHED` is enabled in the kernel.
389 389
 * The `SecurityOptions` field within the `GET /info` response now includes `userns` if user namespaces are enabled in the daemon.
390 390
 * `GET /nodes` and `GET /node/(id or name)` now return `Addr` as part of a node's `Status`, which is the address that that node connects to the manager from.
391
-* The `HostConfig` field now includes `NanoCPUs` that represents CPU quota in units of 10<sup>-9</sup> CPUs.
391
+* The `HostConfig` field now includes `NanoCpus` that represents CPU quota in units of 10<sup>-9</sup> CPUs.
392 392
 * `GET /info` now returns more structured information about security options.
393 393
 * The `HostConfig` field now includes `CpuCount` that represents the number of CPUs available for execution by the container. Windows daemon only.
394 394
 * `POST /services/create` and `POST /services/(id or name)/update` now accept the `TTY` parameter, which allocate a pseudo-TTY in container.