class Crowbar::Client::Command::Node::Hardware

Implementation for the node hardware command

Public Instance Methods

execute() click to toggle source
# File lib/crowbar/client/command/node/hardware.rb, line 35
def execute
  request.process do |request|
    case request.code
    when 200
      say "Successfully triggered hardware for #{args.name}"
    when 404
      err "Node does not exist"
    else
      err request.parsed_response["error"]
    end
  end
end
request() click to toggle source
# File lib/crowbar/client/command/node/hardware.rb, line 27
def request
  @request ||= Request::Node::Hardware.new(
    args.easy_merge(
      action: :update
    )
  )
end