Browse code

Cleanup exec API docs and available params

Adds pertitent information about what is expected in the json payload
and comments out unsupported (exec) features in runConfig.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2014/11/21 03:01:59
Showing 4 changed files
... ...
@@ -122,8 +122,6 @@ func (d *Daemon) ContainerExecCreate(job *engine.Job) engine.Status {
122 122
 	entrypoint, args := d.getEntrypointAndArgs(nil, config.Cmd)
123 123
 
124 124
 	processConfig := execdriver.ProcessConfig{
125
-		Privileged: config.Privileged,
126
-		User:       config.User,
127 125
 		Tty:        config.Tty,
128 126
 		Entrypoint: entrypoint,
129 127
 		Arguments:  args,
... ...
@@ -1560,7 +1560,6 @@ Sets up an exec instance in a running container `id`
1560 1560
 	     "Cmd":[
1561 1561
                      "date"
1562 1562
              ],
1563
-	     "Container":"e90e34656806",
1564 1563
         }
1565 1564
 
1566 1565
 **Example response**:
... ...
@@ -1574,7 +1573,12 @@ Sets up an exec instance in a running container `id`
1574 1574
 
1575 1575
 Json Parameters:
1576 1576
 
1577
--   **execConfig** ? exec configuration.
1577
+-   **AttachStdin** - Boolean value, attaches to stdin of the exec command.
1578
+-   **AttachStdout** - Boolean value, attaches to stdout of the exec command.
1579
+-   **AttachStderr** - Boolean value, attaches to stderr of the exec command.
1580
+-   **Tty** - Boolean value to allocate a pseudo-TTY
1581
+-   **Cmd** - Command to run specified as a string or an array of strings.
1582
+
1578 1583
 
1579 1584
 Status Codes:
1580 1585
 
... ...
@@ -1585,8 +1589,9 @@ Status Codes:
1585 1585
 
1586 1586
 `POST /exec/(id)/start`
1587 1587
 
1588
-Starts a previously set up exec instance `id`. If `detach` is true, this API returns after
1589
-starting the `exec` command. Otherwise, this API sets up an interactive session with the `exec` command.
1588
+Starts a previously set up exec instance `id`. If `detach` is true, this API
1589
+returns after starting the `exec` command. Otherwise, this API sets up an
1590
+interactive session with the `exec` command.
1590 1591
 
1591 1592
 **Example request**:
1592 1593
 
... ...
@@ -1607,7 +1612,8 @@ starting the `exec` command. Otherwise, this API sets up an interactive session
1607 1607
 
1608 1608
 Json Parameters:
1609 1609
 
1610
--   **execConfig** ? exec configuration.
1610
+-   **Detach** - Detach from the exec command
1611
+-   **Tty** - Boolean value to allocate a pseudo-TTY
1611 1612
 
1612 1613
 Status Codes:
1613 1614
 
... ...
@@ -1511,7 +1511,6 @@ Sets up an exec instance in a running container `id`
1511 1511
 	     "Cmd":[
1512 1512
                      "date"
1513 1513
              ],
1514
-	     "Container":"e90e34656806",
1515 1514
         }
1516 1515
 
1517 1516
 **Example response**:
... ...
@@ -1525,7 +1524,12 @@ Sets up an exec instance in a running container `id`
1525 1525
 
1526 1526
 Json Parameters:
1527 1527
 
1528
--   **execConfig** ? exec configuration.
1528
+-   **AttachStdin** - Boolean value, attaches to stdin of the exec command.
1529
+-   **AttachStdout** - Boolean value, attaches to stdout of the exec command.
1530
+-   **AttachStderr** - Boolean value, attaches to stderr of the exec command.
1531
+-   **Tty** - Boolean value to allocate a pseudo-TTY
1532
+-   **Cmd** - Command to run specified as a string or an array of strings.
1533
+
1529 1534
 
1530 1535
 Status Codes:
1531 1536
 
... ...
@@ -1536,8 +1540,9 @@ Status Codes:
1536 1536
 
1537 1537
 `POST /exec/(id)/start`
1538 1538
 
1539
-Starts a previously set up exec instance `id`. If `detach` is true, this API returns after
1540
-starting the `exec` command. Otherwise, this API sets up an interactive session with the `exec` command.
1539
+Starts a previously set up exec instance `id`. If `detach` is true, this API
1540
+returns after starting the `exec` command. Otherwise, this API sets up an
1541
+interactive session with the `exec` command.
1541 1542
 
1542 1543
 **Example request**:
1543 1544
 
... ...
@@ -1558,7 +1563,8 @@ starting the `exec` command. Otherwise, this API sets up an interactive session
1558 1558
 
1559 1559
 Json Parameters:
1560 1560
 
1561
--   **execConfig** ? exec configuration.
1561
+-   **Detach** - Detach from the exec command
1562
+-   **Tty** - Boolean value to allocate a pseudo-TTY
1562 1563
 
1563 1564
 Status Codes:
1564 1565
 
... ...
@@ -19,10 +19,11 @@ type ExecConfig struct {
19 19
 
20 20
 func ExecConfigFromJob(job *engine.Job) *ExecConfig {
21 21
 	execConfig := &ExecConfig{
22
-		User:         job.Getenv("User"),
23
-		Privileged:   job.GetenvBool("Privileged"),
22
+		// TODO(vishh): Expose 'User' once it is supported.
23
+		//User:         job.Getenv("User"),
24
+		// TODO(vishh): Expose 'Privileged' once it is supported.
25
+		//Privileged:   job.GetenvBool("Privileged"),
24 26
 		Tty:          job.GetenvBool("Tty"),
25
-		Container:    job.Getenv("Container"),
26 27
 		AttachStdin:  job.GetenvBool("AttachStdin"),
27 28
 		AttachStderr: job.GetenvBool("AttachStderr"),
28 29
 		AttachStdout: job.GetenvBool("AttachStdout"),