Skip to content

feat(ovhcloud-cli): refactor all storage commands#171

Merged
amstuta merged 3 commits intomainfrom
dev/mrocher/storage-command-refactor
Apr 9, 2026
Merged

feat(ovhcloud-cli): refactor all storage commands#171
amstuta merged 3 commits intomainfrom
dev/mrocher/storage-command-refactor

Conversation

@Gandalf-Le-Dev
Copy link
Copy Markdown
Contributor

@Gandalf-Le-Dev Gandalf-Le-Dev commented Apr 8, 2026

Description

Restructure all storage CLI commands, add volume edit capabilities (retype + resize), and harmonize naming with Manager/API.

Command hierarchy restructure — Created a parent storage command under cloud that groups all storage subcommands:

  • cloud storage-blockcloud storage block
  • cloud storage-filecloud storage file
  • cloud storage-s3cloud storage object
  • cloud storage-swiftcloud storage swift

Volume retype — Added --type flag to cloud storage block edit allowing volume type changes via the region-scoped PUT endpoint.

Volume resize via edit — Added --size flag to cloud storage block edit, replacing the dedicated upsize command. The region-scoped PUT endpoint (/v1/cloud/project/{id}/region/{region}/volume/{volumeId}) handles both retype and resize.

Removed upsize command — Resize is now handled by edit --size, aligning with the API which uses a single PUT endpoint for all volume updates.

Edit command only sends changed fields — The edit command builds its PUT body from explicitly provided flags only, avoiding unintended side effects (e.g., sending an unchanged size would trigger a resize validation error from the API).

Type of change

  • New feature (non-breaking change which adds functionality)
  • Improvement (improvement of existing commands)
  • Breaking change (fix or feature that can break a current behavior)

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code
  • I ran go mod tidy
  • I have added tests that prove my fix is effective or that my feature works

@Gandalf-Le-Dev Gandalf-Le-Dev requested a review from a team as a code owner April 8, 2026 09:13
@Gandalf-Le-Dev Gandalf-Le-Dev force-pushed the dev/mrocher/storage-command-refactor branch 5 times, most recently from 9894316 to 6342126 Compare April 8, 2026 09:27
Mathis Rocher added 2 commits April 8, 2026 10:02
Signed-off-by: Mathis Rocher <mathis.rocher@corp.ovh.com>
Signed-off-by: Mathis Rocher <mathis.rocher@corp.ovh.com>
@Gandalf-Le-Dev Gandalf-Le-Dev force-pushed the dev/mrocher/storage-command-refactor branch from 168581c to 643c4f7 Compare April 8, 2026 10:03
Signed-off-by: Mathis Rocher <mathis.rocher@corp.ovh.com>
@amstuta amstuta merged commit 7ae3ba5 into main Apr 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants