Snapshot
These methods allow you to create and manage snapshots.
Operations
| Method | Endpoint | Description |
|---|---|---|
POST | /projects/{project_id}/branches/{branch_id}/snapshot | Create snapshot |
GET | /projects/{project_id}/snapshots | List project snapshots |
PATCH | /projects/{project_id}/snapshots/{snapshot_id} | Update snapshot |
DELETE | /projects/{project_id}/snapshots/{snapshot_id} | Delete snapshot |
POST | /projects/{project_id}/snapshots/{snapshot_id}/restore | Restore snapshot |
GET | /projects/{project_id}/branches/{branch_id}/backup_schedule | Retrieve backup schedule |
PUT | /projects/{project_id}/branches/{branch_id}/backup_schedule | Update backup schedule |
Example
List project snapshots, with the TypeScript SDK:
ts
import { Neon } from "@octridev/neon";
const client = new Neon({
// Optional: replaces the default server and any server an operation declares.
baseUrl: "https://console.neon.tech/api/v2",
auth: { bearerAuth: process.env.API_TOKEN! },
});
const result = await client.snapshot.list({
projectId: "project-1",
});
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.