CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/lib/api/schema/compute/get-servers.ts
Views: 688
1
import { z } from "../../framework";
2
3
import { FailedAPIOperationSchema } from "../common";
4
5
import { ProjectIdSchema } from "../projects/common";
6
7
import { ComputeServerIdSchema, ComputeServerTitleSchema } from "./common";
8
9
// OpenAPI spec
10
//
11
export const GetComputeServersInputSchema = z
12
.object({
13
id: ComputeServerIdSchema.optional(),
14
project_id: ProjectIdSchema.optional(),
15
})
16
.describe("Parameters that restrict compute servers to get.");
17
18
export const GetComputeServersOutputSchema = z.union([
19
FailedAPIOperationSchema,
20
z.array(
21
z.object({
22
id: ComputeServerIdSchema,
23
title: ComputeServerTitleSchema,
24
}),
25
),
26
]);
27
28
export type GetComputeServersInput = z.infer<
29
typeof GetComputeServersInputSchema
30
>;
31
export type GetComputeServersOutput = z.infer<
32
typeof GetComputeServersOutputSchema
33
>;
34
35