Class: OodCore::Job::QueueInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ood_core/job/queue_info.rb

Overview

QueueInfo is information about a given queue on a scheduler.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**opts) ⇒ QueueInfo



20
21
22
23
24
25
# File 'lib/ood_core/job/queue_info.rb', line 20

def initialize(**opts)
  @name = opts.fetch(:name, 'unknown')
  @qos = opts.fetch(:qos, [])
  @allow_accounts = opts.fetch(:allow_accounts, nil)
  @deny_accounts = opts.fetch(:deny_accounts, [])
end

Instance Attribute Details

#allow_accountsObject (readonly)

The accounts that are allowed to use this queue.

nil means ALL accounts are allowed.



15
16
17
# File 'lib/ood_core/job/queue_info.rb', line 15

def allow_accounts
  @allow_accounts
end

#deny_accountsObject (readonly)

The accounts that are not allowed to use this queue.



18
19
20
# File 'lib/ood_core/job/queue_info.rb', line 18

def deny_accounts
  @deny_accounts
end

#nameObject (readonly) Also known as: to_s

The name of the queue.



6
7
8
# File 'lib/ood_core/job/queue_info.rb', line 6

def name
  @name
end

#qosObject (readonly)

The QoSes associated with this queue



10
11
12
# File 'lib/ood_core/job/queue_info.rb', line 10

def qos
  @qos
end

Instance Method Details

#to_hObject



27
28
29
30
31
32
# File 'lib/ood_core/job/queue_info.rb', line 27

def to_h
  instance_variables.map do |var|
    name = var.to_s.gsub('@', '').to_sym
    [name, send(name)]
  end.to_h
end