class Docker::Api::ApiClient
- Docker::Api::ApiClient
- Reference
- Object
Overview
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.
Included Modules
Defined in:
docker/api/api_client.crConstant Summary
-
DEFAULT_URL =
"unix:///var/run/docker.sock"
Constructors
Instance Method Summary
-
#api_version : String | Nil
API version in use, defaults to latest if
nil
-
#connection : HTTP::Client
:no_doc: Underlying HTTP connection - exposed for access from test framework only.
-
#delete(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)
Executes a DELETE request on the docker client connection.
-
#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
. -
#delete(path, body : NamedTuple)
Executes a DELETE request on the docker client connection with a JSON body formed from the passed
NamedTuple
. -
#delete(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)
Executes a DELETE request and yields a
HTTP::Client::Response
. -
#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. -
#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. -
#get(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)
Executes a GET request on the docker client connection.
-
#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
. -
#get(path, body : NamedTuple)
Executes a GET request on the docker client connection with a JSON body formed from the passed
NamedTuple
. -
#get(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)
Executes a GET request and yields a
HTTP::Client::Response
. -
#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. -
#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. -
#head(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)
Executes a HEAD request on the docker client connection.
-
#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
. -
#head(path, body : NamedTuple)
Executes a HEAD request on the docker client connection with a JSON body formed from the passed
NamedTuple
. -
#head(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)
Executes a HEAD request and yields a
HTTP::Client::Response
. -
#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. -
#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. -
#options(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)
Executes a OPTIONS request on the docker client connection.
-
#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
. -
#options(path, body : NamedTuple)
Executes a OPTIONS request on the docker client connection with a JSON body formed from the passed
NamedTuple
. -
#options(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)
Executes a OPTIONS request and yields a
HTTP::Client::Response
. -
#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. -
#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. -
#patch(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)
Executes a PATCH request on the docker client connection.
-
#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
. -
#patch(path, body : NamedTuple)
Executes a PATCH request on the docker client connection with a JSON body formed from the passed
NamedTuple
. -
#patch(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)
Executes a PATCH request and yields a
HTTP::Client::Response
. -
#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. -
#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. -
#post(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)
Executes a POST request on the docker client connection.
-
#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
. -
#post(path, body : NamedTuple)
Executes a POST request on the docker client connection with a JSON body formed from the passed
NamedTuple
. -
#post(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)
Executes a POST request and yields a
HTTP::Client::Response
. -
#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. -
#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. -
#put(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType | Nil = nil)
Executes a PUT request on the docker client connection.
-
#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
. -
#put(path, body : NamedTuple)
Executes a PUT request on the docker client connection with a JSON body formed from the passed
NamedTuple
. -
#put(path, headers : HTTP::Headers | Nil = nil, body : HTTP::Client::BodyType = nil, &)
Executes a PUT request and yields a
HTTP::Client::Response
. -
#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. -
#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.
Instance methods inherited from module Docker::Api::Images
build(path : String, **opts)
build,
images(all : Bool | Nil = nil, name : String | Nil = nil, filters : Hash | Nil = nil)
images,
inspect_image(id : String)
inspect_image
Instance methods inherited from module Docker::Api::Daemon
ping
ping,
version
version
Instance methods inherited from module Docker::Api::Containers
containers(all : Bool | Nil = nil, limit : Int | Nil = nil, size : Bool | Nil = nil, filters : Hash | Nil = nil)
containers,
create_container(name : String | Nil = nil, **props)
create_container,
inspect_container(id : String)
inspect_container,
kill(id : String, signal : String | Nil = nil)
kill,
pause(id : String)
pause,
remove_container(id : String, v : Bool | Nil = nil, force : Bool | Nil = nil, link : Bool | Nil = nil)
remove_container,
rename(id : String, name : String)
rename,
restart(id : String, timeout : Int | Nil = nil)
restart,
start(id : String)
start,
stop(id : String, timeout : Int | Nil = nil)
stop,
unpause(id : String)
unpause,
update(id : String, **props)
update,
wait(id : String, condition : String | Nil = nil)
wait
Constructor Detail
Instance Method Detail
:no_doc: Underlying HTTP connection - exposed for access from test framework only.
Executes a DELETE request on the docker client connection.
The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.
Executes a DELETE request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
Executes a DELETE request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
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.
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.
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.
Executes a GET request on the docker client connection.
The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.
Executes a GET request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
Executes a GET request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
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.
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.
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.
Executes a HEAD request on the docker client connection.
The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.
Executes a HEAD request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
Executes a HEAD request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
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.
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.
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.
Executes a OPTIONS request on the docker client connection.
The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.
Executes a OPTIONS request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
Executes a OPTIONS request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
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.
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.
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.
Executes a PATCH request on the docker client connection.
The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.
Executes a PATCH request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
Executes a PATCH request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
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.
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.
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.
Executes a POST request on the docker client connection.
The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.
Executes a POST request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
Executes a POST request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
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.
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.
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.
Executes a PUT request on the docker client connection.
The response status will be automatically checked and a Docker::ApiError raised if unsuccessful.
Executes a PUT request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
Executes a PUT request on the docker client connection with a JSON body
formed from the passed NamedTuple
.
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.
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.
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.