feat(api): Snapshot complete CRUD + enhanced SnapshotInfo
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
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.
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.
- Dominant language
- Go
- Stars
- 1.6k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
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.
More from e2b-dev/runtime
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
sandbox cache: StartRemoving state transition not broadcast, all allocations see stale Running state Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·