From 8168636076a376237c6a85fd1066e4fffed0bc6a Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 5 Jun 2013 18:16:49 +0200 Subject: [PATCH] feature #2050: Add update action to appflow-server.rb --- flow/controllers/appflow-server.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/flow/controllers/appflow-server.rb b/flow/controllers/appflow-server.rb index 789ef07e61..52d9cd7e9b 100644 --- a/flow/controllers/appflow-server.rb +++ b/flow/controllers/appflow-server.rb @@ -400,6 +400,17 @@ post '/service_template/:id/action' do OpenNebula::Error.new("Action #{action['perform']}: " << "You have to specify an OCTET") end + when 'update' + if opts && opts['template_json'] + begin + rc = service_template.update(opts['template_json']) + rescue Validator::ParseException, JSON::ParserError + OpenNebula::Error.new($!.message) + end + else + OpenNebula::Error.new("Action #{action['perform']}: " << + "You have to provide a template") + end else OpenNebula::Error.new("Action #{action['perform']} not supported") end