diff options
author | Micha Rautenberg <rautenberg@in-silico.ch> | 2015-10-14 11:35:00 +0200 |
---|---|---|
committer | Micha Rautenberg <rautenberg@in-silico.ch> | 2015-10-14 11:35:00 +0200 |
commit | 1c0d79491ea3116e7b2d6acedc8796d7d469cdf3 (patch) | |
tree | c5f5243bff5a4b5e2f13d4107b90faf2cb3070ca | |
parent | 4fe376ee23d3876fcac421cc55e1c0831516e168 (diff) |
Add GET /algorithm/descriptor route
-rw-r--r-- | application.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/application.rb b/application.rb index 3f94032..c95547b 100644 --- a/application.rb +++ b/application.rb @@ -74,6 +74,17 @@ post "/model/:id/?" do return prediction.to_json end +# Get a list of all descriptors +# @param [Header] Accept one of text/plain, application/json +# @return [text/plain, application/json] list of all prediction models +get "/algorithm/descriptor/?" do + case @accept + when "text/plain" + return OpenTox::Algorithm::Descriptor::DESCRIPTORS.collect{|k, v| "#{k}: #{v}\n"} + when "application/json" + return JSON.pretty_generate OpenTox::Algorithm::Descriptor::DESCRIPTORS + end +end =begin post "/model/?" do |