class

Docker::Api::ApiClient

Inherits Docker::Api::Images / Docker::Api::Daemon / Docker::Api::Containers / Reference / Object

Low-level wrapper for the Docker Engine API.

Each method on maps one-to-one with a REST API endpoint, and either returns the response that the API responds with or raises an Docker::ApiError. It's possible to use ApiClient directly if you require the extra flexibility, however in most cases the abstractions provided by the higher-level Docker::Client may be the better choice.

Constants

DEFAULT_URL = "unix:///var/run/docker.sock"

Constructors

new(base_url = DEFAULT_URL, api_version : Nil | String = nil)
Source

Instance methods

api_version

API version in use, defaults to latest if nil

Source
connection

:no_doc: Underlying HTTP connection - exposed for access from test framework only.

Source
delete(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)

Executes a DELETE request on the docker client connection.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
delete(path, headers : HTTP::Headers, body : NamedTuple)

Executes a DELETE request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
delete(path, body : NamedTuple)

Executes a DELETE request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
delete(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)

Executes a DELETE request and yields a HTTP::Client::Response.

When working with endpoint that provide stream responses these may be accessed as available by calling #body_io on the yielded response object.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
delete(path, headers : HTTP::Headers, body : NamedTuple, &)

Executes a DELETE request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
delete(path, body : NamedTuple, &)

Executes a DELETE request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
get(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)

Executes a GET request on the docker client connection.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
get(path, headers : HTTP::Headers, body : NamedTuple)

Executes a GET request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
get(path, body : NamedTuple)

Executes a GET request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
get(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)

Executes a GET request and yields a HTTP::Client::Response.

When working with endpoint that provide stream responses these may be accessed as available by calling #body_io on the yielded response object.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
get(path, headers : HTTP::Headers, body : NamedTuple, &)

Executes a GET request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
get(path, body : NamedTuple, &)

Executes a GET request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
head(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)

Executes a HEAD request on the docker client connection.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
head(path, headers : HTTP::Headers, body : NamedTuple)

Executes a HEAD request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
head(path, body : NamedTuple)

Executes a HEAD request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
head(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)

Executes a HEAD request and yields a HTTP::Client::Response.

When working with endpoint that provide stream responses these may be accessed as available by calling #body_io on the yielded response object.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
head(path, headers : HTTP::Headers, body : NamedTuple, &)

Executes a HEAD request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
head(path, body : NamedTuple, &)

Executes a HEAD request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
options(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)

Executes a OPTIONS request on the docker client connection.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
options(path, headers : HTTP::Headers, body : NamedTuple)

Executes a OPTIONS request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
options(path, body : NamedTuple)

Executes a OPTIONS request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
options(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)

Executes a OPTIONS request and yields a HTTP::Client::Response.

When working with endpoint that provide stream responses these may be accessed as available by calling #body_io on the yielded response object.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
options(path, headers : HTTP::Headers, body : NamedTuple, &)

Executes a OPTIONS request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
options(path, body : NamedTuple, &)

Executes a OPTIONS request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
patch(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)

Executes a PATCH request on the docker client connection.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
patch(path, headers : HTTP::Headers, body : NamedTuple)

Executes a PATCH request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
patch(path, body : NamedTuple)

Executes a PATCH request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
patch(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)

Executes a PATCH request and yields a HTTP::Client::Response.

When working with endpoint that provide stream responses these may be accessed as available by calling #body_io on the yielded response object.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
patch(path, headers : HTTP::Headers, body : NamedTuple, &)

Executes a PATCH request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
patch(path, body : NamedTuple, &)

Executes a PATCH request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
post(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)

Executes a POST request on the docker client connection.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
post(path, headers : HTTP::Headers, body : NamedTuple)

Executes a POST request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
post(path, body : NamedTuple)

Executes a POST request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
post(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)

Executes a POST request and yields a HTTP::Client::Response.

When working with endpoint that provide stream responses these may be accessed as available by calling #body_io on the yielded response object.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
post(path, headers : HTTP::Headers, body : NamedTuple, &)

Executes a POST request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
post(path, body : NamedTuple, &)

Executes a POST request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
put(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)

Executes a PUT request on the docker client connection.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
put(path, headers : HTTP::Headers, body : NamedTuple)

Executes a PUT request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
put(path, body : NamedTuple)

Executes a PUT request on the docker client connection with a JSON body formed from the passed NamedTuple.

Source
put(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)

Executes a PUT request and yields a HTTP::Client::Response.

When working with endpoint that provide stream responses these may be accessed as available by calling #body_io on the yielded response object.

The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.

Source
put(path, headers : HTTP::Headers, body : NamedTuple, &)

Executes a PUT request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source
put(path, body : NamedTuple, &)

Executes a PUT request on the docker client connection with a JSON body formed from the passed NamedTuple and yields streamed response entries to the block.

Source