@ricsam/r5d-api 0.0.49 → 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.
@@ -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",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "type": "commonjs"
5
5
  }
@@ -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",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "type": "module"
5
5
  }
@@ -280,6 +280,61 @@ 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
+ }>;
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
+ };
283
338
  export type R5dctlClientOptions = {
284
339
  baseUrl?: string;
285
340
  token?: string;
@@ -354,6 +409,13 @@ export declare class R5dctlClient {
354
409
  confirmed: true;
355
410
  }) => Promise<R5dctlWorkspaceSyncResult>;
356
411
  };
412
+ readonly k8s: {
413
+ resources: () => Promise<R5dctlK8sResources>;
414
+ resourceHistory: (input: {
415
+ workloadUid: string;
416
+ containerName: string;
417
+ }) => Promise<R5dctlK8sResourceHistory>;
418
+ };
357
419
  readonly projects: {
358
420
  list: () => Promise<R5dctlProject[]>;
359
421
  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.50",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/index.cjs",
6
6
  "module": "./dist/mjs/index.mjs",