class Nomad::Allocation

Public Instance Methods

list(**options) click to toggle source

List allocations.

@param options [String] :prefix An optional prefix to filter

@return [Array<Alloc>]

# File lib/nomad/api/allocation.rb, line 21
def list(**options)
  json = client.get("/v1/allocations", options)
  return json.map { |item| Alloc.decode(item) }
end
read(id, **options) click to toggle source

Read a specific allocation.

@param [String] id The full ID of the allocation to read

@return [Alloc]

# File lib/nomad/api/allocation.rb, line 31
def read(id, **options)
  json = client.get("/v1/allocation/#{CGI.escape(id)}", options)
  return Alloc.decode(json)
end