@ricsam/r5d-api 0.0.49 → 0.0.51

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.
@@ -208,6 +208,21 @@ 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
+ window: input.window
223
+ }
224
+ })
225
+ };
211
226
  projects = {
212
227
  list: () => this.request({
213
228
  method: "GET",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "type": "commonjs"
5
5
  }
@@ -184,6 +184,21 @@ 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
+ window: input.window
199
+ }
200
+ })
201
+ };
187
202
  projects = {
188
203
  list: () => this.request({
189
204
  method: "GET",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "type": "module"
5
5
  }
@@ -280,6 +280,64 @@ export type R5dctlSessionCreateInput = {
280
280
  export type R5dctlSessionUpdateInput = {
281
281
  name: string | null;
282
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
+ phase: string | null;
295
+ }>;
296
+ };
297
+ export type R5dctlK8sWorkload = {
298
+ uid: string;
299
+ kind: "Deployment" | "StatefulSet" | "DaemonSet" | "CronJob" | "ReplicaSet" | "Job" | "Pod";
300
+ namespace: string;
301
+ name: string;
302
+ replicas: number;
303
+ readyReplicas: number;
304
+ containers: R5dctlK8sContainer[];
305
+ };
306
+ export type R5dctlK8sResources = {
307
+ status: "ready";
308
+ collectedAt: string;
309
+ metricsFreshAt: string | null;
310
+ metricsStale: boolean;
311
+ workloads: R5dctlK8sWorkload[];
312
+ };
313
+ export type R5dctlK8sHistoryPoint = {
314
+ bucketStart: string;
315
+ cpuMinNanoCores: number;
316
+ cpuMaxNanoCores: number;
317
+ cpuLatestNanoCores: number;
318
+ memoryMinBytes: number;
319
+ memoryMaxBytes: number;
320
+ memoryLatestBytes: number;
321
+ sampleCount: number;
322
+ firstSampleAt: string;
323
+ lastSampleAt: string;
324
+ };
325
+ export type R5dctlK8sResourceHistory = {
326
+ workloadUid: string;
327
+ containerName: string;
328
+ windowStart: string;
329
+ windowEnd: string;
330
+ coverageStart: string | null;
331
+ coverageEnd: string | null;
332
+ incomplete: boolean;
333
+ stale: boolean;
334
+ envelope: R5dctlK8sHistoryPoint[];
335
+ pods: Array<{
336
+ podUid: string;
337
+ podName: string;
338
+ points: R5dctlK8sHistoryPoint[];
339
+ }>;
340
+ };
283
341
  export type R5dctlClientOptions = {
284
342
  baseUrl?: string;
285
343
  token?: string;
@@ -354,6 +412,14 @@ export declare class R5dctlClient {
354
412
  confirmed: true;
355
413
  }) => Promise<R5dctlWorkspaceSyncResult>;
356
414
  };
415
+ readonly k8s: {
416
+ resources: () => Promise<R5dctlK8sResources>;
417
+ resourceHistory: (input: {
418
+ workloadUid: string;
419
+ containerName: string;
420
+ window?: "24h" | "7d";
421
+ }) => Promise<R5dctlK8sResourceHistory>;
422
+ };
357
423
  readonly projects: {
358
424
  list: () => Promise<R5dctlProject[]>;
359
425
  describe: (projectRef: string) => Promise<R5dctlProjectDescription>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/index.cjs",
6
6
  "module": "./dist/mjs/index.mjs",