浏览代码

Merge pull request #8073 from ClusterHQ/7743-restart-policy-api-doc

Add some documentation for the RestartPolicy feature.
Fred Lifton 10 年之前
父节点
当前提交
b03f506303

+ 9 - 1
docs/sources/reference/api/docker_remote_api_v1.14.md

@@ -133,7 +133,8 @@ Create a container
              "NetworkDisabled": false,
              "NetworkDisabled": false,
              "ExposedPorts":{
              "ExposedPorts":{
                      "22/tcp": {}
                      "22/tcp": {}
-             }
+             },
+             "RestartPolicy": { "Name": "always" }
         }
         }
 
 
 **Example response**:
 **Example response**:
@@ -150,6 +151,13 @@ Json Parameters:
 
 
      
      
 
 
+-   **RestartPolicy** – The behavior to apply when the container exits.  The
+        value is an object with a `Name` property of either `"always"` to
+        always restart or `"on-failure"` to restart only when the container
+        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
+        controls the number of times to retry before giving up.
+        The default is not to restart. (optional)
+
 -   **config** – the container's configuration
 -   **config** – the container's configuration
 
 
 Query Parameters:
 Query Parameters:

+ 9 - 1
docs/sources/reference/api/docker_remote_api_v1.15.md

@@ -135,7 +135,8 @@ Create a container
              "NetworkDisabled": false,
              "NetworkDisabled": false,
              "ExposedPorts":{
              "ExposedPorts":{
                      "22/tcp": {}
                      "22/tcp": {}
-             }
+             },
+             "RestartPolicy": { "Name": "always" }
         }
         }
 
 
 **Example response**:
 **Example response**:
@@ -152,6 +153,13 @@ Json Parameters:
 
 
      
      
 
 
+-   **RestartPolicy** – The behavior to apply when the container exits.  The
+        value is an object with a `Name` property of either `"always"` to
+        always restart or `"on-failure"` to restart only when the container
+        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
+        controls the number of times to retry before giving up.
+        The default is not to restart. (optional)
+
 -   **config** – the container's configuration
 -   **config** – the container's configuration
 
 
 Query Parameters:
 Query Parameters: