fluke/devops-service/app/api3/parsers/script.rb

23 lines
548 B
Ruby
Raw Normal View History

2015-07-30 15:37:43 +03:00
require_relative "request_parser"
module Devops
2018-04-04 22:44:39 +03:00
module API3
2015-07-30 15:37:43 +03:00
module Parser
class ScriptParser < RequestParser
2018-04-04 22:44:39 +03:00
def body
@body ||= @request.body.read
2015-07-30 15:37:43 +03:00
end
def run_script
body = create_object_from_json_body
nodes = check_array(body["nodes"], "Parameter 'nodes' must be a not empty array of strings")
p = check_array(body["params"], "Parameter 'params' should be a not empty array of strings", String, true)
return nodes, p
end
end
end
end
end