Class: DockerEngineRuby::Resources::Tasks
- Inherits:
-
Object
- Object
- DockerEngineRuby::Resources::Tasks
- Defined in:
- lib/docker_engine_ruby/resources/tasks.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Tasks
constructor
private
A new instance of Tasks.
-
#inspect_(id, request_options: {}) ⇒ DockerEngineRuby::Models::Task
Inspect a task.
-
#list(filters: nil, request_options: {}) ⇒ Array<DockerEngineRuby::Models::Task>
List tasks.
-
#logs(id, details: nil, follow: nil, since: nil, stderr: nil, stdout: nil, tail: nil, timestamps: nil, request_options: {}) ⇒ StringIO
Get task logs.
Constructor Details
#initialize(client:) ⇒ Tasks
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 Tasks.
78 79 80 |
# File 'lib/docker_engine_ruby/resources/tasks.rb', line 78 def initialize(client:) @client = client end |
Instance Method Details
#inspect_(id, request_options: {}) ⇒ DockerEngineRuby::Models::Task
Inspect a task
37 38 39 40 41 42 43 44 |
# File 'lib/docker_engine_ruby/resources/tasks.rb', line 37 def inspect_(id, params = {}) @client.request( method: :get, path: ["tasks/%1$s", id], model: DockerEngineRuby::Task, options: params[:request_options] ) end |
#list(filters: nil, request_options: {}) ⇒ Array<DockerEngineRuby::Models::Task>
List tasks
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/docker_engine_ruby/resources/tasks.rb', line 16 def list(params = {}) parsed, = DockerEngineRuby::TaskListParams.dump_request(params) @client.request( method: :get, path: "tasks", query: parsed, model: DockerEngineRuby::Internal::Type::ArrayOf[DockerEngineRuby::Task], options: ) end |
#logs(id, details: nil, follow: nil, since: nil, stderr: nil, stdout: nil, tail: nil, timestamps: nil, request_options: {}) ⇒ StringIO
Get task logs
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/docker_engine_ruby/resources/tasks.rb', line 63 def logs(id, params = {}) parsed, = DockerEngineRuby::TaskLogsParams.dump_request(params) @client.request( method: :get, path: ["tasks/%1$s/logs", id], query: parsed, headers: {"accept" => "application/octet-stream"}, model: StringIO, options: ) end |