lib/cpee/implementation.rb in cpee-1.4.18 vs lib/cpee/implementation.rb in cpee-1.4.20
- old
+ new
@@ -166,10 +166,14 @@
controller[id] = Controller.new(id,opts)
controller[id].info = name
controller[id].state_change!
+ @headers << Riddl::Header.new("CPEE-INSTANCE", controller[id].instance)
+ @headers << Riddl::Header.new("CPEE-INSTANCE-URL", controller[id].instance_url)
+ @headers << Riddl::Header.new("CPEE-INSTANCE-UUID", controller[id].uuid)
+
Riddl::Parameter::Simple.new("id", id)
end
end #}}}
class Info < Riddl::Implementation #{{{
@@ -238,10 +242,14 @@
unless controller[id]
@status = 400
return
end
Riddl::Parameter::Complex.new("res","text/plain") do
- controller[id].console(@p[0].value)
+ begin
+ controller[id].console(@p[0].value)
+ rescue => e
+ e.message
+ end
end
end
end #}}}
class DeleteInstance < Riddl::Implementation #{{{