Browse code

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

Add missing fields in Swagger docs

Victor Vieux authored on 2017/02/23 08:54:23
Showing 1 changed files
... ...
@@ -469,6 +469,31 @@ definitions:
469 469
         type: "integer"
470 470
         format: "int64"
471 471
 
472
+  HealthConfig:
473
+    description: "A test to perform to check that the container is healthy."
474
+    type: "object"
475
+    properties:
476
+      Test:
477
+        description: |
478
+          The test to perform. Possible values are:
479
+
480
+          - `{}` inherit healthcheck from image or parent image
481
+          - `{"NONE"}` disable healthcheck
482
+          - `{"CMD", args...}` exec arguments directly
483
+          - `{"CMD-SHELL", command}` run command with system's default shell
484
+        type: "array"
485
+        items:
486
+          type: "string"
487
+      Interval:
488
+        description: "The time to wait between checks in nanoseconds. It should be 0 or not less than 1000000000(1s). 0 means inherit."
489
+        type: "integer"
490
+      Timeout:
491
+        description: "The time to wait before considering the check to have hung. It should be 0 or not less than 1000000000(1s). 0 means inherit."
492
+        type: "integer"
493
+      Retries:
494
+        description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit."
495
+        type: "integer"
496
+
472 497
   HostConfig:
473 498
     description: "Container configuration that depends on the host we are running on"
474 499
     allOf:
... ...
@@ -728,29 +753,7 @@ definitions:
728 728
         items:
729 729
           type: "string"
730 730
       Healthcheck:
731
-        description: "A test to perform to check that the container is healthy."
732
-        type: "object"
733
-        properties:
734
-          Test:
735
-            description: |
736
-              The test to perform. Possible values are:
737
-
738
-              - `{}` inherit healthcheck from image or parent image
739
-              - `{"NONE"}` disable healthcheck
740
-              - `{"CMD", args...}` exec arguments directly
741
-              - `{"CMD-SHELL", command}` run command with system's default shell
742
-            type: "array"
743
-            items:
744
-              type: "string"
745
-          Interval:
746
-            description: "The time to wait between checks in nanoseconds. It should be 0 or not less than 1000000000(1s). 0 means inherit."
747
-            type: "integer"
748
-          Timeout:
749
-            description: "The time to wait before considering the check to have hung. It should be 0 or not less than 1000000000(1s). 0 means inherit."
750
-            type: "integer"
751
-          Retries:
752
-            description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit."
753
-            type: "integer"
731
+        $ref: "#/definitions/HealthConfig"
754 732
       ArgsEscaped:
755 733
         description: "Command is already escaped (Windows only)"
756 734
         type: "boolean"
... ...
@@ -1870,6 +1873,11 @@ definitions:
1870 1870
           Image:
1871 1871
             description: "The image name to use for the container."
1872 1872
             type: "string"
1873
+          Labels:
1874
+            description: "User-defined key/value data."
1875
+            type: "object"
1876
+            additionalProperties:
1877
+              type: "string"
1873 1878
           Command:
1874 1879
             description: "The command to be run in the image."
1875 1880
             type: "array"
... ...
@@ -1880,6 +1888,9 @@ definitions:
1880 1880
             type: "array"
1881 1881
             items:
1882 1882
               type: "string"
1883
+          Hostname:
1884
+            description: "The hostname to use for the container, as a valid RFC 1123 hostname."
1885
+            type: "string"
1883 1886
           Env:
1884 1887
             description: "A list of environment variables in the form `VAR=value`."
1885 1888
             type: "array"
... ...
@@ -1891,14 +1902,17 @@ definitions:
1891 1891
           User:
1892 1892
             description: "The user inside the container."
1893 1893
             type: "string"
1894
-          Labels:
1895
-            description: "User-defined key/value data."
1896
-            type: "object"
1897
-            additionalProperties:
1894
+          Groups:
1895
+            type: "array"
1896
+            description: "A list of additional groups that the container process will run as."
1897
+            items:
1898 1898
               type: "string"
1899 1899
           TTY:
1900 1900
             description: "Whether a pseudo-TTY should be allocated."
1901 1901
             type: "boolean"
1902
+          OpenStdin:
1903
+            description: "Open `stdin`"
1904
+            type: "boolean"
1902 1905
           ReadOnly:
1903 1906
             description: "Mount the container's root filesystem as read only."
1904 1907
             type: "boolean"
... ...
@@ -1911,6 +1925,17 @@ definitions:
1911 1911
             description: "Amount of time to wait for the container to terminate before forcefully killing it."
1912 1912
             type: "integer"
1913 1913
             format: "int64"
1914
+          HealthCheck:
1915
+            $ref: "#/definitions/HealthConfig"
1916
+          Hosts:
1917
+            type: "array"
1918
+            description: |
1919
+              A list of hostnames/IP mappings to add to the container's `/etc/hosts` file.
1920
+              The format of extra hosts on swarmkit is specified in:
1921
+              http://man7.org/linux/man-pages/man5/hosts.5.html
1922
+                IP_address canonical_hostname [aliases...]
1923
+            items:
1924
+              type: "string"
1914 1925
           DNSConfig:
1915 1926
             description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)."
1916 1927
             type: "object"