Class: Docker::API::Operations
- Inherits:
-
Object
- Object
- Docker::API::Operations
- Defined in:
- lib/docker/api/operations.rb,
sig/docker/api/operations.rbs
Overview
Every operation the Docker Engine API defines, one method each.
This layer is generated from Docker's own specification, so it is complete by construction: if the daemon documents an endpoint, there is a method for it, with every parameter that endpoint accepts. It is also public API rather than an escape hatch -- reach for it directly whenever the ergonomic layer has not grown sugar for what you need.
Methods take keyword arguments named after the specification's parameters, return a Response, and raise a Error subclass for any status the endpoint does not document as success.
Instance Attribute Summary collapse
-
#connection ⇒ Docker::API::Connection
readonly
The connection in use.
Instance Method Summary collapse
-
#build_prune {|chunk| ... } ⇒ Docker::API::Response
Delete builder cache.
-
#config_create {|chunk| ... } ⇒ Docker::API::Response
Create a config.
-
#config_delete {|chunk| ... } ⇒ Docker::API::Response
Delete a config.
-
#config_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a config.
-
#config_list {|chunk| ... } ⇒ Docker::API::Response
List configs.
-
#config_update {|chunk| ... } ⇒ Docker::API::Response
Update a Config.
-
#container_archive {|chunk| ... } ⇒ Docker::API::Response
Get an archive of a filesystem resource in a container.
-
#container_archive_info {|chunk| ... } ⇒ Docker::API::Response
Get information about files in a container.
-
#container_attach {|chunk| ... } ⇒ Docker::API::Response
Attach to a container.
-
#container_attach_websocket {|chunk| ... } ⇒ Docker::API::Response
Attach to a container via a websocket.
-
#container_changes {|chunk| ... } ⇒ Docker::API::Response
Get changes on a container’s filesystem.
-
#container_create {|chunk| ... } ⇒ Docker::API::Response
Create a container.
-
#container_delete {|chunk| ... } ⇒ Docker::API::Response
Remove a container.
-
#container_exec {|chunk| ... } ⇒ Docker::API::Response
Create an exec instance.
-
#container_export {|chunk| ... } ⇒ Docker::API::Response
Export a container.
-
#container_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a container.
-
#container_kill {|chunk| ... } ⇒ Docker::API::Response
Kill a container.
-
#container_list {|chunk| ... } ⇒ Docker::API::Response
List containers.
-
#container_logs {|chunk| ... } ⇒ Docker::API::Response
Get container logs.
-
#container_pause {|chunk| ... } ⇒ Docker::API::Response
Pause a container.
-
#container_prune {|chunk| ... } ⇒ Docker::API::Response
Delete stopped containers.
-
#container_rename {|chunk| ... } ⇒ Docker::API::Response
Rename a container.
-
#container_resize {|chunk| ... } ⇒ Docker::API::Response
Resize a container TTY.
-
#container_restart {|chunk| ... } ⇒ Docker::API::Response
Restart a container.
-
#container_start {|chunk| ... } ⇒ Docker::API::Response
Start a container.
-
#container_stats {|chunk| ... } ⇒ Docker::API::Response
Get container stats based on resource usage.
-
#container_stop {|chunk| ... } ⇒ Docker::API::Response
Stop a container.
-
#container_top {|chunk| ... } ⇒ Docker::API::Response
List processes running inside a container.
-
#container_unpause {|chunk| ... } ⇒ Docker::API::Response
Unpause a container.
-
#container_update {|chunk| ... } ⇒ Docker::API::Response
Update a container.
-
#container_wait {|chunk| ... } ⇒ Docker::API::Response
Wait for a container.
-
#distribution_inspect {|chunk| ... } ⇒ Docker::API::Response
Get image information from the registry.
-
#exec_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect an exec instance.
-
#exec_resize {|chunk| ... } ⇒ Docker::API::Response
Resize an exec instance.
-
#exec_start {|chunk| ... } ⇒ Docker::API::Response
Start an exec instance.
-
#get_plugin_privileges {|chunk| ... } ⇒ Docker::API::Response
Get plugin privileges.
-
#image_attestations {|chunk| ... } ⇒ Docker::API::Response
Get attestation statements for an image.
-
#image_build {|chunk| ... } ⇒ Docker::API::Response
Build an image.
-
#image_commit {|chunk| ... } ⇒ Docker::API::Response
Create a new image from a container.
-
#image_create {|chunk| ... } ⇒ Docker::API::Response
Create an image.
-
#image_delete {|chunk| ... } ⇒ Docker::API::Response
Remove an image.
-
#image_get {|chunk| ... } ⇒ Docker::API::Response
Export an image.
-
#image_get_all {|chunk| ... } ⇒ Docker::API::Response
Export several images.
-
#image_history {|chunk| ... } ⇒ Docker::API::Response
Get the history of an image.
-
#image_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect an image.
-
#image_list {|chunk| ... } ⇒ Docker::API::Response
List Images.
-
#image_load {|chunk| ... } ⇒ Docker::API::Response
Import images.
-
#image_prune {|chunk| ... } ⇒ Docker::API::Response
Delete unused images.
-
#image_push {|chunk| ... } ⇒ Docker::API::Response
Push an image.
-
#image_search {|chunk| ... } ⇒ Docker::API::Response
Search images.
-
#image_tag {|chunk| ... } ⇒ Docker::API::Response
Tag an image.
-
#initialize(connection) ⇒ Operations
constructor
A new instance of Operations.
-
#network_connect {|chunk| ... } ⇒ Docker::API::Response
Connect a container to a network.
-
#network_create {|chunk| ... } ⇒ Docker::API::Response
Create a network.
-
#network_delete {|chunk| ... } ⇒ Docker::API::Response
Remove a network.
-
#network_disconnect {|chunk| ... } ⇒ Docker::API::Response
Disconnect a container from a network.
-
#network_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a network.
-
#network_list {|chunk| ... } ⇒ Docker::API::Response
List networks.
-
#network_prune {|chunk| ... } ⇒ Docker::API::Response
Delete unused networks.
-
#node_delete {|chunk| ... } ⇒ Docker::API::Response
Delete a node.
-
#node_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a node.
-
#node_list {|chunk| ... } ⇒ Docker::API::Response
List nodes.
-
#node_update {|chunk| ... } ⇒ Docker::API::Response
Update a node.
-
#plugin_create {|chunk| ... } ⇒ Docker::API::Response
Create a plugin.
-
#plugin_delete {|chunk| ... } ⇒ Docker::API::Response
Remove a plugin.
-
#plugin_disable {|chunk| ... } ⇒ Docker::API::Response
Disable a plugin.
-
#plugin_enable {|chunk| ... } ⇒ Docker::API::Response
Enable a plugin.
-
#plugin_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a plugin.
-
#plugin_list {|chunk| ... } ⇒ Docker::API::Response
List plugins.
-
#plugin_pull {|chunk| ... } ⇒ Docker::API::Response
Install a plugin.
-
#plugin_push {|chunk| ... } ⇒ Docker::API::Response
Push a plugin.
-
#plugin_set {|chunk| ... } ⇒ Docker::API::Response
Configure a plugin.
-
#plugin_upgrade {|chunk| ... } ⇒ Docker::API::Response
Upgrade a plugin.
-
#put_container_archive {|chunk| ... } ⇒ Docker::API::Response
Extract an archive of files or folders to a directory in a container.
-
#secret_create {|chunk| ... } ⇒ Docker::API::Response
Create a secret.
-
#secret_delete {|chunk| ... } ⇒ Docker::API::Response
Delete a secret.
-
#secret_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a secret.
-
#secret_list {|chunk| ... } ⇒ Docker::API::Response
List secrets.
-
#secret_update {|chunk| ... } ⇒ Docker::API::Response
Update a Secret.
-
#service_create {|chunk| ... } ⇒ Docker::API::Response
Create a service.
-
#service_delete {|chunk| ... } ⇒ Docker::API::Response
Delete a service.
-
#service_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a service.
-
#service_list {|chunk| ... } ⇒ Docker::API::Response
List services.
-
#service_logs {|chunk| ... } ⇒ Docker::API::Response
Get service logs.
-
#service_update {|chunk| ... } ⇒ Docker::API::Response
Update a service.
-
#session {|chunk| ... } ⇒ Docker::API::Response
Initialize interactive session.
-
#swarm_init {|chunk| ... } ⇒ Docker::API::Response
Initialize a new swarm.
-
#swarm_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect swarm.
-
#swarm_join {|chunk| ... } ⇒ Docker::API::Response
Join an existing swarm.
-
#swarm_leave {|chunk| ... } ⇒ Docker::API::Response
Leave a swarm.
-
#swarm_unlock {|chunk| ... } ⇒ Docker::API::Response
Unlock a locked manager.
-
#swarm_unlockkey {|chunk| ... } ⇒ Docker::API::Response
Get the unlock key.
-
#swarm_update {|chunk| ... } ⇒ Docker::API::Response
Update a swarm.
-
#system_auth {|chunk| ... } ⇒ Docker::API::Response
Check auth configuration.
-
#system_data_usage {|chunk| ... } ⇒ Docker::API::Response
Get data usage information.
-
#system_events {|chunk| ... } ⇒ Docker::API::Response
Monitor events.
-
#system_info {|chunk| ... } ⇒ Docker::API::Response
Get system information.
-
#system_ping {|chunk| ... } ⇒ Docker::API::Response
Ping.
-
#system_ping_head {|chunk| ... } ⇒ Docker::API::Response
Ping.
-
#system_version {|chunk| ... } ⇒ Docker::API::Response
Get version.
-
#task_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a task.
-
#task_list {|chunk| ... } ⇒ Docker::API::Response
List tasks.
-
#task_logs {|chunk| ... } ⇒ Docker::API::Response
Get task logs.
-
#volume_create {|chunk| ... } ⇒ Docker::API::Response
Create a volume.
-
#volume_delete {|chunk| ... } ⇒ Docker::API::Response
Remove a volume.
-
#volume_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a volume.
-
#volume_list {|chunk| ... } ⇒ Docker::API::Response
List volumes.
-
#volume_prune {|chunk| ... } ⇒ Docker::API::Response
Delete unused volumes.
-
#volume_update {|chunk| ... } ⇒ Docker::API::Response
"Update a volume.
Constructor Details
#initialize(connection) ⇒ Operations
Returns a new instance of Operations.
38 39 40 |
# File 'lib/docker/api/operations.rb', line 38 def initialize(connection) @connection = connection end |
Instance Attribute Details
#connection ⇒ Docker::API::Connection (readonly)
Returns the connection in use.
43 44 45 |
# File 'lib/docker/api/operations.rb', line 43 def connection @connection end |
Instance Method Details
#build_prune {|chunk| ... } ⇒ Docker::API::Response
Delete builder cache
Engine API: POST /build/prune
keep for cache (sent to the daemon as 'reserved-space')
allowed to keep for cache (sent to the daemon as 'max-used-space')
after pruning (sent to the daemon as 'min-free-space')
map[string][]string) to process on the list of build cache objects.
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 |
# File 'lib/docker/api/operations.rb', line 1022 def build_prune(reserved_space: nil, max_used_space: nil, min_free_space: nil, all: nil, filters: nil, &block) connection.request( :post, "/build/prune", query: { "reserved-space" => reserved_space, "max-used-space" => max_used_space, "min-free-space" => min_free_space, "all" => all, "filters" => filters, }, expects: [200], operation: "build_prune", &block ) end |
#config_create {|chunk| ... } ⇒ Docker::API::Response
Create a config
Engine API: POST /configs/create
object
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/docker/api/operations.rb', line 57 def config_create(body: nil, &block) connection.request( :post, "/configs/create", body: body, expects: [201], operation: "config_create", &block ) end |
#config_delete {|chunk| ... } ⇒ Docker::API::Response
Delete a config
Engine API: DELETE /configs/id
79 80 81 82 83 84 85 86 87 |
# File 'lib/docker/api/operations.rb', line 79 def config_delete(id:, &block) connection.request( :delete, "/configs/#{Path.escape(id)}", expects: [204], operation: "config_delete", &block ) end |
#config_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a config
Engine API: GET /configs/id
100 101 102 103 104 105 106 107 108 |
# File 'lib/docker/api/operations.rb', line 100 def config_inspect(id:, &block) connection.request( :get, "/configs/#{Path.escape(id)}", expects: [200], operation: "config_inspect", &block ) end |
#config_list {|chunk| ... } ⇒ Docker::API::Response
List configs
Engine API: GET /configs
map[string][]string) to process on the configs list.
121 122 123 124 125 126 127 128 129 130 |
# File 'lib/docker/api/operations.rb', line 121 def config_list(filters: nil, &block) connection.request( :get, "/configs", query: { "filters" => filters }, expects: [200], operation: "config_list", &block ) end |
#config_update {|chunk| ... } ⇒ Docker::API::Response
Update a Config
Engine API: POST /configs/id/update
updated. This is required to avoid conflicting writes. only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#ope... (body parameter 'body' in the API specification)
150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/docker/api/operations.rb', line 150 def config_update(id:, version:, body: nil, &block) connection.request( :post, "/configs/#{Path.escape(id)}/update", query: { "version" => version }, body: body, expects: [200], operation: "config_update", &block ) end |
#container_archive {|chunk| ... } ⇒ Docker::API::Response
Get an archive of a filesystem resource in a container
Get a tar archive of a resource in the filesystem of container id.
Engine API: GET /containers/id/archive
176 177 178 179 180 181 182 183 184 185 |
# File 'lib/docker/api/operations.rb', line 176 def container_archive(id:, path:, &block) connection.request( :get, "/containers/#{Path.escape(id)}/archive", query: { "path" => path }, expects: [200], operation: "container_archive", &block ) end |
#container_archive_info {|chunk| ... } ⇒ Docker::API::Response
Get information about files in a container
A response header X-Docker-Container-Path-Stat is returned, containing a
base64 - encoded JSON object with some filesystem header information about
the path.
Engine API: HEAD /containers/id/archive
203 204 205 206 207 208 209 210 211 212 |
# File 'lib/docker/api/operations.rb', line 203 def container_archive_info(id:, path:, &block) connection.request( :head, "/containers/#{Path.escape(id)}/archive", query: { "path" => path }, expects: [200], operation: "container_archive_info", &block ) end |
#container_attach {|chunk| ... } ⇒ Docker::API::Response
Attach to a container
Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached.
Engine API: POST /containers/id/attach
a container.Format is a single character [a-Z] or ctrl-<value> where
<value> is one of: a-z, @, ^, [, ,... (sent to the daemon as
'detachKeys')
request was made onwards.
hijacking
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/docker/api/operations.rb', line 241 def container_attach(id:, detach_keys: nil, logs: nil, stream: nil, stdin: nil, stdout: nil, stderr: nil, &block) connection.request( :post, "/containers/#{Path.escape(id)}/attach", query: { "detachKeys" => detach_keys, "logs" => logs, "stream" => stream, "stdin" => stdin, "stdout" => stdout, "stderr" => stderr, }, expects: [200], operation: "container_attach", &block ) end |
#container_attach_websocket {|chunk| ... } ⇒ Docker::API::Response
Attach to a container via a websocket
Engine API: GET /containers/id/attach/ws
a container.Format is a single character [a-Z] or ctrl-<value> where
<value> is one of: a-z, @, ^, [, ,,... (sent to the daemon
as 'detachKeys')
hijacking
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/docker/api/operations.rb', line 281 def container_attach_websocket(id:, detach_keys: nil, logs: nil, stream: nil, stdin: nil, stdout: nil, stderr: nil, &block) connection.request( :get, "/containers/#{Path.escape(id)}/attach/ws", query: { "detachKeys" => detach_keys, "logs" => logs, "stream" => stream, "stdin" => stdin, "stdout" => stdout, "stderr" => stderr, }, expects: [200], operation: "container_attach_websocket", &block ) end |
#container_changes {|chunk| ... } ⇒ Docker::API::Response
Get changes on a container’s filesystem
Returns which files in a container's filesystem have been added, deleted,
or modified. The Kind of modification can be one of:
Engine API: GET /containers/id/changes
312 313 314 315 316 317 318 319 320 |
# File 'lib/docker/api/operations.rb', line 312 def container_changes(id:, &block) connection.request( :get, "/containers/#{Path.escape(id)}/changes", expects: [200], operation: "container_changes", &block ) end |
#container_create {|chunk| ... } ⇒ Docker::API::Response
Create a container
Engine API: POST /containers/create
specification)
Must match /?[a-zA-Z0-9][a-zA-Z0-9_.-]+.
os[/arch[/variant]] used for image lookup.
339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/docker/api/operations.rb', line 339 def container_create(body:, name: nil, platform: nil, &block) connection.request( :post, "/containers/create", query: { "name" => name, "platform" => platform }, body: body, expects: [201], operation: "container_create", &block ) end |
#container_delete {|chunk| ... } ⇒ Docker::API::Response
Remove a container
Engine API: DELETE /containers/id
container. removing it. container.
369 370 371 372 373 374 375 376 377 378 |
# File 'lib/docker/api/operations.rb', line 369 def container_delete(id:, v: nil, force: nil, link: nil, &block) connection.request( :delete, "/containers/#{Path.escape(id)}", query: { "v" => v, "force" => force, "link" => link }, expects: [204], operation: "container_delete", &block ) end |
#container_exec {|chunk| ... } ⇒ Docker::API::Response
Create an exec instance
Run a command inside a running container.
Engine API: POST /containers/id/exec
the API specification)
918 919 920 921 922 923 924 925 926 927 |
# File 'lib/docker/api/operations.rb', line 918 def container_exec(id:, body:, &block) connection.request( :post, "/containers/#{Path.escape(id)}/exec", body: body, expects: [201], operation: "container_exec", &block ) end |
#container_export {|chunk| ... } ⇒ Docker::API::Response
Export a container
Export the contents of a container as a tarball.
Engine API: GET /containers/id/export
392 393 394 395 396 397 398 399 400 |
# File 'lib/docker/api/operations.rb', line 392 def container_export(id:, &block) connection.request( :get, "/containers/#{Path.escape(id)}/export", expects: [200], operation: "container_export", &block ) end |
#container_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a container
Return low-level information about a container.
Engine API: GET /containers/id/json
SizeRw and SizeRootFs
416 417 418 419 420 421 422 423 424 425 |
# File 'lib/docker/api/operations.rb', line 416 def container_inspect(id:, size: nil, &block) connection.request( :get, "/containers/#{Path.escape(id)}/json", query: { "size" => size }, expects: [200], operation: "container_inspect", &block ) end |
#container_kill {|chunk| ... } ⇒ Docker::API::Response
Kill a container
Send a POSIX signal to a container, defaulting to killing to the container.
Engine API: POST /containers/id/kill
integer or string (e.g. SIGINT).
443 444 445 446 447 448 449 450 451 452 |
# File 'lib/docker/api/operations.rb', line 443 def container_kill(id:, signal: nil, &block) connection.request( :post, "/containers/#{Path.escape(id)}/kill", query: { "signal" => signal }, expects: [204], operation: "container_kill", &block ) end |
#container_list {|chunk| ... } ⇒ Docker::API::Response
List containers
Returns a list of containers. For details on the format, see the inspect endpoint.
Engine API: GET /containers/json
running containers are shown.
containers, including non-running ones.
SizeRw and SizeRootFs.
encoded as JSON (a map[string][]string). For example, {"status": ["paused"]} will only return paused containers.
475 476 477 478 479 480 481 482 483 484 |
# File 'lib/docker/api/operations.rb', line 475 def container_list(all: nil, limit: nil, size: nil, filters: nil, &block) connection.request( :get, "/containers/json", query: { "all" => all, "limit" => limit, "size" => size, "filters" => filters }, expects: [200], operation: "container_list", &block ) end |
#container_logs {|chunk| ... } ⇒ Docker::API::Response
Get container logs
Get stdout and stderr logs from a container.
Engine API: GET /containers/id/logs
timestamp
UNIX timestamp (sent to the daemon as 'until')
end of the logs. Specify as an integer or all to output all log lines.
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/docker/api/operations.rb', line 508 def container_logs( id:, follow: nil, stdout: nil, stderr: nil, since: nil, until_: nil, timestamps: nil, tail: nil, &block ) connection.request( :get, "/containers/#{Path.escape(id)}/logs", query: { "follow" => follow, "stdout" => stdout, "stderr" => stderr, "since" => since, "until" => until_, "timestamps" => , "tail" => tail, }, expects: [200], operation: "container_logs", &block ) end |
#container_pause {|chunk| ... } ⇒ Docker::API::Response
Pause a container
Use the freezer cgroup to suspend all processes in a container.
Engine API: POST /containers/id/pause
549 550 551 552 553 554 555 556 557 |
# File 'lib/docker/api/operations.rb', line 549 def container_pause(id:, &block) connection.request( :post, "/containers/#{Path.escape(id)}/pause", expects: [204], operation: "container_pause", &block ) end |
#container_prune {|chunk| ... } ⇒ Docker::API::Response
Delete stopped containers
Engine API: POST /containers/prune
encoded as JSON (a map[string][]string).
569 570 571 572 573 574 575 576 577 578 |
# File 'lib/docker/api/operations.rb', line 569 def container_prune(filters: nil, &block) connection.request( :post, "/containers/prune", query: { "filters" => filters }, expects: [200], operation: "container_prune", &block ) end |
#container_rename {|chunk| ... } ⇒ Docker::API::Response
Rename a container
Engine API: POST /containers/id/rename
592 593 594 595 596 597 598 599 600 601 |
# File 'lib/docker/api/operations.rb', line 592 def container_rename(id:, name:, &block) connection.request( :post, "/containers/#{Path.escape(id)}/rename", query: { "name" => name }, expects: [204], operation: "container_rename", &block ) end |
#container_resize {|chunk| ... } ⇒ Docker::API::Response
Resize a container TTY
Resize the TTY for a container.
Engine API: POST /containers/id/resize
617 618 619 620 621 622 623 624 625 626 |
# File 'lib/docker/api/operations.rb', line 617 def container_resize(id:, h:, w:, &block) connection.request( :post, "/containers/#{Path.escape(id)}/resize", query: { "h" => h, "w" => w }, expects: [200], operation: "container_resize", &block ) end |
#container_restart {|chunk| ... } ⇒ Docker::API::Response
Restart a container
Engine API: POST /containers/id/restart
integer or string (e.g. SIGINT).
container
642 643 644 645 646 647 648 649 650 651 |
# File 'lib/docker/api/operations.rb', line 642 def container_restart(id:, signal: nil, t: nil, &block) connection.request( :post, "/containers/#{Path.escape(id)}/restart", query: { "signal" => signal, "t" => t }, expects: [204], operation: "container_restart", &block ) end |
#container_start {|chunk| ... } ⇒ Docker::API::Response
Start a container
Engine API: POST /containers/id/start
a container. Format is a single character [a-Z] or ctrl-<value>
where <value> is one of: a-z, @, ^, [, ,... (sent to the
daemon as 'detachKeys')
668 669 670 671 672 673 674 675 676 677 |
# File 'lib/docker/api/operations.rb', line 668 def container_start(id:, detach_keys: nil, &block) connection.request( :post, "/containers/#{Path.escape(id)}/start", query: { "detachKeys" => detach_keys }, expects: [204], operation: "container_start", &block ) end |
#container_stats {|chunk| ... } ⇒ Docker::API::Response
Get container stats based on resource usage
This endpoint returns a live stream of a container’s resource usage statistics.
Engine API: GET /containers/id/stats
be output once and then it will disconnect.
for 2 cycles. Must be used with stream=false. (sent to the daemon as
'one-shot')
697 698 699 700 701 702 703 704 705 706 |
# File 'lib/docker/api/operations.rb', line 697 def container_stats(id:, stream: nil, one_shot: nil, &block) connection.request( :get, "/containers/#{Path.escape(id)}/stats", query: { "stream" => stream, "one-shot" => one_shot }, expects: [200], operation: "container_stats", &block ) end |
#container_stop {|chunk| ... } ⇒ Docker::API::Response
Stop a container
Engine API: POST /containers/id/stop
integer or string (e.g. SIGINT).
container
723 724 725 726 727 728 729 730 731 732 |
# File 'lib/docker/api/operations.rb', line 723 def container_stop(id:, signal: nil, t: nil, &block) connection.request( :post, "/containers/#{Path.escape(id)}/stop", query: { "signal" => signal, "t" => t }, expects: [204], operation: "container_stop", &block ) end |
#container_top {|chunk| ... } ⇒ Docker::API::Response
List processes running inside a container
On Unix systems, this is done by running the ps command. This endpoint
is not supported on Windows.
Engine API: GET /containers/id/top
aux
749 750 751 752 753 754 755 756 757 758 |
# File 'lib/docker/api/operations.rb', line 749 def container_top(id:, ps_args: nil, &block) connection.request( :get, "/containers/#{Path.escape(id)}/top", query: { "ps_args" => ps_args }, expects: [200], operation: "container_top", &block ) end |
#container_unpause {|chunk| ... } ⇒ Docker::API::Response
Unpause a container
Resume a container which has been paused.
Engine API: POST /containers/id/unpause
772 773 774 775 776 777 778 779 780 |
# File 'lib/docker/api/operations.rb', line 772 def container_unpause(id:, &block) connection.request( :post, "/containers/#{Path.escape(id)}/unpause", expects: [204], operation: "container_unpause", &block ) end |
#container_update {|chunk| ... } ⇒ Docker::API::Response
Update a container
Change various configuration options of a container without having to recreate it.
Engine API: POST /containers/id/update
796 797 798 799 800 801 802 803 804 805 |
# File 'lib/docker/api/operations.rb', line 796 def container_update(id:, body:, &block) connection.request( :post, "/containers/#{Path.escape(id)}/update", body: body, expects: [200], operation: "container_update", &block ) end |
#container_wait {|chunk| ... } ⇒ Docker::API::Response
Wait for a container
Block until a container stops, then returns the exit code.
Engine API: POST /containers/id/wait
given condition.
822 823 824 825 826 827 828 829 830 831 |
# File 'lib/docker/api/operations.rb', line 822 def container_wait(id:, condition: nil, &block) connection.request( :post, "/containers/#{Path.escape(id)}/wait", query: { "condition" => condition }, expects: [200], operation: "container_wait", &block ) end |
#distribution_inspect {|chunk| ... } ⇒ Docker::API::Response
Get image information from the registry
Return image digest and platform information by contacting the registry.
Engine API: GET /distribution/name/json
image found
893 894 895 896 897 898 899 900 901 |
# File 'lib/docker/api/operations.rb', line 893 def distribution_inspect(name:, &block) connection.request( :get, "/distribution/#{Path.escape(name)}/json", expects: [200], operation: "distribution_inspect", &block ) end |
#exec_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect an exec instance
Return low-level information about an exec instance.
Engine API: GET /exec/id/json
941 942 943 944 945 946 947 948 949 |
# File 'lib/docker/api/operations.rb', line 941 def exec_inspect(id:, &block) connection.request( :get, "/exec/#{Path.escape(id)}/json", expects: [200], operation: "exec_inspect", &block ) end |
#exec_resize {|chunk| ... } ⇒ Docker::API::Response
Resize an exec instance
Resize the TTY session used by an exec instance. This endpoint only works
if tty was specified as part of creating and starting the exec instance.
Engine API: POST /exec/id/resize
967 968 969 970 971 972 973 974 975 976 |
# File 'lib/docker/api/operations.rb', line 967 def exec_resize(id:, h:, w:, &block) connection.request( :post, "/exec/#{Path.escape(id)}/resize", query: { "h" => h, "w" => w }, expects: [200], operation: "exec_resize", &block ) end |
#exec_start {|chunk| ... } ⇒ Docker::API::Response
Start an exec instance
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.
Engine API: POST /exec/id/start
specification)
994 995 996 997 998 999 1000 1001 1002 1003 |
# File 'lib/docker/api/operations.rb', line 994 def exec_start(id:, body: nil, &block) connection.request( :post, "/exec/#{Path.escape(id)}/start", body: body, expects: [200], operation: "exec_start", &block ) end |
#get_plugin_privileges {|chunk| ... } ⇒ Docker::API::Response
Get plugin privileges
Engine API: GET /plugins/privileges
optional, and is the default if omitted.
1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 |
# File 'lib/docker/api/operations.rb', line 1918 def get_plugin_privileges(remote:, &block) connection.request( :get, "/plugins/privileges", query: { "remote" => remote }, expects: [200], operation: "get_plugin_privileges", &block ) end |
#image_attestations {|chunk| ... } ⇒ Docker::API::Response
Get attestation statements for an image
Return the in-toto attestation statements attached to the image for the given platform. The daemon locates the attestation manifest(s) that reference the matching platform image manifest, reads their statement layers, and returns the verbatim statement JSON together with layer metadata.
Engine API: GET /images/name/attestations
the image variant whose attestations to return. If omitted, the daemon's
default (host) platform is used.
returned statements. May be repeated to accept any of several predicate
types. If omitted, all statements are returned.
body in each returned entry. Defaults to false; when omitted or false,
only the descriptor and predicate type are returne...
platform value)
found for the requested platform
not support attestations. This is returned by the legacy (...
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 |
# File 'lib/docker/api/operations.rb', line 1069 def image_attestations(name:, platform: nil, type: nil, statement: nil, &block) connection.request( :get, "/images/#{Path.escape(name)}/attestations", query: { "platform" => platform, "type" => type, "statement" => statement }, expects: [200], operation: "image_attestations", &block ) end |
#image_build {|chunk| ... } ⇒ Docker::API::Response
Build an image
Build an image from a tar archive with a Dockerfile in it.
Engine API: POST /build
Dockerfile. This is ignored if remote is specified and points to an
external Dockerfile.
the name:tag format. If you omit the tag the default latest value is
assumed. You can provide several t p...
URI. If the URI points to a single text file, the file’s contents are
placed into a file called Dockerfile and the...
image.
resolution.
image exists locally.
successful build.
even upon failure.
to disable swap.
0-3, 0,1).
microseconds.
container can get in a CPU period.
variables. Users pass these values at build-time. Docker uses the
buildargs as the environment context for commands run...
be greater than 0. If omitted the system uses 64MB.
single layer. (Experimental release only.)
image, as a JSON map of string pairs.
commands during build. Supported standard values are: bridge, host,
none, and container:<name|id>. Any other value...
of a stringified JSON array of objects. Each object must have two
top-level properties: Type and Attrs. The `Typ...
object with auth configurations for multiple registries that a build may
refer to. (sent to the daemon as 'X-Registry-Config')
following algorithms: identity (no compression), gzip, bzip2, xz. (body
parameter 'inputStream' in the API specification)
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 |
# File 'lib/docker/api/operations.rb', line 1147 def image_build( dockerfile: nil, t: nil, extrahosts: nil, remote: nil, q: nil, nocache: nil, cachefrom: nil, pull: nil, rm: nil, forcerm: nil, memory: nil, memswap: nil, cpushares: nil, cpusetcpus: nil, cpuperiod: nil, cpuquota: nil, buildargs: nil, shmsize: nil, squash: nil, labels: nil, networkmode: nil, platform: nil, target: nil, outputs: nil, version: nil, content_type: nil, x_registry_config: nil, body: nil, &block ) connection.request( :post, "/build", query: { "dockerfile" => dockerfile, "t" => t, "extrahosts" => extrahosts, "remote" => remote, "q" => q, "nocache" => nocache, "cachefrom" => cachefrom, "pull" => pull, "rm" => rm, "forcerm" => forcerm, "memory" => memory, "memswap" => memswap, "cpushares" => cpushares, "cpusetcpus" => cpusetcpus, "cpuperiod" => cpuperiod, "cpuquota" => cpuquota, "buildargs" => buildargs, "shmsize" => shmsize, "squash" => squash, "labels" => labels, "networkmode" => networkmode, "platform" => platform, "target" => target, "outputs" => outputs, "version" => version, }, headers: { "Content-type" => content_type, "X-Registry-Config" => x_registry_config }.compact, body: body, expects: [200], operation: "image_build", &block ) end |
#image_commit {|chunk| ... } ⇒ Docker::API::Response
Create a new image from a container
Engine API: POST /commit
Smith hannibal@a-team.com`) committing committing 'containerConfig' in the API specification)
1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 |
# File 'lib/docker/api/operations.rb', line 1237 def image_commit( container: nil, repo: nil, tag: nil, comment: nil, author: nil, pause: nil, changes: nil, body: nil, &block ) connection.request( :post, "/commit", query: { "container" => container, "repo" => repo, "tag" => tag, "comment" => comment, "author" => , "pause" => pause, "changes" => changes, }, body: body, expects: [201], operation: "image_commit", &block ) end |
#image_create {|chunk| ... } ⇒ Docker::API::Response
Create an image
Pull or import an image.
Engine API: POST /images/create
includes a tag or digest, specific behavior applies: (sent to the daemon
as 'fromImage')
from which the image can be retrieved or - to read the image from the
request body. This parameter may only be used w... (sent to the daemon
as 'fromSrc')
imported. The repo may include a tag. This parameter may only be used
when importing an image.
this causes all tags for the given image to be pulled.
the image that is created, for example: changes=ENV DEBUG=true. Note
that ENV DEBUG=true should be URI component encoded.
os[/arch[/variant]].
configuration. (sent to the daemon as 'X-Registry-Auth')
specified in fromSrc query parameter (body parameter 'inputImage' in the
API specification)
read access
1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 |
# File 'lib/docker/api/operations.rb', line 1302 def image_create( from_image: nil, from_src: nil, repo: nil, tag: nil, message: nil, changes: nil, platform: nil, x_registry_auth: nil, body: nil, &block ) connection.request( :post, "/images/create", query: { "fromImage" => from_image, "fromSrc" => from_src, "repo" => repo, "tag" => tag, "message" => , "changes" => changes, "platform" => platform, }, headers: { "X-Registry-Auth" => x_registry_auth }.compact, body: body, expects: [200], operation: "image_create", &block ) end |
#image_delete {|chunk| ... } ⇒ Docker::API::Response
Remove an image
Remove an image, along with any untagged parent images that were referenced by that image.
Engine API: DELETE /images/name
stopped containers or has other tags to delete. Multiple values are accepted. Each platform is a OCI platform encoded as a JSON string.
1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 |
# File 'lib/docker/api/operations.rb', line 1354 def image_delete(name:, force: nil, noprune: nil, platforms: nil, &block) connection.request( :delete, "/images/#{Path.escape(name)}", query: { "force" => force, "noprune" => noprune, "platforms" => platforms }, expects: [200], operation: "image_delete", &block ) end |
#image_get {|chunk| ... } ⇒ Docker::API::Response
Export an image
Get a tarball containing all images and metadata for a repository.
Engine API: GET /images/name/get
describing a platform which will be used to select a platform-specific image to be saved if the image is multi-platform. If not provid...
1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 |
# File 'lib/docker/api/operations.rb', line 1379 def image_get(name:, platform: nil, &block) connection.request( :get, "/images/#{Path.escape(name)}/get", query: { "platform" => platform }, expects: [200], operation: "image_get", &block ) end |
#image_get_all {|chunk| ... } ⇒ Docker::API::Response
Export several images
Get a tarball containing all images and metadata for several image repositories.
Engine API: GET /images/get
will be used to select the platform-specific image(s) to be saved if the image is multi-platform. If not provided, the full m...
1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 |
# File 'lib/docker/api/operations.rb', line 1405 def image_get_all(names: nil, platform: nil, &block) connection.request( :get, "/images/get", query: { "names" => names, "platform" => platform }, expects: [200], operation: "image_get_all", &block ) end |
#image_history {|chunk| ... } ⇒ Docker::API::Response
Get the history of an image
Return parent layers of an image.
Engine API: GET /images/name/history
platform-variant. If omitted, it defaults to any locally available platform, prioritizing the daemon's host platform.
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 |
# File 'lib/docker/api/operations.rb', line 1431 def image_history(name:, platform: nil, &block) connection.request( :get, "/images/#{Path.escape(name)}/history", query: { "platform" => platform }, expects: [200], operation: "image_history", &block ) end |
#image_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect an image
Return low-level information about an image.
Engine API: GET /images/name/json
platform-variant. If omitted, it defaults to any locally available platform, prioritizing the daemon's host platform.
1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 |
# File 'lib/docker/api/operations.rb', line 1458 def image_inspect(name:, manifests: nil, platform: nil, &block) connection.request( :get, "/images/#{Path.escape(name)}/json", query: { "manifests" => manifests, "platform" => platform }, expects: [200], operation: "image_inspect", &block ) end |
#image_list {|chunk| ... } ⇒ Docker::API::Response
List Images
Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image.
Engine API: GET /images/json
layer (no children) are shown by default.
map[string][]string) to process on the images list.
SharedSize field on each image. (sent to the daemon as 'shared-size')
field on each image.
summary.
summary. Requires manifests=1.
1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 |
# File 'lib/docker/api/operations.rb', line 1492 def image_list(all: nil, filters: nil, shared_size: nil, digests: nil, manifests: nil, identity: nil, &block) connection.request( :get, "/images/json", query: { "all" => all, "filters" => filters, "shared-size" => shared_size, "digests" => digests, "manifests" => manifests, "identity" => identity, }, expects: [200], operation: "image_list", &block ) end |
#image_load {|chunk| ... } ⇒ Docker::API::Response
Import images
Load a set of images and tags into a repository.
Engine API: POST /images/load
will be used to select the platform-specific image(s) to load if the image is multi-platform. If not provided, the full multi... 'imagesTarball' in the API specification)
1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 |
# File 'lib/docker/api/operations.rb', line 1526 def image_load(quiet: nil, platform: nil, body: nil, &block) connection.request( :post, "/images/load", query: { "quiet" => quiet, "platform" => platform }, body: body, expects: [200], operation: "image_load", &block ) end |
#image_prune {|chunk| ... } ⇒ Docker::API::Response
Delete unused images
Engine API: POST /images/prune
encoded as JSON (a map[string][]string). Available filters:
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 |
# File 'lib/docker/api/operations.rb', line 1548 def image_prune(filters: nil, &block) connection.request( :post, "/images/prune", query: { "filters" => filters }, expects: [200], operation: "image_prune", &block ) end |
#image_push {|chunk| ... } ⇒ Docker::API::Response
Push an image
Push an image to a registry.
Engine API: POST /images/name/push
registry.example.com/myimage. The image must be present in the local
image store with the same name.
(sent to the daemon as 'X-Registry-Auth')
latest. If no tag is provided, all tags of the given image that are
present in the local image store are pushed.
platform-variant to push. If not provided, all available variants will
attempt to be pushed.
1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 |
# File 'lib/docker/api/operations.rb', line 1581 def image_push(name:, x_registry_auth:, tag: nil, platform: nil, &block) connection.request( :post, "/images/#{Path.escape(name)}/push", query: { "tag" => tag, "platform" => platform }, headers: { "X-Registry-Auth" => x_registry_auth }.compact, expects: [200], operation: "image_push", &block ) end |
#image_search {|chunk| ... } ⇒ Docker::API::Response
Search images
Search for an image on Docker Hub.
Engine API: GET /images/search
map[string][]string) to process on the images list. Available filters:
1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 |
# File 'lib/docker/api/operations.rb', line 1607 def image_search(term:, limit: nil, filters: nil, &block) connection.request( :get, "/images/search", query: { "term" => term, "limit" => limit, "filters" => filters }, expects: [200], operation: "image_search", &block ) end |
#image_tag {|chunk| ... } ⇒ Docker::API::Response
Tag an image
Create a tag that refers to a source image.
Engine API: POST /images/name/tag
someuser/someimage.
1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 |
# File 'lib/docker/api/operations.rb', line 1635 def image_tag(name:, repo: nil, tag: nil, &block) connection.request( :post, "/images/#{Path.escape(name)}/tag", query: { "repo" => repo, "tag" => tag }, expects: [201], operation: "image_tag", &block ) end |
#network_connect {|chunk| ... } ⇒ Docker::API::Response
Connect a container to a network
The network must be either a local-scoped network or a swarm-scoped
network with the attachable option set. A network cannot be re-attached
to a running container
Engine API: POST /networks/id/connect
1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 |
# File 'lib/docker/api/operations.rb', line 1663 def network_connect(id:, body:, &block) connection.request( :post, "/networks/#{Path.escape(id)}/connect", body: body, expects: [200], operation: "network_connect", &block ) end |
#network_create {|chunk| ... } ⇒ Docker::API::Response
Create a network
Engine API: POST /networks/create
in the API specification) when trying to create a network named after a pre-define...
1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 |
# File 'lib/docker/api/operations.rb', line 1688 def network_create(body:, &block) connection.request( :post, "/networks/create", body: body, expects: [201], operation: "network_create", &block ) end |
#network_delete {|chunk| ... } ⇒ Docker::API::Response
Remove a network
Engine API: DELETE /networks/id
pre-defined networks
1711 1712 1713 1714 1715 1716 1717 1718 1719 |
# File 'lib/docker/api/operations.rb', line 1711 def network_delete(id:, &block) connection.request( :delete, "/networks/#{Path.escape(id)}", expects: [204], operation: "network_delete", &block ) end |
#network_disconnect {|chunk| ... } ⇒ Docker::API::Response
Disconnect a container from a network
Engine API: POST /networks/id/disconnect
scoped networks
1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 |
# File 'lib/docker/api/operations.rb', line 1734 def network_disconnect(id:, body:, &block) connection.request( :post, "/networks/#{Path.escape(id)}/disconnect", body: body, expects: [200], operation: "network_disconnect", &block ) end |
#network_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a network
Engine API: GET /networks/id
troubleshooting or local)
1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 |
# File 'lib/docker/api/operations.rb', line 1759 def network_inspect(id:, verbose: nil, scope: nil, &block) connection.request( :get, "/networks/#{Path.escape(id)}", query: { "verbose" => verbose, "scope" => scope }, expects: [200], operation: "network_inspect", &block ) end |
#network_list {|chunk| ... } ⇒ Docker::API::Response
List networks
Returns a list of networks. For details on the format, see the network inspect endpoint.
Engine API: GET /networks
map[string][]string) to process on the networks list.
1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 |
# File 'lib/docker/api/operations.rb', line 1783 def network_list(filters: nil, &block) connection.request( :get, "/networks", query: { "filters" => filters }, expects: [200], operation: "network_list", &block ) end |
#network_prune {|chunk| ... } ⇒ Docker::API::Response
Delete unused networks
Engine API: POST /networks/prune
encoded as JSON (a map[string][]string).
1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 |
# File 'lib/docker/api/operations.rb', line 1804 def network_prune(filters: nil, &block) connection.request( :post, "/networks/prune", query: { "filters" => filters }, expects: [200], operation: "network_prune", &block ) end |
#node_delete {|chunk| ... } ⇒ Docker::API::Response
Delete a node
Engine API: DELETE /nodes/id
1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 |
# File 'lib/docker/api/operations.rb', line 1827 def node_delete(id:, force: nil, &block) connection.request( :delete, "/nodes/#{Path.escape(id)}", query: { "force" => force }, expects: [200], operation: "node_delete", &block ) end |
#node_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a node
Engine API: GET /nodes/id
1849 1850 1851 1852 1853 1854 1855 1856 1857 |
# File 'lib/docker/api/operations.rb', line 1849 def node_inspect(id:, &block) connection.request( :get, "/nodes/#{Path.escape(id)}", expects: [200], operation: "node_inspect", &block ) end |
#node_list {|chunk| ... } ⇒ Docker::API::Response
List nodes
Engine API: GET /nodes
encoded as JSON (a map[string][]string).
1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 |
# File 'lib/docker/api/operations.rb', line 1870 def node_list(filters: nil, &block) connection.request( :get, "/nodes", query: { "filters" => filters }, expects: [200], operation: "node_list", &block ) end |
#node_update {|chunk| ... } ⇒ Docker::API::Response
Update a node
Engine API: POST /nodes/id/update
updated. This is required to avoid conflicting writes.
1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 |
# File 'lib/docker/api/operations.rb', line 1896 def node_update(id:, version:, body: nil, &block) connection.request( :post, "/nodes/#{Path.escape(id)}/update", query: { "version" => version }, body: body, expects: [200], operation: "node_update", &block ) end |
#plugin_create {|chunk| ... } ⇒ Docker::API::Response
Create a plugin
Engine API: POST /plugins/create
optional, and is the default if omitted. manifest (body parameter 'tarContext' in the API specification)
1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 |
# File 'lib/docker/api/operations.rb', line 1941 def plugin_create(name:, body: nil, &block) connection.request( :post, "/plugins/create", query: { "name" => name }, body: body, expects: [204], operation: "plugin_create", &block ) end |
#plugin_delete {|chunk| ... } ⇒ Docker::API::Response
Remove a plugin
Engine API: DELETE /plugins/name
optional, and is the default if omitted. result in issues if the plugin is in use by a container.
1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 |
# File 'lib/docker/api/operations.rb', line 1966 def plugin_delete(name:, force: nil, &block) connection.request( :delete, "/plugins/#{Path.escape(name)}", query: { "force" => force }, expects: [200], operation: "plugin_delete", &block ) end |
#plugin_disable {|chunk| ... } ⇒ Docker::API::Response
Disable a plugin
Engine API: POST /plugins/name/disable
optional, and is the default if omitted.
1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 |
# File 'lib/docker/api/operations.rb', line 1989 def plugin_disable(name:, force: nil, &block) connection.request( :post, "/plugins/#{Path.escape(name)}/disable", query: { "force" => force }, expects: [200], operation: "plugin_disable", &block ) end |
#plugin_enable {|chunk| ... } ⇒ Docker::API::Response
Enable a plugin
Engine API: POST /plugins/name/enable
optional, and is the default if omitted.
2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 |
# File 'lib/docker/api/operations.rb', line 2012 def plugin_enable(name:, timeout: nil, &block) connection.request( :post, "/plugins/#{Path.escape(name)}/enable", query: { "timeout" => timeout }, expects: [200], operation: "plugin_enable", &block ) end |
#plugin_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a plugin
Engine API: GET /plugins/name/json
optional, and is the default if omitted.
2034 2035 2036 2037 2038 2039 2040 2041 2042 |
# File 'lib/docker/api/operations.rb', line 2034 def plugin_inspect(name:, &block) connection.request( :get, "/plugins/#{Path.escape(name)}/json", expects: [200], operation: "plugin_inspect", &block ) end |
#plugin_list {|chunk| ... } ⇒ Docker::API::Response
List plugins
Returns information about installed plugins.
Engine API: GET /plugins
map[string][]string) to process on the plugin list.
2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 |
# File 'lib/docker/api/operations.rb', line 2056 def plugin_list(filters: nil, &block) connection.request( :get, "/plugins", query: { "filters" => filters }, expects: [200], operation: "plugin_list", &block ) end |
#plugin_pull {|chunk| ... } ⇒ Docker::API::Response
Install a plugin
Pulls and installs a plugin. After the plugin is installed, it can be
enabled using the POST /plugins/{name}/enable
endpoint.
Engine API: POST /plugins/pull
configuration to use when pulling a plugin from a registry. (sent to the daemon as 'X-Registry-Auth')
2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 |
# File 'lib/docker/api/operations.rb', line 2085 def plugin_pull(remote:, name: nil, x_registry_auth: nil, body: nil, &block) connection.request( :post, "/plugins/pull", query: { "remote" => remote, "name" => name }, headers: { "X-Registry-Auth" => x_registry_auth }.compact, body: body, expects: [204], operation: "plugin_pull", &block ) end |
#plugin_push {|chunk| ... } ⇒ Docker::API::Response
Push a plugin
Push a plugin to the registry.
Engine API: POST /plugins/name/push
optional, and is the default if omitted.
2111 2112 2113 2114 2115 2116 2117 2118 2119 |
# File 'lib/docker/api/operations.rb', line 2111 def plugin_push(name:, &block) connection.request( :post, "/plugins/#{Path.escape(name)}/push", expects: [200], operation: "plugin_push", &block ) end |
#plugin_set {|chunk| ... } ⇒ Docker::API::Response
Configure a plugin
Engine API: POST /plugins/name/set
optional, and is the default if omitted.
2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 |
# File 'lib/docker/api/operations.rb', line 2133 def plugin_set(name:, body: nil, &block) connection.request( :post, "/plugins/#{Path.escape(name)}/set", body: body, expects: [204], operation: "plugin_set", &block ) end |
#plugin_upgrade {|chunk| ... } ⇒ Docker::API::Response
Upgrade a plugin
Engine API: POST /plugins/name/upgrade
optional, and is the default if omitted. configuration to use when pulling a plugin from a registry. (sent to the daemon as 'X-Registry-Auth')
2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 |
# File 'lib/docker/api/operations.rb', line 2160 def plugin_upgrade(name:, remote:, x_registry_auth: nil, body: nil, &block) connection.request( :post, "/plugins/#{Path.escape(name)}/upgrade", query: { "remote" => remote }, headers: { "X-Registry-Auth" => x_registry_auth }.compact, body: body, expects: [204], operation: "plugin_upgrade", &block ) end |
#put_container_archive {|chunk| ... } ⇒ Docker::API::Response
Extract an archive of files or folders to a directory in a container
Upload a tar archive to be extracted to a path in the filesystem of
container id. path parameter is asserted to be a directory. If it exists
as a file, 400 error will be returned with message "not a directory".
Engine API: PUT /containers/id/archive
archive’s contents into.
with one of the following algorithms: identity (no compression),
gzip, bzip2, or xz. (body parameter 'inputStream' in the API
specification)
then it will be an error if unpacking the given content would cause an
existing directory to be replaced with a non-directory and vice... (sent
to the daemon as 'noOverwriteDirNonDir')
UID/GID maps to the dest file or dir (sent to the daemon as
'copyUIDGID')
container rootfs is marked as read-only.
exist inside the container
864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
# File 'lib/docker/api/operations.rb', line 864 def put_container_archive(id:, path:, body:, no_overwrite_dir_non_dir: nil, copy_uidgid: nil, &block) connection.request( :put, "/containers/#{Path.escape(id)}/archive", query: { "path" => path, "noOverwriteDirNonDir" => no_overwrite_dir_non_dir, "copyUIDGID" => copy_uidgid, }, body: body, expects: [200], operation: "put_container_archive", &block ) end |
#secret_create {|chunk| ... } ⇒ Docker::API::Response
Create a secret
Engine API: POST /secrets/create
object
2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 |
# File 'lib/docker/api/operations.rb', line 2185 def secret_create(body: nil, &block) connection.request( :post, "/secrets/create", body: body, expects: [201], operation: "secret_create", &block ) end |
#secret_delete {|chunk| ... } ⇒ Docker::API::Response
Delete a secret
Engine API: DELETE /secrets/id
2207 2208 2209 2210 2211 2212 2213 2214 2215 |
# File 'lib/docker/api/operations.rb', line 2207 def secret_delete(id:, &block) connection.request( :delete, "/secrets/#{Path.escape(id)}", expects: [204], operation: "secret_delete", &block ) end |
#secret_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a secret
Engine API: GET /secrets/id
2228 2229 2230 2231 2232 2233 2234 2235 2236 |
# File 'lib/docker/api/operations.rb', line 2228 def secret_inspect(id:, &block) connection.request( :get, "/secrets/#{Path.escape(id)}", expects: [200], operation: "secret_inspect", &block ) end |
#secret_list {|chunk| ... } ⇒ Docker::API::Response
List secrets
Engine API: GET /secrets
map[string][]string) to process on the secrets list.
2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 |
# File 'lib/docker/api/operations.rb', line 2249 def secret_list(filters: nil, &block) connection.request( :get, "/secrets", query: { "filters" => filters }, expects: [200], operation: "secret_list", &block ) end |
#secret_update {|chunk| ... } ⇒ Docker::API::Response
Update a Secret
Engine API: POST /secrets/id/update
updated. This is required to avoid conflicting writes. only the Labels field can be updated. All other fields must remain unchanged from the [SecretInspect endpoint](#ope... (body parameter 'body' in the API specification)
2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 |
# File 'lib/docker/api/operations.rb', line 2278 def secret_update(id:, version:, body: nil, &block) connection.request( :post, "/secrets/#{Path.escape(id)}/update", query: { "version" => version }, body: body, expects: [200], operation: "secret_update", &block ) end |
#service_create {|chunk| ... } ⇒ Docker::API::Response
Create a service
Engine API: POST /services/create
configuration for pulling from private registries. (sent to the daemon as 'X-Registry-Auth') services service
2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 |
# File 'lib/docker/api/operations.rb', line 2308 def service_create(body:, x_registry_auth: nil, &block) connection.request( :post, "/services/create", headers: { "X-Registry-Auth" => x_registry_auth }.compact, body: body, expects: [201], operation: "service_create", &block ) end |
#service_delete {|chunk| ... } ⇒ Docker::API::Response
Delete a service
Engine API: DELETE /services/id
2331 2332 2333 2334 2335 2336 2337 2338 2339 |
# File 'lib/docker/api/operations.rb', line 2331 def service_delete(id:, &block) connection.request( :delete, "/services/#{Path.escape(id)}", expects: [200], operation: "service_delete", &block ) end |
#service_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a service
Engine API: GET /services/id
values. (sent to the daemon as 'insertDefaults')
2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 |
# File 'lib/docker/api/operations.rb', line 2354 def service_inspect(id:, insert_defaults: nil, &block) connection.request( :get, "/services/#{Path.escape(id)}", query: { "insertDefaults" => insert_defaults }, expects: [200], operation: "service_inspect", &block ) end |
#service_list {|chunk| ... } ⇒ Docker::API::Response
List services
Engine API: GET /services
map[string][]string) to process on the services list.
running and desired tasks.
2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 |
# File 'lib/docker/api/operations.rb', line 2378 def service_list(filters: nil, status: nil, &block) connection.request( :get, "/services", query: { "filters" => filters, "status" => status }, expects: [200], operation: "service_list", &block ) end |
#service_logs {|chunk| ... } ⇒ Docker::API::Response
Get service logs
Get stdout and stderr logs from a service. See also
/containers/{id}/logs.
Engine API: GET /services/id/logs
provided to logs.
timestamp
end of the logs. Specify as an integer or all to output all log lines.
2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 |
# File 'lib/docker/api/operations.rb', line 2413 def service_logs( id:, details: nil, follow: nil, stdout: nil, stderr: nil, since: nil, timestamps: nil, tail: nil, &block ) connection.request( :get, "/services/#{Path.escape(id)}/logs", query: { "details" => details, "follow" => follow, "stdout" => stdout, "stderr" => stderr, "since" => since, "timestamps" => , "tail" => tail, }, expects: [200], operation: "service_logs", &block ) end |
#service_update {|chunk| ... } ⇒ Docker::API::Response
Update a service
Engine API: POST /services/id/update
updated. This is required to avoid conflicting writes. This version number should be the value as currently set o... is not specified, this parameter indicates where to find registry authorization credentials. (sent to the daemon as 'registryAuthFrom') cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case. configuration for pulling from private registries. (sent to the daemon as 'X-Registry-Auth')
2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 |
# File 'lib/docker/api/operations.rb', line 2467 def service_update(id:, body:, version:, registry_auth_from: nil, rollback: nil, x_registry_auth: nil, &block) connection.request( :post, "/services/#{Path.escape(id)}/update", query: { "version" => version, "registryAuthFrom" => registry_auth_from, "rollback" => rollback }, headers: { "X-Registry-Auth" => x_registry_auth }.compact, body: body, expects: [200], operation: "service_update", &block ) end |
#session {|chunk| ... } ⇒ Docker::API::Response
Initialize interactive session
Start a new interactive session with a server. Session allows server to call back to the client for advanced capabilities.
Engine API: POST /session
2493 2494 2495 2496 2497 2498 2499 2500 2501 |
# File 'lib/docker/api/operations.rb', line 2493 def session(&block) connection.request( :post, "/session", expects: [200], operation: "session", &block ) end |
#swarm_init {|chunk| ... } ⇒ Docker::API::Response
Initialize a new swarm
Engine API: POST /swarm/init
2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 |
# File 'lib/docker/api/operations.rb', line 2514 def swarm_init(body:, &block) connection.request( :post, "/swarm/init", body: body, expects: [200], operation: "swarm_init", &block ) end |
#swarm_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect swarm
Engine API: GET /swarm
2535 2536 2537 2538 2539 2540 2541 2542 2543 |
# File 'lib/docker/api/operations.rb', line 2535 def swarm_inspect(&block) connection.request( :get, "/swarm", expects: [200], operation: "swarm_inspect", &block ) end |
#swarm_join {|chunk| ... } ⇒ Docker::API::Response
Join an existing swarm
Engine API: POST /swarm/join
2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 |
# File 'lib/docker/api/operations.rb', line 2556 def swarm_join(body:, &block) connection.request( :post, "/swarm/join", body: body, expects: [200], operation: "swarm_join", &block ) end |
#swarm_leave {|chunk| ... } ⇒ Docker::API::Response
Leave a swarm
Engine API: POST /swarm/leave
manager or that it will break the cluster.
2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 |
# File 'lib/docker/api/operations.rb', line 2578 def swarm_leave(force: nil, &block) connection.request( :post, "/swarm/leave", query: { "force" => force }, expects: [200], operation: "swarm_leave", &block ) end |
#swarm_unlock {|chunk| ... } ⇒ Docker::API::Response
Unlock a locked manager
Engine API: POST /swarm/unlock
2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 |
# File 'lib/docker/api/operations.rb', line 2599 def swarm_unlock(body:, &block) connection.request( :post, "/swarm/unlock", body: body, expects: [200], operation: "swarm_unlock", &block ) end |
#swarm_unlockkey {|chunk| ... } ⇒ Docker::API::Response
Get the unlock key
Engine API: GET /swarm/unlockkey
2619 2620 2621 2622 2623 2624 2625 2626 2627 |
# File 'lib/docker/api/operations.rb', line 2619 def swarm_unlockkey(&block) connection.request( :get, "/swarm/unlockkey", expects: [200], operation: "swarm_unlockkey", &block ) end |
#swarm_update {|chunk| ... } ⇒ Docker::API::Response
Update a swarm
Engine API: POST /swarm/update
updated. This is required to avoid conflicting writes. (sent to the daemon as 'rotateWorkerToken') token. (sent to the daemon as 'rotateManagerToken') unlock key. (sent to the daemon as 'rotateManagerUnlockKey')
2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 |
# File 'lib/docker/api/operations.rb', line 2648 def swarm_update( body:, version:, rotate_worker_token: nil, rotate_manager_token: nil, rotate_manager_unlock_key: nil, &block ) connection.request( :post, "/swarm/update", query: { "version" => version, "rotateWorkerToken" => rotate_worker_token, "rotateManagerToken" => rotate_manager_token, "rotateManagerUnlockKey" => rotate_manager_unlock_key, }, body: body, expects: [200], operation: "swarm_update", &block ) end |
#system_auth {|chunk| ... } ⇒ Docker::API::Response
Check auth configuration
Validate credentials for a registry and, if available, get an identity token for accessing the registry without password.
Engine API: POST /auth
'authConfig' in the API specification)
2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 |
# File 'lib/docker/api/operations.rb', line 2686 def system_auth(body: nil, &block) connection.request( :post, "/auth", body: body, expects: [200, 204], operation: "system_auth", &block ) end |
#system_data_usage {|chunk| ... } ⇒ Docker::API::Response
Get data usage information
Engine API: GET /system/df
return data.
2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 |
# File 'lib/docker/api/operations.rb', line 2708 def system_data_usage(type: nil, verbose: nil, &block) connection.request( :get, "/system/df", query: { "type" => type, "verbose" => verbose }, expects: [200], operation: "system_data_usage", &block ) end |
#system_events {|chunk| ... } ⇒ Docker::API::Response
Monitor events
Stream real-time events from the server.
Engine API: GET /events
stream new events.
then stop streaming. (sent to the daemon as 'until')
map[string][]string) to process on the event list. Available filters:
2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 |
# File 'lib/docker/api/operations.rb', line 2736 def system_events(since: nil, until_: nil, filters: nil, &block) connection.request( :get, "/events", query: { "since" => since, "until" => until_, "filters" => filters }, expects: [200], operation: "system_events", &block ) end |
#system_info {|chunk| ... } ⇒ Docker::API::Response
Get system information
Engine API: GET /info
2755 2756 2757 2758 2759 2760 2761 2762 2763 |
# File 'lib/docker/api/operations.rb', line 2755 def system_info(&block) connection.request( :get, "/info", expects: [200], operation: "system_info", &block ) end |
#system_ping {|chunk| ... } ⇒ Docker::API::Response
Ping
This is a dummy endpoint you can use to test if the server is accessible.
Engine API: GET /_ping
2775 2776 2777 2778 2779 2780 2781 2782 2783 |
# File 'lib/docker/api/operations.rb', line 2775 def system_ping(&block) connection.request( :get, "/_ping", expects: [200], operation: "system_ping", &block ) end |
#system_ping_head {|chunk| ... } ⇒ Docker::API::Response
Ping
This is a dummy endpoint you can use to test if the server is accessible.
Engine API: HEAD /_ping
2795 2796 2797 2798 2799 2800 2801 2802 2803 |
# File 'lib/docker/api/operations.rb', line 2795 def system_ping_head(&block) connection.request( :head, "/_ping", expects: [200], operation: "system_ping_head", &block ) end |
#system_version {|chunk| ... } ⇒ Docker::API::Response
Get version
Returns the version of Docker that is running and various information about the system that Docker is running on.
Engine API: GET /version
2816 2817 2818 2819 2820 2821 2822 2823 2824 |
# File 'lib/docker/api/operations.rb', line 2816 def system_version(&block) connection.request( :get, "/version", expects: [200], operation: "system_version", &block ) end |
#task_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a task
Engine API: GET /tasks/id
2837 2838 2839 2840 2841 2842 2843 2844 2845 |
# File 'lib/docker/api/operations.rb', line 2837 def task_inspect(id:, &block) connection.request( :get, "/tasks/#{Path.escape(id)}", expects: [200], operation: "task_inspect", &block ) end |
#task_list {|chunk| ... } ⇒ Docker::API::Response
List tasks
Engine API: GET /tasks
map[string][]string) to process on the tasks list.
2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 |
# File 'lib/docker/api/operations.rb', line 2858 def task_list(filters: nil, &block) connection.request( :get, "/tasks", query: { "filters" => filters }, expects: [200], operation: "task_list", &block ) end |
#task_logs {|chunk| ... } ⇒ Docker::API::Response
Get task logs
Get stdout and stderr logs from a task. See also
/containers/{id}/logs.
Engine API: GET /tasks/id/logs
provided to logs.
timestamp
end of the logs. Specify as an integer or all to output all log lines.
2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 |
# File 'lib/docker/api/operations.rb', line 2893 def task_logs( id:, details: nil, follow: nil, stdout: nil, stderr: nil, since: nil, timestamps: nil, tail: nil, &block ) connection.request( :get, "/tasks/#{Path.escape(id)}/logs", query: { "details" => details, "follow" => follow, "stdout" => stdout, "stderr" => stderr, "since" => since, "timestamps" => , "tail" => tail, }, expects: [200], operation: "task_logs", &block ) end |
#volume_create {|chunk| ... } ⇒ Docker::API::Response
Create a volume
Engine API: POST /volumes/create
in the API specification)
2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 |
# File 'lib/docker/api/operations.rb', line 2932 def volume_create(body:, &block) connection.request( :post, "/volumes/create", body: body, expects: [201], operation: "volume_create", &block ) end |
#volume_delete {|chunk| ... } ⇒ Docker::API::Response
Remove a volume
Instruct the driver to remove the volume.
Engine API: DELETE /volumes/name
removed
2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 |
# File 'lib/docker/api/operations.rb', line 2958 def volume_delete(name:, force: nil, &block) connection.request( :delete, "/volumes/#{Path.escape(name)}", query: { "force" => force }, expects: [204], operation: "volume_delete", &block ) end |
#volume_inspect {|chunk| ... } ⇒ Docker::API::Response
Inspect a volume
Engine API: GET /volumes/name
2979 2980 2981 2982 2983 2984 2985 2986 2987 |
# File 'lib/docker/api/operations.rb', line 2979 def volume_inspect(name:, &block) connection.request( :get, "/volumes/#{Path.escape(name)}", expects: [200], operation: "volume_inspect", &block ) end |
#volume_list {|chunk| ... } ⇒ Docker::API::Response
List volumes
Engine API: GET /volumes
map[string][]string) to process on the volumes list. Available
filters:
3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 |
# File 'lib/docker/api/operations.rb', line 3000 def volume_list(filters: nil, &block) connection.request( :get, "/volumes", query: { "filters" => filters }, expects: [200], operation: "volume_list", &block ) end |
#volume_prune {|chunk| ... } ⇒ Docker::API::Response
Delete unused volumes
Engine API: POST /volumes/prune
encoded as JSON (a map[string][]string).
3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 |
# File 'lib/docker/api/operations.rb', line 3021 def volume_prune(filters: nil, &block) connection.request( :post, "/volumes/prune", query: { "filters" => filters }, expects: [200], operation: "volume_prune", &block ) end |
#volume_update {|chunk| ... } ⇒ Docker::API::Response
"Update a volume. Valid only for Swarm cluster volumes"
Engine API: PUT /volumes/name
This is required to avoid conflicting writes. Found in the volume's
ClusterVolume field.
only Availability may change. All other fields must remain unchanged.
(body parameter 'body' in the API specification)
3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 |
# File 'lib/docker/api/operations.rb', line 3050 def volume_update(name:, version:, body: nil, &block) connection.request( :put, "/volumes/#{Path.escape(name)}", query: { "version" => version }, body: body, expects: [200], operation: "volume_update", &block ) end |