@@ -17,8 +17,8 @@ trait ExecAsyncResourceTrait
17
17
/**
18
18
* Run a command inside a running container.
19
19
*
20
- * @param string $id ID or name of container
21
20
* @param \Docker\API\Model\ContainersIdExecPostBody $execConfig Exec configuration
21
+ * @param string $id ID or name of container
22
22
* @param array $parameters List of parameters
23
23
* @param string $fetch Fetch mode (object or response)
24
24
* @param \Amp\CancellationToken $cancellationToken Token to cancel the request
@@ -29,14 +29,14 @@ trait ExecAsyncResourceTrait
29
29
*
30
30
* @return \Amp\Promise<\Amp\Artax\Response|\Docker\API\Model\IdResponse>
31
31
*/
32
- public function containerExec (string $ id , \Docker \API \Model \ContainersIdExecPostBody $ execConfig , array $ parameters = [], string $ fetch = self ::FETCH_OBJECT , \Amp \CancellationToken $ cancellationToken = null ): \Amp \Promise
32
+ public function containerExec (\Docker \API \Model \ContainersIdExecPostBody $ execConfig, string $ id , array $ parameters = [], string $ fetch = self ::FETCH_OBJECT , \Amp \CancellationToken $ cancellationToken = null ): \Amp \Promise
33
33
{
34
- return \Amp \call (function () use ($ id , $ execConfig , $ parameters , $ fetch , $ cancellationToken ) {
34
+ return \Amp \call (function () use ($ execConfig , $ id , $ parameters , $ fetch , $ cancellationToken ) {
35
35
$ queryParam = new QueryParam ();
36
- $ url = '/v1.25/ containers/{id}/exec ' ;
36
+ $ url = '/containers/{id}/exec ' ;
37
37
$ url = str_replace ('{id} ' , urlencode ($ id ), $ url );
38
38
$ url = $ url . ('? ' . $ queryParam ->buildQueryString ($ parameters ));
39
- $ headers = array_merge (['Host ' => ' localhost ' , ' Accept ' => ['application/json ' ], 'Content-Type ' => 'application/json ' ], $ queryParam ->buildHeaders ($ parameters ));
39
+ $ headers = array_merge (['Accept ' => ['application/json ' ], 'Content-Type ' => 'application/json ' ], $ queryParam ->buildHeaders ($ parameters ));
40
40
$ body = $ this ->serializer ->serialize ($ execConfig , 'json ' );
41
41
$ request = new \Amp \Artax \Request ($ url , 'POST ' );
42
42
$ request = $ request ->withHeaders ($ headers );
@@ -64,8 +64,8 @@ public function containerExec(string $id, \Docker\API\Model\ContainersIdExecPost
64
64
/**
65
65
* Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command.
66
66
*
67
- * @param string $id Exec instance ID
68
67
* @param \Docker\API\Model\ExecIdStartPostBody $execStartConfig
68
+ * @param string $id Exec instance ID
69
69
* @param array $parameters List of parameters
70
70
* @param string $fetch Fetch mode (object or response)
71
71
* @param \Amp\CancellationToken $cancellationToken Token to cancel the request
@@ -75,14 +75,14 @@ public function containerExec(string $id, \Docker\API\Model\ContainersIdExecPost
75
75
*
76
76
* @return \Amp\Promise<\Amp\Artax\Response|null>
77
77
*/
78
- public function execStart (string $ id , \Docker \API \Model \ExecIdStartPostBody $ execStartConfig , array $ parameters = [], string $ fetch = self ::FETCH_OBJECT , \Amp \CancellationToken $ cancellationToken = null ): \Amp \Promise
78
+ public function execStart (\Docker \API \Model \ExecIdStartPostBody $ execStartConfig, string $ id , array $ parameters = [], string $ fetch = self ::FETCH_OBJECT , \Amp \CancellationToken $ cancellationToken = null ): \Amp \Promise
79
79
{
80
- return \Amp \call (function () use ($ id , $ execStartConfig , $ parameters , $ fetch , $ cancellationToken ) {
80
+ return \Amp \call (function () use ($ execStartConfig , $ id , $ parameters , $ fetch , $ cancellationToken ) {
81
81
$ queryParam = new QueryParam ();
82
- $ url = '/v1.25/ exec/{id}/start ' ;
82
+ $ url = '/exec/{id}/start ' ;
83
83
$ url = str_replace ('{id} ' , urlencode ($ id ), $ url );
84
84
$ url = $ url . ('? ' . $ queryParam ->buildQueryString ($ parameters ));
85
- $ headers = array_merge (['Host ' => ' localhost ' ], $ queryParam ->buildHeaders ($ parameters ));
85
+ $ headers = array_merge (['Accept ' => [ ' application/json ' ], ' Content-Type ' => ' application/json ' ], $ queryParam ->buildHeaders ($ parameters ));
86
86
$ body = $ this ->serializer ->serialize ($ execStartConfig , 'json ' );
87
87
$ request = new \Amp \Artax \Request ($ url , 'POST ' );
88
88
$ request = $ request ->withHeaders ($ headers );
@@ -127,10 +127,10 @@ public function execResize(string $id, array $parameters = [], string $fetch = s
127
127
$ queryParam = new QueryParam ();
128
128
$ queryParam ->setDefault ('h ' , null );
129
129
$ queryParam ->setDefault ('w ' , null );
130
- $ url = '/v1.25/ exec/{id}/resize ' ;
130
+ $ url = '/exec/{id}/resize ' ;
131
131
$ url = str_replace ('{id} ' , urlencode ($ id ), $ url );
132
132
$ url = $ url . ('? ' . $ queryParam ->buildQueryString ($ parameters ));
133
- $ headers = array_merge (['Host ' => ' localhost ' ], $ queryParam ->buildHeaders ($ parameters ));
133
+ $ headers = array_merge (['Accept ' => [ ' application/json ' ] ], $ queryParam ->buildHeaders ($ parameters ));
134
134
$ body = $ queryParam ->buildFormDataString ($ parameters );
135
135
$ request = new \Amp \Artax \Request ($ url , 'POST ' );
136
136
$ request = $ request ->withHeaders ($ headers );
@@ -166,10 +166,10 @@ public function execInspect(string $id, array $parameters = [], string $fetch =
166
166
{
167
167
return \Amp \call (function () use ($ id , $ parameters , $ fetch , $ cancellationToken ) {
168
168
$ queryParam = new QueryParam ();
169
- $ url = '/v1.25/ exec/{id}/json ' ;
169
+ $ url = '/exec/{id}/json ' ;
170
170
$ url = str_replace ('{id} ' , urlencode ($ id ), $ url );
171
171
$ url = $ url . ('? ' . $ queryParam ->buildQueryString ($ parameters ));
172
- $ headers = array_merge (['Host ' => ' localhost ' , ' Accept ' => ['application/json ' ]], $ queryParam ->buildHeaders ($ parameters ));
172
+ $ headers = array_merge (['Accept ' => ['application/json ' ]], $ queryParam ->buildHeaders ($ parameters ));
173
173
$ body = $ queryParam ->buildFormDataString ($ parameters );
174
174
$ request = new \Amp \Artax \Request ($ url , 'GET ' );
175
175
$ request = $ request ->withHeaders ($ headers );
0 commit comments