# Server.api4 '', "/app/#{Rhoconnect::API_VERSION}/:source_name/queue_updates", :post, \ # {:admin_route => false, :login_required => true, :deprecated_route => {:verb => :post, :url => ['/api/application', '/application', '/api/application/queue_updates']}} do # begin # if params["cud"] # cud = JSON.parse(params["cud"]) # params.delete("cud") # params.merge!(cud) # end # rescue JSON::ParserError => jpe # log jpe.message + jpe.backtrace.join("\n") # throw :halt, [500, "Server error while processing client data"] # rescue Exception => e # log e.message + e.backtrace.join("\n") # throw :halt, [500, "Internal server error"] # end # # catch_all do # current_client_sync.receive_cud(params) # status 200 # end # end # # Server.api4 '', "/app/#{Rhoconnect::API_VERSION}/:source_name", :post, \ # {:login_required => true, :admin_route => false} do # begin # if params["cud"] # cud = JSON.parse(params["cud"]) # params.delete("cud") # params.merge!(cud) # end # rescue JSON::ParserError => jpe # log jpe.message + jpe.backtrace.join("\n") # throw :halt, [500, "Server error while processing client data"] # rescue Exception => e # log e.message + e.backtrace.join("\n") # throw :halt, [500, "Internal server error"] # end # # catch_all do # current_client_sync.receive_cud(params) # status 200 # end # end # # Server.api4 '', "/app/#{Rhoconnect::API_VERSION}/:source_name/:id", :put, \ # {:login_required => true, :admin_route => false} do # begin # if params["cud"] # cud = JSON.parse(params["cud"]) # params.delete("cud") # params.merge!(cud) # end # rescue JSON::ParserError => jpe # log jpe.message + jpe.backtrace.join("\n") # throw :halt, [500, "Server error while processing client data"] # rescue Exception => e # log e.message + e.backtrace.join("\n") # throw :halt, [500, "Internal server error"] # end # # begin # if params["update"] # cud = params["update"] # params.delete("update") # params.merge!("update" => {params[:id] => cud}) # end # rescue JSON::ParserError => jpe # log jpe.message + jpe.backtrace.join("\n") # throw :halt, [500, "Server error while processing client data"] # rescue Exception => e # log e.message + e.backtrace.join("\n") # throw :halt, [500, "Internal server error"] # end # # catch_all do # current_client_sync.receive_cud(params) # status 200 # end # end # # Server.api4 '', "/app/#{Rhoconnect::API_VERSION}/:source_name/:id", :delete, \ # {:login_required => true, :admin_route => false} do # begin # obj = current_client.get_object(:cd, params[:id]) # params.merge!("delete" => { params[:id] => obj } ) # rescue JSON::ParserError => jpe # log jpe.message + jpe.backtrace.join("\n") # throw :halt, [500, "Server error while processing client data"] # rescue Exception => e # log e.message + e.backtrace.join("\n") # throw :halt, [500, "Internal server error"] # end # # catch_all do # current_client_sync.receive_cud(params) # status 200 # end # end