From 6f3b55a686c0e58622aa456b1e8602025cdf356e Mon Sep 17 00:00:00 2001 From: zagganas Date: Fri, 29 Apr 2022 11:52:44 +0000 Subject: [PATCH] API endpoint for active Jupyter servers per project --- controllers/ApiController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/controllers/ApiController.php b/controllers/ApiController.php index b3ca697..0c92a55 100644 --- a/controllers/ApiController.php +++ b/controllers/ApiController.php @@ -419,6 +419,17 @@ public function actionPeriodStatistics() $this->asJson($usage); } + public function actionActiveJupyterProjects() + { + $servers=JupyterServer::find()->select(['project'])->where(['active'=>true])->distinct()->all(); + $projects=[]; + foreach ($servers as $server) + { + $projects[$server->project]=true; + } + return $this->asJson($projects); + } + }