Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/src/packages/next/lib/api/schema/compute/create-server.ts
Views: 923
import { z } from "../../framework";12import { FailedAPIOperationSchema } from "../common";34import { ProjectIdSchema } from "../projects/common";56import {7ComputeServerCloudSchema,8ComputeServerColorSchema,9ComputeServerIdSchema,10ComputeServerTitleSchema,11ServerConfigurationSchema,12} from "./common";1314// OpenAPI spec15//16export const CreateServerInputSchema = z17.object({18configuration: ServerConfigurationSchema,19title: ComputeServerTitleSchema,20color: ComputeServerColorSchema,21cloud: ComputeServerCloudSchema,22project_id: ProjectIdSchema.describe(23"The project id that this compute server provides compute for.",24),25idle_timeout: z26.number()27.describe(28`The idle timeout in seconds of this compute server. If set to 0, the server will29never turn off automatically. The compute server idle timeouts if none of the tabs30it is providing are actively touched through the web UI. _Not yet implemented._`,31)32.optional(),33autorestart: z34.boolean()35.describe(36`If true and the compute server stops for any reason, then it37will be automatically started again. This is primarily useful for38stopping instances.`,39)40.optional(),41notes: z42.string()43.describe("Open-ended text in markdown about this item.")44.optional(),45course_project_id: ProjectIdSchema.describe(46"Set if this is a computer server in a student project associated to a course in the project with id course_project_id.",47).optional(),48course_server_id: z49.number()50.describe(51"Set if this is a computer server in a student project associated to a course, where the *global* compute server id is this.",52)53.optional(),54})55.describe("Create a new compute server with the provided configuration.");5657export const CreateServerOutputSchema = z.union([58FailedAPIOperationSchema,59ComputeServerIdSchema.describe("The id of the created compute server."),60]);6162export type CreateServerInput = z.infer<typeof CreateServerInputSchema>;63export type CreateServerOutput = z.infer<typeof CreateServerOutputSchema>;646566