Browse code

Merge pull request #31275 from thaJeztah/17.03-swagger-cherry-picks

17.03 swagger cherry picks

Victor Vieux authored on 2017/02/23 11:26:57
Showing 1 changed files
... ...
@@ -468,6 +468,31 @@ definitions:
468 468
         type: "integer"
469 469
         format: "int64"
470 470
 
471
+  HealthConfig:
472
+    description: "A test to perform to check that the container is healthy."
473
+    type: "object"
474
+    properties:
475
+      Test:
476
+        description: |
477
+          The test to perform. Possible values are:
478
+
479
+          - `{}` inherit healthcheck from image or parent image
480
+          - `{"NONE"}` disable healthcheck
481
+          - `{"CMD", args...}` exec arguments directly
482
+          - `{"CMD-SHELL", command}` run command with system's default shell
483
+        type: "array"
484
+        items:
485
+          type: "string"
486
+      Interval:
487
+        description: "The time to wait between checks in nanoseconds. 0 means inherit."
488
+        type: "integer"
489
+      Timeout:
490
+        description: "The time to wait before considering the check to have hung. 0 means inherit."
491
+        type: "integer"
492
+      Retries:
493
+        description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit."
494
+        type: "integer"
495
+
471 496
   HostConfig:
472 497
     description: "Container configuration that depends on the host we are running on"
473 498
     allOf:
... ...
@@ -727,29 +752,7 @@ definitions:
727 727
         items:
728 728
           type: "string"
729 729
       Healthcheck:
730
-        description: "A test to perform to check that the container is healthy."
731
-        type: "object"
732
-        properties:
733
-          Test:
734
-            description: |
735
-              The test to perform. Possible values are:
736
-
737
-              - `{}` inherit healthcheck from image or parent image
738
-              - `{"NONE"}` disable healthcheck
739
-              - `{"CMD", args...}` exec arguments directly
740
-              - `{"CMD-SHELL", command}` run command with system's default shell
741
-            type: "array"
742
-            items:
743
-              type: "string"
744
-          Interval:
745
-            description: "The time to wait between checks in nanoseconds. 0 means inherit."
746
-            type: "integer"
747
-          Timeout:
748
-            description: "The time to wait before considering the check to have hung. 0 means inherit."
749
-            type: "integer"
750
-          Retries:
751
-            description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit."
752
-            type: "integer"
730
+        $ref: "#/definitions/HealthConfig"
753 731
       ArgsEscaped:
754 732
         description: "Command is already escaped (Windows only)"
755 733
         type: "boolean"
... ...
@@ -1544,6 +1547,21 @@ definitions:
1544 1544
           Settable: null
1545 1545
           Value: []
1546 1546
 
1547
+  ObjectVersion:
1548
+    description: |
1549
+      The version number of the object such as node, service, etc. This is needed to avoid conflicting writes.
1550
+      The client must send the version number along with the modified specification when updating these objects.
1551
+      This approach ensures safe concurrency and determinism in that the change on the object
1552
+      may not be applied if the version number has changed from the last read. In other words,
1553
+      if two update requests specify the same base version, only one of the requests can succeed.
1554
+      As a result, two separate update requests that happen at the same time will not
1555
+      unintentially overwrite each other.
1556
+    type: "object"
1557
+    properties:
1558
+      Index:
1559
+        type: "integer"
1560
+        format: "int64"
1561
+
1547 1562
   NodeSpec:
1548 1563
     type: "object"
1549 1564
     properties:
... ...
@@ -1580,11 +1598,7 @@ definitions:
1580 1580
       ID:
1581 1581
         type: "string"
1582 1582
       Version:
1583
-        type: "object"
1584
-        properties:
1585
-          Index:
1586
-            type: "integer"
1587
-            format: "int64"
1583
+        $ref: "#/definitions/ObjectVersion"
1588 1584
       CreatedAt:
1589 1585
         type: "string"
1590 1586
         format: "dateTime"
... ...
@@ -1807,11 +1821,7 @@ definitions:
1807 1807
         description: "The ID of the swarm."
1808 1808
         type: "string"
1809 1809
       Version:
1810
-        type: "object"
1811
-        properties:
1812
-          Index:
1813
-            type: "integer"
1814
-            format: "int64"
1810
+        $ref: "#/definitions/ObjectVersion"
1815 1811
       CreatedAt:
1816 1812
         type: "string"
1817 1813
         format: "dateTime"
... ...
@@ -1830,6 +1840,11 @@ definitions:
1830 1830
           Image:
1831 1831
             description: "The image name to use for the container."
1832 1832
             type: "string"
1833
+          Labels:
1834
+            description: "User-defined key/value data."
1835
+            type: "object"
1836
+            additionalProperties:
1837
+              type: "string"
1833 1838
           Command:
1834 1839
             description: "The command to be run in the image."
1835 1840
             type: "array"
... ...
@@ -1840,6 +1855,9 @@ definitions:
1840 1840
             type: "array"
1841 1841
             items:
1842 1842
               type: "string"
