Selaa lähdekoodia

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

Update service networks documentation
Brian Goff 5 vuotta sitten
vanhempi
commit
6f8c671d70
1 muutettua tiedostoa jossa 23 lisäystä ja 17 poistoa
  1. 23 17
      api/swagger.yaml

+ 23 - 17
api/swagger.yaml

@@ -2995,16 +2995,10 @@ definitions:
         description: "Runtime is the type of runtime specified for the task executor."
         description: "Runtime is the type of runtime specified for the task executor."
         type: "string"
         type: "string"
       Networks:
       Networks:
+        description: "Specifies which networks the service should attach to."
         type: "array"
         type: "array"
         items:
         items:
-          type: "object"
-          properties:
-            Target:
-              type: "string"
-            Aliases:
-              type: "array"
-              items:
-                type: "string"
+          $ref: "#/definitions/NetworkAttachmentConfig"
       LogDriver:
       LogDriver:
         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."
         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."
         type: "object"
         type: "object"
@@ -3250,17 +3244,11 @@ definitions:
               - "stop-first"
               - "stop-first"
               - "start-first"
               - "start-first"
       Networks:
       Networks:
-        description: "Array of network names or IDs to attach the service to."
+        description: "Specifies which networks the service should attach to."
         type: "array"
         type: "array"
         items:
         items:
-          type: "object"
-          properties:
-            Target:
-              type: "string"
-            Aliases:
-              type: "array"
-              items:
-                type: "string"
+          $ref: "#/definitions/NetworkAttachmentConfig"
+
       EndpointSpec:
       EndpointSpec:
         $ref: "#/definitions/EndpointSpec"
         $ref: "#/definitions/EndpointSpec"
 
 
@@ -4464,6 +4452,24 @@ definitions:
           IP address and ports at which this node can be reached.
           IP address and ports at which this node can be reached.
         type: "string"
         type: "string"
 
 
+  NetworkAttachmentConfig:
+    description: "Specifies how a service should be attached to a particular network."
+    type: "object"
+    properties:
+      Target:
+        description: "The target network for attachment. Must be a network name or ID."
+        type: "string"
+      Aliases:
+        description: "Discoverable alternate names for the service on this network."
+        type: "array"
+        items:
+          type: "string"
+      DriverOpts:
+        description: "Driver attachment options for the network target"
+        type: "object"
+        additionalProperties:
+          type: "string"
+
 paths:
 paths:
   /containers/json:
   /containers/json:
     get:
     get: