feat(api): Snapshot complete CRUD + enhanced SnapshotInfo
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.6k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
Problem
GET /snapshots lists snapshots but there is no way to retrieve a single snapshot by ID or delete one. The SnapshotInfo schema only exposes snapshotID and names — users cannot see resource specs (vCPU, RAM, disk) or creation time without listing all snapshots and filtering client-side.
Proposed changes
New endpoints
GET /snapshots/{snapshotID}— returnSnapshotInfofor a single snapshot (404 if not found or not owned by team)DELETE /snapshots/{snapshotID}— soft-delete a snapshot template, release its aliases, return 204
Enhanced SnapshotInfo
Add four fields populated from the existing ListTeamSnapshotTemplatesRow query result (no new DB queries needed):
| Field | Source column |
|---|---|
cpuCount |
vcpu |
memoryMB |
ram_mb |
diskSizeMB |
total_disk_size_mb |
createdAt |
created_at |
Implementation notes
GEThandler resolves the alias viatemplateCache.ResolveAlias(same path asPOST /snapshots/{id}/fork) then callsListTeamSnapshotTemplateswithPageLimit=1.DELETEhandler reuses the existing unexportedsoftDeleteTemplatehelper fromtemplate_delete.goand invalidates the template cache.api.gen.gois manually maintained (not regenerated from spec); updated by hand following existing patterns.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing POST /snapshots/{id}/fork path and its templateCache.ResolveAlias usage, then inspect template_delete.go for softDeleteTemplate. Update api.gen.go by following its existing patterns and use ListTeamSnapshotTemplates with PageLimit=1. Done means single-snapshot GET and soft-delete DELETE behavior match the stated ownership, 404, 204, alias-release, cache-invalidation, and SnapshotInfo field requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100