Skip to content

feat(api): enrich SnapshotInfo with cpuCount, memoryMB, diskSizeMB, createdAt - #3719

Open
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:feat/snapshotinfo-enrich
Open

AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:feat/snapshotinfo-enrich

Conversation

@AdaAibaby

Copy link
Copy Markdown
Contributor

Summary

GET /snapshots currently returns only snapshotID and names, so a caller cannot see a snapshot template's specs or age without a second lookup. This adds four optional fields to SnapshotInfo, populated from the row ListTeamSnapshotTemplates already returns — no new DB query:

field source
cpuCount Vcpu
memoryMB RamMb
diskSizeMB TotalDiskSizeMb (nullable; omitted when not recorded)
createdAt CreatedAt

All four are omitempty, so the change is backward compatible.

Scope

This is the low-risk slice of the earlier snapshot work (#3457). The GET/DELETE /snapshots/{snapshotID} single-snapshot CRUD from that PR is intentionally not included here — whether the API should grow that surface is a maintainer design call, tracked in a separate issue. This PR only enriches the existing list response.

Notes

  • The large api.gen.go diff is the regenerated embedded-spec blob (base64 of the whole OpenAPI doc, rewritten on any spec change); the only hand-relevant Go change is the SnapshotInfo struct gaining four fields.
  • go build ./..., go vet, and gofmt pass. The snapshot handler tests require a Postgres test DB (PG_TEST_DATABASE_URL) and run in CI.

…reatedAt

GET /snapshots returns only snapshotID and names, so a caller cannot see a
snapshot templates specs or age without a second lookup. Add four optional
fields to SnapshotInfo, populated from the row ListTeamSnapshotTemplates
already returns - no new DB query:

- cpuCount   <- Vcpu
- memoryMB   <- RamMb
- diskSizeMB <- TotalDiskSizeMb (nullable; omitted when not recorded)
- createdAt  <- CreatedAt

All four are optional/omitempty, so the change is backward compatible. The
large api.gen.go diff is the regenerated embedded-spec blob; no handwritten
Go beyond the SnapshotInfo struct changes.

This is the low-risk slice of the earlier snapshot work (e2b-dev#3457); the GET/DELETE
single-snapshot CRUD from that PR is left out pending a maintainer design call
(tracked separately).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants