Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/lib/api/schema/compute/create-server.ts
Views: 688
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(),45})46.describe("Create a new compute server with the provided configuration.");4748export const CreateServerOutputSchema = z.union([49FailedAPIOperationSchema,50ComputeServerIdSchema.describe("The id of the created compute server."),51]);5253export type CreateServerInput = z.infer<typeof CreateServerInputSchema>;54export type CreateServerOutput = z.infer<typeof CreateServerOutputSchema>;555657