Class: LxcSsh::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/lxc_ssh/container.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cpu_sharesObject

Returns the value of attribute cpu_shares.



4
5
6
# File 'lib/lxc_ssh/container.rb', line 4

def cpu_shares
  @cpu_shares
end

#cpu_usageObject

Returns the value of attribute cpu_usage.



4
5
6
# File 'lib/lxc_ssh/container.rb', line 4

def cpu_usage
  @cpu_usage
end

#ipObject

Returns the value of attribute ip.



4
5
6
# File 'lib/lxc_ssh/container.rb', line 4

def ip
  @ip
end

#memory_limitObject

Returns the value of attribute memory_limit.



4
5
6
# File 'lib/lxc_ssh/container.rb', line 4

def memory_limit
  @memory_limit
end

#memory_usageObject

Returns the value of attribute memory_usage.



4
5
6
# File 'lib/lxc_ssh/container.rb', line 4

def memory_usage
  @memory_usage
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/lxc_ssh/container.rb', line 4

def name
  @name
end

#pidObject

Returns the value of attribute pid.



4
5
6
# File 'lib/lxc_ssh/container.rb', line 4

def pid
  @pid
end

#stateObject

Returns the value of attribute state.



4
5
6
# File 'lib/lxc_ssh/container.rb', line 4

def state
  @state
end

Instance Method Details

#frozen?Boolean

Checks if the container is frozen

Returns:

  • (Boolean)


23
24
25
# File 'lib/lxc_ssh/container.rb', line 23

def frozen?
  @state == 'FROZEN'
end

#running?Boolean

Checks if the container is running

Returns:

  • (Boolean)


16
17
18
# File 'lib/lxc_ssh/container.rb', line 16

def running?
  @state == 'RUNNING'
end

#stopped?Boolean

Checks if the container is stopped

Returns:

  • (Boolean)


30
31
32
# File 'lib/lxc_ssh/container.rb', line 30

def stopped?
  !running? && !frozen?
end