class OSC::Reservations::Node

Provides a way for the developer to view the properties of any given reserved node.

Attributes

id[RW]

@return [String] The ID of this node.

jobs[RW]

@return [Array<String>] A list of job id’s running on this node.

np[RW]

@return [Fixnum] Number of cores on this node.

props[RW]

@return [Array<String>] A list of properties for this node.

users[RW]

@return [Array<String>] A list of users running on this node.

Public Class Methods

new(opts) click to toggle source

@param opts [Hash] Options used to create a node. @option opts [String] :id The ID of this node. @option opts [Fixnum] :np The number of processors on this node. @option opts [Array<String>] :props An array of properties for this node. @option opts [Array<String>] :jobs An array of job IDs running on this node. @option opts [Array<String>] :users An array of users running on this node.

# File lib/osc/reservations/node.rb, line 27
def initialize(opts)
  @id    = opts[:id]
  @np    = opts[:np]
  @props = opts[:props]
  @jobs  = opts[:jobs]
  @users = opts[:users]
end

Public Instance Methods

free?() click to toggle source

Is this node free to use? @return [Boolean] is node free?

# File lib/osc/reservations/node.rb, line 37
def free?
  jobs.empty?
end