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/scripts.ts
Views: 688
1
import { z } from "../../framework";
2
3
import { FailedAPIOperationSchema } from "../common";
4
5
import { ComputeServerIdSchema } from "./common";
6
7
// OpenAPI spec
8
//
9
export const ComputeServerScriptsInputSchema = z
10
.object({
11
id: ComputeServerIdSchema,
12
api_key: z
13
.string()
14
.describe("Used to get the project associated with the compute server. "),
15
action: z
16
.enum(["start", "stop", "deprovision"])
17
.describe(
18
"Determines which script is to be returned from this API call.",
19
),
20
})
21
.describe(
22
`Returns a bash script that when run as root starts a compute server and
23
connects it to a project. This is meant to be used for on prem compute
24
servers, hence it includes installing the \`/cocalc\` code and the
25
\`user\` user.`,
26
);
27
28
export const ComputeServerScriptsOutputSchema = z.union([
29
FailedAPIOperationSchema,
30
z.string().describe("The script of interest."),
31
]);
32
33
export type ComputeServerScriptsInput = z.infer<
34
typeof ComputeServerScriptsInputSchema
35
>;
36
export type ComputeServerScriptsOutput = z.infer<
37
typeof ComputeServerScriptsOutputSchema
38
>;
39
40