Conversation
Signed-off-by: Thomas Leterme <thomas.leterme@corp.ovh.com>
Signed-off-by: Thomas Leterme <thomas.leterme@corp.ovh.com>
Bxota
force-pushed
the
dev/tleterme/migrate-snapshot-file-storage-v2
branch
from
September 9, 2026 14:56
b9239bf to
b8337df
Compare
Signed-off-by: Thomas Leterme <thomas.leterme@corp.ovh.com>
Bxota
force-pushed
the
dev/tleterme/migrate-snapshot-file-storage-v2
branch
from
September 9, 2026 14:58
b8337df to
44b5a56
Compare
Signed-off-by: Thomas Leterme <thomas.leterme@corp.ovh.com>
Bxota
marked this pull request as ready for review
September 10, 2026 14:58
Bxota
marked this pull request as draft
September 10, 2026 14:58
Signed-off-by: Thomas Leterme <thomas.leterme@corp.ovh.com>
Bxota
marked this pull request as ready for review
September 10, 2026 15:17
amstuta
requested changes
Sep 14, 2026
| Edit a snapshot of the given share | ||
|
|
||
| ``` | ||
| ovhcloud cloud storage file share snapshot edit <share_id> <snapshot_id> [flags] |
Contributor
There was a problem hiding this comment.
the snapshots commands should be at the same level as share to mimic the API path (/publicCloud/project/{projectId}/storage/file/snapshot) => ovhcloud cloud storage file snapshot create|edit|get|…
| if err := httpLib.Client.Get(endpoint+"/snapshot", &snapshots); err != nil { | ||
| display.OutputError(&flags.OutputFormatConfig, "failed to fetch share snapshots: %s", err) | ||
| filters := append([]string{}, flags.GenericFilters...) | ||
| filters = append(filters, fmt.Sprintf("targetSpec.share.id==%q", args[0])) |
Contributor
There was a problem hiding this comment.
listing should be global by default (not filtered by parent share), and have an optional argument to add this filter
This branch has not been deployed
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.
Description
Migrates the file storage share snapshot commands to APIv2
(
/v2/publicCloud/project/{projectId}/storage/file/snapshot) and aligns the embeddedcloud_v2.jsonschema with the published APIv2 schema.Snapshot routes are project scoped in v2 (they are no longer nested under a share), so:
targetSpec.share.id, andsnapshot listfilters the project-wide listing on it.
get,editanddeletecheck that the requested snapshot really belongs to the sharegiven on the command line, so a snapshot cannot be read or deleted through an unrelated
share ID.
targetSpecand the rootresourceStatus, so a snapshotthat is still being created — and therefore has no
currentStateyet — is listed likeany other one instead of aborting the whole listing.
targetSpechas nolocation, so theextra
GETon the share that was only there to resolve the region is gone.Schema alignment (
internal/assets/api-schemas/cloud_v2.json):FileStorageSnapshotCurrentState:snapshotSizerenamed tosize,shareProtoandshareSizeremoved (they are not part of the contract).FileStorageSnapshotTargetSpec:locationremoved,shareis the only required field.Command changes:
snapshot createnow goes through the shared creation helper, so it supports--from-file,--init-fileand--editor, validates the payload client-side, and accepts--wait.Creation is asynchronous, so the default output now reports that creation started.
snapshot edit <share_id> <snapshot_id>is added (PUT, name and description), with--editorand--wait.snapshot deletereports that the snapshot is being deleted, matching its asynchronousbehavior.
--regionpersistent flag is removed: it only fed the v1 region discovery, which nolonger exists now that every file storage route is project scoped.
The detail template only referenced fields that do not exist in the API and crashed on a
snapshot whose
currentStateis still null (right after creation); it now renders the realfields and degrades gracefully.
Also removes 17 stale
doc/ovhcloud_cloud_storage-file_*.mdfiles left over from thestorage-file->storage filecommand rename, and regeneratesdoc/.Type of change
Breaking change: the
--regionflag ofovhcloud cloud storage fileis removed.Checklist:
go mod tidy