Class: DockerEngineAPI::Resources::System

Inherits:
Object
  • Object
show all
Defined in:
lib/docker_engine_api/resources/system.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ System

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 System.

Parameters:



150
151
152
# File 'lib/docker_engine_api/resources/system.rb', line 150

def initialize(client:)
  @client = client
end

Instance Method Details

#data_usage(type: nil, verbose: nil, request_options: {}) ⇒ DockerEngineAPI::Models::SystemDataUsageResponse

Some parameter documentations has been truncated, see Models::SystemDataUsageParams for more details.

Get data usage information

Parameters:

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
# File 'lib/docker_engine_api/resources/system.rb', line 22

def data_usage(params = {})
  parsed, options = DockerEngineAPI::SystemDataUsageParams.dump_request(params)
  @client.request(
    method: :get,
    path: "system/df",
    query: parsed,
    model: DockerEngineAPI::Models::SystemDataUsageResponse,
    options: options
  )
end

#events(filters: nil, since: nil, until_: nil, request_options: {}) ⇒ DockerEngineAPI::Models::SystemEventsResponse

Some parameter documentations has been truncated, see Models::SystemEventsParams for more details.

Stream real-time events from the server.

Various objects within Docker report events when something happens to them.

Containers report these events: attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, exec_die, export, health_status, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update, and prune

Images report these events: create, delete, import, load, pull, push, save, tag, untag, and prune

Volumes report these events: create, mount, unmount, destroy, and prune

Networks report these events: create, connect, disconnect, destroy, update, remove, and prune

The Docker daemon reports these events: reload

Services report these events: create, update, and remove

Nodes report these events: create, update, and remove

Secrets report these events: create, update, and remove

Configs report these events: create, update, and remove

The Builder reports prune events

Parameters:

  • filters (String)

    A JSON encoded value of filters (a map[string][]string) to process on the even

  • since (String)

    Show events created since this timestamp then stream new events.

  • until_ (String)

    Show events created until this timestamp then stop streaming.

  • request_options (DockerEngineAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



79
80
81
82
83
84
85
86
87
88
89
# File 'lib/docker_engine_api/resources/system.rb', line 79

def events(params = {})
  parsed, options = DockerEngineAPI::SystemEventsParams.dump_request(params)
  @client.request(
    method: :get,
    path: "events",
    query: parsed.transform_keys(until_: "until"),
    headers: {"accept" => "application/json-seq"},
    model: DockerEngineAPI::Models::SystemEventsResponse,
    options: options
  )
end

#info(request_options: {}) ⇒ DockerEngineAPI::Models::Info

Get system information

Parameters:

Returns:

See Also:



100
101
102
103
104
105
106
107
# File 'lib/docker_engine_api/resources/system.rb', line 100

def info(params = {})
  @client.request(
    method: :get,
    path: "info",
    model: DockerEngineAPI::Info,
    options: params[:request_options]
  )
end

#ping(request_options: {}) ⇒ String

This is a dummy endpoint you can use to test if the server is accessible.

Parameters:

Returns:

  • (String)

See Also:



118
119
120
121
122
123
124
125
126
# File 'lib/docker_engine_api/resources/system.rb', line 118

def ping(params = {})
  @client.request(
    method: :get,
    path: "_ping",
    headers: {"accept" => "text/plain"},
    model: String,
    options: params[:request_options]
  )
end

#version(request_options: {}) ⇒ DockerEngineAPI::Models::Version

Returns the version of Docker that is running and various information about the system that Docker is running on.

Parameters:

Returns:

See Also:



138
139
140
141
142
143
144
145
# File 'lib/docker_engine_api/resources/system.rb', line 138

def version(params = {})
  @client.request(
    method: :get,
    path: "version",
    model: DockerEngineAPI::Version,
    options: params[:request_options]
  )
end