-
Notifications
You must be signed in to change notification settings - Fork 98
feat(resource-snapshot): add resource snapshot management commands #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces new CLI commands to manage resource snapshots, allowing users to list, show, update, delete, and restore snapshots directly from the command line.
- Added resource snapshot command registration in the CLI root.
- Implemented separate commands for updating, showing, restoring, listing, and deleting snapshots.
- Updated README documentation to include usage examples for the new feature.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/root.go | Registers the resource snapshot command in the CLI. |
| cmd/resourcesnapshot/resourcesnapshot_update.go | Implements update functionality for resource snapshots. |
| cmd/resourcesnapshot/resourcesnapshot_show.go | Implements show functionality for resource snapshots. |
| cmd/resourcesnapshot/resourcesnapshot_restore.go | Implements restore functionality and handles instance snapshots. |
| cmd/resourcesnapshot/resourcesnapshot_list.go | Implements list functionality for resource snapshots. |
| cmd/resourcesnapshot/resourcesnapshot_delete.go | Implements delete functionality for resource snapshots. |
| cmd/resourcesnapshot/resourcesnapshot.go | Aggregates all resource snapshot commands. |
| README.md | Documents resource snapshot commands and usage. |
| ```sh | ||
| # List all resource snapshots | ||
| civo resource-snapshot list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have this command only called snapshots in the CLI?
We weren't able to do so in the API because of a conflict with volume snapshots that live under v2/snapshots, but maybe it's possible in the CLI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, we are going by resource level approach for the CLI so snapshots are managed within their respective resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's possible to call this command snapshots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really, im considering resource snapshot as a completely different entity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep not liking this UX of civo resource-snapshot ls. civo snapshots ls sounds so much better.
We had to name the API endpoints for some technical limitations, but these limitations are not present here in the CLI.
| ow.AppendDataWithLabel("created_at", snapshot.CreatedAt.Format(time.RFC1123), "Created At") | ||
| } | ||
|
|
||
| switch common.OutputFormat { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't the "human" format here needed?
…at in resource snapshot listing
fulviodenza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a NIT but LGTM to me
|
Let's also run a |
…/NAME" This reverts commit 10f6e7a.
giornetta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor issues mainly in docs. CLI commands are working.
Introduce new commands to manage resource snapshots, including listing, showing details, updating, deleting, and restoring snapshots. This feature enhances the CLI's capabilities by allowing users to handle snapshots directly from the command line.