@openstatus/sdk-node 0.1.1 → 0.1.3
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/README.md +901 -429
- package/esm/gen/openstatus/maintenance/v1/maintenance_pb.d.ts +139 -0
- package/esm/gen/openstatus/maintenance/v1/maintenance_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/maintenance/v1/maintenance_pb.js +18 -0
- package/esm/gen/openstatus/maintenance/v1/service_pb.d.ts +315 -0
- package/esm/gen/openstatus/maintenance/v1/service_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/maintenance/v1/service_pb.js +66 -0
- package/esm/gen/openstatus/monitor/v1/service_pb.d.ts +7 -13
- package/esm/gen/openstatus/monitor/v1/service_pb.d.ts.map +1 -1
- package/esm/gen/openstatus/monitor/v1/service_pb.js +1 -1
- package/esm/gen/openstatus/notification/v1/notification_pb.d.ts +110 -0
- package/esm/gen/openstatus/notification/v1/notification_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/notification/v1/notification_pb.js +19 -0
- package/esm/gen/openstatus/notification/v1/providers_pb.d.ts +504 -0
- package/esm/gen/openstatus/notification/v1/providers_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/notification/v1/providers_pb.js +199 -0
- package/esm/gen/openstatus/notification/v1/service_pb.d.ts +403 -0
- package/esm/gen/openstatus/notification/v1/service_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/notification/v1/service_pb.js +91 -0
- package/esm/gen/openstatus/status_page/v1/service_pb.d.ts +4 -3
- package/esm/gen/openstatus/status_page/v1/service_pb.d.ts.map +1 -1
- package/esm/gen/openstatus/status_page/v1/service_pb.js +3 -1
- package/esm/gen/openstatus/status_page/v1/status_page_pb.d.ts +0 -60
- package/esm/gen/openstatus/status_page/v1/status_page_pb.d.ts.map +1 -1
- package/esm/gen/openstatus/status_page/v1/status_page_pb.js +1 -6
- package/esm/gen/openstatus/status_report/v1/service_pb.js +1 -1
- package/esm/mod.d.ts +47 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +13 -0
- package/package.json +5 -2
- package/script/gen/openstatus/maintenance/v1/maintenance_pb.d.ts +139 -0
- package/script/gen/openstatus/maintenance/v1/maintenance_pb.d.ts.map +1 -0
- package/script/gen/openstatus/maintenance/v1/maintenance_pb.js +21 -0
- package/script/gen/openstatus/maintenance/v1/service_pb.d.ts +315 -0
- package/script/gen/openstatus/maintenance/v1/service_pb.d.ts.map +1 -0
- package/script/gen/openstatus/maintenance/v1/service_pb.js +69 -0
- package/script/gen/openstatus/monitor/v1/service_pb.d.ts +7 -13
- package/script/gen/openstatus/monitor/v1/service_pb.d.ts.map +1 -1
- package/script/gen/openstatus/monitor/v1/service_pb.js +1 -1
- package/script/gen/openstatus/notification/v1/notification_pb.d.ts +110 -0
- package/script/gen/openstatus/notification/v1/notification_pb.d.ts.map +1 -0
- package/script/gen/openstatus/notification/v1/notification_pb.js +22 -0
- package/script/gen/openstatus/notification/v1/providers_pb.d.ts +504 -0
- package/script/gen/openstatus/notification/v1/providers_pb.d.ts.map +1 -0
- package/script/gen/openstatus/notification/v1/providers_pb.js +202 -0
- package/script/gen/openstatus/notification/v1/service_pb.d.ts +403 -0
- package/script/gen/openstatus/notification/v1/service_pb.d.ts.map +1 -0
- package/script/gen/openstatus/notification/v1/service_pb.js +94 -0
- package/script/gen/openstatus/status_page/v1/service_pb.d.ts +4 -3
- package/script/gen/openstatus/status_page/v1/service_pb.d.ts.map +1 -1
- package/script/gen/openstatus/status_page/v1/service_pb.js +3 -1
- package/script/gen/openstatus/status_page/v1/status_page_pb.d.ts +0 -60
- package/script/gen/openstatus/status_page/v1/status_page_pb.d.ts.map +1 -1
- package/script/gen/openstatus/status_page/v1/status_page_pb.js +2 -7
- package/script/gen/openstatus/status_report/v1/service_pb.js +1 -1
- package/script/mod.d.ts +47 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +18 -3
package/README.md
CHANGED
|
@@ -7,37 +7,68 @@
|
|
|
7
7
|
Official Node.js SDK for [OpenStatus](https://openstatus.dev) - The open-source
|
|
8
8
|
status page with uptime monitoring.
|
|
9
9
|
|
|
10
|
+
## Table of Contents
|
|
11
|
+
|
|
12
|
+
- [Features](#features)
|
|
13
|
+
- [Installation](#installation)
|
|
14
|
+
- [Quick Start](#quick-start)
|
|
15
|
+
- [Authentication](#authentication)
|
|
16
|
+
- [SDK Reference](#sdk-reference)
|
|
17
|
+
- [Monitor Service](#monitor-service)
|
|
18
|
+
- [Health Service](#health-service)
|
|
19
|
+
- [Status Report Service](#status-report-service)
|
|
20
|
+
- [Status Page Service](#status-page-service)
|
|
21
|
+
- [Maintenance Service](#maintenance-service)
|
|
22
|
+
- [Notification Service](#notification-service)
|
|
23
|
+
- [Reference](#reference)
|
|
24
|
+
- [Monitor Options](#monitor-options)
|
|
25
|
+
- [Assertions](#assertions)
|
|
26
|
+
- [Regions](#regions)
|
|
27
|
+
- [Enums](#enums)
|
|
28
|
+
- [Error Handling](#error-handling)
|
|
29
|
+
- [Related](#related)
|
|
30
|
+
|
|
10
31
|
## Features
|
|
11
32
|
|
|
33
|
+
### Monitoring
|
|
34
|
+
|
|
35
|
+
- **HTTP Monitoring** - Monitor websites and APIs with customizable assertions
|
|
36
|
+
- **TCP Monitoring** - Check database connections and other TCP services
|
|
37
|
+
- **DNS Monitoring** - Verify DNS records and resolution
|
|
38
|
+
- **Global Regions** - Monitor from 28 locations worldwide
|
|
39
|
+
|
|
12
40
|
### Status Page
|
|
13
41
|
|
|
14
42
|
- **Status Pages** - Create and manage public status pages with custom domains
|
|
15
43
|
- **Page Components** - Add monitor-based or static components with grouping
|
|
16
44
|
- **Subscribers** - Manage email subscriptions for status updates
|
|
17
|
-
- **Status Reports** - Manage incident
|
|
18
|
-
|
|
45
|
+
- **Status Reports** - Manage incident reports with update timelines
|
|
46
|
+
- **Maintenance Windows** - Schedule and manage planned maintenance periods
|
|
19
47
|
|
|
20
|
-
###
|
|
48
|
+
### Notifications
|
|
21
49
|
|
|
22
|
-
- **
|
|
23
|
-
|
|
24
|
-
- **
|
|
50
|
+
- **12 Providers** - Slack, Discord, Email, PagerDuty, Opsgenie, Telegram, and
|
|
51
|
+
more
|
|
52
|
+
- **Webhook Support** - Custom webhooks with headers for any integration
|
|
53
|
+
- **Monitor Alerts** - Get notified when monitors go down or recover
|
|
54
|
+
|
|
55
|
+
### Developer Experience
|
|
25
56
|
|
|
26
|
-
- **Global Regions** - Monitor from 28 locations worldwide
|
|
27
57
|
- **Type-safe** - Full TypeScript support with generated types from protobuf
|
|
58
|
+
- **Multiple Runtimes** - Works with Node.js, Deno, and Bun
|
|
28
59
|
|
|
29
60
|
## Installation
|
|
30
61
|
|
|
31
|
-
###
|
|
62
|
+
### npm
|
|
32
63
|
|
|
33
64
|
```bash
|
|
34
|
-
|
|
65
|
+
npm install @openstatus/sdk-node
|
|
35
66
|
```
|
|
36
67
|
|
|
37
|
-
###
|
|
68
|
+
### JSR
|
|
38
69
|
|
|
39
70
|
```bash
|
|
40
|
-
|
|
71
|
+
npx jsr add @openstatus/sdk-node
|
|
41
72
|
```
|
|
42
73
|
|
|
43
74
|
### Deno
|
|
@@ -58,33 +89,32 @@ import {
|
|
|
58
89
|
} from "@openstatus/sdk-node";
|
|
59
90
|
|
|
60
91
|
const headers = {
|
|
61
|
-
"x-openstatus-key":
|
|
92
|
+
"x-openstatus-key": process.env.OPENSTATUS_API_KEY,
|
|
62
93
|
};
|
|
63
94
|
|
|
64
95
|
// Create a monitor
|
|
65
|
-
const { monitor } = await openstatus.monitor.v1.MonitorService
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
],
|
|
78
|
-
},
|
|
96
|
+
const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor(
|
|
97
|
+
{
|
|
98
|
+
monitor: {
|
|
99
|
+
name: "My API",
|
|
100
|
+
url: "https://api.example.com/health",
|
|
101
|
+
periodicity: Periodicity.PERIODICITY_1M,
|
|
102
|
+
method: HTTPMethod.HTTP_METHOD_GET,
|
|
103
|
+
regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD],
|
|
104
|
+
active: true,
|
|
105
|
+
statusCodeAssertions: [
|
|
106
|
+
{ comparator: NumberComparator.EQUAL, target: BigInt(200) },
|
|
107
|
+
],
|
|
79
108
|
},
|
|
80
|
-
|
|
81
|
-
|
|
109
|
+
},
|
|
110
|
+
{ headers },
|
|
111
|
+
);
|
|
82
112
|
|
|
83
113
|
console.log(`Monitor created: ${monitor?.id}`);
|
|
84
114
|
|
|
85
115
|
// List all monitors
|
|
86
|
-
const { httpMonitors, tcpMonitors, dnsMonitors, totalSize } =
|
|
87
|
-
.monitor.v1.MonitorService.listMonitors({}, { headers });
|
|
116
|
+
const { httpMonitors, tcpMonitors, dnsMonitors, totalSize } =
|
|
117
|
+
await openstatus.monitor.v1.MonitorService.listMonitors({}, { headers });
|
|
88
118
|
|
|
89
119
|
console.log(`Found ${totalSize} monitors`);
|
|
90
120
|
```
|
|
@@ -96,24 +126,26 @@ All API requests require an API key. Get yours from the
|
|
|
96
126
|
|
|
97
127
|
```typescript
|
|
98
128
|
const headers = {
|
|
99
|
-
"x-openstatus-key":
|
|
129
|
+
"x-openstatus-key": process.env.OPENSTATUS_API_KEY,
|
|
100
130
|
};
|
|
101
131
|
|
|
102
132
|
// Pass headers to any service method
|
|
103
133
|
await openstatus.monitor.v1.MonitorService.listMonitors({}, { headers });
|
|
104
134
|
```
|
|
105
135
|
|
|
106
|
-
|
|
136
|
+
### Environment Variables
|
|
107
137
|
|
|
108
138
|
| Variable | Description | Default |
|
|
109
139
|
| -------------------- | ----------------------- | -------------------------------- |
|
|
110
|
-
| `OPENSTATUS_API_KEY` | Your OpenStatus API key |
|
|
140
|
+
| `OPENSTATUS_API_KEY` | Your OpenStatus API key | Required |
|
|
111
141
|
| `OPENSTATUS_API_URL` | Custom API endpoint | `https://api.openstatus.dev/rpc` |
|
|
112
142
|
|
|
113
|
-
##
|
|
143
|
+
## SDK Reference
|
|
114
144
|
|
|
115
145
|
### Monitor Service
|
|
116
146
|
|
|
147
|
+
Manage HTTP, TCP, and DNS monitors.
|
|
148
|
+
|
|
117
149
|
#### `createHTTPMonitor(request, options)`
|
|
118
150
|
|
|
119
151
|
Create an HTTP/HTTPS monitor.
|
|
@@ -121,20 +153,19 @@ Create an HTTP/HTTPS monitor.
|
|
|
121
153
|
```typescript
|
|
122
154
|
import { HTTPMethod, Periodicity, Region } from "@openstatus/sdk-node";
|
|
123
155
|
|
|
124
|
-
const { monitor } = await openstatus.monitor.v1.MonitorService
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
active: true,
|
|
134
|
-
},
|
|
156
|
+
const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor(
|
|
157
|
+
{
|
|
158
|
+
monitor: {
|
|
159
|
+
name: "My Website",
|
|
160
|
+
url: "https://example.com",
|
|
161
|
+
periodicity: Periodicity.PERIODICITY_1M,
|
|
162
|
+
method: HTTPMethod.HTTP_METHOD_GET,
|
|
163
|
+
regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD],
|
|
164
|
+
active: true,
|
|
135
165
|
},
|
|
136
|
-
|
|
137
|
-
|
|
166
|
+
},
|
|
167
|
+
{ headers },
|
|
168
|
+
);
|
|
138
169
|
```
|
|
139
170
|
|
|
140
171
|
#### `updateHTTPMonitor(request, options)`
|
|
@@ -142,17 +173,16 @@ const { monitor } = await openstatus.monitor.v1.MonitorService
|
|
|
142
173
|
Update an existing HTTP monitor.
|
|
143
174
|
|
|
144
175
|
```typescript
|
|
145
|
-
const { monitor } = await openstatus.monitor.v1.MonitorService
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
active: false,
|
|
152
|
-
},
|
|
176
|
+
const { monitor } = await openstatus.monitor.v1.MonitorService.updateHTTPMonitor(
|
|
177
|
+
{
|
|
178
|
+
id: "mon_123",
|
|
179
|
+
monitor: {
|
|
180
|
+
name: "Updated Name",
|
|
181
|
+
active: false,
|
|
153
182
|
},
|
|
154
|
-
|
|
155
|
-
|
|
183
|
+
},
|
|
184
|
+
{ headers },
|
|
185
|
+
);
|
|
156
186
|
```
|
|
157
187
|
|
|
158
188
|
#### `createTCPMonitor(request, options)`
|
|
@@ -195,7 +225,7 @@ const { monitor } = await openstatus.monitor.v1.MonitorService.updateTCPMonitor(
|
|
|
195
225
|
Create a DNS resolution monitor.
|
|
196
226
|
|
|
197
227
|
```typescript
|
|
198
|
-
import { RecordComparator } from "@openstatus/sdk-node";
|
|
228
|
+
import { Periodicity, RecordComparator, Region } from "@openstatus/sdk-node";
|
|
199
229
|
|
|
200
230
|
const { monitor } = await openstatus.monitor.v1.MonitorService.createDNSMonitor(
|
|
201
231
|
{
|
|
@@ -275,15 +305,11 @@ Get the current status of a monitor across all configured regions.
|
|
|
275
305
|
```typescript
|
|
276
306
|
import { MonitorStatus, Region } from "@openstatus/sdk-node";
|
|
277
307
|
|
|
278
|
-
const { id, regions } = await openstatus.monitor.v1.MonitorService
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
);
|
|
308
|
+
const { id, regions } = await openstatus.monitor.v1.MonitorService.getMonitorStatus(
|
|
309
|
+
{ id: "mon_123" },
|
|
310
|
+
{ headers },
|
|
311
|
+
);
|
|
283
312
|
|
|
284
|
-
// regions is an array of { region, status }
|
|
285
|
-
// region: Region enum value (e.g., Region.FLY_AMS)
|
|
286
|
-
// status: MonitorStatus.ACTIVE, MonitorStatus.DEGRADED, or MonitorStatus.ERROR
|
|
287
313
|
for (const { region, status } of regions) {
|
|
288
314
|
console.log(`${Region[region]}: ${MonitorStatus[status]}`);
|
|
289
315
|
}
|
|
@@ -299,7 +325,7 @@ import { TimeRange } from "@openstatus/sdk-node";
|
|
|
299
325
|
const summary = await openstatus.monitor.v1.MonitorService.getMonitorSummary(
|
|
300
326
|
{
|
|
301
327
|
id: "mon_123",
|
|
302
|
-
timeRange: TimeRange.TIME_RANGE_7D,
|
|
328
|
+
timeRange: TimeRange.TIME_RANGE_7D,
|
|
303
329
|
regions: [], // optional: filter by specific regions
|
|
304
330
|
},
|
|
305
331
|
{ headers },
|
|
@@ -307,15 +333,14 @@ const summary = await openstatus.monitor.v1.MonitorService.getMonitorSummary(
|
|
|
307
333
|
|
|
308
334
|
console.log(`Last ping: ${summary.lastPingAt}`);
|
|
309
335
|
console.log(`Success: ${summary.totalSuccessful}`);
|
|
310
|
-
console.log(`Degraded: ${summary.totalDegraded}`);
|
|
311
336
|
console.log(`Failed: ${summary.totalFailed}`);
|
|
312
337
|
console.log(`P50 latency: ${summary.p50}ms`);
|
|
313
|
-
console.log(`P75 latency: ${summary.p75}ms`);
|
|
314
|
-
console.log(`P90 latency: ${summary.p90}ms`);
|
|
315
338
|
console.log(`P95 latency: ${summary.p95}ms`);
|
|
316
339
|
console.log(`P99 latency: ${summary.p99}ms`);
|
|
317
340
|
```
|
|
318
341
|
|
|
342
|
+
---
|
|
343
|
+
|
|
319
344
|
### Health Service
|
|
320
345
|
|
|
321
346
|
Check API health status (no authentication required).
|
|
@@ -327,9 +352,11 @@ const { status } = await openstatus.health.v1.HealthService.check({});
|
|
|
327
352
|
console.log(ServingStatus[status]); // "SERVING"
|
|
328
353
|
```
|
|
329
354
|
|
|
355
|
+
---
|
|
356
|
+
|
|
330
357
|
### Status Report Service
|
|
331
358
|
|
|
332
|
-
Manage incident
|
|
359
|
+
Manage incident reports with update timelines.
|
|
333
360
|
|
|
334
361
|
#### `createStatusReport(request, options)`
|
|
335
362
|
|
|
@@ -338,19 +365,18 @@ Create a new status report.
|
|
|
338
365
|
```typescript
|
|
339
366
|
import { StatusReportStatus } from "@openstatus/sdk-node";
|
|
340
367
|
|
|
341
|
-
const { statusReport } = await openstatus.statusReport.v1.StatusReportService
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
);
|
|
368
|
+
const { statusReport } = await openstatus.statusReport.v1.StatusReportService.createStatusReport(
|
|
369
|
+
{
|
|
370
|
+
title: "API Degradation",
|
|
371
|
+
status: StatusReportStatus.INVESTIGATING,
|
|
372
|
+
message: "We are investigating reports of increased latency.",
|
|
373
|
+
date: "2024-01-15T10:30:00Z",
|
|
374
|
+
pageId: "page_123",
|
|
375
|
+
pageComponentIds: ["comp_456"],
|
|
376
|
+
notify: true,
|
|
377
|
+
},
|
|
378
|
+
{ headers },
|
|
379
|
+
);
|
|
354
380
|
|
|
355
381
|
console.log(`Status report created: ${statusReport?.id}`);
|
|
356
382
|
```
|
|
@@ -360,16 +386,16 @@ console.log(`Status report created: ${statusReport?.id}`);
|
|
|
360
386
|
Get a status report by ID (includes full update timeline).
|
|
361
387
|
|
|
362
388
|
```typescript
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
389
|
+
import { StatusReportStatus } from "@openstatus/sdk-node";
|
|
390
|
+
|
|
391
|
+
const { statusReport } = await openstatus.statusReport.v1.StatusReportService.getStatusReport(
|
|
392
|
+
{ id: "sr_123" },
|
|
393
|
+
{ headers },
|
|
394
|
+
);
|
|
368
395
|
|
|
369
396
|
console.log(`Title: ${statusReport?.title}`);
|
|
370
397
|
console.log(`Status: ${StatusReportStatus[statusReport?.status ?? 0]}`);
|
|
371
398
|
|
|
372
|
-
// Access update timeline
|
|
373
399
|
for (const update of statusReport?.updates ?? []) {
|
|
374
400
|
console.log(`${update.date}: ${update.message}`);
|
|
375
401
|
}
|
|
@@ -382,15 +408,12 @@ List all status reports with pagination and optional filtering.
|
|
|
382
408
|
```typescript
|
|
383
409
|
import { StatusReportStatus } from "@openstatus/sdk-node";
|
|
384
410
|
|
|
385
|
-
const { statusReports, totalSize } =
|
|
386
|
-
.StatusReportService.listStatusReports(
|
|
411
|
+
const { statusReports, totalSize } =
|
|
412
|
+
await openstatus.statusReport.v1.StatusReportService.listStatusReports(
|
|
387
413
|
{
|
|
388
414
|
limit: 10,
|
|
389
415
|
offset: 0,
|
|
390
|
-
statuses: [
|
|
391
|
-
StatusReportStatus.INVESTIGATING,
|
|
392
|
-
StatusReportStatus.IDENTIFIED,
|
|
393
|
-
],
|
|
416
|
+
statuses: [StatusReportStatus.INVESTIGATING, StatusReportStatus.IDENTIFIED],
|
|
394
417
|
},
|
|
395
418
|
{ headers },
|
|
396
419
|
);
|
|
@@ -400,18 +423,17 @@ console.log(`Found ${totalSize} status reports`);
|
|
|
400
423
|
|
|
401
424
|
#### `updateStatusReport(request, options)`
|
|
402
425
|
|
|
403
|
-
Update status report metadata
|
|
426
|
+
Update status report metadata.
|
|
404
427
|
|
|
405
428
|
```typescript
|
|
406
|
-
const { statusReport } = await openstatus.statusReport.v1.StatusReportService
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
);
|
|
429
|
+
const { statusReport } = await openstatus.statusReport.v1.StatusReportService.updateStatusReport(
|
|
430
|
+
{
|
|
431
|
+
id: "sr_123",
|
|
432
|
+
title: "Updated Title",
|
|
433
|
+
pageComponentIds: ["comp_456", "comp_789"],
|
|
434
|
+
},
|
|
435
|
+
{ headers },
|
|
436
|
+
);
|
|
415
437
|
```
|
|
416
438
|
|
|
417
439
|
#### `deleteStatusReport(request, options)`
|
|
@@ -419,11 +441,10 @@ const { statusReport } = await openstatus.statusReport.v1.StatusReportService
|
|
|
419
441
|
Delete a status report and all its updates.
|
|
420
442
|
|
|
421
443
|
```typescript
|
|
422
|
-
const { success } = await openstatus.statusReport.v1.StatusReportService
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
);
|
|
444
|
+
const { success } = await openstatus.statusReport.v1.StatusReportService.deleteStatusReport(
|
|
445
|
+
{ id: "sr_123" },
|
|
446
|
+
{ headers },
|
|
447
|
+
);
|
|
427
448
|
```
|
|
428
449
|
|
|
429
450
|
#### `addStatusReportUpdate(request, options)`
|
|
@@ -433,29 +454,19 @@ Add a new update to an existing status report timeline.
|
|
|
433
454
|
```typescript
|
|
434
455
|
import { StatusReportStatus } from "@openstatus/sdk-node";
|
|
435
456
|
|
|
436
|
-
const { statusReport } = await openstatus.statusReport.v1.StatusReportService
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
{ headers },
|
|
447
|
-
);
|
|
457
|
+
const { statusReport } = await openstatus.statusReport.v1.StatusReportService.addStatusReportUpdate(
|
|
458
|
+
{
|
|
459
|
+
statusReportId: "sr_123",
|
|
460
|
+
status: StatusReportStatus.IDENTIFIED,
|
|
461
|
+
message: "The issue has been identified as a database connection problem.",
|
|
462
|
+
date: "2024-01-15T11:00:00Z", // optional, defaults to current time
|
|
463
|
+
notify: true,
|
|
464
|
+
},
|
|
465
|
+
{ headers },
|
|
466
|
+
);
|
|
448
467
|
```
|
|
449
468
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
| Enum Value | Description |
|
|
453
|
-
| --------------- | -------------------------------- |
|
|
454
|
-
| `UNSPECIFIED` | Default/unspecified status |
|
|
455
|
-
| `INVESTIGATING` | Actively investigating the issue |
|
|
456
|
-
| `IDENTIFIED` | Root cause has been identified |
|
|
457
|
-
| `MONITORING` | Fix deployed, monitoring |
|
|
458
|
-
| `RESOLVED` | Issue fully resolved |
|
|
469
|
+
---
|
|
459
470
|
|
|
460
471
|
### Status Page Service
|
|
461
472
|
|
|
@@ -466,17 +477,16 @@ Manage status pages, components, and subscribers.
|
|
|
466
477
|
Create a new status page.
|
|
467
478
|
|
|
468
479
|
```typescript
|
|
469
|
-
const { statusPage } = await openstatus.statusPage.v1.StatusPageService
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
);
|
|
480
|
+
const { statusPage } = await openstatus.statusPage.v1.StatusPageService.createStatusPage(
|
|
481
|
+
{
|
|
482
|
+
title: "My Service Status",
|
|
483
|
+
slug: "my-service",
|
|
484
|
+
description: "Status page for My Service",
|
|
485
|
+
homepageUrl: "https://example.com",
|
|
486
|
+
contactUrl: "https://example.com/contact",
|
|
487
|
+
},
|
|
488
|
+
{ headers },
|
|
489
|
+
);
|
|
480
490
|
|
|
481
491
|
console.log(`Status page created: ${statusPage?.id}`);
|
|
482
492
|
```
|
|
@@ -486,11 +496,10 @@ console.log(`Status page created: ${statusPage?.id}`);
|
|
|
486
496
|
Get a status page by ID.
|
|
487
497
|
|
|
488
498
|
```typescript
|
|
489
|
-
const { statusPage } = await openstatus.statusPage.v1.StatusPageService
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
);
|
|
499
|
+
const { statusPage } = await openstatus.statusPage.v1.StatusPageService.getStatusPage(
|
|
500
|
+
{ id: "page_123" },
|
|
501
|
+
{ headers },
|
|
502
|
+
);
|
|
494
503
|
```
|
|
495
504
|
|
|
496
505
|
#### `listStatusPages(request, options)`
|
|
@@ -498,8 +507,8 @@ const { statusPage } = await openstatus.statusPage.v1.StatusPageService
|
|
|
498
507
|
List all status pages with pagination.
|
|
499
508
|
|
|
500
509
|
```typescript
|
|
501
|
-
const { statusPages, totalSize } =
|
|
502
|
-
.StatusPageService.listStatusPages(
|
|
510
|
+
const { statusPages, totalSize } =
|
|
511
|
+
await openstatus.statusPage.v1.StatusPageService.listStatusPages(
|
|
503
512
|
{ limit: 10, offset: 0 },
|
|
504
513
|
{ headers },
|
|
505
514
|
);
|
|
@@ -512,15 +521,14 @@ console.log(`Found ${totalSize} status pages`);
|
|
|
512
521
|
Update a status page.
|
|
513
522
|
|
|
514
523
|
```typescript
|
|
515
|
-
const { statusPage } = await openstatus.statusPage.v1.StatusPageService
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
);
|
|
524
|
+
const { statusPage } = await openstatus.statusPage.v1.StatusPageService.updateStatusPage(
|
|
525
|
+
{
|
|
526
|
+
id: "page_123",
|
|
527
|
+
title: "Updated Title",
|
|
528
|
+
description: "Updated description",
|
|
529
|
+
},
|
|
530
|
+
{ headers },
|
|
531
|
+
);
|
|
524
532
|
```
|
|
525
533
|
|
|
526
534
|
#### `deleteStatusPage(request, options)`
|
|
@@ -528,11 +536,10 @@ const { statusPage } = await openstatus.statusPage.v1.StatusPageService
|
|
|
528
536
|
Delete a status page.
|
|
529
537
|
|
|
530
538
|
```typescript
|
|
531
|
-
const { success } = await openstatus.statusPage.v1.StatusPageService
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
);
|
|
539
|
+
const { success } = await openstatus.statusPage.v1.StatusPageService.deleteStatusPage(
|
|
540
|
+
{ id: "page_123" },
|
|
541
|
+
{ headers },
|
|
542
|
+
);
|
|
536
543
|
```
|
|
537
544
|
|
|
538
545
|
#### `addMonitorComponent(request, options)`
|
|
@@ -540,17 +547,16 @@ const { success } = await openstatus.statusPage.v1.StatusPageService
|
|
|
540
547
|
Add a monitor-based component to a status page.
|
|
541
548
|
|
|
542
549
|
```typescript
|
|
543
|
-
const { component } = await openstatus.statusPage.v1.StatusPageService
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
);
|
|
550
|
+
const { component } = await openstatus.statusPage.v1.StatusPageService.addMonitorComponent(
|
|
551
|
+
{
|
|
552
|
+
pageId: "page_123",
|
|
553
|
+
monitorId: "mon_456",
|
|
554
|
+
name: "API Server",
|
|
555
|
+
description: "Main API endpoint",
|
|
556
|
+
order: 1,
|
|
557
|
+
},
|
|
558
|
+
{ headers },
|
|
559
|
+
);
|
|
554
560
|
```
|
|
555
561
|
|
|
556
562
|
#### `addStaticComponent(request, options)`
|
|
@@ -558,16 +564,15 @@ const { component } = await openstatus.statusPage.v1.StatusPageService
|
|
|
558
564
|
Add a static component (not linked to a monitor).
|
|
559
565
|
|
|
560
566
|
```typescript
|
|
561
|
-
const { component } = await openstatus.statusPage.v1.StatusPageService
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
);
|
|
567
|
+
const { component } = await openstatus.statusPage.v1.StatusPageService.addStaticComponent(
|
|
568
|
+
{
|
|
569
|
+
pageId: "page_123",
|
|
570
|
+
name: "Third-party Service",
|
|
571
|
+
description: "External dependency",
|
|
572
|
+
order: 2,
|
|
573
|
+
},
|
|
574
|
+
{ headers },
|
|
575
|
+
);
|
|
571
576
|
```
|
|
572
577
|
|
|
573
578
|
#### `updateComponent(request, options)`
|
|
@@ -575,15 +580,14 @@ const { component } = await openstatus.statusPage.v1.StatusPageService
|
|
|
575
580
|
Update a component.
|
|
576
581
|
|
|
577
582
|
```typescript
|
|
578
|
-
const { component } = await openstatus.statusPage.v1.StatusPageService
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
);
|
|
583
|
+
const { component } = await openstatus.statusPage.v1.StatusPageService.updateComponent(
|
|
584
|
+
{
|
|
585
|
+
id: "comp_123",
|
|
586
|
+
name: "Updated Component Name",
|
|
587
|
+
order: 3,
|
|
588
|
+
},
|
|
589
|
+
{ headers },
|
|
590
|
+
);
|
|
587
591
|
```
|
|
588
592
|
|
|
589
593
|
#### `removeComponent(request, options)`
|
|
@@ -591,11 +595,10 @@ const { component } = await openstatus.statusPage.v1.StatusPageService
|
|
|
591
595
|
Remove a component from a status page.
|
|
592
596
|
|
|
593
597
|
```typescript
|
|
594
|
-
const { success } = await openstatus.statusPage.v1.StatusPageService
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
);
|
|
598
|
+
const { success } = await openstatus.statusPage.v1.StatusPageService.removeComponent(
|
|
599
|
+
{ id: "comp_123" },
|
|
600
|
+
{ headers },
|
|
601
|
+
);
|
|
599
602
|
```
|
|
600
603
|
|
|
601
604
|
#### `createComponentGroup(request, options)`
|
|
@@ -603,14 +606,13 @@ const { success } = await openstatus.statusPage.v1.StatusPageService
|
|
|
603
606
|
Create a component group.
|
|
604
607
|
|
|
605
608
|
```typescript
|
|
606
|
-
const { group } = await openstatus.statusPage.v1.StatusPageService
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
);
|
|
609
|
+
const { group } = await openstatus.statusPage.v1.StatusPageService.createComponentGroup(
|
|
610
|
+
{
|
|
611
|
+
pageId: "page_123",
|
|
612
|
+
name: "Core Services",
|
|
613
|
+
},
|
|
614
|
+
{ headers },
|
|
615
|
+
);
|
|
614
616
|
```
|
|
615
617
|
|
|
616
618
|
#### `updateComponentGroup(request, options)`
|
|
@@ -618,14 +620,13 @@ const { group } = await openstatus.statusPage.v1.StatusPageService
|
|
|
618
620
|
Update a component group.
|
|
619
621
|
|
|
620
622
|
```typescript
|
|
621
|
-
const { group } = await openstatus.statusPage.v1.StatusPageService
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
);
|
|
623
|
+
const { group } = await openstatus.statusPage.v1.StatusPageService.updateComponentGroup(
|
|
624
|
+
{
|
|
625
|
+
id: "group_123",
|
|
626
|
+
name: "Updated Group Name",
|
|
627
|
+
},
|
|
628
|
+
{ headers },
|
|
629
|
+
);
|
|
629
630
|
```
|
|
630
631
|
|
|
631
632
|
#### `deleteComponentGroup(request, options)`
|
|
@@ -633,11 +634,10 @@ const { group } = await openstatus.statusPage.v1.StatusPageService
|
|
|
633
634
|
Delete a component group.
|
|
634
635
|
|
|
635
636
|
```typescript
|
|
636
|
-
const { success } = await openstatus.statusPage.v1.StatusPageService
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
);
|
|
637
|
+
const { success } = await openstatus.statusPage.v1.StatusPageService.deleteComponentGroup(
|
|
638
|
+
{ id: "group_123" },
|
|
639
|
+
{ headers },
|
|
640
|
+
);
|
|
641
641
|
```
|
|
642
642
|
|
|
643
643
|
#### `subscribeToPage(request, options)`
|
|
@@ -645,14 +645,13 @@ const { success } = await openstatus.statusPage.v1.StatusPageService
|
|
|
645
645
|
Subscribe an email to status page updates.
|
|
646
646
|
|
|
647
647
|
```typescript
|
|
648
|
-
const { subscriber } = await openstatus.statusPage.v1.StatusPageService
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
);
|
|
648
|
+
const { subscriber } = await openstatus.statusPage.v1.StatusPageService.subscribeToPage(
|
|
649
|
+
{
|
|
650
|
+
pageId: "page_123",
|
|
651
|
+
email: "user@example.com",
|
|
652
|
+
},
|
|
653
|
+
{ headers },
|
|
654
|
+
);
|
|
656
655
|
```
|
|
657
656
|
|
|
658
657
|
#### `unsubscribeFromPage(request, options)`
|
|
@@ -661,24 +660,22 @@ Unsubscribe from a status page.
|
|
|
661
660
|
|
|
662
661
|
```typescript
|
|
663
662
|
// By email
|
|
664
|
-
const { success } = await openstatus.statusPage.v1.StatusPageService
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
);
|
|
663
|
+
const { success } = await openstatus.statusPage.v1.StatusPageService.unsubscribeFromPage(
|
|
664
|
+
{
|
|
665
|
+
pageId: "page_123",
|
|
666
|
+
identifier: { case: "email", value: "user@example.com" },
|
|
667
|
+
},
|
|
668
|
+
{ headers },
|
|
669
|
+
);
|
|
672
670
|
|
|
673
671
|
// Or by subscriber ID
|
|
674
|
-
const { success: success2 } = await openstatus.statusPage.v1.StatusPageService
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
);
|
|
672
|
+
const { success: success2 } = await openstatus.statusPage.v1.StatusPageService.unsubscribeFromPage(
|
|
673
|
+
{
|
|
674
|
+
pageId: "page_123",
|
|
675
|
+
identifier: { case: "id", value: "sub_456" },
|
|
676
|
+
},
|
|
677
|
+
{ headers },
|
|
678
|
+
);
|
|
682
679
|
```
|
|
683
680
|
|
|
684
681
|
#### `listSubscribers(request, options)`
|
|
@@ -686,8 +683,8 @@ const { success: success2 } = await openstatus.statusPage.v1.StatusPageService
|
|
|
686
683
|
List all subscribers for a status page.
|
|
687
684
|
|
|
688
685
|
```typescript
|
|
689
|
-
const { subscribers, totalSize } =
|
|
690
|
-
.StatusPageService.listSubscribers(
|
|
686
|
+
const { subscribers, totalSize } =
|
|
687
|
+
await openstatus.statusPage.v1.StatusPageService.listSubscribers(
|
|
691
688
|
{
|
|
692
689
|
pageId: "page_123",
|
|
693
690
|
limit: 50,
|
|
@@ -703,11 +700,10 @@ const { subscribers, totalSize } = await openstatus.statusPage.v1
|
|
|
703
700
|
Get full status page content including components, groups, and active reports.
|
|
704
701
|
|
|
705
702
|
```typescript
|
|
706
|
-
const content = await openstatus.statusPage.v1.StatusPageService
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
);
|
|
703
|
+
const content = await openstatus.statusPage.v1.StatusPageService.getStatusPageContent(
|
|
704
|
+
{ identifier: { case: "slug", value: "my-service" } },
|
|
705
|
+
{ headers },
|
|
706
|
+
);
|
|
711
707
|
|
|
712
708
|
console.log(`Page: ${content.statusPage?.title}`);
|
|
713
709
|
console.log(`Components: ${content.components.length}`);
|
|
@@ -721,8 +717,8 @@ Get the aggregated status of a status page.
|
|
|
721
717
|
```typescript
|
|
722
718
|
import { OverallStatus } from "@openstatus/sdk-node";
|
|
723
719
|
|
|
724
|
-
const { overallStatus, componentStatuses } =
|
|
725
|
-
.StatusPageService.getOverallStatus(
|
|
720
|
+
const { overallStatus, componentStatuses } =
|
|
721
|
+
await openstatus.statusPage.v1.StatusPageService.getOverallStatus(
|
|
726
722
|
{ identifier: { case: "id", value: "page_123" } },
|
|
727
723
|
{ headers },
|
|
728
724
|
);
|
|
@@ -733,168 +729,519 @@ for (const { componentId, status } of componentStatuses) {
|
|
|
733
729
|
}
|
|
734
730
|
```
|
|
735
731
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
| Option | Type | Required | Description |
|
|
739
|
-
| ------------- | ------ | -------- | ---------------------------------------- |
|
|
740
|
-
| `title` | string | Yes | Title of the status page (max 256 chars) |
|
|
741
|
-
| `slug` | string | Yes | URL-friendly slug (lowercase, hyphens) |
|
|
742
|
-
| `description` | string | No | Description (max 2048 chars) |
|
|
743
|
-
| `homepageUrl` | string | No | Link to your homepage |
|
|
744
|
-
| `contactUrl` | string | No | Link to your contact page |
|
|
745
|
-
|
|
746
|
-
### Page Access Type
|
|
732
|
+
---
|
|
747
733
|
|
|
748
|
-
|
|
749
|
-
| -------------------- | ----------------------- |
|
|
750
|
-
| `UNSPECIFIED` | Default/unspecified |
|
|
751
|
-
| `PUBLIC` | Publicly accessible |
|
|
752
|
-
| `PASSWORD_PROTECTED` | Requires password |
|
|
753
|
-
| `AUTHENTICATED` | Requires authentication |
|
|
734
|
+
### Maintenance Service
|
|
754
735
|
|
|
755
|
-
|
|
736
|
+
Manage scheduled maintenance windows.
|
|
756
737
|
|
|
757
|
-
|
|
758
|
-
| ------------- | ------------------- |
|
|
759
|
-
| `UNSPECIFIED` | Default/unspecified |
|
|
760
|
-
| `SYSTEM` | Follow system theme |
|
|
761
|
-
| `LIGHT` | Light theme |
|
|
762
|
-
| `DARK` | Dark theme |
|
|
738
|
+
#### `createMaintenance(request, options)`
|
|
763
739
|
|
|
764
|
-
|
|
740
|
+
Create a new maintenance window.
|
|
765
741
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
742
|
+
```typescript
|
|
743
|
+
const { maintenance } = await openstatus.maintenance.v1.MaintenanceService.createMaintenance(
|
|
744
|
+
{
|
|
745
|
+
title: "Database Upgrade",
|
|
746
|
+
message: "We will be upgrading our database infrastructure.",
|
|
747
|
+
from: "2024-01-20T02:00:00Z",
|
|
748
|
+
to: "2024-01-20T04:00:00Z",
|
|
749
|
+
pageId: "page_123",
|
|
750
|
+
pageComponentIds: ["comp_456"],
|
|
751
|
+
notify: true,
|
|
752
|
+
},
|
|
753
|
+
{ headers },
|
|
754
|
+
);
|
|
775
755
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
| Enum Value | Description |
|
|
779
|
-
| ------------- | ------------------------- |
|
|
780
|
-
| `UNSPECIFIED` | Default/unspecified |
|
|
781
|
-
| `MONITOR` | Linked to a monitor |
|
|
782
|
-
| `STATIC` | Static component (manual) |
|
|
783
|
-
|
|
784
|
-
## Monitor Options
|
|
785
|
-
|
|
786
|
-
### HTTP Monitor
|
|
787
|
-
|
|
788
|
-
| Option | Type | Required | Description |
|
|
789
|
-
| ---------------------- | ------------------- | -------- | --------------------------------------------------- |
|
|
790
|
-
| `name` | string | Yes | Monitor name (max 256 chars) |
|
|
791
|
-
| `url` | string | Yes | URL to monitor (max 2048 chars) |
|
|
792
|
-
| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) |
|
|
793
|
-
| `method` | HTTPMethod | No | HTTP method (see [HTTP Methods](#http-methods)) |
|
|
794
|
-
| `body` | string | No | Request body |
|
|
795
|
-
| `headers` | Headers[] | No | Custom headers (`{ key: string, value: string }[]`) |
|
|
796
|
-
| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) |
|
|
797
|
-
| `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
|
|
798
|
-
| `followRedirects` | boolean | No | Follow redirects (default: true) |
|
|
799
|
-
| `regions` | Region[] | No | [Regions](#regions) for checks |
|
|
800
|
-
| `active` | boolean | No | Enable monitoring (default: false) |
|
|
801
|
-
| `public` | boolean | No | Public visibility (default: false) |
|
|
802
|
-
| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
|
|
803
|
-
| `description` | string | No | Monitor description (max 1024 chars) |
|
|
804
|
-
| `statusCodeAssertions` | array | No | [Status code assertions](#status-code-assertions) |
|
|
805
|
-
| `bodyAssertions` | array | No | [Body assertions](#body-assertions) |
|
|
806
|
-
| `headerAssertions` | array | No | [Header assertions](#header-assertions) |
|
|
807
|
-
| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
|
|
808
|
-
|
|
809
|
-
### TCP Monitor
|
|
810
|
-
|
|
811
|
-
| Option | Type | Required | Description |
|
|
812
|
-
| --------------- | ------------------- | -------- | ------------------------------------------------ |
|
|
813
|
-
| `name` | string | Yes | Monitor name (max 256 chars) |
|
|
814
|
-
| `uri` | string | Yes | `host:port` to monitor (max 2048 chars) |
|
|
815
|
-
| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) |
|
|
816
|
-
| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) |
|
|
817
|
-
| `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
|
|
818
|
-
| `regions` | Region[] | No | [Regions](#regions) for checks |
|
|
819
|
-
| `active` | boolean | No | Enable monitoring (default: false) |
|
|
820
|
-
| `public` | boolean | No | Public visibility (default: false) |
|
|
821
|
-
| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
|
|
822
|
-
| `description` | string | No | Monitor description (max 1024 chars) |
|
|
823
|
-
| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
|
|
824
|
-
|
|
825
|
-
### DNS Monitor
|
|
826
|
-
|
|
827
|
-
| Option | Type | Required | Description |
|
|
828
|
-
| ------------------ | ------------------- | -------- | ------------------------------------------------ |
|
|
829
|
-
| `name` | string | Yes | Monitor name (max 256 chars) |
|
|
830
|
-
| `uri` | string | Yes | Domain to resolve (max 2048 chars) |
|
|
831
|
-
| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) |
|
|
832
|
-
| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) |
|
|
833
|
-
| `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
|
|
834
|
-
| `regions` | Region[] | No | [Regions](#regions) for checks |
|
|
835
|
-
| `active` | boolean | No | Enable monitoring (default: false) |
|
|
836
|
-
| `public` | boolean | No | Public visibility (default: false) |
|
|
837
|
-
| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
|
|
838
|
-
| `description` | string | No | Monitor description (max 1024 chars) |
|
|
839
|
-
| `recordAssertions` | array | No | [DNS record assertions](#dns-record-assertions) |
|
|
840
|
-
| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
|
|
841
|
-
|
|
842
|
-
### Periodicity
|
|
843
|
-
|
|
844
|
-
| Enum Value | Description |
|
|
845
|
-
| ----------------- | ----------- |
|
|
846
|
-
| `PERIODICITY_30S` | Every 30s |
|
|
847
|
-
| `PERIODICITY_1M` | Every 1m |
|
|
848
|
-
| `PERIODICITY_5M` | Every 5m |
|
|
849
|
-
| `PERIODICITY_10M` | Every 10m |
|
|
850
|
-
| `PERIODICITY_30M` | Every 30m |
|
|
851
|
-
| `PERIODICITY_1H` | Every 1h |
|
|
756
|
+
console.log(`Maintenance created: ${maintenance?.id}`);
|
|
757
|
+
```
|
|
852
758
|
|
|
853
|
-
|
|
759
|
+
#### `getMaintenance(request, options)`
|
|
854
760
|
|
|
855
|
-
|
|
856
|
-
| --------------------- | ----------- |
|
|
857
|
-
| `HTTP_METHOD_GET` | GET |
|
|
858
|
-
| `HTTP_METHOD_POST` | POST |
|
|
859
|
-
| `HTTP_METHOD_HEAD` | HEAD |
|
|
860
|
-
| `HTTP_METHOD_PUT` | PUT |
|
|
861
|
-
| `HTTP_METHOD_PATCH` | PATCH |
|
|
862
|
-
| `HTTP_METHOD_DELETE` | DELETE |
|
|
863
|
-
| `HTTP_METHOD_TRACE` | TRACE |
|
|
864
|
-
| `HTTP_METHOD_CONNECT` | CONNECT |
|
|
865
|
-
| `HTTP_METHOD_OPTIONS` | OPTIONS |
|
|
761
|
+
Get a maintenance window by ID.
|
|
866
762
|
|
|
867
|
-
|
|
763
|
+
```typescript
|
|
764
|
+
const { maintenance } = await openstatus.maintenance.v1.MaintenanceService.getMaintenance(
|
|
765
|
+
{ id: "maint_123" },
|
|
766
|
+
{ headers },
|
|
767
|
+
);
|
|
868
768
|
|
|
869
|
-
|
|
769
|
+
console.log(`Title: ${maintenance?.title}`);
|
|
770
|
+
console.log(`From: ${maintenance?.from}`);
|
|
771
|
+
console.log(`To: ${maintenance?.to}`);
|
|
772
|
+
```
|
|
870
773
|
|
|
871
|
-
|
|
774
|
+
#### `listMaintenances(request, options)`
|
|
872
775
|
|
|
873
|
-
|
|
776
|
+
List all maintenance windows with pagination and optional filtering.
|
|
874
777
|
|
|
875
778
|
```typescript
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
{
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
779
|
+
const { maintenances, totalSize } =
|
|
780
|
+
await openstatus.maintenance.v1.MaintenanceService.listMaintenances(
|
|
781
|
+
{
|
|
782
|
+
limit: 10,
|
|
783
|
+
offset: 0,
|
|
784
|
+
pageId: "page_123", // optional filter
|
|
785
|
+
},
|
|
786
|
+
{ headers },
|
|
787
|
+
);
|
|
788
|
+
|
|
789
|
+
console.log(`Found ${totalSize} maintenance windows`);
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
#### `updateMaintenance(request, options)`
|
|
793
|
+
|
|
794
|
+
Update a maintenance window.
|
|
795
|
+
|
|
796
|
+
```typescript
|
|
797
|
+
const { maintenance } = await openstatus.maintenance.v1.MaintenanceService.updateMaintenance(
|
|
798
|
+
{
|
|
799
|
+
id: "maint_123",
|
|
800
|
+
title: "Extended Database Upgrade",
|
|
801
|
+
to: "2024-01-20T06:00:00Z",
|
|
802
|
+
},
|
|
803
|
+
{ headers },
|
|
804
|
+
);
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
#### `deleteMaintenance(request, options)`
|
|
808
|
+
|
|
809
|
+
Delete a maintenance window.
|
|
810
|
+
|
|
811
|
+
```typescript
|
|
812
|
+
const { success } = await openstatus.maintenance.v1.MaintenanceService.deleteMaintenance(
|
|
813
|
+
{ id: "maint_123" },
|
|
814
|
+
{ headers },
|
|
815
|
+
);
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
---
|
|
819
|
+
|
|
820
|
+
### Notification Service
|
|
821
|
+
|
|
822
|
+
Manage notification channels for monitor alerts. Supports 12 providers including
|
|
823
|
+
Slack, Discord, Email, PagerDuty, and custom webhooks.
|
|
824
|
+
|
|
825
|
+
#### `createNotification(request, options)`
|
|
826
|
+
|
|
827
|
+
Create a new notification channel.
|
|
828
|
+
|
|
829
|
+
```typescript
|
|
830
|
+
import { NotificationProvider } from "@openstatus/sdk-node";
|
|
831
|
+
|
|
832
|
+
const { notification } = await openstatus.notification.v1.NotificationService.createNotification(
|
|
833
|
+
{
|
|
834
|
+
name: "Slack Alerts",
|
|
835
|
+
provider: NotificationProvider.SLACK,
|
|
836
|
+
data: {
|
|
837
|
+
data: {
|
|
838
|
+
case: "slack",
|
|
839
|
+
value: { webhookUrl: "https://hooks.slack.com/services/..." },
|
|
840
|
+
},
|
|
841
|
+
},
|
|
842
|
+
monitorIds: ["mon_123", "mon_456"],
|
|
843
|
+
},
|
|
844
|
+
{ headers },
|
|
845
|
+
);
|
|
846
|
+
|
|
847
|
+
console.log(`Notification created: ${notification?.id}`);
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
#### `getNotification(request, options)`
|
|
851
|
+
|
|
852
|
+
Get a notification channel by ID.
|
|
853
|
+
|
|
854
|
+
```typescript
|
|
855
|
+
import { NotificationProvider } from "@openstatus/sdk-node";
|
|
856
|
+
|
|
857
|
+
const { notification } = await openstatus.notification.v1.NotificationService.getNotification(
|
|
858
|
+
{ id: "notif_123" },
|
|
859
|
+
{ headers },
|
|
860
|
+
);
|
|
861
|
+
|
|
862
|
+
console.log(`Name: ${notification?.name}`);
|
|
863
|
+
console.log(`Provider: ${NotificationProvider[notification?.provider ?? 0]}`);
|
|
864
|
+
```
|
|
865
|
+
|
|
866
|
+
#### `listNotifications(request, options)`
|
|
867
|
+
|
|
868
|
+
List all notification channels with pagination.
|
|
869
|
+
|
|
870
|
+
```typescript
|
|
871
|
+
const { notifications, totalSize } =
|
|
872
|
+
await openstatus.notification.v1.NotificationService.listNotifications(
|
|
873
|
+
{ limit: 10, offset: 0 },
|
|
874
|
+
{ headers },
|
|
875
|
+
);
|
|
876
|
+
|
|
877
|
+
console.log(`Found ${totalSize} notification channels`);
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
#### `updateNotification(request, options)`
|
|
881
|
+
|
|
882
|
+
Update a notification channel.
|
|
883
|
+
|
|
884
|
+
```typescript
|
|
885
|
+
const { notification } = await openstatus.notification.v1.NotificationService.updateNotification(
|
|
886
|
+
{
|
|
887
|
+
id: "notif_123",
|
|
888
|
+
name: "Updated Slack Alerts",
|
|
889
|
+
monitorIds: ["mon_123", "mon_456", "mon_789"],
|
|
890
|
+
},
|
|
891
|
+
{ headers },
|
|
892
|
+
);
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
#### `deleteNotification(request, options)`
|
|
896
|
+
|
|
897
|
+
Delete a notification channel.
|
|
898
|
+
|
|
899
|
+
```typescript
|
|
900
|
+
const { success } = await openstatus.notification.v1.NotificationService.deleteNotification(
|
|
901
|
+
{ id: "notif_123" },
|
|
902
|
+
{ headers },
|
|
903
|
+
);
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
#### `sendTestNotification(request, options)`
|
|
907
|
+
|
|
908
|
+
Send a test notification to verify configuration.
|
|
909
|
+
|
|
910
|
+
```typescript
|
|
911
|
+
import { NotificationProvider } from "@openstatus/sdk-node";
|
|
912
|
+
|
|
913
|
+
const { success, errorMessage } =
|
|
914
|
+
await openstatus.notification.v1.NotificationService.sendTestNotification(
|
|
915
|
+
{
|
|
916
|
+
provider: NotificationProvider.SLACK,
|
|
917
|
+
data: {
|
|
918
|
+
data: {
|
|
919
|
+
case: "slack",
|
|
920
|
+
value: { webhookUrl: "https://hooks.slack.com/services/..." },
|
|
921
|
+
},
|
|
922
|
+
},
|
|
923
|
+
},
|
|
924
|
+
{ headers },
|
|
925
|
+
);
|
|
926
|
+
|
|
927
|
+
if (success) {
|
|
928
|
+
console.log("Test notification sent successfully");
|
|
929
|
+
} else {
|
|
930
|
+
console.log(`Test failed: ${errorMessage}`);
|
|
883
931
|
}
|
|
884
932
|
```
|
|
885
933
|
|
|
886
|
-
|
|
934
|
+
#### `checkNotificationLimit(request, options)`
|
|
887
935
|
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
936
|
+
Check if the workspace has reached its notification limit.
|
|
937
|
+
|
|
938
|
+
```typescript
|
|
939
|
+
const { limitReached, currentCount, maxCount } =
|
|
940
|
+
await openstatus.notification.v1.NotificationService.checkNotificationLimit({}, { headers });
|
|
941
|
+
|
|
942
|
+
console.log(`${currentCount}/${maxCount} notification channels used`);
|
|
943
|
+
```
|
|
944
|
+
|
|
945
|
+
#### Provider Configuration Examples
|
|
946
|
+
|
|
947
|
+
<details>
|
|
948
|
+
<summary><strong>Slack</strong></summary>
|
|
949
|
+
|
|
950
|
+
```typescript
|
|
951
|
+
{
|
|
952
|
+
provider: NotificationProvider.SLACK,
|
|
953
|
+
data: {
|
|
954
|
+
data: {
|
|
955
|
+
case: "slack",
|
|
956
|
+
value: { webhookUrl: "https://hooks.slack.com/services/..." }
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
</details>
|
|
963
|
+
|
|
964
|
+
<details>
|
|
965
|
+
<summary><strong>Discord</strong></summary>
|
|
966
|
+
|
|
967
|
+
```typescript
|
|
968
|
+
{
|
|
969
|
+
provider: NotificationProvider.DISCORD,
|
|
970
|
+
data: {
|
|
971
|
+
data: {
|
|
972
|
+
case: "discord",
|
|
973
|
+
value: { webhookUrl: "https://discord.com/api/webhooks/..." }
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
</details>
|
|
980
|
+
|
|
981
|
+
<details>
|
|
982
|
+
<summary><strong>Email</strong></summary>
|
|
983
|
+
|
|
984
|
+
```typescript
|
|
985
|
+
{
|
|
986
|
+
provider: NotificationProvider.EMAIL,
|
|
987
|
+
data: {
|
|
988
|
+
data: {
|
|
989
|
+
case: "email",
|
|
990
|
+
value: { email: "alerts@example.com" }
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
```
|
|
995
|
+
|
|
996
|
+
</details>
|
|
997
|
+
|
|
998
|
+
<details>
|
|
999
|
+
<summary><strong>PagerDuty</strong></summary>
|
|
1000
|
+
|
|
1001
|
+
```typescript
|
|
1002
|
+
{
|
|
1003
|
+
provider: NotificationProvider.PAGERDUTY,
|
|
1004
|
+
data: {
|
|
1005
|
+
data: {
|
|
1006
|
+
case: "pagerduty",
|
|
1007
|
+
value: { integrationKey: "your-integration-key" }
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
</details>
|
|
1014
|
+
|
|
1015
|
+
<details>
|
|
1016
|
+
<summary><strong>Opsgenie</strong></summary>
|
|
1017
|
+
|
|
1018
|
+
```typescript
|
|
1019
|
+
import { OpsgenieRegion } from "@openstatus/sdk-node";
|
|
1020
|
+
|
|
1021
|
+
{
|
|
1022
|
+
provider: NotificationProvider.OPSGENIE,
|
|
1023
|
+
data: {
|
|
1024
|
+
data: {
|
|
1025
|
+
case: "opsgenie",
|
|
1026
|
+
value: { apiKey: "your-api-key", region: OpsgenieRegion.US }
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
</details>
|
|
1033
|
+
|
|
1034
|
+
<details>
|
|
1035
|
+
<summary><strong>Telegram</strong></summary>
|
|
1036
|
+
|
|
1037
|
+
```typescript
|
|
1038
|
+
{
|
|
1039
|
+
provider: NotificationProvider.TELEGRAM,
|
|
1040
|
+
data: {
|
|
1041
|
+
data: {
|
|
1042
|
+
case: "telegram",
|
|
1043
|
+
value: { chatId: "123456789" }
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
```
|
|
1048
|
+
|
|
1049
|
+
</details>
|
|
1050
|
+
|
|
1051
|
+
<details>
|
|
1052
|
+
<summary><strong>Google Chat</strong></summary>
|
|
1053
|
+
|
|
1054
|
+
```typescript
|
|
1055
|
+
{
|
|
1056
|
+
provider: NotificationProvider.GOOGLE_CHAT,
|
|
1057
|
+
data: {
|
|
1058
|
+
data: {
|
|
1059
|
+
case: "googleChat",
|
|
1060
|
+
value: { webhookUrl: "https://chat.googleapis.com/v1/spaces/..." }
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
</details>
|
|
1067
|
+
|
|
1068
|
+
<details>
|
|
1069
|
+
<summary><strong>Grafana OnCall</strong></summary>
|
|
1070
|
+
|
|
1071
|
+
```typescript
|
|
1072
|
+
{
|
|
1073
|
+
provider: NotificationProvider.GRAFANA_ONCALL,
|
|
1074
|
+
data: {
|
|
1075
|
+
data: {
|
|
1076
|
+
case: "grafanaOncall",
|
|
1077
|
+
value: { webhookUrl: "https://oncall.example.com/..." }
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1083
|
+
</details>
|
|
1084
|
+
|
|
1085
|
+
<details>
|
|
1086
|
+
<summary><strong>Ntfy</strong></summary>
|
|
1087
|
+
|
|
1088
|
+
```typescript
|
|
1089
|
+
{
|
|
1090
|
+
provider: NotificationProvider.NTFY,
|
|
1091
|
+
data: {
|
|
1092
|
+
data: {
|
|
1093
|
+
case: "ntfy",
|
|
1094
|
+
value: {
|
|
1095
|
+
topic: "my-alerts",
|
|
1096
|
+
serverUrl: "https://ntfy.sh", // optional, defaults to ntfy.sh
|
|
1097
|
+
token: "tk_..." // optional auth token
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
```
|
|
1103
|
+
|
|
1104
|
+
</details>
|
|
1105
|
+
|
|
1106
|
+
<details>
|
|
1107
|
+
<summary><strong>SMS</strong></summary>
|
|
1108
|
+
|
|
1109
|
+
```typescript
|
|
1110
|
+
{
|
|
1111
|
+
provider: NotificationProvider.SMS,
|
|
1112
|
+
data: {
|
|
1113
|
+
data: {
|
|
1114
|
+
case: "sms",
|
|
1115
|
+
value: { phoneNumber: "+1234567890" }
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
```
|
|
1120
|
+
|
|
1121
|
+
</details>
|
|
1122
|
+
|
|
1123
|
+
<details>
|
|
1124
|
+
<summary><strong>WhatsApp</strong></summary>
|
|
1125
|
+
|
|
1126
|
+
```typescript
|
|
1127
|
+
{
|
|
1128
|
+
provider: NotificationProvider.WHATSAPP,
|
|
1129
|
+
data: {
|
|
1130
|
+
data: {
|
|
1131
|
+
case: "whatsapp",
|
|
1132
|
+
value: { phoneNumber: "+1234567890" }
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
</details>
|
|
1139
|
+
|
|
1140
|
+
<details>
|
|
1141
|
+
<summary><strong>Custom Webhook</strong></summary>
|
|
1142
|
+
|
|
1143
|
+
```typescript
|
|
1144
|
+
{
|
|
1145
|
+
provider: NotificationProvider.WEBHOOK,
|
|
1146
|
+
data: {
|
|
1147
|
+
data: {
|
|
1148
|
+
case: "webhook",
|
|
1149
|
+
value: {
|
|
1150
|
+
endpoint: "https://api.example.com/webhook",
|
|
1151
|
+
headers: [
|
|
1152
|
+
{ key: "Authorization", value: "Bearer token" },
|
|
1153
|
+
{ key: "X-Custom-Header", value: "value" }
|
|
1154
|
+
]
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
```
|
|
1160
|
+
|
|
1161
|
+
</details>
|
|
1162
|
+
|
|
1163
|
+
---
|
|
1164
|
+
|
|
1165
|
+
## Reference
|
|
1166
|
+
|
|
1167
|
+
### Monitor Options
|
|
1168
|
+
|
|
1169
|
+
#### HTTP Monitor
|
|
1170
|
+
|
|
1171
|
+
| Option | Type | Required | Description |
|
|
1172
|
+
| ---------------------- | ------------------- | -------- | ------------------------------------------ |
|
|
1173
|
+
| `name` | string | Yes | Monitor name (max 256 chars) |
|
|
1174
|
+
| `url` | string | Yes | URL to monitor (max 2048 chars) |
|
|
1175
|
+
| `periodicity` | Periodicity | Yes | Check interval |
|
|
1176
|
+
| `method` | HTTPMethod | No | HTTP method (default: GET) |
|
|
1177
|
+
| `body` | string | No | Request body |
|
|
1178
|
+
| `headers` | Headers[] | No | Custom headers `{ key, value }[]` |
|
|
1179
|
+
| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000)|
|
|
1180
|
+
| `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
|
|
1181
|
+
| `followRedirects` | boolean | No | Follow redirects (default: true) |
|
|
1182
|
+
| `regions` | Region[] | No | Regions for checks |
|
|
1183
|
+
| `active` | boolean | No | Enable monitoring (default: false) |
|
|
1184
|
+
| `public` | boolean | No | Public visibility (default: false) |
|
|
1185
|
+
| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
|
|
1186
|
+
| `description` | string | No | Monitor description (max 1024 chars) |
|
|
1187
|
+
| `statusCodeAssertions` | array | No | Status code assertions |
|
|
1188
|
+
| `bodyAssertions` | array | No | Body assertions |
|
|
1189
|
+
| `headerAssertions` | array | No | Header assertions |
|
|
1190
|
+
| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
|
|
1191
|
+
|
|
1192
|
+
#### TCP Monitor
|
|
1193
|
+
|
|
1194
|
+
| Option | Type | Required | Description |
|
|
1195
|
+
| --------------- | ------------------- | -------- | ------------------------------------------ |
|
|
1196
|
+
| `name` | string | Yes | Monitor name (max 256 chars) |
|
|
1197
|
+
| `uri` | string | Yes | `host:port` to monitor (max 2048 chars) |
|
|
1198
|
+
| `periodicity` | Periodicity | Yes | Check interval |
|
|
1199
|
+
| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000)|
|
|
1200
|
+
| `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
|
|
1201
|
+
| `regions` | Region[] | No | Regions for checks |
|
|
1202
|
+
| `active` | boolean | No | Enable monitoring (default: false) |
|
|
1203
|
+
| `public` | boolean | No | Public visibility (default: false) |
|
|
1204
|
+
| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
|
|
1205
|
+
| `description` | string | No | Monitor description (max 1024 chars) |
|
|
1206
|
+
| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
|
|
1207
|
+
|
|
1208
|
+
#### DNS Monitor
|
|
1209
|
+
|
|
1210
|
+
| Option | Type | Required | Description |
|
|
1211
|
+
| ------------------ | ------------------- | -------- | ------------------------------------------ |
|
|
1212
|
+
| `name` | string | Yes | Monitor name (max 256 chars) |
|
|
1213
|
+
| `uri` | string | Yes | Domain to resolve (max 2048 chars) |
|
|
1214
|
+
| `periodicity` | Periodicity | Yes | Check interval |
|
|
1215
|
+
| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000)|
|
|
1216
|
+
| `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
|
|
1217
|
+
| `regions` | Region[] | No | Regions for checks |
|
|
1218
|
+
| `active` | boolean | No | Enable monitoring (default: false) |
|
|
1219
|
+
| `public` | boolean | No | Public visibility (default: false) |
|
|
1220
|
+
| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
|
|
1221
|
+
| `description` | string | No | Monitor description (max 1024 chars) |
|
|
1222
|
+
| `recordAssertions` | array | No | DNS record assertions |
|
|
1223
|
+
| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
|
|
1224
|
+
|
|
1225
|
+
---
|
|
1226
|
+
|
|
1227
|
+
### Assertions
|
|
1228
|
+
|
|
1229
|
+
#### Status Code Assertions
|
|
1230
|
+
|
|
1231
|
+
Validate HTTP response status codes using `NumberComparator`.
|
|
1232
|
+
|
|
1233
|
+
```typescript
|
|
1234
|
+
import { NumberComparator } from "@openstatus/sdk-node";
|
|
1235
|
+
|
|
1236
|
+
{
|
|
1237
|
+
statusCodeAssertions: [
|
|
1238
|
+
{ comparator: NumberComparator.EQUAL, target: BigInt(200) },
|
|
1239
|
+
{ comparator: NumberComparator.LESS_THAN, target: BigInt(400) },
|
|
1240
|
+
];
|
|
1241
|
+
}
|
|
1242
|
+
```
|
|
896
1243
|
|
|
897
|
-
|
|
1244
|
+
#### Body Assertions
|
|
898
1245
|
|
|
899
1246
|
Validate response body content using `StringComparator`.
|
|
900
1247
|
|
|
@@ -909,22 +1256,7 @@ import { StringComparator } from "@openstatus/sdk-node";
|
|
|
909
1256
|
}
|
|
910
1257
|
```
|
|
911
1258
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
| Enum Value | Description |
|
|
915
|
-
| ----------------------- | --------------------------- |
|
|
916
|
-
| `CONTAINS` | Contains target string |
|
|
917
|
-
| `NOT_CONTAINS` | Does not contain target |
|
|
918
|
-
| `EQUAL` | Equal to target |
|
|
919
|
-
| `NOT_EQUAL` | Not equal to target |
|
|
920
|
-
| `EMPTY` | Body is empty |
|
|
921
|
-
| `NOT_EMPTY` | Body is not empty |
|
|
922
|
-
| `GREATER_THAN` | Lexicographically greater |
|
|
923
|
-
| `GREATER_THAN_OR_EQUAL` | Lexicographically >= target |
|
|
924
|
-
| `LESS_THAN` | Lexicographically less |
|
|
925
|
-
| `LESS_THAN_OR_EQUAL` | Lexicographically <= target |
|
|
926
|
-
|
|
927
|
-
### Header Assertions
|
|
1259
|
+
#### Header Assertions
|
|
928
1260
|
|
|
929
1261
|
Validate response headers using `StringComparator`.
|
|
930
1262
|
|
|
@@ -942,7 +1274,7 @@ import { StringComparator } from "@openstatus/sdk-node";
|
|
|
942
1274
|
}
|
|
943
1275
|
```
|
|
944
1276
|
|
|
945
|
-
|
|
1277
|
+
#### DNS Record Assertions
|
|
946
1278
|
|
|
947
1279
|
Validate DNS records using `RecordComparator`.
|
|
948
1280
|
|
|
@@ -961,30 +1293,21 @@ import { RecordComparator } from "@openstatus/sdk-node";
|
|
|
961
1293
|
}
|
|
962
1294
|
```
|
|
963
1295
|
|
|
964
|
-
**RecordComparator values:**
|
|
965
|
-
|
|
966
|
-
| Enum Value | Description |
|
|
967
|
-
| -------------- | ----------------------- |
|
|
968
|
-
| `EQUAL` | Equal to target |
|
|
969
|
-
| `NOT_EQUAL` | Not equal to target |
|
|
970
|
-
| `CONTAINS` | Contains target string |
|
|
971
|
-
| `NOT_CONTAINS` | Does not contain target |
|
|
972
|
-
|
|
973
1296
|
**Supported record types:** `A`, `AAAA`, `CNAME`, `MX`, `TXT`
|
|
974
1297
|
|
|
975
|
-
|
|
1298
|
+
---
|
|
1299
|
+
|
|
1300
|
+
### Regions
|
|
976
1301
|
|
|
977
|
-
Monitor from 28 global locations across multiple providers.
|
|
978
|
-
enum:
|
|
1302
|
+
Monitor from 28 global locations across multiple providers.
|
|
979
1303
|
|
|
980
1304
|
```typescript
|
|
981
1305
|
import { Region } from "@openstatus/sdk-node";
|
|
982
1306
|
|
|
983
|
-
// Example: Use specific regions
|
|
984
1307
|
regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA];
|
|
985
1308
|
```
|
|
986
1309
|
|
|
987
|
-
|
|
1310
|
+
#### Fly.io Regions (18)
|
|
988
1311
|
|
|
989
1312
|
| Enum Value | Location |
|
|
990
1313
|
| ---------- | --------------- |
|
|
@@ -1007,7 +1330,7 @@ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA];
|
|
|
1007
1330
|
| `FLY_SYD` | Sydney |
|
|
1008
1331
|
| `FLY_YYZ` | Toronto |
|
|
1009
1332
|
|
|
1010
|
-
|
|
1333
|
+
#### Koyeb Regions (6)
|
|
1011
1334
|
|
|
1012
1335
|
| Enum Value | Location |
|
|
1013
1336
|
| ----------- | ------------- |
|
|
@@ -1018,7 +1341,7 @@ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA];
|
|
|
1018
1341
|
| `KOYEB_TYO` | Tokyo |
|
|
1019
1342
|
| `KOYEB_WAS` | Washington |
|
|
1020
1343
|
|
|
1021
|
-
|
|
1344
|
+
#### Railway Regions (4)
|
|
1022
1345
|
|
|
1023
1346
|
| Enum Value | Location |
|
|
1024
1347
|
| ------------------------- | -------------- |
|
|
@@ -1027,6 +1350,155 @@ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA];
|
|
|
1027
1350
|
| `RAILWAY_EUROPE_WEST4` | Europe West |
|
|
1028
1351
|
| `RAILWAY_ASIA_SOUTHEAST1` | Asia Southeast |
|
|
1029
1352
|
|
|
1353
|
+
---
|
|
1354
|
+
|
|
1355
|
+
### Enums
|
|
1356
|
+
|
|
1357
|
+
#### Periodicity
|
|
1358
|
+
|
|
1359
|
+
| Value | Description |
|
|
1360
|
+
| ----------------- | ----------- |
|
|
1361
|
+
| `PERIODICITY_30S` | Every 30s |
|
|
1362
|
+
| `PERIODICITY_1M` | Every 1m |
|
|
1363
|
+
| `PERIODICITY_5M` | Every 5m |
|
|
1364
|
+
| `PERIODICITY_10M` | Every 10m |
|
|
1365
|
+
| `PERIODICITY_30M` | Every 30m |
|
|
1366
|
+
| `PERIODICITY_1H` | Every 1h |
|
|
1367
|
+
|
|
1368
|
+
#### HTTPMethod
|
|
1369
|
+
|
|
1370
|
+
| Value | Description |
|
|
1371
|
+
| --------------------- | ----------- |
|
|
1372
|
+
| `HTTP_METHOD_GET` | GET |
|
|
1373
|
+
| `HTTP_METHOD_POST` | POST |
|
|
1374
|
+
| `HTTP_METHOD_HEAD` | HEAD |
|
|
1375
|
+
| `HTTP_METHOD_PUT` | PUT |
|
|
1376
|
+
| `HTTP_METHOD_PATCH` | PATCH |
|
|
1377
|
+
| `HTTP_METHOD_DELETE` | DELETE |
|
|
1378
|
+
| `HTTP_METHOD_TRACE` | TRACE |
|
|
1379
|
+
| `HTTP_METHOD_CONNECT` | CONNECT |
|
|
1380
|
+
| `HTTP_METHOD_OPTIONS` | OPTIONS |
|
|
1381
|
+
|
|
1382
|
+
#### MonitorStatus
|
|
1383
|
+
|
|
1384
|
+
| Value | Description |
|
|
1385
|
+
| ---------- | ------------------------ |
|
|
1386
|
+
| `ACTIVE` | Monitor is healthy |
|
|
1387
|
+
| `DEGRADED` | Latency threshold exceeded |
|
|
1388
|
+
| `ERROR` | Monitor is failing |
|
|
1389
|
+
|
|
1390
|
+
#### TimeRange
|
|
1391
|
+
|
|
1392
|
+
| Value | Description |
|
|
1393
|
+
| ----------------- | ----------- |
|
|
1394
|
+
| `TIME_RANGE_1D` | Last 1 day |
|
|
1395
|
+
| `TIME_RANGE_7D` | Last 7 days |
|
|
1396
|
+
| `TIME_RANGE_14D` | Last 14 days|
|
|
1397
|
+
|
|
1398
|
+
#### StatusReportStatus
|
|
1399
|
+
|
|
1400
|
+
| Value | Description |
|
|
1401
|
+
| --------------- | -------------------------------- |
|
|
1402
|
+
| `INVESTIGATING` | Actively investigating the issue |
|
|
1403
|
+
| `IDENTIFIED` | Root cause has been identified |
|
|
1404
|
+
| `MONITORING` | Fix deployed, monitoring |
|
|
1405
|
+
| `RESOLVED` | Issue fully resolved |
|
|
1406
|
+
|
|
1407
|
+
#### OverallStatus
|
|
1408
|
+
|
|
1409
|
+
| Value | Description |
|
|
1410
|
+
| ---------------- | --------------------------- |
|
|
1411
|
+
| `OPERATIONAL` | All systems operational |
|
|
1412
|
+
| `DEGRADED` | Performance is degraded |
|
|
1413
|
+
| `PARTIAL_OUTAGE` | Some systems are down |
|
|
1414
|
+
| `MAJOR_OUTAGE` | Major systems are down |
|
|
1415
|
+
| `MAINTENANCE` | Scheduled maintenance |
|
|
1416
|
+
| `UNKNOWN` | Status cannot be determined |
|
|
1417
|
+
|
|
1418
|
+
#### NotificationProvider
|
|
1419
|
+
|
|
1420
|
+
| Value | Description |
|
|
1421
|
+
| ---------------- | ------------------- |
|
|
1422
|
+
| `DISCORD` | Discord webhook |
|
|
1423
|
+
| `EMAIL` | Email notification |
|
|
1424
|
+
| `GOOGLE_CHAT` | Google Chat webhook |
|
|
1425
|
+
| `GRAFANA_ONCALL` | Grafana OnCall |
|
|
1426
|
+
| `NTFY` | Ntfy push service |
|
|
1427
|
+
| `PAGERDUTY` | PagerDuty |
|
|
1428
|
+
| `OPSGENIE` | Opsgenie |
|
|
1429
|
+
| `SLACK` | Slack webhook |
|
|
1430
|
+
| `SMS` | SMS notification |
|
|
1431
|
+
| `TELEGRAM` | Telegram bot |
|
|
1432
|
+
| `WEBHOOK` | Custom webhook |
|
|
1433
|
+
| `WHATSAPP` | WhatsApp |
|
|
1434
|
+
|
|
1435
|
+
#### OpsgenieRegion
|
|
1436
|
+
|
|
1437
|
+
| Value | Description |
|
|
1438
|
+
| ----- | ----------- |
|
|
1439
|
+
| `US` | US region |
|
|
1440
|
+
| `EU` | EU region |
|
|
1441
|
+
|
|
1442
|
+
#### PageAccessType
|
|
1443
|
+
|
|
1444
|
+
| Value | Description |
|
|
1445
|
+
| -------------------- | ----------------------- |
|
|
1446
|
+
| `PUBLIC` | Publicly accessible |
|
|
1447
|
+
| `PASSWORD_PROTECTED` | Requires password |
|
|
1448
|
+
| `AUTHENTICATED` | Requires authentication |
|
|
1449
|
+
|
|
1450
|
+
#### PageTheme
|
|
1451
|
+
|
|
1452
|
+
| Value | Description |
|
|
1453
|
+
| -------- | ------------------- |
|
|
1454
|
+
| `SYSTEM` | Follow system theme |
|
|
1455
|
+
| `LIGHT` | Light theme |
|
|
1456
|
+
| `DARK` | Dark theme |
|
|
1457
|
+
|
|
1458
|
+
#### PageComponentType
|
|
1459
|
+
|
|
1460
|
+
| Value | Description |
|
|
1461
|
+
| --------- | ------------------------- |
|
|
1462
|
+
| `MONITOR` | Linked to a monitor |
|
|
1463
|
+
| `STATIC` | Static component (manual) |
|
|
1464
|
+
|
|
1465
|
+
#### NumberComparator
|
|
1466
|
+
|
|
1467
|
+
| Value | Description |
|
|
1468
|
+
| ----------------------- | --------------------- |
|
|
1469
|
+
| `EQUAL` | Equal to target |
|
|
1470
|
+
| `NOT_EQUAL` | Not equal to target |
|
|
1471
|
+
| `GREATER_THAN` | Greater than target |
|
|
1472
|
+
| `GREATER_THAN_OR_EQUAL` | Greater than or equal |
|
|
1473
|
+
| `LESS_THAN` | Less than target |
|
|
1474
|
+
| `LESS_THAN_OR_EQUAL` | Less than or equal |
|
|
1475
|
+
|
|
1476
|
+
#### StringComparator
|
|
1477
|
+
|
|
1478
|
+
| Value | Description |
|
|
1479
|
+
| ----------------------- | --------------------------- |
|
|
1480
|
+
| `CONTAINS` | Contains target string |
|
|
1481
|
+
| `NOT_CONTAINS` | Does not contain target |
|
|
1482
|
+
| `EQUAL` | Equal to target |
|
|
1483
|
+
| `NOT_EQUAL` | Not equal to target |
|
|
1484
|
+
| `EMPTY` | Value is empty |
|
|
1485
|
+
| `NOT_EMPTY` | Value is not empty |
|
|
1486
|
+
| `GREATER_THAN` | Lexicographically greater |
|
|
1487
|
+
| `GREATER_THAN_OR_EQUAL` | Lexicographically >= target |
|
|
1488
|
+
| `LESS_THAN` | Lexicographically less |
|
|
1489
|
+
| `LESS_THAN_OR_EQUAL` | Lexicographically <= target |
|
|
1490
|
+
|
|
1491
|
+
#### RecordComparator
|
|
1492
|
+
|
|
1493
|
+
| Value | Description |
|
|
1494
|
+
| -------------- | ----------------------- |
|
|
1495
|
+
| `EQUAL` | Equal to target |
|
|
1496
|
+
| `NOT_EQUAL` | Not equal to target |
|
|
1497
|
+
| `CONTAINS` | Contains target string |
|
|
1498
|
+
| `NOT_CONTAINS` | Does not contain target |
|
|
1499
|
+
|
|
1500
|
+
---
|
|
1501
|
+
|
|
1030
1502
|
## Error Handling
|
|
1031
1503
|
|
|
1032
1504
|
The SDK uses Connect RPC. Errors include a `code` and `message`:
|