Browse code

Update service networks documentation

The previous description stated that an array of names / ids could be passed when the API in reality expects objects in the form of NetworkAttachmentConfig. This is fixed by updating the description and adding a definition for NetworkAttachmentConfig.

Signed-off-by: Hannes Ljungberg <hannes@5monkeys.se>
(cherry picked from commit 4d09fab232ed282d020afbe1e0935b53379df4ad)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Hannes Ljungberg authored on 2019/07/11 23:12:52
Showing 1 changed files
... ...
@@ -3002,16 +3002,10 @@ definitions:
3002 3002
         description: "Runtime is the type of runtime specified for the task executor."
3003 3003
         type: "string"
3004 3004
       Networks:
3005
+        description: "Specifies which networks the service should attach to."
3005 3006
         type: "array"
3006 3007
         items:
3007
-          type: "object"
3008
-          properties:
3009
-            Target:
3010
-              type: "string"
3011
-            Aliases:
3012
-              type: "array"
3013
-              items:
3014
-                type: "string"
3008
+          $ref: "#/definitions/NetworkAttachmentConfig"
3015 3009
       LogDriver:
3016 3010
         description: "Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified."
3017 3011
         type: "object"
... ...
@@ -3257,17 +3251,11 @@ definitions:
3257 3257
               - "stop-first"
3258 3258
               - "start-first"
3259 3259
       Networks:
3260
-        description: "Array of network names or IDs to attach the service to."
3260
+        description: "Specifies which networks the service should attach to."
3261 3261
         type: "array"
3262 3262
         items:
3263
-          type: "object"
3264
-          properties:
3265
-            Target:
3266
-              type: "string"
3267
-            Aliases:
3268
-              type: "array"
3269
-              items:
3270
-                type: "string"
3263
+          $ref: "#/definitions/NetworkAttachmentConfig"
3264
+
3271 3265
       EndpointSpec:
3272 3266
         $ref: "#/definitions/EndpointSpec"
3273 3267
 
... ...
@@ -4439,6 +4427,24 @@ definitions:
4439 4439
           IP address and ports at which this node can be reached.
4440 4440
         type: "string"
4441 4441
 
4442
+  NetworkAttachmentConfig:
4443
+    description: "Specifies how a service should be attached to a particular network."
4444
+    type: "object"
4445
+    properties:
4446
+      Target:
4447
+        description: "The target network for attachment. Must be a network name or ID."
4448
+        type: "string"
4449
+      Aliases:
4450
+        description: "Discoverable alternate names for the service on this network."
4451
+        type: "array"
4452
+        items:
4453
+          type: "string"
4454
+      DriverOpts:
4455
+        description: "Driver attachment options for the network target"
4456
+        type: "object"
4457
+        additionalProperties:
4458
+          type: "string"
4459
+
4442 4460
 paths:
4443 4461
   /containers/json:
4444 4462
     get: