From c8df2e9ab8aacbca48b424fb5604a31336835e6c Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 4 May 2011 16:22:12 +0200 Subject: [PATCH] Add comments to the VNC implementation --- src/sunstone/models/SunstoneServer.rb | 4 +++- src/sunstone/sunstone-server.rb | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 60616aa6b6..9bd1e00766 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -219,7 +219,6 @@ class SunstoneServer ######################################################################## # VNC ######################################################################## - def startvnc(id) resource = retrieve_resource("vm", id) if OpenNebula.is_error?(resource) @@ -258,6 +257,9 @@ class SunstoneServer return [200, info] end + ############################################################################ + # + ############################################################################ def stopvnc(id,pipe) resource = retrieve_resource("vm", id) if OpenNebula.is_error?(resource) diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 83a01f550d..eb230d6807 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -163,6 +163,9 @@ post '/:pool' do @SunstoneServer.create_resource(params[:pool], request.body.read) end +############################################################################## +# Stop the VNC Session of a target VM +############################################################################## post '/vm/:id/stopvnc' do vm_id = params[:id] vnc_hash = session['vnc'] @@ -180,6 +183,9 @@ post '/vm/:id/stopvnc' do rc end +############################################################################## +# Start a VNC Session for a target VM +############################################################################## post '/vm/:id/startvnc' do vm_id = params[:id]