Selaa lähdekoodia

增加获取jupyter状态方法

liweiquan 2 vuotta sitten
vanhempi
commit
990d42ac87
1 muutettua tiedostoa jossa 11 lisäystä ja 1 poistoa
  1. 11 1
      app/utils/send_util.py

+ 11 - 1
app/utils/send_util.py

@@ -168,4 +168,14 @@ def update_jupyter(data):
         return res.json()
         return res.json()
     else:
     else:
         msg = result['msg'] if 'msg' in result.keys() else result
         msg = result['msg'] if 'msg' in result.keys() else result
-        raise Exception(f'更新jupyter,请求jupyter端失败-->{msg}')
+        raise Exception(f'更新jupyter,请求jupyter端失败-->{msg}')
+
+# 获取jupyter服务状态
+def get_jupyter_status(data):
+    res = requests.post(url=f'http://{PROGRAMME_URL}/helm/ops/status', json=data)
+    result = res.json()
+    if 'code' in result.keys() and result['code'] == 200:
+        return res.json()
+    else:
+        msg = result['msg'] if 'msg' in result.keys() else result
+        raise Exception(f'获取jupyter服务状态,请求jupyter端失败-->{msg}')