Class: Docker::API::System
Overview
This class represents the Docker API system related endpoints.
Instance Method Summary collapse
-
#auth(body = {}) ⇒ Object
Validate credentials for a registry and, if available, get an identity token for accessing the registry without password.
-
#df(params = {}) ⇒ Object
Get data usage information.
-
#events(params = {}, &block) ⇒ Object
Stream real-time events from the server.
-
#info ⇒ Object
Get system information.
-
#ping ⇒ Object
This is a dummy endpoint you can use to test if the server is accessible.
-
#version ⇒ Object
Return the version of Docker that is running and various information about the system that Docker is running on.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Docker::API::Base
Instance Method Details
#auth(body = {}) ⇒ Object
Validate credentials for a registry and, if available, get an identity token for accessing the registry without password.
Docker API: POST /auth
13 14 15 |
# File 'lib/docker/api/system.rb', line 13 def auth body = {} @connection.request(method: :post, path: "/auth", headers: { "Content-Type" => "application/json" }, body: body.to_json) end |
#df(params = {}) ⇒ Object
Get data usage information.
Docker API: GET /system/df
61 62 63 |
# File 'lib/docker/api/system.rb', line 61 def df params = {} @connection.get(build_path("/system/df", params)) end |
#events(params = {}, &block) ⇒ Object
Stream real-time events from the server.
Docker API: GET /events
25 26 27 |
# File 'lib/docker/api/system.rb', line 25 def events params = {}, &block @connection.request(method: :get, path: build_path("/events", params), response_block: block_given? ? block : default_streamer ) end |
#info ⇒ Object
Get system information.
Docker API: GET /info
43 44 45 |
# File 'lib/docker/api/system.rb', line 43 def info @connection.get("/info") end |
#ping ⇒ Object
This is a dummy endpoint you can use to test if the server is accessible.
Docker API: GET /_ping
34 35 36 |
# File 'lib/docker/api/system.rb', line 34 def ping @connection.get("/_ping") end |
#version ⇒ Object
Return the version of Docker that is running and various information about the system that Docker is running on.
Docker API: GET /version
52 53 54 |
# File 'lib/docker/api/system.rb', line 52 def version @connection.get("/version") end |