Browse code

Add some documentation for the RestartPolicy feature.

Signed-off-by: Jean-Paul Calderone <jean-paul@clusterhq.com>

Jean-Paul Calderone authored on 2014/09/17 06:40:56
Showing 2 changed files
... ...
@@ -133,7 +133,8 @@ Create a container
133 133
              "NetworkDisabled": false,
134 134
              "ExposedPorts":{
135 135
                      "22/tcp": {}
136
-             }
136
+             },
137
+             "RestartPolicy": { "Name": "always" }
137 138
         }
138 139
 
139 140
 **Example response**:
... ...
@@ -150,6 +151,13 @@ Json Parameters:
150 150
 
151 151
      
152 152
 
153
+-   **RestartPolicy** – The behavior to apply when the container exits.  The
154
+        value is an object with a `Name` property of either `"always"` to
155
+        always restart or `"on-failure"` to restart only when the container
156
+        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
157
+        controls the number of times to retry before giving up.
158
+        The default is not to restart. (optional)
159
+
153 160
 -   **config** – the container's configuration
154 161
 
155 162
 Query Parameters:
... ...
@@ -135,7 +135,8 @@ Create a container
135 135
              "NetworkDisabled": false,
136 136
              "ExposedPorts":{
137 137
                      "22/tcp": {}
138
-             }
138
+             },
139
+             "RestartPolicy": { "Name": "always" }
139 140
         }
140 141
 
141 142
 **Example response**:
... ...
@@ -152,6 +153,13 @@ Json Parameters:
152 152
 
153 153
      
154 154
 
155
+-   **RestartPolicy** – The behavior to apply when the container exits.  The
156
+        value is an object with a `Name` property of either `"always"` to
157
+        always restart or `"on-failure"` to restart only when the container
158
+        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
159
+        controls the number of times to retry before giving up.
160
+        The default is not to restart. (optional)
161
+
155 162
 -   **config** – the container's configuration
156 163
 
157 164
 Query Parameters: