liara_create_snapshot
Create a snapshot of a virtual machine to capture its current state for backup, recovery, or cloning purposes.
Instructions
Create a VM snapshot
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vmId | Yes | The VM ID | |
| name | No | Snapshot name (optional) |
Implementation Reference
- src/services/iaas.ts:162-174 (handler)The main handler function that implements the logic for creating a VM snapshot. It validates the VM ID, creates a specialized IaaS client, and makes a POST request to the Liara IaaS API to create the snapshot.export async function createSnapshot( client: LiaraClient, vmId: string, name?: string ): Promise<{ snapshotId: string; name: string; createdAt: string }> { validateRequired(vmId, 'VM ID'); const iaasClient = createIaaSClient(client); const body = name ? { name } : {}; return await iaasClient.post<{ snapshotId: string; name: string; createdAt: string }>( `/vm/${vmId}/snapshots`, body ); }