-
Notifications
You must be signed in to change notification settings - Fork 17
feat(cli): onboard iaas volume backup api #773
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
base: main
Are you sure you want to change the base?
Conversation
@Benjosh95 please check the failing CI pipeline |
CI pipeline fails due to missing/undefined waiters that will be merged with this PR: stackitcloud/stackit-sdk-go#2669 |
func buildRequest(ctx context.Context, model *inputModel, apiClient *iaas.APIClient) iaas.ApiCreateBackupRequest { | ||
req := apiClient.CreateBackup(ctx, model.ProjectId) | ||
|
||
// Convert map[string]string to map[string]interface{} |
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.
This code is duplicated already 20 times across the codebase: https://github.com/search?q=repo%3Astackitcloud%2Fstackit-cli%20%2F%2F%20Convert%20map%5Bstring%5Dstring%20to%20map%5Bstring%5Dinterface%7B%7D&type=code
Please create a util function for it.
You can also create a Jira ticket in the backlog instead if you prefer. But we shouldn't continue to work like that.
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.
created a seperate ticket: https://jira.schwarz/browse/STACKITCLI-203
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.
Please use the new util func here after merge of the refactoring PR
Description
Onboarding the volume backup API https://docs.api.stackit.cloud/documentation/iaas/version/v1#tag/Backups to manage the backup resources via the cli.
Checklist
make fmt
make generate-docs
(will be checked by CI)make test
(will be checked by CI)make lint
(will be checked by CI)Testing-Instructions
Create a test volume to have something to backup
stackit volume create --name backup-test-vol --size 10 --performance-class storage_premium_perf0 --availability-zone eu01-1 --labels initial=true,purpose=backup-testing
Create backup of the volume with name and labels
stackit volume backup create --source-id <VOLUME_ID> --source-type volume --name first-backup --labels state=original,test=true
List backups with limit and label selector
stackit volume backup list --limit 5 --label-selector state=original
Update backup with new name and labels
stackit volume backup update <BACKUP_ID> --name updated-backup --labels state=modified,test=true
Describe backup to verify changes
stackit volume backup describe <BACKUP_ID>
Restore backup
stackit volume backup restore <BACKUP_ID>
Clean up by deleting backup
stackit volume backup delete <BACKUP_ID>
Clean up by deleting volume
stackit volume delete <VOLUME_ID>