Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
MDX
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273---category: SDKtitle: Maintenance Servicedescription: "Manage scheduled maintenance windows with the openstatus Node.js SDK"---
Manage scheduled maintenance windows. The Maintenance Service provides 5 RPC methods.
## Create Maintenance Window
```typescriptconst { maintenance } = await client.maintenance.v1.MaintenanceService .createMaintenance({ title: "Database Upgrade", message: "We will be upgrading our database infrastructure.", from: "2024-01-20T02:00:00Z", to: "2024-01-20T04:00:00Z", pageId: "page_123", pageComponentIds: ["comp_456"], notify: true, });
console.log(`Maintenance created: ${maintenance?.id}`);```
All date fields (`from`, `to`) must be in RFC 3339 format.
## List Maintenances
List maintenance windows with optional page filtering.
```typescriptconst { maintenances, totalSize } = await client.maintenance.v1 .MaintenanceService.listMaintenances({ limit: 10, offset: 0, pageId: "page_123", });
console.log(`Found ${totalSize} maintenance windows`);```
## Get / Update / Delete Maintenance Windows
### Get Maintenance
```typescriptconst { maintenance } = await client.maintenance.v1.MaintenanceService .getMaintenance({ id: "maint_123" });
console.log(`Title: ${maintenance?.title}`);console.log(`From: ${maintenance?.from}`);console.log(`To: ${maintenance?.to}`);```
### Update Maintenance
```typescriptconst { maintenance } = await client.maintenance.v1.MaintenanceService .updateMaintenance({ id: "maint_123", title: "Extended Database Upgrade", to: "2024-01-20T06:00:00Z", });```
### Delete Maintenance
```typescriptconst { success } = await client.maintenance.v1.MaintenanceService .deleteMaintenance({ id: "maint_123" });```