add test jupyter call

chromesetting
guange 5 years ago
parent 945ecd61c3
commit c2ed47a736

@ -2,4 +2,23 @@ class MainController < ApplicationController
def index
render file: 'public/react/build/index.html', :layout => false
end
def test_juypter
#打开tpm - juypter接口
shixun = Shixun.find()
shixun_tomcat = edu_setting('cloud_bridge')
uri = "#{shixun_tomcat}/bridge/jupyter/get"
params = {tpiID: "tpm_#{shixun.id}", :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"}
logger.debug "test_juypter: uri->#{uri}, params->#{params}"
res = uri_post uri, params
logger.info "test_juypter: #{res}"
res.to_json
end
end

@ -9,6 +9,9 @@ Rails.application.routes.draw do
get 'auth/qq/callback', to: 'oauth/qq#create'
get 'auth/failure', to: 'oauth/base#auth_failure'
get 'test_juypter', to: 'main#test_juypter'
resources :edu_settings
scope '/api' do
get 'home/index'

Loading…
Cancel
Save