2024-02-05 02:13:32 +00:00
|
|
|
import { getUserDeployments } from "../k8s/k8s-server-control.js";
|
2024-01-15 20:30:31 +00:00
|
|
|
import { getInstances } from "../k8s/server-status.js";
|
2023-12-20 03:20:04 +00:00
|
|
|
import { sendError } from "../util/ExpressClientError.js";
|
|
|
|
|
|
|
|
export function serverList(req, res) {
|
2024-02-05 02:13:32 +00:00
|
|
|
getUserDeployments(req.cairoId)
|
2023-12-20 03:20:04 +00:00
|
|
|
.then((sd) => res.json(sd.map((s) => s.metadata.name.substring(4))))
|
|
|
|
.catch((e) => {
|
2024-01-15 20:30:31 +00:00
|
|
|
ERR("STATUS CONTROLLER", e);
|
2023-12-20 03:20:04 +00:00
|
|
|
res.status(500).send("Couldn't get server list");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function serverInstances(req, res) {
|
2024-02-05 02:13:32 +00:00
|
|
|
getInstances(req.cairoId)
|
2023-12-20 03:20:04 +00:00
|
|
|
.then((i) => res.json(i))
|
|
|
|
.catch(sendError(res));
|
|
|
|
}
|