Class: Bsdkrun::DockerStatus
- Inherits:
-
Data
- Object
- Data
- Bsdkrun::DockerStatus
- Defined in:
- lib/bsdkrun/types.rb
Overview
The Docker engine VM: whether it is up, and how to reach it.
bsdkrun runs one docker:dind microVM and serves its API on a host unix
socket, so the host's own docker CLI drives the same engine.
Instance Attribute Summary collapse
-
#api_port ⇒ Object
readonly
Returns the value of attribute api_port.
-
#containers ⇒ Object
readonly
Returns the value of attribute containers.
-
#disk ⇒ Object
readonly
Returns the value of attribute disk.
-
#disk_size ⇒ Object
readonly
Returns the value of attribute disk_size.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#machine_id ⇒ Object
readonly
Returns the value of attribute machine_id.
-
#machine_running ⇒ Object
readonly
Returns the value of attribute machine_running.
-
#mounts ⇒ Object
readonly
Returns the value of attribute mounts.
-
#running ⇒ Object
readonly
Returns the value of attribute running.
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
-
#socket_ready ⇒ Object
readonly
Returns the value of attribute socket_ready.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Attribute Details
#api_port ⇒ Object (readonly)
Returns the value of attribute api_port
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def api_port @api_port end |
#containers ⇒ Object (readonly)
Returns the value of attribute containers
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def containers @containers end |
#disk ⇒ Object (readonly)
Returns the value of attribute disk
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def disk @disk end |
#disk_size ⇒ Object (readonly)
Returns the value of attribute disk_size
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def disk_size @disk_size end |
#images ⇒ Object (readonly)
Returns the value of attribute images
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def images @images end |
#machine_id ⇒ Object (readonly)
Returns the value of attribute machine_id
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def machine_id @machine_id end |
#machine_running ⇒ Object (readonly)
Returns the value of attribute machine_running
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def machine_running @machine_running end |
#mounts ⇒ Object (readonly)
Returns the value of attribute mounts
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def mounts @mounts end |
#running ⇒ Object (readonly)
Returns the value of attribute running
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def running @running end |
#socket ⇒ Object (readonly)
Returns the value of attribute socket
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def socket @socket end |
#socket_ready ⇒ Object (readonly)
Returns the value of attribute socket_ready
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def socket_ready @socket_ready end |
#version ⇒ Object (readonly)
Returns the value of attribute version
211 212 213 |
# File 'lib/bsdkrun/types.rb', line 211 def version @version end |
Class Method Details
.from_graphql(s) ⇒ DockerStatus
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/bsdkrun/types.rb', line 217 def self.from_graphql(s) new( running: !!s["running"], machine_id: s["machineId"], machine_running: !!s["machineRunning"], socket: s["socket"].to_s, socket_ready: !!s["socketReady"], api_port: to_i_or_nil(s["apiPort"]), version: s["version"], containers: to_i_or_nil(s["containers"]), images: to_i_or_nil(s["images"]), mounts: Array(s["mounts"]), disk: s["disk"], disk_size: to_i_or_nil(s["diskSize"]) ) end |
.from_row(row) ⇒ DockerStatus
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/bsdkrun/types.rb', line 236 def self.from_row(row) new( running: !!row["running"], machine_id: row["machine_id"], machine_running: !!row["machine_running"], socket: row["socket"].to_s, socket_ready: !!row["socket_ready"], api_port: to_i_or_nil(row["api_port"]), version: row["version"], containers: to_i_or_nil(row["containers"]), images: to_i_or_nil(row["images"]), mounts: Array(row["mounts"]), disk: row["disk"], disk_size: to_i_or_nil(row["disk_size"]) ) end |