class SafetyRazor::Slice::Node

Client API for Razor’s node slice.

@author Fletcher Nichol <fnichol@nichol.ca>

Public Instance Methods

checkin(params) click to toggle source
# File lib/safety_razor/slice/node.rb, line 21
def checkin(params)
  payload = JSON.generate(params)
  response = connection.post(slice_path("checkin"),
    'json_hash' => payload)
  parse(response).first
end
create(params) click to toggle source
# File lib/safety_razor/slice/node.rb, line 38
def create(params)
  raise NoMethodError, "Node#create is not defined"
end
destroy(uuid) click to toggle source
# File lib/safety_razor/slice/node.rb, line 46
def destroy(uuid)
  raise NoMethodError, "Node#destroy is not defined"
end
get_attributes(uuid) click to toggle source
# File lib/safety_razor/slice/node.rb, line 28
def get_attributes(uuid)
  response = connection.get(slice_path(uuid), "field" => "attributes")
  parse(response).first
end
get_hardware_ids(uuid) click to toggle source
# File lib/safety_razor/slice/node.rb, line 33
def get_hardware_ids(uuid)
  response = connection.get(slice_path(uuid), "field" => "hardware_ids")
  parse(response).first["hw_id"]
end
register(params) click to toggle source
# File lib/safety_razor/slice/node.rb, line 14
def register(params)
  payload = JSON.generate(params)
  response = connection.post(slice_path("register"),
    'json_hash' => payload)
  parse(response).first
end
update(params) click to toggle source
# File lib/safety_razor/slice/node.rb, line 42
def update(params)
  raise NoMethodError, "Node#update is not defined"
end

Private Instance Methods

slice_name() click to toggle source
# File lib/safety_razor/slice/node.rb, line 52
def slice_name
  "node"
end