Class: DockerEngineAPI::Resources::Exec
- Inherits:
-
Object
- Object
- DockerEngineAPI::Resources::Exec
- Defined in:
- lib/docker_engine_api/resources/exec.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Exec
constructor
private
A new instance of Exec.
-
#inspect_(id, request_options: {}) ⇒ DockerEngineAPI::Models::ExecInspectResponse
Return low-level information about an exec instance.
-
#resize(id, h:, w:, request_options: {}) ⇒ nil
Resize the TTY session used by an exec instance.
-
#start(id, console_size: nil, detach: nil, tty: nil, request_options: {}) ⇒ nil
Starts a previously set up exec instance.
Constructor Details
#initialize(client:) ⇒ Exec
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Exec.
86 87 88 |
# File 'lib/docker_engine_api/resources/exec.rb', line 86 def initialize(client:) @client = client end |
Instance Method Details
#inspect_(id, request_options: {}) ⇒ DockerEngineAPI::Models::ExecInspectResponse
Return low-level information about an exec instance.
17 18 19 20 21 22 23 24 |
# File 'lib/docker_engine_api/resources/exec.rb', line 17 def inspect_(id, params = {}) @client.request( method: :get, path: ["exec/%1$s/json", id], model: DockerEngineAPI::Models::ExecInspectResponse, options: params[:request_options] ) end |
#resize(id, h:, w:, request_options: {}) ⇒ nil
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.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/docker_engine_api/resources/exec.rb', line 42 def resize(id, params) parsed, = DockerEngineAPI::ExecResizeParams.dump_request(params) @client.request( method: :post, path: ["exec/%1$s/resize", id], query: parsed, model: NilClass, options: ) end |
#start(id, console_size: nil, detach: nil, tty: nil, request_options: {}) ⇒ nil
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.
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/docker_engine_api/resources/exec.rb', line 72 def start(id, params = {}) parsed, = DockerEngineAPI::ExecStartParams.dump_request(params) @client.request( method: :post, path: ["exec/%1$s/start", id], body: parsed, model: NilClass, options: ) end |