diff --git a/docker-swagger.json b/docker-swagger.json index ce27d0f5..9be9bd23 100644 --- a/docker-swagger.json +++ b/docker-swagger.json @@ -3299,7 +3299,7 @@ } }, "/exec/{id}/json": { - "post": { + "get": { "summary": "Exec Inspect", "description": "Return low-level information about the exec command id.", "operationId": "find", diff --git a/generated/Resource/ExecResource.php b/generated/Resource/ExecResource.php index 8590470f..f6397c19 100644 --- a/generated/Resource/ExecResource.php +++ b/generated/Resource/ExecResource.php @@ -119,7 +119,7 @@ public function find($id, $parameters = [], $fetch = self::FETCH_OBJECT) $url = $url . ('?' . $queryParam->buildQueryString($parameters)); $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); $body = $queryParam->buildFormDataString($parameters); - $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); + $request = $this->messageFactory->createRequest('GET', $url, $headers, $body); $response = $this->httpClient->sendRequest($request); if (self::FETCH_OBJECT == $fetch) { if ('200' == $response->getStatusCode()) { diff --git a/tests/Manager/ExecManagerTest.php b/tests/Manager/ExecManagerTest.php index aca0698b..72c14f3f 100644 --- a/tests/Manager/ExecManagerTest.php +++ b/tests/Manager/ExecManagerTest.php @@ -53,6 +53,30 @@ public function testStartStream() ]); } + public function testExecFind() + { + $createContainerResult = $this->createContainer(); + + $execConfig = new ExecConfig(); + $execConfig->setCmd(["/bin/true"]); + + $execCreateResult = $this->getManager()->create($createContainerResult->getId(), $execConfig); + + $execStartConfig = new ExecStartConfig(); + $execStartConfig->setDetach(false); + $execStartConfig->setTty(false); + + $this->getManager()->start($execCreateResult->getId(), $execStartConfig); + + $execFindResult = $this->getManager()->find($execCreateResult->getId()); + + $this->assertInstanceOf('Docker\API\Model\ExecCommand', $execFindResult); + + self::getDocker()->getContainerManager()->kill($createContainerResult->getId(), [ + 'signal' => 'SIGKILL' + ]); + } + private function createContainer() { $containerConfig = new ContainerConfig();