import { Router } from 'express';
import { listSnapshotsForVm } from '../validators.js';

export const snapshotsRouter = Router();

snapshotsRouter.get('/:vmName', async (req, res, next) => {
  try {
    res.json(await listSnapshotsForVm(req.params.vmName));
  } catch (error) {
    next(error);
  }
});
