Browse code

Merge pull request #39495 from hannseman/network-attachment-config-docs

Update service networks documentation

Brian Goff authored on 2019/11/06 04:24:47
Showing 1 changed files
... ...
@@ -2995,16 +2995,10 @@ definitions:
2995 2995
         description: "Runtime is the type of runtime specified for the task executor."
2996 2996
         type: "string"
2997 2997
       Networks:
2998
+        description: "Specifies which networks the service should attach to."
2998 2999
         type: "array"
2999 3000
         items:
3000
-          type: "object"
3001
-          properties:
3002
-            Target:
3003
-              type: "string"
3004
-            Aliases:
3005
-              type: "array"
3006
-              items:
3007
-                type: "string"
3001
+          $ref: "#/definitions/NetworkAttachmentConfig"
3008 3002
       LogDriver:
3009 3003
         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."
3010 3004
         type: "object"
... ...
@@ -3250,17 +3244,11 @@ definitions:
3250 3250
               - "stop-first"
3251 3251
               - "start-first"
3252 3252
       Networks:
3253
-        description: "Array of network names or IDs to attach the service to."
3253
+        description: "Specifies which networks the service should attach to."
3254 3254
         type: "array"
3255 3255
         items:
3256
-          type: "object"
3257
-          properties:
3258
-            Target:
3259
-              type: "string"
3260
-            Aliases:
3261
-              type: "array"
3262
-              items:
3263
-                type: "string"
3256
+          $ref: "#/definitions/NetworkAttachmentConfig"
3257
+
3264 3258
       EndpointSpec:
3265 3259
         $ref: "#/definitions/EndpointSpec"
3266 3260
 
... ...
@@ -4464,6 +4452,24 @@ definitions:
4464 4464
           IP address and ports at which this node can be reached.
4465 4465
         type: "string"
4466 4466
 
4467
+  NetworkAttachmentConfig:
4468
+    description: "Specifies how a service should be attached to a particular network."
4469
+    type: "object"
4470
+    properties:
4471
+      Target:
4472
+        description: "The target network for attachment. Must be a network name or ID."
4473
+        type: "string"
4474
+      Aliases:
4475
+        description: "Discoverable alternate names for the service on this network."
4476
+        type: "array"
4477
+        items:
4478
+          type: "string"
4479
+      DriverOpts:
4480
+        description: "Driver attachment options for the network target"
4481
+        type: "object"
4482
+        additionalProperties:
4483
+          type: "string"
4484
+
4467 4485
 paths:
4468 4486
   /containers/json:
4469 4487
     get: