class Crowbar::Client::Command::Restricted::Allocate

Implementation for the restricted allocate command

Public Instance Methods

execute() click to toggle source
# File lib/crowbar/client/command/restricted/allocate.rb, line 35
def execute
  request.process do |request|
    case request.code
    when 200
      say "Successfully triggered allocate 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/restricted/allocate.rb, line 27
def request
  @request ||= Request::Restricted::Allocate.new(
    args.easy_merge(
      action: :allocate
    )
  )
end