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/common.ts
Views: 688
import { z } from "../../framework";12export const ComputeServerIdSchema = z3.number()4.int()5.min(0)6.describe("Compute server id (or 0 for your home base)");78export const ComputeServerStateSchema = z9.enum([10"deprovisioned",11"off",12"running",13"starting",14"stopping",15"suspended",16"suspending",17"unknown",18])19.describe("The state of the compute server.");2021export const ComputeServerColorSchema = z.string().describe(22`Compute server color in \`rgb(#,#,#)\` format. Used for color-coding compute servers in23the CoCalc UI.`,24);2526export const ComputeServerTitleSchema = z.string().describe(27`Title of this compute server. Used purely to make it easier for the user to keep28track of it.`,29);3031export const ComputeServerCloudSchema = z32.enum(["google-cloud", "hyperstack", "onprem"])33.describe("The cloud provider used to run this compute server");3435export const ComputeServerImageProxySchema = z.object({36path: z.string(),37target: z.string(),38ws: z.boolean().optional(),39app: z.string().optional(),40name: z.string().optional(),41});4243export const GoogleCloudServerConfigurationSchema = z.object({}).passthrough();4445export const HyperstackServerConfigurationSchema = z.object({}).passthrough();4647export const ServerConfigurationSchema = z.union([48GoogleCloudServerConfigurationSchema,49HyperstackServerConfigurationSchema,50]);5152export const BaseServerConfigurationSchema = z.object({53cloud: ComputeServerCloudSchema,54dns: z.string().describe("DNS name"),55spot: z.boolean().describe("If true, provision a spot instance."),56zone: z57.string()58.describe("Cloud provider zone to which this template defaults."),59image: z.string().describe("Compute server template image name."),60region: z.string().describe("Compute server template region name."),61ephemeral: z62.boolean()63.describe("Indicates whether the compute server is ephemeral.")64.optional(),65diskType: z.string().describe("Compute server template disk type."),66diskSizeGb: z67.number()68.min(0)69.describe("Compute server template disk image size in GB."),70externalIp: z71.boolean()72.describe(73`When true, the compute server is configured with an external IP address.`,74),75tag_cocalc: z.string().describe("CoCalc tag"),76machineType: z77.string()78.describe(79"Cloud-specific machine type for this template (e.g., `t2d-standard-1`).",80),81excludeFromSync: z82.array(z.string())83.describe("Array of top level directories to exclude from sync."),84acceleratorType: z85.string()86.describe(87"Number of hardware accelerators to be provisioned to this server.",88)89.optional(),90acceleratorCount: z91.number()92.int()93.min(0)94.describe(95"Number of hardware accelerators to be provisioned with this server.",96)97.optional(),98proxy: ComputeServerImageProxySchema.optional(),99});100101export type BaseServerConfiguration = z.infer<102typeof BaseServerConfigurationSchema103>;104export type ComputeServerBodyId = z.infer<typeof ComputeServerIdSchema>;105export type ComputeServerCloud = z.infer<typeof ComputeServerCloudSchema>;106export type ComputeServerColor = z.infer<typeof ComputeServerColorSchema>;107export type ComputeServerImageProxy = z.infer<108typeof ComputeServerImageProxySchema109>;110export type ComputeServerState = z.infer<typeof ComputeServerStateSchema>;111export type ComputeServerTitle = z.infer<typeof ComputeServerTitleSchema>;112export type GoogleCloudServerConfiguration = z.infer<113typeof GoogleCloudServerConfigurationSchema114>;115export type HyperstackServerConfiguration = z.infer<116typeof HyperstackServerConfigurationSchema117>;118export type ServerConfiguration = z.infer<typeof ServerConfigurationSchema>;119120121