@ricsam/r5d-api 0.0.48 → 0.0.50
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/dist/cjs/index.cjs +14 -0
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/index.mjs +14 -0
- package/dist/mjs/package.json +1 -1
- package/dist/types/index.d.ts +72 -2
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -208,6 +208,20 @@ class R5dctlClient {
|
|
|
208
208
|
body: input
|
|
209
209
|
})
|
|
210
210
|
};
|
|
211
|
+
k8s = {
|
|
212
|
+
resources: () => this.request({
|
|
213
|
+
method: "GET",
|
|
214
|
+
path: "/api/user/managed-vcluster/resources"
|
|
215
|
+
}),
|
|
216
|
+
resourceHistory: (input) => this.request({
|
|
217
|
+
method: "GET",
|
|
218
|
+
path: "/api/user/managed-vcluster/resource-history",
|
|
219
|
+
query: {
|
|
220
|
+
workloadUid: input.workloadUid,
|
|
221
|
+
containerName: input.containerName
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
};
|
|
211
225
|
projects = {
|
|
212
226
|
list: () => this.request({
|
|
213
227
|
method: "GET",
|
package/dist/cjs/package.json
CHANGED
package/dist/mjs/index.mjs
CHANGED
|
@@ -184,6 +184,20 @@ class R5dctlClient {
|
|
|
184
184
|
body: input
|
|
185
185
|
})
|
|
186
186
|
};
|
|
187
|
+
k8s = {
|
|
188
|
+
resources: () => this.request({
|
|
189
|
+
method: "GET",
|
|
190
|
+
path: "/api/user/managed-vcluster/resources"
|
|
191
|
+
}),
|
|
192
|
+
resourceHistory: (input) => this.request({
|
|
193
|
+
method: "GET",
|
|
194
|
+
path: "/api/user/managed-vcluster/resource-history",
|
|
195
|
+
query: {
|
|
196
|
+
workloadUid: input.workloadUid,
|
|
197
|
+
containerName: input.containerName
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
};
|
|
187
201
|
projects = {
|
|
188
202
|
list: () => this.request({
|
|
189
203
|
method: "GET",
|
package/dist/mjs/package.json
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -176,6 +176,15 @@ export type R5dctlApiKey = {
|
|
|
176
176
|
lastUsedAt: string | null;
|
|
177
177
|
};
|
|
178
178
|
export type R5dctlProcessRunStatus = "starting" | "running" | "exited" | "cancelled" | "failed";
|
|
179
|
+
export type R5dctlProcessTarget = {
|
|
180
|
+
type: "project";
|
|
181
|
+
projectId: string;
|
|
182
|
+
branchName: string;
|
|
183
|
+
} | {
|
|
184
|
+
type: "workspace";
|
|
185
|
+
ownerUserId: string;
|
|
186
|
+
rootProfile: "visible_projects" | "canonical_sync";
|
|
187
|
+
};
|
|
179
188
|
export type R5dctlWorkspaceSyncResult = {
|
|
180
189
|
type: "workspace_sync";
|
|
181
190
|
attemptId: string;
|
|
@@ -214,10 +223,9 @@ export type R5dctlWorkspaceStatus = {
|
|
|
214
223
|
};
|
|
215
224
|
export type R5dctlProcessRun = {
|
|
216
225
|
runId: string;
|
|
217
|
-
|
|
226
|
+
target: R5dctlProcessTarget;
|
|
218
227
|
projectPath: string;
|
|
219
228
|
sessionId: string;
|
|
220
|
-
branchName: string;
|
|
221
229
|
workerLabel: string;
|
|
222
230
|
platform?: string;
|
|
223
231
|
arch?: string;
|
|
@@ -272,6 +280,61 @@ export type R5dctlSessionCreateInput = {
|
|
|
272
280
|
export type R5dctlSessionUpdateInput = {
|
|
273
281
|
name: string | null;
|
|
274
282
|
};
|
|
283
|
+
export type R5dctlK8sUsage = {
|
|
284
|
+
cpuNanoCores: number | null;
|
|
285
|
+
memoryBytes: number | null;
|
|
286
|
+
sampledAt: string | null;
|
|
287
|
+
};
|
|
288
|
+
export type R5dctlK8sContainer = {
|
|
289
|
+
name: string;
|
|
290
|
+
currentUsage: R5dctlK8sUsage;
|
|
291
|
+
pods: Array<R5dctlK8sUsage & {
|
|
292
|
+
podUid: string;
|
|
293
|
+
podName: string;
|
|
294
|
+
}>;
|
|
295
|
+
};
|
|
296
|
+
export type R5dctlK8sWorkload = {
|
|
297
|
+
uid: string;
|
|
298
|
+
kind: "Deployment" | "StatefulSet" | "DaemonSet" | "CronJob" | "ReplicaSet" | "Job" | "Pod";
|
|
299
|
+
namespace: string;
|
|
300
|
+
name: string;
|
|
301
|
+
containers: R5dctlK8sContainer[];
|
|
302
|
+
};
|
|
303
|
+
export type R5dctlK8sResources = {
|
|
304
|
+
status: "ready";
|
|
305
|
+
collectedAt: string;
|
|
306
|
+
metricsFreshAt: string | null;
|
|
307
|
+
metricsStale: boolean;
|
|
308
|
+
workloads: R5dctlK8sWorkload[];
|
|
309
|
+
};
|
|
310
|
+
export type R5dctlK8sHistoryPoint = {
|
|
311
|
+
bucketStart: string;
|
|
312
|
+
cpuMinNanoCores: number;
|
|
313
|
+
cpuMaxNanoCores: number;
|
|
314
|
+
cpuLatestNanoCores: number;
|
|
315
|
+
memoryMinBytes: number;
|
|
316
|
+
memoryMaxBytes: number;
|
|
317
|
+
memoryLatestBytes: number;
|
|
318
|
+
sampleCount: number;
|
|
319
|
+
firstSampleAt: string;
|
|
320
|
+
lastSampleAt: string;
|
|
321
|
+
};
|
|
322
|
+
export type R5dctlK8sResourceHistory = {
|
|
323
|
+
workloadUid: string;
|
|
324
|
+
containerName: string;
|
|
325
|
+
windowStart: string;
|
|
326
|
+
windowEnd: string;
|
|
327
|
+
coverageStart: string | null;
|
|
328
|
+
coverageEnd: string | null;
|
|
329
|
+
incomplete: boolean;
|
|
330
|
+
stale: boolean;
|
|
331
|
+
envelope: R5dctlK8sHistoryPoint[];
|
|
332
|
+
pods: Array<{
|
|
333
|
+
podUid: string;
|
|
334
|
+
podName: string;
|
|
335
|
+
points: R5dctlK8sHistoryPoint[];
|
|
336
|
+
}>;
|
|
337
|
+
};
|
|
275
338
|
export type R5dctlClientOptions = {
|
|
276
339
|
baseUrl?: string;
|
|
277
340
|
token?: string;
|
|
@@ -346,6 +409,13 @@ export declare class R5dctlClient {
|
|
|
346
409
|
confirmed: true;
|
|
347
410
|
}) => Promise<R5dctlWorkspaceSyncResult>;
|
|
348
411
|
};
|
|
412
|
+
readonly k8s: {
|
|
413
|
+
resources: () => Promise<R5dctlK8sResources>;
|
|
414
|
+
resourceHistory: (input: {
|
|
415
|
+
workloadUid: string;
|
|
416
|
+
containerName: string;
|
|
417
|
+
}) => Promise<R5dctlK8sResourceHistory>;
|
|
418
|
+
};
|
|
349
419
|
readonly projects: {
|
|
350
420
|
list: () => Promise<R5dctlProject[]>;
|
|
351
421
|
describe: (projectRef: string) => Promise<R5dctlProjectDescription>;
|