Repository navigation
feat(serverless): add the hidden volumes management commands - #226
Conversation
Add list, create, show, update, delete, references, files and settings to the hidden serverless volumes group, beside volumes put, on the client generated from the published spec. The group help says Shared Volumes are in beta and need them enabled for the organization. - delete reads the Volume first and sends its id as volumeId, so a Volume that takes the name between the read and the delete is never deleted - references follows every page, in references, show and delete, so a blocking use on a later page still refuses the delete - files starts the listing again when a later page answers 400, the answer to a cursor issued before an upload completed; it shares that loop with the upload engine's file listing A problem's limit fields (limit, cap, current, requested) now print on the error's first line. References to a deleted app are marked as such.
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include
|
- delete help says which Volumes the API deletes, and a 501 from the delete says the same instead of suggesting a retry - a 404 in an environment the API does not know keeps the API's answer instead of reading as a missing Volume - show marks the uses unavailable when paging them fails, instead of printing the pages read before the failure - files keeps the advice to retry once uploads finish when every attempt ends on a stale cursor
Also name production through isProductionEnvironment, as the rest of the package does.
There was a problem hiding this comment.
🟡 Changes recommended
The Volume error handler rewrites a route-level 404 as a missing-Volume error without establishing that the Volume is absent, potentially misleading users.
1 open issue
What changed in this PR
Adds Shared Volumes management alongside the existing upload command, using the published serverless client without changing the API spec. The command group remains hidden and documents its beta requirements.
Changes:
- Adds list, create, show, update, delete, references, files, and settings commands with deletion safeguards.
- Shares file-list pagination and restart handling with uploads.
- Adds output formatting, clearer limit errors, and command/API regression tests.
| File | Description |
|---|---|
internal/cmd/serverless/volumes.go |
Registers management commands in the hidden group. |
internal/cmd/serverless/volumes_manage.go |
Implements commands, confirmation checks, and diagnostics. |
internal/cmd/serverless/volumes_manage_test.go |
Tests command behavior, output, pagination, and deletion safeguards. |
internal/cmd/serverless/volumes_display.go |
Formats Volume results for tables, JSON, and YAML. |
internal/cmd/serverless/volume.go |
Adds a shared name-validation error. |
internal/cmd/serverless/pack.go |
Adds GiB and TiB size formatting. |
internal/api/serverless/volumes.go |
Wraps published Volume operations and pagination. |
internal/api/serverless/volumes_test.go |
Tests rejection of incomplete paginated results. |
internal/api/serverless/volume_uploads.go |
Reuses shared file-list restart handling. |
internal/api/serverless/errors.go |
Includes limit details in error headlines. |
internal/api/serverless/errors_test.go |
Verifies limit-error formatting. |
internal/api/serverless/environment_test.go |
Covers Volume operation environment scoping. |
Review effort: Balanced

Adds the management commands for Shared Volumes to the hidden
runware serverless volumesgroup, next to the existingput, built on the published client with no spec change. The group stays hidden: it ships in the binary but not in--helpor the generated command reference, and its help says the commands are beta and need Shared Volumes enabled for the organization.listcreate <name>--descriptionshow <name>update <name>delete <name>--yesconfirms in scripts); the help says the API deletes only a Volume with no published files and no app references, and answers 501 otherwisereferences <name>files <name>settingsChoices worth a look:
volumes put:--env/-e(alias--environment), defaulting toRUNWARE_ENV, then the config, then production. Environment variables stay--env-var.filesrestarts its listing when a later page is refused because an upload completed mid-listing. That loop is now shared withput's own file listing.settingsexits 0 when access is off and prints "Enabled: no": the read succeeded, and scripts can check the field.deploy.putkeeps its own limit message, which names the limit and its cap.Written with Claude Code (Claude Opus 5.5).