1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "snapshotAt": "2026-10-01T12:00:00Z",
12 "asOf": "2026-10-01T12:00:30Z",
13 "maxAgeSeconds": 60,
14 "coverageComplete": true,
15 "targetNodes": [
16 "node-1"
17 ],
18 "pods": [
19 {
20 "namespace": "app",
21 "name": "api-1",
22 "nodeName": "node-1",
23 "labels": {
24 "app": "api"
25 },
26 "ready": true,
27 "phase": "Running",
28 "ownerKind": "ReplicaSet",
29 "terminating": false
30 },
31 {
32 "namespace": "app",
33 "name": "api-2",
34 "nodeName": "node-1",
35 "labels": {
36 "app": "api"
37 },
38 "ready": true,
39 "phase": "Running",
40 "ownerKind": "ReplicaSet",
41 "terminating": false
42 }
43 ],
44 "budgets": [
45 {
46 "namespace": "app",
47 "name": "api-budget",
48 "generation": 1,
49 "observedGeneration": 1,
50 "selector": {
51 "matchLabels": {
52 "app": "api"
53 }
54 },
55 "disruptionsAllowed": 1,
56 "currentHealthy": 2,
57 "desiredHealthy": 1,
58 "unhealthyPodEvictionPolicy": "IfHealthyBudget"
59 }
60 ]
61};
62
63
64const run = await client.actor("wheresprada/kubernetes-pdb-drain-snapshot-check").call(input);
65
66
67console.log('Results from dataset');
68console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
69const { items } = await client.dataset(run.defaultDatasetId).listItems();
70items.forEach((item) => {
71 console.dir(item);
72});
73
74