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/get-template.ts
Views: 688
import { z } from "../../framework";12import { FailedAPIOperationSchema } from "../common";34import {5BaseServerConfigurationSchema,6ComputeServerCloudSchema,7ComputeServerColorSchema,8ComputeServerIdSchema,9ComputeServerTitleSchema,10} from "./common";1112// OpenAPI spec13//14export const ComputeServerTemplateObjectSchema = z15.object({16enabled: z17.boolean()18.describe(19"If true, this server template is to be shown in the CoCalc UI.",20)21.optional(),22priority: z23.number()24.describe("Semantic priority for this server template.")25.optional(),26})27.describe(28"Contains information about this template's priority and availability.",29);3031export const GetComputeServerTemplateSchema = z.object({32id: ComputeServerIdSchema.describe("Compute server template id"),33title: ComputeServerTitleSchema,34color: ComputeServerColorSchema,35cloud: ComputeServerCloudSchema,36configuration:37BaseServerConfigurationSchema.describe(`Default cloud server configuration for this template. _The exact38structure of this object is still in development, and this schema should39be used accordingly.`),40template: ComputeServerTemplateObjectSchema,41avatar_image_tiny: z42.union([z.string().describe("Image URL"), z.null()])43.describe(44`tiny (32x32) visual image associated with the compute server. Suitable to45include as part of changefeed`,46),47position: z48.number()49.int()50.describe("Used for sorting a list of compute servers in the UI."),51cost_per_hour: z52.object({53running: z54.number()55.describe(56"Cost in (fractional) cents for the compute server when powered on.",57),58off: z59.number()60.describe(61"Cost in (fractional) cents for the compute server when powered off.",62),63})64.describe("Compute server template.")65.optional(),66});6768export const GetComputeServerTemplateInputSchema = z69.object({70id: ComputeServerIdSchema.describe("Compute server template id."),71})72.describe("Get a specific compute server template by `id`.");7374export const GetComputeServerTemplateOutputSchema = z.union([75FailedAPIOperationSchema,76GetComputeServerTemplateSchema,77]);7879export type GetComputeServerTemplateInput = z.infer<80typeof GetComputeServerTemplateInputSchema81>;82export type GetComputeServerTemplateOutput = z.infer<83typeof GetComputeServerTemplateOutputSchema84>;858687