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/check-in.ts
Views: 688
1
import { z } from "../../framework";
2
3
import { FailedAPIOperationSchema } from "../common";
4
5
import { ComputeServerIdSchema } from "./common";
6
7
const VpnSha1Schema = z.string().describe("SHA1 VPN hash").optional();
8
9
const StorageSha1Schema = z.string().describe("SHA-1 storage hash").optional();
10
11
// OpenAPI spec
12
//
13
export const ComputeServerCheckInInputSchema = z
14
.object({
15
id: ComputeServerIdSchema,
16
vpn_sha1: VpnSha1Schema,
17
storage_sha1: StorageSha1Schema,
18
})
19
.describe(
20
`Used by compute servers to periodically checking in with CoCalc using a project api
21
key.`,
22
);
23
24
export const ComputeServerCheckInOutputSchema = z.union([
25
FailedAPIOperationSchema,
26
z.object({
27
vpn: z.object({
28
image: z.string().describe("VPN image name and tag."),
29
nodes: z.array(z.object({})),
30
}),
31
storage: z.array(z.object({})),
32
vpn_sha1: VpnSha1Schema,
33
storage_sha1: StorageSha1Schema,
34
}),
35
]);
36
37
export type ComputeServerCheckInInput = z.infer<
38
typeof ComputeServerCheckInInputSchema
39
>;
40
export type ComputeServerCheckInOutput = z.infer<
41
typeof ComputeServerCheckInOutputSchema
42
>;
43
44