Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore ImageBuild endpoint along with others. (#60) #61

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 65 additions & 2 deletions src/Docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,71 @@
namespace Docker;

use Docker\API\Client;
use Docker\API\Exception\BadRequestException;
use Docker\API\Model\AuthConfig;
use Docker\Endpoint\ImagePush;
use Docker\API\Model\ExecIdStartPostBody;
use Docker\API\Runtime\Client\Client as RuntimeClient;
use Docker\API\Exception\BadRequestException;
use Docker\Endpoint\ContainerAttach;
use Docker\Endpoint\ContainerAttachWebsocket;
use Docker\Endpoint\ContainerLogs;
use Docker\Endpoint\ExecStart;
use Docker\Endpoint\ImageBuild;
use Docker\Endpoint\ImageCreate;
use Docker\Endpoint\ImagePush;
use Docker\Endpoint\SystemEvents;

/**
* Docker\Docker.
*/
class Docker extends Client
{
/**
* {@inheritdoc}
*/
public function containerAttach(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = [])
{
return $this->executeEndpoint(new ContainerAttach($id, $queryParameters, $accept), $fetch);
}

/**
* {@inheritdoc}
*/
public function containerAttachWebsocket(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = [])
{
return $this->executeEndpoint(new ContainerAttachWebsocket($id, $queryParameters, $accept), $fetch);
}

/**
* {@inheritdoc}
*/
public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = [])
{
return $this->executeEndpoint(new ContainerLogs($id, $queryParameters, $accept), $fetch);
}

/**
* {@inheritdoc}
*/
public function execStart(string $id, ?ExecIdStartPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT, array $accept = [])
{
return $this->executeEndpoint(new ExecStart($id, $requestBody, $accept), $fetch);
}

/**
* {@inheritdoc}
*/
public function imageBuild($requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new ImageBuild($requestBody, $queryParameters, $headerParameters), $fetch);
}

/**
* {@inheritdoc}
*/
public function imageCreate(string $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new ImageCreate($requestBody, $queryParameters, $headerParameters), $fetch);
}
public function imagePush(string $name, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = [])
{
if (isset($headerParameters['X-Registry-Auth']) && $headerParameters['X-Registry-Auth'] instanceof AuthConfig) {
Expand All @@ -24,6 +79,14 @@ public function imagePush(string $name, array $queryParameters = [], array $head
return $this->executeEndpoint(new ImagePush($name, $queryParameters, $headerParameters, $accept), $fetch);
}

/**
* {@inheritdoc}
*/
public function systemEvents(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new SystemEvents($queryParameters), $fetch);
}

public static function create($httpClient = null, array $additionalPlugins = [], array $additionalNormalizers = [])
{
if (null === $httpClient) {
Expand Down
Loading