1843
+          Hostname:
1844
+            description: "The hostname to use for the container, as a valid RFC 1123 hostname."
1845
+            type: "string"
1843 1846
           Env:
1844 1847
             description: "A list of environment variables in the form `VAR=value`."
1845 1848
             type: "array"
... ...
@@ -1851,14 +1869,20 @@ definitions:
1851 1851
           User:
1852 1852
             description: "The user inside the container."
1853 1853
             type: "string"
1854
-          Labels:
1855
-            description: "User-defined key/value data."
1856
-            type: "object"
1857
-            additionalProperties:
1854
+          Groups:
1855
+            type: "array"
1856
+            description: "A list of additional groups that the container process will run as."
1857
+            items:
1858 1858
               type: "string"
1859 1859
           TTY:
1860 1860
             description: "Whether a pseudo-TTY should be allocated."
1861 1861
             type: "boolean"
1862
+          OpenStdin:
1863
+            description: "Open `stdin`"
1864
+            type: "boolean"
1865
+          ReadOnly:
1866
+            description: "Mount the container's root filesystem as read only."
1867
+            type: "boolean"
1862 1868
           Mounts:
1863 1869
             description: "Specification for mounts to be added to containers created as part of the service."
1864 1870
             type: "array"
... ...
@@ -1868,6 +1892,17 @@ definitions:
1868 1868
             description: "Amount of time to wait for the container to terminate before forcefully killing it."
1869 1869
             type: "integer"
1870 1870
             format: "int64"
1871
+          HealthCheck:
1872
+            $ref: "#/definitions/HealthConfig"
1873
+          Hosts:
1874
+            type: "array"
1875
+            description: |
1876
+              A list of hostnames/IP mappings to add to the container's `/etc/hosts` file.
1877
+              The format of extra hosts on swarmkit is specified in:
1878
+              http://man7.org/linux/man-pages/man5/hosts.5.html
1879
+                IP_address canonical_hostname [aliases...]
1880
+            items:
1881
+              type: "string"
1871 1882
           DNSConfig:
1872 1883
             description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)."
1873 1884
             type: "object"
... ...
@@ -1887,6 +1922,38 @@ definitions:
1887 1887
                 type: "array"
1888 1888
                 items:
1889 1889
                   type: "string"
1890
+          Secrets:
1891
+            description: "Secrets contains references to zero or more secrets that will be exposed to the service."
1892
+            type: "array"
1893
+            items:
1894
+              type: "object"
1895
+              properties:
1896
+                File:
1897
+                  description: "File represents a specific target that is backed by a file."
1898
+                  type: "object"
1899
+                  properties:
1900
+                    Name:
1901
+                      description: "Name represents the final filename in the filesystem."
1902
+                      type: "string"
1903
+                    UID:
1904
+                      description: "UID represents the file UID."
1905
+                      type: "string"
1906
+                    GID:
1907
+                      description: "GID represents the file GID."
1908
+                      type: "string"
1909
+                    Mode:
1910
+                      description: "Mode represents the FileMode of the file."
1911
+                      type: "integer"
1912
+                      format: "uint32"
1913
+                SecretID:
1914
+                  description: "SecretID represents the ID of the specific secret that we're referencing."
1915
+                  type: "string"
1916
+                SecretName:
1917
+                  description: |
1918
+                    SecretName is the name of the secret that this references, but this is just provided for
1919
+                    lookup/display purposes. The secret in the reference will be identified by its ID.
1920
+                  type: "string"
1921
+
1890 1922
       Resources:
1891 1923
         description: "Resource requirements which apply to each individual container created as part of the service."
1892 1924
         type: "object"
... ...
@@ -1994,11 +2061,7 @@ definitions:
1994 1994
         description: "The ID of the task."
1995 1995
         type: "string"
1996 1996
       Version:
1997
-        type: "object"
1998
-        properties:
1999
-          Index:
2000
-            type: "integer"
2001
-            format: "int64"
1997
+        $ref: "#/definitions/ObjectVersion"
2002 1998
       CreatedAt:
2003 1999
         type: "string"
2004 2000
         format: "dateTime"
... ...
@@ -2206,11 +2269,7 @@ definitions:
2206 2206
       ID:
2207 2207
         type: "string"
2208 2208
       Version:
2209
-        type: "object"
2210
-        properties:
2211
-          Index:
2212
-            type: "integer"
2213
-            format: "int64"
2209
+        $ref: "#/definitions/ObjectVersion"
2214 2210
       CreatedAt:
2215 2211
         type: "string"
2216 2212
         format: "dateTime"
... ...
@@ -2418,11 +2477,7 @@ definitions:
2418 2418
       ID:
2419 2419
         type: "string"
2420 2420
       Version:
2421
-        type: "object"
2422
-        properties:
2423
-          Index:
2424
-            type: "integer"
2425
-            format: "int64"
2421
+        $ref: "#/definitions/ObjectVersion"
2426 2422
       CreatedAt:
2427 2423
         type: "string"
2428 2424
         format: "dateTime"