class OodReservations::Query

Object used to communicate with a batch server to retrieve reservation information for current user

Public Class Methods

build(**kwargs) click to toggle source

Build a query object choosing the class of the object based on the servers available in the cluster object @param (see Query#initialize) @return [Query,nil] query object used to query reservations from cluster

# File lib/ood_reservations/query.rb, line 14
def self.build(**kwargs)
  if Queries::TorqueMoab.match(**kwargs)
    Queries::TorqueMoab.new(**kwargs)
  else
    nil
  end
end
new(cluster:, **_) click to toggle source

@param cluster [OodCluster::Cluster] the cluster to query

# File lib/ood_reservations/query.rb, line 23
def initialize(cluster:, **_)
  @cluster = cluster
end

Public Instance Methods

reservation(id:) click to toggle source

Queries the batch server for a given reservation @param id [#to_s] the id of the reservation @return [Reservation] the requested reservation @abstract This should be implemented by the adapter

# File lib/ood_reservations/query.rb, line 31
def reservation(id:)
  raise NotImplementedError
end
reservations() click to toggle source

Queries the batch server for a list of reservations @return [Array<Reservation>] list of reservations @abstract This should be implemented by the adapter

# File lib/ood_reservations/query.rb, line 38
def reservations
  raise NotImplementedError
end