Class: DockerSwarm::System

Inherits:
Base
  • Object
show all
Defined in:
lib/docker_swarm/models/system.rb

Overview

Access point for Docker System information and operations

Class Method Summary collapse

Methods inherited from Base

all, #as_json, #assign_attributes, #attributes, defined_attributes, find, #id, #initialize, #method_missing, #payload_for_docker, #persisted?, #reload, #respond_to_missing?, root_key, routes, #serializable_hash, where

Methods included from Concerns::Inspectable

#inspect

Constructor Details

This class inherits a constructor from DockerSwarm::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DockerSwarm::Base

Class Method Details

.dfHash

Returns system-wide data usage information

Returns:

  • (Hash)


33
34
35
# File 'lib/docker_swarm/models/system.rb', line 33

def self.df
  Api.request(action: routes[:df])
end

.infoHash

Returns system information

Returns:

  • (Hash)


15
16
17
# File 'lib/docker_swarm/models/system.rb', line 15

def self.info
  Api.request(action: routes[:info])
end

.resource_nameString

Override resource name to match API endpoint

Returns:

  • (String)


9
10
11
# File 'lib/docker_swarm/models/system.rb', line 9

def self.resource_name
  "system"
end

.upString

Checks if the Docker daemon is responding

Returns:

  • (String)

    “OK” if up



27
28
29
# File 'lib/docker_swarm/models/system.rb', line 27

def self.up
  Api.request(action: routes[:up])
end

.versionHash

Returns Docker version information

Returns:

  • (Hash)


21
22
23
# File 'lib/docker_swarm/models/system.rb', line 21

def self.version
  Api.request(action: routes[:version])
end