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/set-server-configuration.ts
Views: 688
1
import { z } from "../../framework";
2
3
import { FailedAPIOperationSchema, OkAPIOperationSchema } from "../common";
4
5
import {
6
ComputeServerIdSchema,
7
GoogleCloudServerConfigurationSchema,
8
HyperstackServerConfigurationSchema,
9
} from "./common";
10
11
// OpenAPI spec
12
//
13
export const SetServerConfigurationInputSchema = z
14
.object({
15
id: ComputeServerIdSchema,
16
configuration: z
17
.union([
18
GoogleCloudServerConfigurationSchema.partial(),
19
HyperstackServerConfigurationSchema.partial(),
20
])
21
.describe(
22
`Server configuration to change. Note that only a subset of the
23
configuration is necessary so that configuration fields may be individually
24
changed.`,
25
),
26
})
27
.describe("Create a new compute server with the provided configuration.");
28
29
export const SetServerConfigurationOutputSchema = z.union([
30
FailedAPIOperationSchema,
31
OkAPIOperationSchema,
32
]);
33
34
export type SetServerConfigurationInput = z.infer<
35
typeof SetServerConfigurationInputSchema
36
>;
37
export type SetServerConfigurationOutput = z.infer<
38
typeof SetServerConfigurationOutputSchema
39
>;
40
41