Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/lib/api/schema/projects/set-admin-quotas.ts
1698 views
1
import { z } from "../../framework";
2
3
import {
4
FailedAPIOperationSchema,
5
SuccessfulAPIOperationSchema,
6
} from "../common";
7
8
import { ProjectIdSchema } from "./common";
9
10
// OpenAPI spec
11
//
12
export const SetAdminQuotasInputSchema = z
13
.object({
14
project_id: ProjectIdSchema.describe("Project id to set quotas for."),
15
memory_limit: z
16
.number()
17
.nonnegative()
18
.optional()
19
.describe("Memory limit in MB"),
20
memory_request: z
21
.number()
22
.nonnegative()
23
.optional()
24
.describe("Memory request in MB"),
25
cpu_request: z
26
.number()
27
.nonnegative()
28
.optional()
29
.describe("CPU request (number of cores)"),
30
cpu_limit: z
31
.number()
32
.nonnegative()
33
.optional()
34
.describe("CPU limit (number of cores)"),
35
disk_quota: z
36
.number()
37
.nonnegative()
38
.optional()
39
.describe("Disk quota in MB"),
40
idle_timeout: z
41
.number()
42
.nonnegative()
43
.optional()
44
.describe("Idle timeout in seconds"),
45
internet: z.boolean().optional().describe("Internet access"),
46
member_host: z.boolean().optional().describe("Member hosting"),
47
always_running: z.boolean().optional().describe("Always running"),
48
})
49
.describe(
50
"**Administrators only**. Used to set project quotas as an admin. Important: you have to stop and start the project after any change.",
51
);
52
53
export const SetAdminQuotasOutputSchema = z.union([
54
FailedAPIOperationSchema,
55
SuccessfulAPIOperationSchema,
56
]);
57
58
export type SetAdminQuotasInput = z.infer<typeof SetAdminQuotasInputSchema>;
59
export type SetAdminQuotasOutput = z.infer<typeof SetAdminQuotasOutputSchema>;
60
61