2015-07-30 15:37:43 +03:00
|
|
|
require_relative "request_parser"
|
|
|
|
|
|
|
|
|
|
module Devops
|
|
|
|
|
module API2_0
|
|
|
|
|
module Parser
|
|
|
|
|
class DeployParser < RequestParser
|
|
|
|
|
|
|
|
|
|
def deploy
|
|
|
|
|
r = create_object_from_json_body
|
|
|
|
|
names = check_array(r["names"], "Parameter 'names' should be a not empty array of strings")
|
|
|
|
|
tags = check_array(r["tags"], "Parameter 'tags' should be an array of strings", String, true)
|
|
|
|
|
build_number = check_string(r["build_number"], "Parameter 'build_number' should be a not empty string", true)
|
2015-09-11 12:22:58 +03:00
|
|
|
rl = check_array(r["run_list"], "Parameter 'run_list' should be an array of string", String, true)
|
|
|
|
|
Validators::Helpers::RunList.new(rl).validate! unless rl.nil?
|
2016-03-01 22:05:25 +03:00
|
|
|
check_string(r["named_task"], "Parameter 'named_task' should be a not empty string", true)
|
2015-07-30 15:37:43 +03:00
|
|
|
r
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|