Class: DockerEngineAPI::Resources::Tasks
- Inherits:
-
Object
- Object
- DockerEngineAPI::Resources::Tasks
- Defined in:
- lib/docker_engine_api/resources/tasks.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Tasks
constructor
private
A new instance of Tasks.
-
#inspect_(id, request_options: {}) ⇒ DockerEngineAPI::Models::Task
Inspect a task.
-
#list(filters: nil, request_options: {}) ⇒ Array<DockerEngineAPI::Models::Task>
Some parameter documentations has been truncated, see Models::TaskListParams for more details.
-
#logs(id, details: nil, follow: nil, since: nil, stderr: nil, stdout: nil, tail: nil, timestamps: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::TaskLogsParams for more details.
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.
98 99 100 |
# File 'lib/docker_engine_api/resources/tasks.rb', line 98 def initialize(client:) @client = client end |
Instance Method Details
#inspect_(id, request_options: {}) ⇒ DockerEngineAPI::Models::Task
Inspect a task
42 43 44 45 46 47 48 49 |
# File 'lib/docker_engine_api/resources/tasks.rb', line 42 def inspect_(id, params = {}) @client.request( method: :get, path: ["tasks/%1$s", id], model: DockerEngineAPI::Task, options: params[:request_options] ) end |
#list(filters: nil, request_options: {}) ⇒ Array<DockerEngineAPI::Models::Task>
Some parameter documentations has been truncated, see Models::TaskListParams for more details.
List tasks
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/docker_engine_api/resources/tasks.rb', line 20 def list(params = {}) parsed, = DockerEngineAPI::TaskListParams.dump_request(params) @client.request( method: :get, path: "tasks", query: parsed, model: DockerEngineAPI::Internal::Type::ArrayOf[DockerEngineAPI::Task], options: ) end |
#logs(id, details: nil, follow: nil, since: nil, stderr: nil, stdout: nil, tail: nil, timestamps: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::TaskLogsParams for more details.
Get stdout and stderr logs from a task. See also [‘/containers/id/logs`](#operation/ContainerLogs).
Note: This endpoint works only for services with the local, json-file or journald logging drivers.
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/docker_engine_api/resources/tasks.rb', line 83 def logs(id, params = {}) parsed, = DockerEngineAPI::TaskLogsParams.dump_request(params) @client.request( method: :get, path: ["tasks/%1$s/logs", id], query: parsed, headers: {"accept" => "application/vnd.docker.multiplexed-stream"}, model: StringIO, options: ) end |