feature #2050: Add update action to appflow-server.rb

This commit is contained in:
Daniel Molina committed 2013-06-05 18:16:49 +02:00
1 parent d22ed605f2
commit 8168636076
1 file changed
+11
+11
View File
@@ -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