Browse code

Merge pull request #31203 from yongtang/02202017-Swagger-ContainerSpec

Add missing fields in Swagger docs
(cherry picked from commit 19cd2aa389dff922589fe83fc2c48f0477a36617)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Victor Vieux authored on 2017/02/23 08:54:23
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"
... ...
@@ -1837,6 +1840,11 @@ definitions:
1837 1837
           Image:
1838 1838
             description: "The image name to use for the container."
1839 1839
             type: "string"
1840
+          Labels:
1841
+            description: "User-defined key/value data."
1842
+            type: "object"
1843
+            additionalProperties:
1844
+              type: "string"
1840 1845
           Command:
1841 1846
             description: "The command to be run in the image."
1842 1847
             type: "array"
... ...
@@ -1847,6 +1855,9 @@ definitions:
1847 1847
             type: "array"
1848 1848
             items:
1849 1849
               type: "string"
1850
+          Hostname:
1851
+            description: "The hostname to use for the container, as a valid RFC 1123 hostname."
1852
+            type: "string"
1850 1853
           Env:
1851 1854
             description: "A list of environment variables in the form `VAR=value`."
1852 1855
             type: "array"
... ...
@@ -1858,14 +1869,20 @@ definitions:
1858 1858
           User:
1859 1859
             description: "The user inside the container."
1860 1860
             type: "string"
1861
-          Labels:
1862
-            description: "User-defined key/value data."
1863
-            type: "object"
1864
-            additionalProperties:
1861
+          Groups:
1862
+            type: "array"
1863
+            description: "A list of additional groups that the container process will run as."
1864
+            items:
1865 1865
               type: "string"
1866 1866
           TTY:
1867 1867
             description: "Whether a pseudo-TTY should be allocated."
1868 1868
             type: "boolean"
1869
+          OpenStdin:
1870
+            description: "Open `stdin`"
1871
+            type: "boolean"
1872
+          ReadOnly:
1873
+            description: "Mount the container's root filesystem as read only."
1874
+            type: "boolean"
1869 1875
           Mounts:
1870 1876
             description: "Specification for mounts to be added to containers created as part of the service."
1871 1877
             type: "array"
... ...
@@ -1875,6 +1892,17 @@ definitions:
1875 1875
             description: "Amount of time to wait for the container to terminate before forcefully killing it."
1876 1876
             type: "integer"
1877 1877
             format: "int64"
1878
+          HealthCheck:
1879
+            $ref: "#/definitions/HealthConfig"
1880
+          Hosts:
1881
+            type: "array"
1882
+            description: |
1883
+              A list of hostnames/IP mappings to add to the container's `/etc/hosts` file.
1884
+              The format of extra hosts on swarmkit is specified in:
1885
+              http://man7.org/linux/man-pages/man5/hosts.5.html
1886
+                IP_address canonical_hostname [aliases...]
1887
+            items:
1888
+              type: "string"
1878 1889
           DNSConfig:
1879 1890
             description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)."
1880 1891
             type: "object"