Browse code

swagger: sync updates to v1.40

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

Sebastiaan van Stijn authored on 2020/07/23 20:35:54
Showing 1 changed files
... ...
@@ -1202,6 +1202,42 @@ definitions:
1202 1202
         items:
1203 1203
           type: "string"
1204 1204
 
1205
+  NetworkingConfig:
1206
+    description: |
1207
+      NetworkingConfig represents the container's networking configuration for
1208
+      each of its interfaces.
1209
+      It is used for the networking configs specified in the `docker create`
1210
+      and `docker network connect` commands.
1211
+    type: "object"
1212
+    properties:
1213
+      EndpointsConfig:
1214
+        description: |
1215
+          A mapping of network name to endpoint configuration for that network.
1216
+        type: "object"
1217
+        additionalProperties:
1218
+          $ref: "#/definitions/EndpointSettings"
1219
+    example:
1220
+      # putting an example here, instead of using the example values from
1221
+      # /definitions/EndpointSettings, because containers/create currently
1222
+      # does not support attaching to multiple networks, so the example request
1223
+      # would be confusing if it showed that multiple networks can be contained
1224
+      # in the EndpointsConfig.
1225
+      # TODO remove once we support multiple networks on container create (see https://github.com/moby/moby/blob/07e6b843594e061f82baa5fa23c2ff7d536c2a05/daemon/create.go#L323)
1226
+      EndpointsConfig:
1227
+        isolated_nw:
1228
+          IPAMConfig:
1229
+            IPv4Address: "172.20.30.33"
1230
+            IPv6Address: "2001:db8:abcd::3033"
1231
+            LinkLocalIPs:
1232
+              - "169.254.34.68"
1233
+              - "fe80::3468"
1234
+          Links:
1235
+            - "container_1"
1236
+            - "container_2"
1237
+          Aliases:
1238
+            - "server_x"
1239
+            - "server_y"
1240
+
1205 1241
   NetworkSettings:
1206 1242
     description: "NetworkSettings exposes the network settings in the API"
1207 1243
     type: "object"
... ...
@@ -5123,16 +5159,7 @@ paths:
5123 5123
                   HostConfig:
5124 5124
                     $ref: "#/definitions/HostConfig"
5125 5125
                   NetworkingConfig:
5126
-                    description: "This container's networking configuration."
5127
-                    type: "object"
5128
-                    properties:
5129
-                      EndpointsConfig:
5130
-                        description: |
5131
-                          A mapping of network name to endpoint configuration
5132
-                          for that network.
5133
-                        type: "object"
5134
-                        additionalProperties:
5135
-                          $ref: "#/definitions/EndpointSettings"
5126
+                    $ref: "#/definitions/NetworkingConfig"
5136 5127
             example:
5137 5128
               Hostname: ""
5138 5129
               Domainname: ""
... ...
@@ -5194,6 +5221,14 @@ paths:
5194 5194
                   - {}
5195 5195
                 BlkioDeviceWriteIOps:
5196 5196
                   - {}
5197
+                DeviceRequests:
5198
+                  - Driver: "nvidia"
5199
+                    Count: -1
5200
+                    DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"]
5201
+                    Capabilities: [["gpu", "nvidia", "compute"]]
5202
+                    Options:
5203
+                      property1: "string"
5204
+                      property2: "string"
5197 5205
                 MemorySwappiness: 60
5198 5206
                 OomKillDisable: false
5199 5207
                 OomScoreAdj: 500
... ...
@@ -5328,7 +5363,7 @@ paths:
5328 5328
                 x-nullable: true
5329 5329
                 $ref: "#/definitions/ContainerState"
5330 5330
               Image:
5331
-                description: "The container's image"
5331
+                description: "The container's image ID"
5332 5332
                 type: "string"
5333 5333
               ResolvConfPath:
5334 5334
                 type: "string"
... ...
@@ -5447,6 +5482,14 @@ paths:
5447 5447
                 CpuRealtimePeriod: 1000000
5448 5448
                 CpuRealtimeRuntime: 10000
5449 5449
                 Devices: []
5450
+                DeviceRequests:
5451
+                  - Driver: "nvidia"
5452
+                    Count: -1
5453
+                    DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"]
5454
+                    Capabilities: [["gpu", "nvidia", "compute"]]
5455
+                    Options:
5456
+                      property1: "string"
5457
+                      property2: "string"
5450 5458
                 IpcMode: ""
5451 5459
                 LxcConf: []
5452 5460
                 Memory: 0
... ...
@@ -5818,6 +5861,16 @@ paths:
5818 5818
         If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is
5819 5819
         nil then for compatibility with older daemons the length of the
5820 5820
         corresponding `cpu_usage.percpu_usage` array should be used.
5821
+
5822
+        To calculate the values shown by the `stats` command of the docker cli tool
5823
+        the following formulas can be used:
5824
+        * used_memory = `memory_stats.usage - memory_stats.stats.cache`
5825
+        * available_memory = `memory_stats.limit`
5826
+        * Memory usage % = `(used_memory / available_memory) * 100.0`
5827
+        * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`
5828
+        * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`
5829
+        * number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus`
5830
+        * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0`
5821 5831
       operationId: "ContainerStats"
5822 5832
       produces: ["application/json"]
5823 5833
       responses: