runpod-sdk 1.1.1 → 1.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -32
- package/dist/package.json +6 -3
- package/dist/src/graphql/client.d.ts +22 -0
- package/dist/src/graphql/client.js +75 -0
- package/dist/src/graphql/client.js.map +1 -0
- package/dist/src/graphql/generated/index.d.ts +742 -0
- package/dist/src/graphql/generated/index.js +347 -0
- package/dist/src/graphql/generated/index.js.map +1 -0
- package/dist/src/graphql/generated/operations.d.ts +428 -0
- package/dist/src/graphql/generated/operations.js +2 -0
- package/dist/src/graphql/generated/operations.js.map +1 -0
- package/dist/src/graphql/generated/sdk.d.ts +31 -0
- package/dist/src/graphql/generated/sdk.js +232 -0
- package/dist/src/graphql/generated/sdk.js.map +1 -0
- package/dist/src/graphql/generated/types.d.ts +4281 -0
- package/dist/src/graphql/generated/types.js +2 -0
- package/dist/src/graphql/generated/types.js.map +1 -0
- package/dist/src/index.d.ts +53 -8
- package/dist/src/index.js +202 -294
- package/dist/src/index.js.map +1 -1
- package/dist/src/pods/generated-gpu-types.d.ts +299 -0
- package/dist/src/pods/generated-gpu-types.js +148 -0
- package/dist/src/pods/generated-gpu-types.js.map +1 -0
- package/dist/src/pods/index.d.ts +122 -0
- package/dist/src/pods/index.js +242 -0
- package/dist/src/pods/index.js.map +1 -0
- package/package.json +18 -2
- package/schema.gql +161 -0
- package/.claude/settings.local.json +0 -15
- package/.prettierrc +0 -12
- package/CLAUDE.md +0 -48
- package/README-dev.md +0 -7
- package/examples/basic.js +0 -19
- package/examples/cancel.js +0 -27
- package/examples/devServerless.js +0 -17
- package/examples/errors.js +0 -11
- package/examples/health.js +0 -11
- package/examples/purge-queue.js +0 -11
- package/examples/run.js +0 -27
- package/examples/runSync.js +0 -17
- package/examples/stream.js +0 -48
- package/examples/test.js +0 -74
- package/src/index.ts +0 -328
- package/tsconfig.json +0 -16
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { PodStatus, PodType, Exact, Scalars, PodFindAndDeployOnDemandInput, PodRentInterruptableInput } from "./types";
|
|
2
|
+
export type PodCoreFragment = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
desiredStatus: PodStatus;
|
|
6
|
+
imageName?: string | null;
|
|
7
|
+
env?: Array<string | null> | null;
|
|
8
|
+
machineId: string;
|
|
9
|
+
memoryInGb: number;
|
|
10
|
+
vcpuCount: number;
|
|
11
|
+
volumeInGb?: number | null;
|
|
12
|
+
volumeMountPath?: string | null;
|
|
13
|
+
podType?: PodType | null;
|
|
14
|
+
costPerHr: number;
|
|
15
|
+
gpuCount: number;
|
|
16
|
+
containerDiskInGb?: number | null;
|
|
17
|
+
ports?: string | null;
|
|
18
|
+
apiKey?: string | null;
|
|
19
|
+
volumeKey?: string | null;
|
|
20
|
+
containerRegistryAuthId?: string | null;
|
|
21
|
+
};
|
|
22
|
+
export type PodRuntimeFragment = {
|
|
23
|
+
runtime?: {
|
|
24
|
+
uptimeInSeconds?: number | null;
|
|
25
|
+
ports?: Array<{
|
|
26
|
+
ip?: string | null;
|
|
27
|
+
isIpPublic?: boolean | null;
|
|
28
|
+
privatePort?: number | null;
|
|
29
|
+
publicPort?: number | null;
|
|
30
|
+
type?: string | null;
|
|
31
|
+
} | null> | null;
|
|
32
|
+
gpus?: Array<{
|
|
33
|
+
id?: string | null;
|
|
34
|
+
gpuUtilPercent?: number | null;
|
|
35
|
+
memoryUtilPercent?: number | null;
|
|
36
|
+
} | null> | null;
|
|
37
|
+
container?: {
|
|
38
|
+
cpuPercent?: number | null;
|
|
39
|
+
memoryPercent?: number | null;
|
|
40
|
+
} | null;
|
|
41
|
+
} | null;
|
|
42
|
+
};
|
|
43
|
+
export type PodMachineFragment = {
|
|
44
|
+
machine?: {
|
|
45
|
+
podHostId?: string | null;
|
|
46
|
+
gpuDisplayName?: string | null;
|
|
47
|
+
} | null;
|
|
48
|
+
};
|
|
49
|
+
export type PodDetailsFragment = {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
desiredStatus: PodStatus;
|
|
53
|
+
imageName?: string | null;
|
|
54
|
+
env?: Array<string | null> | null;
|
|
55
|
+
machineId: string;
|
|
56
|
+
memoryInGb: number;
|
|
57
|
+
vcpuCount: number;
|
|
58
|
+
volumeInGb?: number | null;
|
|
59
|
+
volumeMountPath?: string | null;
|
|
60
|
+
podType?: PodType | null;
|
|
61
|
+
costPerHr: number;
|
|
62
|
+
gpuCount: number;
|
|
63
|
+
containerDiskInGb?: number | null;
|
|
64
|
+
ports?: string | null;
|
|
65
|
+
apiKey?: string | null;
|
|
66
|
+
volumeKey?: string | null;
|
|
67
|
+
containerRegistryAuthId?: string | null;
|
|
68
|
+
runtime?: {
|
|
69
|
+
uptimeInSeconds?: number | null;
|
|
70
|
+
ports?: Array<{
|
|
71
|
+
ip?: string | null;
|
|
72
|
+
isIpPublic?: boolean | null;
|
|
73
|
+
privatePort?: number | null;
|
|
74
|
+
publicPort?: number | null;
|
|
75
|
+
type?: string | null;
|
|
76
|
+
} | null> | null;
|
|
77
|
+
gpus?: Array<{
|
|
78
|
+
id?: string | null;
|
|
79
|
+
gpuUtilPercent?: number | null;
|
|
80
|
+
memoryUtilPercent?: number | null;
|
|
81
|
+
} | null> | null;
|
|
82
|
+
container?: {
|
|
83
|
+
cpuPercent?: number | null;
|
|
84
|
+
memoryPercent?: number | null;
|
|
85
|
+
} | null;
|
|
86
|
+
} | null;
|
|
87
|
+
machine?: {
|
|
88
|
+
podHostId?: string | null;
|
|
89
|
+
gpuDisplayName?: string | null;
|
|
90
|
+
} | null;
|
|
91
|
+
};
|
|
92
|
+
export type GetPodQueryVariables = Exact<{
|
|
93
|
+
podId: Scalars["String"]["input"];
|
|
94
|
+
}>;
|
|
95
|
+
export type GetPodQuery = {
|
|
96
|
+
pod?: {
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
desiredStatus: PodStatus;
|
|
100
|
+
imageName?: string | null;
|
|
101
|
+
env?: Array<string | null> | null;
|
|
102
|
+
machineId: string;
|
|
103
|
+
memoryInGb: number;
|
|
104
|
+
vcpuCount: number;
|
|
105
|
+
volumeInGb?: number | null;
|
|
106
|
+
volumeMountPath?: string | null;
|
|
107
|
+
podType?: PodType | null;
|
|
108
|
+
costPerHr: number;
|
|
109
|
+
gpuCount: number;
|
|
110
|
+
containerDiskInGb?: number | null;
|
|
111
|
+
ports?: string | null;
|
|
112
|
+
apiKey?: string | null;
|
|
113
|
+
volumeKey?: string | null;
|
|
114
|
+
containerRegistryAuthId?: string | null;
|
|
115
|
+
runtime?: {
|
|
116
|
+
uptimeInSeconds?: number | null;
|
|
117
|
+
ports?: Array<{
|
|
118
|
+
ip?: string | null;
|
|
119
|
+
isIpPublic?: boolean | null;
|
|
120
|
+
privatePort?: number | null;
|
|
121
|
+
publicPort?: number | null;
|
|
122
|
+
type?: string | null;
|
|
123
|
+
} | null> | null;
|
|
124
|
+
gpus?: Array<{
|
|
125
|
+
id?: string | null;
|
|
126
|
+
gpuUtilPercent?: number | null;
|
|
127
|
+
memoryUtilPercent?: number | null;
|
|
128
|
+
} | null> | null;
|
|
129
|
+
container?: {
|
|
130
|
+
cpuPercent?: number | null;
|
|
131
|
+
memoryPercent?: number | null;
|
|
132
|
+
} | null;
|
|
133
|
+
} | null;
|
|
134
|
+
machine?: {
|
|
135
|
+
podHostId?: string | null;
|
|
136
|
+
gpuDisplayName?: string | null;
|
|
137
|
+
} | null;
|
|
138
|
+
} | null;
|
|
139
|
+
};
|
|
140
|
+
export type ListMyPodsQueryVariables = Exact<{
|
|
141
|
+
[key: string]: never;
|
|
142
|
+
}>;
|
|
143
|
+
export type ListMyPodsQuery = {
|
|
144
|
+
myself?: {
|
|
145
|
+
pods?: Array<{
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
desiredStatus: PodStatus;
|
|
149
|
+
imageName?: string | null;
|
|
150
|
+
env?: Array<string | null> | null;
|
|
151
|
+
machineId: string;
|
|
152
|
+
memoryInGb: number;
|
|
153
|
+
vcpuCount: number;
|
|
154
|
+
volumeInGb?: number | null;
|
|
155
|
+
volumeMountPath?: string | null;
|
|
156
|
+
podType?: PodType | null;
|
|
157
|
+
costPerHr: number;
|
|
158
|
+
gpuCount: number;
|
|
159
|
+
containerDiskInGb?: number | null;
|
|
160
|
+
ports?: string | null;
|
|
161
|
+
apiKey?: string | null;
|
|
162
|
+
volumeKey?: string | null;
|
|
163
|
+
containerRegistryAuthId?: string | null;
|
|
164
|
+
runtime?: {
|
|
165
|
+
uptimeInSeconds?: number | null;
|
|
166
|
+
ports?: Array<{
|
|
167
|
+
ip?: string | null;
|
|
168
|
+
isIpPublic?: boolean | null;
|
|
169
|
+
privatePort?: number | null;
|
|
170
|
+
publicPort?: number | null;
|
|
171
|
+
type?: string | null;
|
|
172
|
+
} | null> | null;
|
|
173
|
+
gpus?: Array<{
|
|
174
|
+
id?: string | null;
|
|
175
|
+
gpuUtilPercent?: number | null;
|
|
176
|
+
memoryUtilPercent?: number | null;
|
|
177
|
+
} | null> | null;
|
|
178
|
+
container?: {
|
|
179
|
+
cpuPercent?: number | null;
|
|
180
|
+
memoryPercent?: number | null;
|
|
181
|
+
} | null;
|
|
182
|
+
} | null;
|
|
183
|
+
machine?: {
|
|
184
|
+
podHostId?: string | null;
|
|
185
|
+
gpuDisplayName?: string | null;
|
|
186
|
+
} | null;
|
|
187
|
+
} | null> | null;
|
|
188
|
+
} | null;
|
|
189
|
+
};
|
|
190
|
+
export type CreateOnDemandPodMutationVariables = Exact<{
|
|
191
|
+
input: PodFindAndDeployOnDemandInput;
|
|
192
|
+
}>;
|
|
193
|
+
export type CreateOnDemandPodMutation = {
|
|
194
|
+
podFindAndDeployOnDemand?: {
|
|
195
|
+
id: string;
|
|
196
|
+
name: string;
|
|
197
|
+
desiredStatus: PodStatus;
|
|
198
|
+
imageName?: string | null;
|
|
199
|
+
env?: Array<string | null> | null;
|
|
200
|
+
machineId: string;
|
|
201
|
+
memoryInGb: number;
|
|
202
|
+
vcpuCount: number;
|
|
203
|
+
volumeInGb?: number | null;
|
|
204
|
+
volumeMountPath?: string | null;
|
|
205
|
+
podType?: PodType | null;
|
|
206
|
+
costPerHr: number;
|
|
207
|
+
gpuCount: number;
|
|
208
|
+
containerDiskInGb?: number | null;
|
|
209
|
+
ports?: string | null;
|
|
210
|
+
apiKey?: string | null;
|
|
211
|
+
volumeKey?: string | null;
|
|
212
|
+
containerRegistryAuthId?: string | null;
|
|
213
|
+
runtime?: {
|
|
214
|
+
uptimeInSeconds?: number | null;
|
|
215
|
+
ports?: Array<{
|
|
216
|
+
ip?: string | null;
|
|
217
|
+
isIpPublic?: boolean | null;
|
|
218
|
+
privatePort?: number | null;
|
|
219
|
+
publicPort?: number | null;
|
|
220
|
+
type?: string | null;
|
|
221
|
+
} | null> | null;
|
|
222
|
+
gpus?: Array<{
|
|
223
|
+
id?: string | null;
|
|
224
|
+
gpuUtilPercent?: number | null;
|
|
225
|
+
memoryUtilPercent?: number | null;
|
|
226
|
+
} | null> | null;
|
|
227
|
+
container?: {
|
|
228
|
+
cpuPercent?: number | null;
|
|
229
|
+
memoryPercent?: number | null;
|
|
230
|
+
} | null;
|
|
231
|
+
} | null;
|
|
232
|
+
machine?: {
|
|
233
|
+
podHostId?: string | null;
|
|
234
|
+
gpuDisplayName?: string | null;
|
|
235
|
+
} | null;
|
|
236
|
+
} | null;
|
|
237
|
+
};
|
|
238
|
+
export type CreateInterruptablePodMutationVariables = Exact<{
|
|
239
|
+
input: PodRentInterruptableInput;
|
|
240
|
+
}>;
|
|
241
|
+
export type CreateInterruptablePodMutation = {
|
|
242
|
+
podRentInterruptable?: {
|
|
243
|
+
id: string;
|
|
244
|
+
name: string;
|
|
245
|
+
desiredStatus: PodStatus;
|
|
246
|
+
imageName?: string | null;
|
|
247
|
+
env?: Array<string | null> | null;
|
|
248
|
+
machineId: string;
|
|
249
|
+
memoryInGb: number;
|
|
250
|
+
vcpuCount: number;
|
|
251
|
+
volumeInGb?: number | null;
|
|
252
|
+
volumeMountPath?: string | null;
|
|
253
|
+
podType?: PodType | null;
|
|
254
|
+
costPerHr: number;
|
|
255
|
+
gpuCount: number;
|
|
256
|
+
containerDiskInGb?: number | null;
|
|
257
|
+
ports?: string | null;
|
|
258
|
+
apiKey?: string | null;
|
|
259
|
+
volumeKey?: string | null;
|
|
260
|
+
containerRegistryAuthId?: string | null;
|
|
261
|
+
runtime?: {
|
|
262
|
+
uptimeInSeconds?: number | null;
|
|
263
|
+
ports?: Array<{
|
|
264
|
+
ip?: string | null;
|
|
265
|
+
isIpPublic?: boolean | null;
|
|
266
|
+
privatePort?: number | null;
|
|
267
|
+
publicPort?: number | null;
|
|
268
|
+
type?: string | null;
|
|
269
|
+
} | null> | null;
|
|
270
|
+
gpus?: Array<{
|
|
271
|
+
id?: string | null;
|
|
272
|
+
gpuUtilPercent?: number | null;
|
|
273
|
+
memoryUtilPercent?: number | null;
|
|
274
|
+
} | null> | null;
|
|
275
|
+
container?: {
|
|
276
|
+
cpuPercent?: number | null;
|
|
277
|
+
memoryPercent?: number | null;
|
|
278
|
+
} | null;
|
|
279
|
+
} | null;
|
|
280
|
+
machine?: {
|
|
281
|
+
podHostId?: string | null;
|
|
282
|
+
gpuDisplayName?: string | null;
|
|
283
|
+
} | null;
|
|
284
|
+
} | null;
|
|
285
|
+
};
|
|
286
|
+
export type StopPodMutationVariables = Exact<{
|
|
287
|
+
podId: Scalars["String"]["input"];
|
|
288
|
+
}>;
|
|
289
|
+
export type StopPodMutation = {
|
|
290
|
+
podStop?: {
|
|
291
|
+
id: string;
|
|
292
|
+
name: string;
|
|
293
|
+
desiredStatus: PodStatus;
|
|
294
|
+
imageName?: string | null;
|
|
295
|
+
env?: Array<string | null> | null;
|
|
296
|
+
machineId: string;
|
|
297
|
+
memoryInGb: number;
|
|
298
|
+
vcpuCount: number;
|
|
299
|
+
volumeInGb?: number | null;
|
|
300
|
+
volumeMountPath?: string | null;
|
|
301
|
+
podType?: PodType | null;
|
|
302
|
+
costPerHr: number;
|
|
303
|
+
gpuCount: number;
|
|
304
|
+
containerDiskInGb?: number | null;
|
|
305
|
+
ports?: string | null;
|
|
306
|
+
apiKey?: string | null;
|
|
307
|
+
volumeKey?: string | null;
|
|
308
|
+
containerRegistryAuthId?: string | null;
|
|
309
|
+
runtime?: {
|
|
310
|
+
uptimeInSeconds?: number | null;
|
|
311
|
+
ports?: Array<{
|
|
312
|
+
ip?: string | null;
|
|
313
|
+
isIpPublic?: boolean | null;
|
|
314
|
+
privatePort?: number | null;
|
|
315
|
+
publicPort?: number | null;
|
|
316
|
+
type?: string | null;
|
|
317
|
+
} | null> | null;
|
|
318
|
+
gpus?: Array<{
|
|
319
|
+
id?: string | null;
|
|
320
|
+
gpuUtilPercent?: number | null;
|
|
321
|
+
memoryUtilPercent?: number | null;
|
|
322
|
+
} | null> | null;
|
|
323
|
+
container?: {
|
|
324
|
+
cpuPercent?: number | null;
|
|
325
|
+
memoryPercent?: number | null;
|
|
326
|
+
} | null;
|
|
327
|
+
} | null;
|
|
328
|
+
machine?: {
|
|
329
|
+
podHostId?: string | null;
|
|
330
|
+
gpuDisplayName?: string | null;
|
|
331
|
+
} | null;
|
|
332
|
+
} | null;
|
|
333
|
+
};
|
|
334
|
+
export type ResumePodMutationVariables = Exact<{
|
|
335
|
+
podId: Scalars["String"]["input"];
|
|
336
|
+
gpuCount: Scalars["Int"]["input"];
|
|
337
|
+
}>;
|
|
338
|
+
export type ResumePodMutation = {
|
|
339
|
+
podResume?: {
|
|
340
|
+
id: string;
|
|
341
|
+
name: string;
|
|
342
|
+
desiredStatus: PodStatus;
|
|
343
|
+
imageName?: string | null;
|
|
344
|
+
env?: Array<string | null> | null;
|
|
345
|
+
machineId: string;
|
|
346
|
+
memoryInGb: number;
|
|
347
|
+
vcpuCount: number;
|
|
348
|
+
volumeInGb?: number | null;
|
|
349
|
+
volumeMountPath?: string | null;
|
|
350
|
+
podType?: PodType | null;
|
|
351
|
+
costPerHr: number;
|
|
352
|
+
gpuCount: number;
|
|
353
|
+
containerDiskInGb?: number | null;
|
|
354
|
+
ports?: string | null;
|
|
355
|
+
apiKey?: string | null;
|
|
356
|
+
volumeKey?: string | null;
|
|
357
|
+
containerRegistryAuthId?: string | null;
|
|
358
|
+
runtime?: {
|
|
359
|
+
uptimeInSeconds?: number | null;
|
|
360
|
+
ports?: Array<{
|
|
361
|
+
ip?: string | null;
|
|
362
|
+
isIpPublic?: boolean | null;
|
|
363
|
+
privatePort?: number | null;
|
|
364
|
+
publicPort?: number | null;
|
|
365
|
+
type?: string | null;
|
|
366
|
+
} | null> | null;
|
|
367
|
+
gpus?: Array<{
|
|
368
|
+
id?: string | null;
|
|
369
|
+
gpuUtilPercent?: number | null;
|
|
370
|
+
memoryUtilPercent?: number | null;
|
|
371
|
+
} | null> | null;
|
|
372
|
+
container?: {
|
|
373
|
+
cpuPercent?: number | null;
|
|
374
|
+
memoryPercent?: number | null;
|
|
375
|
+
} | null;
|
|
376
|
+
} | null;
|
|
377
|
+
machine?: {
|
|
378
|
+
podHostId?: string | null;
|
|
379
|
+
gpuDisplayName?: string | null;
|
|
380
|
+
} | null;
|
|
381
|
+
} | null;
|
|
382
|
+
};
|
|
383
|
+
export type TerminatePodMutationVariables = Exact<{
|
|
384
|
+
podId: Scalars["String"]["input"];
|
|
385
|
+
}>;
|
|
386
|
+
export type TerminatePodMutation = {
|
|
387
|
+
podTerminate?: any | null;
|
|
388
|
+
};
|
|
389
|
+
export type UserBasicsFragment = {
|
|
390
|
+
id?: string | null;
|
|
391
|
+
email?: string | null;
|
|
392
|
+
machineQuota?: number | null;
|
|
393
|
+
currentSpendPerHr?: number | null;
|
|
394
|
+
spendLimit?: number | null;
|
|
395
|
+
referralEarned?: number | null;
|
|
396
|
+
};
|
|
397
|
+
export type GetMyProfileQueryVariables = Exact<{
|
|
398
|
+
[key: string]: never;
|
|
399
|
+
}>;
|
|
400
|
+
export type GetMyProfileQuery = {
|
|
401
|
+
myself?: {
|
|
402
|
+
id?: string | null;
|
|
403
|
+
email?: string | null;
|
|
404
|
+
machineQuota?: number | null;
|
|
405
|
+
currentSpendPerHr?: number | null;
|
|
406
|
+
spendLimit?: number | null;
|
|
407
|
+
referralEarned?: number | null;
|
|
408
|
+
} | null;
|
|
409
|
+
};
|
|
410
|
+
export type GpuTypeBasicsFragment = {
|
|
411
|
+
id?: string | null;
|
|
412
|
+
displayName?: string | null;
|
|
413
|
+
memoryInGb?: number | null;
|
|
414
|
+
secureCloud?: boolean | null;
|
|
415
|
+
communityCloud?: boolean | null;
|
|
416
|
+
};
|
|
417
|
+
export type ListGpuTypesQueryVariables = Exact<{
|
|
418
|
+
[key: string]: never;
|
|
419
|
+
}>;
|
|
420
|
+
export type ListGpuTypesQuery = {
|
|
421
|
+
gpuTypes?: Array<{
|
|
422
|
+
id?: string | null;
|
|
423
|
+
displayName?: string | null;
|
|
424
|
+
memoryInGb?: number | null;
|
|
425
|
+
secureCloud?: boolean | null;
|
|
426
|
+
communityCloud?: boolean | null;
|
|
427
|
+
} | null> | null;
|
|
428
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/graphql/generated/operations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { GraphQLClient, RequestOptions } from "graphql-request";
|
|
2
|
+
type GraphQLClientRequestHeaders = RequestOptions["requestHeaders"];
|
|
3
|
+
export declare const PodCoreFragmentDoc: import("graphql").DocumentNode;
|
|
4
|
+
export declare const PodRuntimeFragmentDoc: import("graphql").DocumentNode;
|
|
5
|
+
export declare const PodMachineFragmentDoc: import("graphql").DocumentNode;
|
|
6
|
+
export declare const PodDetailsFragmentDoc: import("graphql").DocumentNode;
|
|
7
|
+
export declare const UserBasicsFragmentDoc: import("graphql").DocumentNode;
|
|
8
|
+
export declare const GpuTypeBasicsFragmentDoc: import("graphql").DocumentNode;
|
|
9
|
+
export declare const GetPodDocument: import("graphql").DocumentNode;
|
|
10
|
+
export declare const ListMyPodsDocument: import("graphql").DocumentNode;
|
|
11
|
+
export declare const CreateOnDemandPodDocument: import("graphql").DocumentNode;
|
|
12
|
+
export declare const CreateInterruptablePodDocument: import("graphql").DocumentNode;
|
|
13
|
+
export declare const StopPodDocument: import("graphql").DocumentNode;
|
|
14
|
+
export declare const ResumePodDocument: import("graphql").DocumentNode;
|
|
15
|
+
export declare const TerminatePodDocument: import("graphql").DocumentNode;
|
|
16
|
+
export declare const GetMyProfileDocument: import("graphql").DocumentNode;
|
|
17
|
+
export declare const ListGpuTypesDocument: import("graphql").DocumentNode;
|
|
18
|
+
export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string, operationType?: string, variables?: any) => Promise<T>;
|
|
19
|
+
export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
|
|
20
|
+
GetPod(variables: GetPodQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<GetPodQuery>;
|
|
21
|
+
ListMyPods(variables?: any, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<ListMyPodsQuery>;
|
|
22
|
+
CreateOnDemandPod(variables: CreateOnDemandPodMutationVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<CreateOnDemandPodMutation>;
|
|
23
|
+
CreateInterruptablePod(variables: CreateInterruptablePodMutationVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<CreateInterruptablePodMutation>;
|
|
24
|
+
StopPod(variables: StopPodMutationVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<StopPodMutation>;
|
|
25
|
+
ResumePod(variables: ResumePodMutationVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<ResumePodMutation>;
|
|
26
|
+
TerminatePod(variables: TerminatePodMutationVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<TerminatePodMutation>;
|
|
27
|
+
GetMyProfile(variables?: any, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<GetMyProfileQuery>;
|
|
28
|
+
ListGpuTypes(variables?: any, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<ListGpuTypesQuery>;
|
|
29
|
+
};
|
|
30
|
+
export type Sdk = ReturnType<typeof getSdk>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
export const PodCoreFragmentDoc = gql `
|
|
3
|
+
fragment PodCore on Pod {
|
|
4
|
+
id
|
|
5
|
+
name
|
|
6
|
+
desiredStatus
|
|
7
|
+
imageName
|
|
8
|
+
env
|
|
9
|
+
machineId
|
|
10
|
+
memoryInGb
|
|
11
|
+
vcpuCount
|
|
12
|
+
volumeInGb
|
|
13
|
+
volumeMountPath
|
|
14
|
+
podType
|
|
15
|
+
costPerHr
|
|
16
|
+
gpuCount
|
|
17
|
+
containerDiskInGb
|
|
18
|
+
ports
|
|
19
|
+
apiKey
|
|
20
|
+
volumeKey
|
|
21
|
+
containerRegistryAuthId
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export const PodRuntimeFragmentDoc = gql `
|
|
25
|
+
fragment PodRuntime on Pod {
|
|
26
|
+
runtime {
|
|
27
|
+
uptimeInSeconds
|
|
28
|
+
ports {
|
|
29
|
+
ip
|
|
30
|
+
isIpPublic
|
|
31
|
+
privatePort
|
|
32
|
+
publicPort
|
|
33
|
+
type
|
|
34
|
+
}
|
|
35
|
+
gpus {
|
|
36
|
+
id
|
|
37
|
+
gpuUtilPercent
|
|
38
|
+
memoryUtilPercent
|
|
39
|
+
}
|
|
40
|
+
container {
|
|
41
|
+
cpuPercent
|
|
42
|
+
memoryPercent
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
export const PodMachineFragmentDoc = gql `
|
|
48
|
+
fragment PodMachine on Pod {
|
|
49
|
+
machine {
|
|
50
|
+
podHostId
|
|
51
|
+
gpuDisplayName
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export const PodDetailsFragmentDoc = gql `
|
|
56
|
+
fragment PodDetails on Pod {
|
|
57
|
+
...PodCore
|
|
58
|
+
...PodRuntime
|
|
59
|
+
...PodMachine
|
|
60
|
+
}
|
|
61
|
+
${PodCoreFragmentDoc}
|
|
62
|
+
${PodRuntimeFragmentDoc}
|
|
63
|
+
${PodMachineFragmentDoc}
|
|
64
|
+
`;
|
|
65
|
+
export const UserBasicsFragmentDoc = gql `
|
|
66
|
+
fragment UserBasics on User {
|
|
67
|
+
id
|
|
68
|
+
email
|
|
69
|
+
machineQuota
|
|
70
|
+
currentSpendPerHr
|
|
71
|
+
spendLimit
|
|
72
|
+
referralEarned
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
export const GpuTypeBasicsFragmentDoc = gql `
|
|
76
|
+
fragment GpuTypeBasics on GpuType {
|
|
77
|
+
id
|
|
78
|
+
displayName
|
|
79
|
+
memoryInGb
|
|
80
|
+
secureCloud
|
|
81
|
+
communityCloud
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
export const GetPodDocument = gql `
|
|
85
|
+
query GetPod($podId: String!) {
|
|
86
|
+
pod(input: { podId: $podId }) {
|
|
87
|
+
...PodDetails
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
${PodDetailsFragmentDoc}
|
|
91
|
+
`;
|
|
92
|
+
export const ListMyPodsDocument = gql `
|
|
93
|
+
query ListMyPods {
|
|
94
|
+
myself {
|
|
95
|
+
pods {
|
|
96
|
+
...PodDetails
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
${PodDetailsFragmentDoc}
|
|
101
|
+
`;
|
|
102
|
+
export const CreateOnDemandPodDocument = gql `
|
|
103
|
+
mutation CreateOnDemandPod($input: PodFindAndDeployOnDemandInput!) {
|
|
104
|
+
podFindAndDeployOnDemand(input: $input) {
|
|
105
|
+
...PodDetails
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
${PodDetailsFragmentDoc}
|
|
109
|
+
`;
|
|
110
|
+
export const CreateInterruptablePodDocument = gql `
|
|
111
|
+
mutation CreateInterruptablePod($input: PodRentInterruptableInput!) {
|
|
112
|
+
podRentInterruptable(input: $input) {
|
|
113
|
+
...PodDetails
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
${PodDetailsFragmentDoc}
|
|
117
|
+
`;
|
|
118
|
+
export const StopPodDocument = gql `
|
|
119
|
+
mutation StopPod($podId: String!) {
|
|
120
|
+
podStop(input: { podId: $podId }) {
|
|
121
|
+
...PodDetails
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
${PodDetailsFragmentDoc}
|
|
125
|
+
`;
|
|
126
|
+
export const ResumePodDocument = gql `
|
|
127
|
+
mutation ResumePod($podId: String!, $gpuCount: Int!) {
|
|
128
|
+
podResume(input: { podId: $podId, gpuCount: $gpuCount }) {
|
|
129
|
+
...PodDetails
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
${PodDetailsFragmentDoc}
|
|
133
|
+
`;
|
|
134
|
+
export const TerminatePodDocument = gql `
|
|
135
|
+
mutation TerminatePod($podId: String!) {
|
|
136
|
+
podTerminate(input: { podId: $podId })
|
|
137
|
+
}
|
|
138
|
+
`;
|
|
139
|
+
export const GetMyProfileDocument = gql `
|
|
140
|
+
query GetMyProfile {
|
|
141
|
+
myself {
|
|
142
|
+
...UserBasics
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
${UserBasicsFragmentDoc}
|
|
146
|
+
`;
|
|
147
|
+
export const ListGpuTypesDocument = gql `
|
|
148
|
+
query ListGpuTypes {
|
|
149
|
+
gpuTypes {
|
|
150
|
+
...GpuTypeBasics
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
${GpuTypeBasicsFragmentDoc}
|
|
154
|
+
`;
|
|
155
|
+
const defaultWrapper = (action, _operationName, _operationType, _variables) => action();
|
|
156
|
+
export function getSdk(client, withWrapper = defaultWrapper) {
|
|
157
|
+
return {
|
|
158
|
+
GetPod(variables, requestHeaders, signal) {
|
|
159
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
160
|
+
document: GetPodDocument,
|
|
161
|
+
variables,
|
|
162
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
163
|
+
signal,
|
|
164
|
+
}), "GetPod", "query", variables);
|
|
165
|
+
},
|
|
166
|
+
ListMyPods(variables, requestHeaders, signal) {
|
|
167
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
168
|
+
document: ListMyPodsDocument,
|
|
169
|
+
variables,
|
|
170
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
171
|
+
signal,
|
|
172
|
+
}), "ListMyPods", "query", variables);
|
|
173
|
+
},
|
|
174
|
+
CreateOnDemandPod(variables, requestHeaders, signal) {
|
|
175
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
176
|
+
document: CreateOnDemandPodDocument,
|
|
177
|
+
variables,
|
|
178
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
179
|
+
signal,
|
|
180
|
+
}), "CreateOnDemandPod", "mutation", variables);
|
|
181
|
+
},
|
|
182
|
+
CreateInterruptablePod(variables, requestHeaders, signal) {
|
|
183
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
184
|
+
document: CreateInterruptablePodDocument,
|
|
185
|
+
variables,
|
|
186
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
187
|
+
signal,
|
|
188
|
+
}), "CreateInterruptablePod", "mutation", variables);
|
|
189
|
+
},
|
|
190
|
+
StopPod(variables, requestHeaders, signal) {
|
|
191
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
192
|
+
document: StopPodDocument,
|
|
193
|
+
variables,
|
|
194
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
195
|
+
signal,
|
|
196
|
+
}), "StopPod", "mutation", variables);
|
|
197
|
+
},
|
|
198
|
+
ResumePod(variables, requestHeaders, signal) {
|
|
199
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
200
|
+
document: ResumePodDocument,
|
|
201
|
+
variables,
|
|
202
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
203
|
+
signal,
|
|
204
|
+
}), "ResumePod", "mutation", variables);
|
|
205
|
+
},
|
|
206
|
+
TerminatePod(variables, requestHeaders, signal) {
|
|
207
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
208
|
+
document: TerminatePodDocument,
|
|
209
|
+
variables,
|
|
210
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
211
|
+
signal,
|
|
212
|
+
}), "TerminatePod", "mutation", variables);
|
|
213
|
+
},
|
|
214
|
+
GetMyProfile(variables, requestHeaders, signal) {
|
|
215
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
216
|
+
document: GetMyProfileDocument,
|
|
217
|
+
variables,
|
|
218
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
219
|
+
signal,
|
|
220
|
+
}), "GetMyProfile", "query", variables);
|
|
221
|
+
},
|
|
222
|
+
ListGpuTypes(variables, requestHeaders, signal) {
|
|
223
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
224
|
+
document: ListGpuTypesDocument,
|
|
225
|
+
variables,
|
|
226
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
227
|
+
signal,
|
|
228
|
+
}), "ListGpuTypes", "query", variables);
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=sdk.js.map
|