1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "vendors": [
12 {
13 "name": "GitHub",
14 "status_json_url": "https://www.githubstatus.com/api/v2/incidents.json",
15 "sla_threshold_pct": 99.9,
16 "excluded_components": []
17 },
18 {
19 "name": "Cloudflare",
20 "status_json_url": "https://www.cloudflarestatus.com/api/v2/incidents.json",
21 "sla_threshold_pct": 99.99,
22 "excluded_components": []
23 },
24 {
25 "name": "OpenAI",
26 "status_json_url": "https://status.openai.com/api/v2/incidents.json",
27 "sla_threshold_pct": 99.9,
28 "excluded_components": []
29 }
30 ],
31 "periodStart": "",
32 "periodEnd": "",
33 "downtimeImpacts": [
34 "critical",
35 "major"
36 ],
37 "maxHistoryPages": 3,
38 "maxIncidentsPerReport": 200,
39 "requestTimeoutSeconds": 30,
40 "concurrency": 5,
41 "maxRedirects": 5,
42 "maxResponseBytes": 5000000
43};
44
45
46const run = await client.actor("kingii98/vendor-sla-attainment-and-credit-claim-report").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56