Class: Nomad::Evaluation

Inherits:
Request show all
Defined in:
lib/nomad/api/evaluation.rb

Instance Attribute Summary

Attributes inherited from Request

#client

Instance Method Summary collapse

Methods inherited from Request

#initialize, #inspect, #to_s

Constructor Details

This class inherits a constructor from Nomad::Request

Instance Method Details

#allocations_for(id, **options) ⇒ Array<Alloc>

Get the list of allocations for the given evaluation.

Parameters:

  • id (String)

    The full ID of the evaluation to get allocations

Returns:



41
42
43
44
# File 'lib/nomad/api/evaluation.rb', line 41

def allocations_for(id, **options)
  json = client.get("/v1/evaluation/#{CGI.escape(id)}/allocations", options)
  return json.map { |item| Alloc.decode(item) }
end

#list(**options) ⇒ Array<Eval>

List allocations.

Parameters:

  • options (String)

    :prefix An optional prefix to filter

Returns:



21
22
23
24
# File 'lib/nomad/api/evaluation.rb', line 21

def list(**options)
  json = client.get("/v1/evaluations", options)
  return json.map { |item| Eval.decode(item) }
end

#read(id, **options) ⇒ Eval

Read a specific evaluation.

Parameters:

  • id (String)

    The full ID of the evaluation to read

Returns:



31
32
33
34
# File 'lib/nomad/api/evaluation.rb', line 31

def read(id, **options)
  json = client.get("/v1/evaluation/#{CGI.escape(id)}", options)
  return Eval.decode(json)
end