Skip to content

Commit

Permalink
Bump Docker Engine API to v1.42
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioheleno committed Oct 9, 2023
1 parent 0983de5 commit 5b39e70
Show file tree
Hide file tree
Showing 163 changed files with 21,961 additions and 2,964 deletions.
2 changes: 1 addition & 1 deletion .jane-openapi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ return [
'date-prefer-interface' => true,
'directory' => __DIR__ . '/src',
'namespace' => 'Docker\\API',
'openapi-file' => __DIR__ . '/spec/v1.41.json',
'openapi-file' => __DIR__ . '/spec/v1.42.json',
'reference' => true,
'strict' => false,
'date-input-format' => 'Y-m-d\TH:i:s.uuP',
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "7.1.41.x-dev",
"dev-main": "7.1.42.x-dev",
"7.1.41": "7.1.41.x-dev",
"6.1.41": "6.1.41.x-dev",
"6.1.36": "6.1.36.x-dev"
}
Expand Down
16,631 changes: 16,631 additions & 0 deletions spec/v1.42.json

Large diffs are not rendered by default.

175 changes: 128 additions & 47 deletions src/Client.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Endpoint/ContainerArchiveInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
if (200 === $status) {
}
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ContainerArchiveInfoBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdArchiveHeadJsonResponse400', 'json'), $response);
throw new \Docker\API\Exception\ContainerArchiveInfoBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
}
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ContainerArchiveInfoNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
Expand Down
7 changes: 4 additions & 3 deletions src/Endpoint/ContainerAttach.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class ContainerAttach extends \Docker\API\Runtime\Client\BaseEndpoint implements
* ### Stream format
*
* When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),
* the stream over the hijacked connected is multiplexed to separate out
* the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream
* and the stream over the hijacked connected is multiplexed to separate out
* `stdout` and `stderr`. The stream consists of a series of frames, each
* containing a header and a payload.
*
Expand Down Expand Up @@ -125,7 +126,7 @@ class ContainerAttach extends \Docker\API\Runtime\Client\BaseEndpoint implements
* @var bool $stderr Attach to `stderr`
* }
*
* @param array $accept Accept content header application/vnd.docker.raw-stream|application/json
* @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json
*/
public function __construct(string $id, array $queryParameters = [], array $accept = [])
{
Expand All @@ -152,7 +153,7 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
public function getExtraHeaders(): array
{
if (empty($this->accept)) {
return ['Accept' => ['application/vnd.docker.raw-stream', 'application/json']];
return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream', 'application/json']];
}

return $this->accept;
Expand Down
23 changes: 20 additions & 3 deletions src/Endpoint/ContainerCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ class ContainerCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements
*
* @var string $name Assign the specified name to the container. Must match
* `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.
* @var string $platform Platform in the format `os[/arch[/variant]]` used for image lookup.
*
* When specified, the daemon checks if the requested image is present
* in the local image cache with the given OS and Architecture, and
* otherwise returns a `404` status.
*
* If the option is not set, the host's native OS and Architecture are
* used to look up the image in the image cache. However, if no platform
* is passed and the given image does exist in the local image cache,
* but its OS or architecture does not match, the container is created
* with the available image, and a warning is added to the `Warnings`
* field in the response, for example;
*
* WARNING: The requested image's platform (linux/arm64/v8) does not
* match the detected host platform (linux/amd64) and no
* specific platform was requested
*
* }
*/
Expand Down Expand Up @@ -52,10 +68,11 @@ public function getExtraHeaders(): array
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
{
$optionsResolver = parent::getQueryOptionsResolver();
$optionsResolver->setDefined(['name']);
$optionsResolver->setDefined(['name', 'platform']);
$optionsResolver->setRequired([]);
$optionsResolver->setDefaults([]);
$optionsResolver->addAllowedTypes('name', ['string']);
$optionsResolver->addAllowedTypes('platform', ['string']);

return $optionsResolver;
}
Expand All @@ -66,14 +83,14 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver
* @throws \Docker\API\Exception\ContainerCreateConflictException
* @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException
*
* @return \Docker\API\Model\ContainersCreatePostResponse201|null
* @return \Docker\API\Model\ContainerCreateResponse|null
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersCreatePostResponse201', 'json');
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainerCreateResponse', 'json');
}
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ContainerCreateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
Expand Down
5 changes: 3 additions & 2 deletions src/Endpoint/ContainerKill.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ class ContainerKill extends \Docker\API\Runtime\Client\BaseEndpoint implements \
* @param string $id ID or name of the container
* @param array $queryParameters {
*
* @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`)
* }
* @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`).
*
* }
*
* @param array $accept Accept content header application/json|text/plain
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Endpoint/ContainerList.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver
* @throws \Docker\API\Exception\ContainerListBadRequestException
* @throws \Docker\API\Exception\ContainerListInternalServerErrorException
*
* @return \Docker\API\Model\ContainerSummaryItem[]|null
* @return \Docker\API\Model\ContainerSummary[]|null
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainerSummaryItem[]', 'json');
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainerSummary[]', 'json');
}
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ContainerListBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
Expand Down
13 changes: 5 additions & 8 deletions src/Endpoint/ContainerLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContainerLogs extends \Docker\API\Runtime\Client\BaseEndpoint implements \
*
* }
*
* @param array $accept Accept content header application/json|text/plain
* @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json
*/
public function __construct(string $id, array $queryParameters = [], array $accept = [])
{
Expand All @@ -57,7 +57,7 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
public function getExtraHeaders(): array
{
if (empty($this->accept)) {
return ['Accept' => ['application/json', 'text/plain']];
return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream', 'application/json']];
}

return $this->accept;
Expand All @@ -82,22 +82,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver

/**
* @throws \Docker\API\Exception\ContainerLogsNotFoundException
* @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException
*
* @return null
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return json_decode($body);
if (200 === $status) {
}
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ContainerLogsNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
throw new \Docker\API\Exception\ContainerLogsNotFoundException($response);
}
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ContainerLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
if (500 === $status) {
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/Endpoint/ContainerRestart.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ class ContainerRestart extends \Docker\API\Runtime\Client\BaseEndpoint implement
* @param string $id ID or name of the container
* @param array $queryParameters {
*
* @var int $t Number of seconds to wait before killing the container
* }
* @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`).
* @var int $t Number of seconds to wait before killing the container
* }
*
* @param array $accept Accept content header application/json|text/plain
*/
Expand Down Expand Up @@ -53,9 +54,10 @@ public function getExtraHeaders(): array
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
{
$optionsResolver = parent::getQueryOptionsResolver();
$optionsResolver->setDefined(['t']);
$optionsResolver->setDefined(['signal', 't']);
$optionsResolver->setRequired([]);
$optionsResolver->setDefaults([]);
$optionsResolver->addAllowedTypes('signal', ['string']);
$optionsResolver->addAllowedTypes('t', ['int']);

return $optionsResolver;
Expand Down
8 changes: 5 additions & 3 deletions src/Endpoint/ContainerStop.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ class ContainerStop extends \Docker\API\Runtime\Client\BaseEndpoint implements \
* @param string $id ID or name of the container
* @param array $queryParameters {
*
* @var int $t Number of seconds to wait before killing the container
* }
* @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`).
* @var int $t Number of seconds to wait before killing the container
* }
*
* @param array $accept Accept content header application/json|text/plain
*/
Expand Down Expand Up @@ -53,9 +54,10 @@ public function getExtraHeaders(): array
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
{
$optionsResolver = parent::getQueryOptionsResolver();
$optionsResolver->setDefined(['t']);
$optionsResolver->setDefined(['signal', 't']);
$optionsResolver->setRequired([]);
$optionsResolver->setDefaults([]);
$optionsResolver->addAllowedTypes('signal', ['string']);
$optionsResolver->addAllowedTypes('t', ['int']);

return $optionsResolver;
Expand Down
13 changes: 9 additions & 4 deletions src/Endpoint/ContainerWait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class ContainerWait extends \Docker\API\Runtime\Client\BaseEndpoint implements \
* @param string $id ID or name of the container
* @param array $queryParameters {
*
* @var string $condition Wait until a container state reaches the given condition, either
* 'not-running' (default), 'next-exit', or 'removed'.
* @var string $condition Wait until a container state reaches the given condition.
*
* Defaults to `not-running` if omitted or empty.
*
* }
*/
Expand Down Expand Up @@ -58,17 +59,21 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver
}

/**
* @throws \Docker\API\Exception\ContainerWaitBadRequestException
* @throws \Docker\API\Exception\ContainerWaitNotFoundException
* @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException
*
* @return \Docker\API\Model\ContainersIdWaitPostResponse200|null
* @return \Docker\API\Model\ContainerWaitResponse|null
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdWaitPostResponse200', 'json');
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainerWaitResponse', 'json');
}
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ContainerWaitBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
}
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ContainerWaitNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
Expand Down
4 changes: 2 additions & 2 deletions src/Endpoint/DistributionInspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public function getExtraHeaders(): array
* @throws \Docker\API\Exception\DistributionInspectUnauthorizedException
* @throws \Docker\API\Exception\DistributionInspectInternalServerErrorException
*
* @return \Docker\API\Model\DistributionNameJsonGetResponse200|null
* @return \Docker\API\Model\DistributionInspect|null
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'Docker\\API\\Model\\DistributionNameJsonGetResponse200', 'json');
return $serializer->deserialize($body, 'Docker\\API\\Model\\DistributionInspect', 'json');
}
if ((null === $contentType) === false && (401 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\DistributionInspectUnauthorizedException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
Expand Down
10 changes: 9 additions & 1 deletion src/Endpoint/ExecResize.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,27 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver
}

/**
* @throws \Docker\API\Exception\ExecResizeBadRequestException
* @throws \Docker\API\Exception\ExecResizeNotFoundException
* @throws \Docker\API\Exception\ExecResizeInternalServerErrorException
*
* @return null
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (201 === $status) {
if (200 === $status) {
}
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ExecResizeBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
}
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ExecResizeNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
}
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \Docker\API\Exception\ExecResizeInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
}
}

public function getAuthenticationScopes(): array
Expand Down
13 changes: 10 additions & 3 deletions src/Endpoint/ExecStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ class ExecStart extends \Docker\API\Runtime\Client\BaseEndpoint implements \Dock
{
use \Docker\API\Runtime\Client\EndpointTrait;
protected $id;
protected $accept;

/**
* 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.
*
* @param string $id Exec instance ID
* @param string $id Exec instance ID
* @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream
*/
public function __construct(string $id, \Docker\API\Model\ExecIdStartPostBody $requestBody = null)
public function __construct(string $id, \Docker\API\Model\ExecIdStartPostBody $requestBody = null, array $accept = [])
{
$this->id = $id;
$this->body = $requestBody;
$this->accept = $accept;
}

public function getMethod(): string
Expand All @@ -43,7 +46,11 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria

public function getExtraHeaders(): array
{
return ['Accept' => ['application/vnd.docker.raw-stream']];
if (empty($this->accept)) {
return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream']];
}

return $this->accept;
}

/**
Expand Down
Loading

0 comments on commit 5b39e70

Please sign in to comment.