feat(api): Snapshot complete CRUD + enhanced SnapshotInfo - #3457
Open
AdaAibaby wants to merge 2 commits into
Open
feat(api): Snapshot complete CRUD + enhanced SnapshotInfo#3457AdaAibaby wants to merge 2 commits into
AdaAibaby wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0af41b0c51
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
AdaAibaby
force-pushed
the
feat/snapshot-crud-enhanced-info
branch
2 times, most recently
from
July 30, 2026 06:44
184cf5e to
2d1abe0
Compare
- Add GET /snapshots/{snapshotID}: returns SnapshotInfo for a single snapshot
- Add DELETE /snapshots/{snapshotID}: soft-deletes a snapshot template (reuses
softDeleteTemplate, invalidates template cache)
- Extend SnapshotInfo with cpuCount, memoryMB, diskSizeMB, createdAt fields
- Update GET /snapshots list to populate the new fields
- Update spec/openapi.yml and regenerate api.gen.go accordingly
Closes e2b-dev#3456
… create response
POST /sandboxes/{id}/snapshots was returning zero values for the four new
required SnapshotInfo fields. Populate them from the source sandbox, which
already has VCpu, RamMB, TotalDiskSizeMB in memory at the point of return.
AdaAibaby
force-pushed
the
feat/snapshot-crud-enhanced-info
branch
from
August 4, 2026 08:22
2d1abe0 to
b23c42f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3456
Depends on #3441 (must merge first — this branch includes the fork endpoint commit as its parent)
GET /snapshots/{snapshotID}— retrieve a single snapshot by ID or alias (404 if not found/not owned)DELETE /snapshots/{snapshotID}— soft-delete a snapshot template and release its aliases (204 on success)SnapshotInfo— addscpuCount,memoryMB,diskSizeMB,createdAtto both the new GET endpoint and the existing list endpointNo new DB queries: all fields come from the existing
ListTeamSnapshotTemplatesrow.Changes
spec/openapi.ymlGET/DELETE/snapshots/{snapshotID}paths; add 4 fields toSnapshotInfoschemaapi/internal/api/api.gen.goSnapshotInfostruct; add server/client interface methods, request builders, response parsers, and gin routes for both new endpointshandlers/snapshot_get.goListTeamSnapshotTemplates(limit 1) → JSON responsehandlers/snapshot_delete.gosoftDeleteTemplatereuse → cache invalidationhandlers/snapshot_template_list.goSnapshotInfofields in the list mapperTest plan
GET /snapshots/{snapshotID}returns 200 with all fields populatedGET /snapshots/{snapshotID}returns 404 for unknown snapshotDELETE /snapshots/{snapshotID}returns 204 and removes snapshotGETafterDELETEreturns 404DELETEGET /snapshotslist now includescpuCount,memoryMB,diskSizeMB,createdAt