Browse code

API: omit classic swarm "SystemStatus" field if empty

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2020/01/03 20:28:23
Showing 3 changed files
... ...
@@ -3717,44 +3717,6 @@ definitions:
3717 3717
           on Windows.
3718 3718
         type: "string"
3719 3719
         example: "/var/lib/docker"
3720
-      SystemStatus:
3721
-        description: |
3722
-          Status information about this node (standalone Swarm API).
3723
-
3724
-          <p><br /></p>
3725
-
3726
-          > **Note**: The information returned in this field is only propagated
3727
-          > by the Swarm standalone API, and is empty (`null`) when using
3728
-          > built-in swarm mode.
3729
-        type: "array"
3730
-        items:
3731
-          type: "array"
3732
-          items:
3733
-            type: "string"
3734
-        example:
3735
-          - ["Role", "primary"]
3736
-          - ["State", "Healthy"]
3737
-          - ["Strategy", "spread"]
3738
-          - ["Filters", "health, port, containerslots, dependency, affinity, constraint, whitelist"]
3739
-          - ["Nodes", "2"]
3740
-          - [" swarm-agent-00", "192.168.99.102:2376"]
3741
-          - ["  └ ID", "5CT6:FBGO:RVGO:CZL4:PB2K:WCYN:2JSV:KSHH:GGFW:QOPG:6J5Q:IOZ2|192.168.99.102:2376"]
3742
-          - ["  └ Status", "Healthy"]
3743
-          - ["  └ Containers", "1 (1 Running, 0 Paused, 0 Stopped)"]
3744
-          - ["  └ Reserved CPUs", "0 / 1"]
3745
-          - ["  └ Reserved Memory", "0 B / 1.021 GiB"]
3746
-          - ["  └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"]
3747
-          - ["  └ UpdatedAt", "2017-08-09T10:03:46Z"]
3748
-          - ["  └ ServerVersion", "17.06.0-ce"]
3749
-          - [" swarm-manager", "192.168.99.101:2376"]
3750
-          - ["  └ ID", "TAMD:7LL3:SEF7:LW2W:4Q2X:WVFH:RTXX:JSYS:XY2P:JEHL:ZMJK:JGIW|192.168.99.101:2376"]
3751
-          - ["  └ Status", "Healthy"]
3752
-          - ["  └ Containers", "2 (2 Running, 0 Paused, 0 Stopped)"]
3753
-          - ["  └ Reserved CPUs", "0 / 1"]
3754
-          - ["  └ Reserved Memory", "0 B / 1.021 GiB"]
3755
-          - ["  └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"]
3756
-          - ["  └ UpdatedAt", "2017-08-09T10:04:11Z"]
3757
-          - ["  └ ServerVersion", "17.06.0-ce"]
3758 3720
       Plugins:
3759 3721
         $ref: "#/definitions/PluginsInfo"
3760 3722
       MemoryLimit:
... ...
@@ -154,7 +154,7 @@ type Info struct {
154 154
 	Images             int
155 155
 	Driver             string
156 156
 	DriverStatus       [][2]string
157
-	SystemStatus       [][2]string // SystemStatus is only propagated by the Swarm standalone API
157
+	SystemStatus       [][2]string `json:",omitempty"` // SystemStatus is only propagated by the Swarm standalone API
158 158
 	Plugins            PluginsInfo
159 159
 	MemoryLimit        bool
160 160
 	SwapLimit          bool
... ...
@@ -31,6 +31,9 @@ keywords: "API, Docker, rcli, REST, documentation"
31 31
 * `GET /info` now  returns an `OSVersion` field, containing the operating system's
32 32
   version. This change is not versioned, and affects all API versions if the daemon
33 33
   has this patch.
34
+* `GET /info` no longer returns the `SystemStatus` field if it does not have a
35
+  value set. This change is not versioned, and affects all API versions if the
36
+  daemon has this patch.
34 37
 * `GET /services` now accepts query parameter `status`. When set `true`,
35 38
   services returned will include `ServiceStatus`, which provides Desired and
36 39
   Running task counts for the service.