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.
80 81 82 |
# File 'lib/docker_engine_ruby/resources/tasks.rb', line 80 def initialize(client:) @client = client end |
Instance Method Details
#inspect_(id, request_options: {}) ⇒ DockerEngineRuby::Models::Task
Inspect a task
38 39 40 41 42 43 44 45 |
# File 'lib/docker_engine_ruby/resources/tasks.rb', line 38 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 26 |
# File 'lib/docker_engine_ruby/resources/tasks.rb', line 16 def list(params = {}) parsed, = DockerEngineRuby::TaskListParams.dump_request(params) query = DockerEngineRuby::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "tasks", query: query, 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
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/docker_engine_ruby/resources/tasks.rb', line 64 def logs(id, params = {}) parsed, = DockerEngineRuby::TaskLogsParams.dump_request(params) query = DockerEngineRuby::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["tasks/%1$s/logs", id], query: query, headers: {"accept" => "application/octet-stream"}, model: StringIO, options: ) end |