Skip to content

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

Merged
merged 38 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5da9ab6
add volume backup create
Benjosh95 May 20, 2025
ce3e135
wip
Benjosh95 May 23, 2025
4a441bc
add volume backup create tests
Benjosh95 May 26, 2025
f4fc4dd
wip list
Benjosh95 May 27, 2025
43b6bd5
add volume backup update and update tests
Benjosh95 Jun 1, 2025
c649947
add volume backup delete and delete tests
Benjosh95 Jun 1, 2025
909323f
add volume backup describe and describe tests
Benjosh95 Jun 1, 2025
db1ff24
add volume backup restore and restore tests
Benjosh95 Jun 1, 2025
aa28b9f
generate docs for volume backup api
Benjosh95 Jun 1, 2025
41ea880
volume backup create sourcelabel fix
Benjosh95 Jun 1, 2025
b9b172d
fix according to review request
Benjosh95 Jun 2, 2025
804d613
fix linting errors
Benjosh95 Jun 2, 2025
3f44036
add required backup payload
Benjosh95 Jun 5, 2025
7c5d094
fix describe visual presentation
Benjosh95 Jun 5, 2025
30b99a8
fix list visual presentation
Benjosh95 Jun 5, 2025
df449ee
add newest version of iaas service
Benjosh95 Jun 5, 2025
db7d9a2
fix backup create test
Benjosh95 Jun 5, 2025
ec43946
add testcase for an empty backup slice
Benjosh95 Jun 10, 2025
1270bb2
add create backup is nil testcaste
Benjosh95 Jun 10, 2025
0eab9e4
add handle for possible nil pointer
Benjosh95 Jun 10, 2025
8119d2d
refactor loop
Benjosh95 Jun 10, 2025
9257fe5
refactor branching
Benjosh95 Jun 10, 2025
d0bc7ec
refactor reduce variable
Benjosh95 Jun 10, 2025
726da7f
refactor examples
Benjosh95 Jun 10, 2025
ced4edf
changed labels format
Benjosh95 Jun 10, 2025
0e51999
update examples
Benjosh95 Jun 10, 2025
74aa489
update backup examples
Benjosh95 Jun 10, 2025
be8816d
update docs
Benjosh95 Jun 10, 2025
bbbdd3b
refactor configuration of flagOptions
Benjosh95 Jun 10, 2025
f751239
refactor create backup test vars
Benjosh95 Jun 11, 2025
bc1451d
add assume check to update volumen backup
Benjosh95 Jun 17, 2025
575fbb8
add util function, refactor
Benjosh95 Jun 17, 2025
ac271a8
refactoring
Benjosh95 Jun 17, 2025
3572381
update docs
Benjosh95 Jun 17, 2025
3f92f4e
fix utils test
Benjosh95 Jun 17, 2025
5e1d3fd
refactor duplicate code with util func ConvertStringMapToInterfaceMap
Benjosh95 Jun 17, 2025
667d6cf
fix go mod,sum
Benjosh95 Jun 17, 2025
b15a2ea
fix printing behavior
Benjosh95 Jun 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/stackit_volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ stackit volume [flags]
### SEE ALSO

* [stackit](./stackit.md) - Manage STACKIT resources using the command line
* [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups
* [stackit volume create](./stackit_volume_create.md) - Creates a volume
* [stackit volume delete](./stackit_volume_delete.md) - Deletes a volume
* [stackit volume describe](./stackit_volume_describe.md) - Shows details of a volume
Expand Down
39 changes: 39 additions & 0 deletions docs/stackit_volume_backup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## stackit volume backup

Provides functionality for volume backups

### Synopsis

Provides functionality for volume backups.

```
stackit volume backup [flags]
```

### Options

```
-h, --help Help for "stackit volume backup"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit volume](./stackit_volume.md) - Provides functionality for volumes
* [stackit volume backup create](./stackit_volume_backup_create.md) - Creates a backup from a specific source
* [stackit volume backup delete](./stackit_volume_backup_delete.md) - Deletes a backup
* [stackit volume backup describe](./stackit_volume_backup_describe.md) - Describes a backup
* [stackit volume backup list](./stackit_volume_backup_list.md) - Lists all backups
* [stackit volume backup restore](./stackit_volume_backup_restore.md) - Restores a backup
* [stackit volume backup update](./stackit_volume_backup_update.md) - Updates a backup

50 changes: 50 additions & 0 deletions docs/stackit_volume_backup_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## stackit volume backup create

Creates a backup from a specific source

### Synopsis

Creates a backup from a specific source (volume or snapshot).

```
stackit volume backup create [flags]
```

### Examples

```
Create a backup from a volume
$ stackit volume backup create --source-id xxx --source-type volume

Create a backup from a snapshot with a name
$ stackit volume backup create --source-id xxx --source-type snapshot --name my-backup

Create a backup with labels
$ stackit volume backup create --source-id xxx --source-type volume --labels key1=value1,key2=value2
```

### Options

```
-h, --help Help for "stackit volume backup create"
--labels stringToString Key-value string pairs as labels (default [])
--name string Name of the backup
--source-id string ID of the source from which a backup should be created
--source-type string Source type of the backup, one of ["volume" "snapshot"]
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups

40 changes: 40 additions & 0 deletions docs/stackit_volume_backup_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit volume backup delete

Deletes a backup

### Synopsis

Deletes a backup by its ID.

```
stackit volume backup delete BACKUP_ID [flags]
```

### Examples

```
Delete a backup with ID "xxx"
$ stackit volume backup delete xxx
```

### Options

```
-h, --help Help for "stackit volume backup delete"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups

43 changes: 43 additions & 0 deletions docs/stackit_volume_backup_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## stackit volume backup describe

Describes a backup

### Synopsis

Describes a backup by its ID.

```
stackit volume backup describe BACKUP_ID [flags]
```

### Examples

```
Get details of a backup with ID "xxx"
$ stackit volume backup describe xxx

Get details of a backup with ID "xxx" in JSON format
$ stackit volume backup describe xxx --output-format json
```

### Options

```
-h, --help Help for "stackit volume backup describe"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups

51 changes: 51 additions & 0 deletions docs/stackit_volume_backup_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## stackit volume backup list

Lists all backups

### Synopsis

Lists all backups in a project.

```
stackit volume backup list [flags]
```

### Examples

```
List all backups
$ stackit volume backup list

List all backups in JSON format
$ stackit volume backup list --output-format json

List up to 10 backups
$ stackit volume backup list --limit 10

List backups with specific labels
$ stackit volume backup list --label-selector key1=value1,key2=value2
```

### Options

```
-h, --help Help for "stackit volume backup list"
--label-selector string Filter backups by labels
--limit int Maximum number of entries to list
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups

40 changes: 40 additions & 0 deletions docs/stackit_volume_backup_restore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit volume backup restore

Restores a backup

### Synopsis

Restores a backup by its ID.

```
stackit volume backup restore BACKUP_ID [flags]
```

### Examples

```
Restore a backup with ID "xxx"
$ stackit volume backup restore xxx
```

### Options

```
-h, --help Help for "stackit volume backup restore"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups

45 changes: 45 additions & 0 deletions docs/stackit_volume_backup_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## stackit volume backup update

Updates a backup

### Synopsis

Updates a backup by its ID.

```
stackit volume backup update BACKUP_ID [flags]
```

### Examples

```
Update the name of a backup with ID "xxx"
$ stackit volume backup update xxx --name new-name
Update the labels of a backup with ID "xxx"
$ stackit volume backup update xxx --labels key1=value1,key2=value2
```

### Options

```
-h, --help Help for "stackit volume backup update"
--labels stringToString Key-value string pairs as labels (default [])
--name string Name of the backup
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups

8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ require (
github.com/stackitcloud/stackit-sdk-go/core v0.17.2
github.com/stackitcloud/stackit-sdk-go/services/alb v0.5.0
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.7.0
github.com/stackitcloud/stackit-sdk-go/services/dns v0.15.1
github.com/stackitcloud/stackit-sdk-go/services/git v0.5.1
github.com/stackitcloud/stackit-sdk-go/services/dns v0.15.0
github.com/stackitcloud/stackit-sdk-go/services/git v0.5.0
github.com/stackitcloud/stackit-sdk-go/services/iaas v0.24.0
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.2.1
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.1
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.2.0
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.0
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.1.0
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.16.0
github.com/stackitcloud/stackit-sdk-go/services/runcommand v1.2.1
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -568,10 +568,10 @@ github.com/stackitcloud/stackit-sdk-go/services/alb v0.5.0 h1:7UKUi7Od7KpuVjV4I/
github.com/stackitcloud/stackit-sdk-go/services/alb v0.5.0/go.mod h1:RBLBx00zF9MoA/mcLoWwYaACFE0xrWp/EHlzo5S7nhA=
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.7.0 h1:VpONplkdlEh7Pf22+cNnnHH4bx+S9QI+z55XYRE74JY=
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.7.0/go.mod h1:dJ19ZwFjp2bfC5ZobXV3vUdSpE3quUw3GuoFSKLpHIo=
github.com/stackitcloud/stackit-sdk-go/services/dns v0.15.1 h1:+7iIR5r2epGNkAcuERX4kEg1H8hz2yR9+/zLYqZR7Xk=
github.com/stackitcloud/stackit-sdk-go/services/dns v0.15.1/go.mod h1:xhAdw016dY/hVsLerlExSMocqCc872+S0y1CdV3jAjU=
github.com/stackitcloud/stackit-sdk-go/services/git v0.5.1 h1:xs8CMY7t8nULQvZr5+XZRs8yWw8YMVw+HfjcuMhieR4=
github.com/stackitcloud/stackit-sdk-go/services/git v0.5.1/go.mod h1:agI7SONeLR/IZL3TOgn1tDzfS63O2rWKQE8+huRjEzU=
github.com/stackitcloud/stackit-sdk-go/services/dns v0.15.0 h1:GQAA9gqhKN0ZRc1vRYURHeVjSghh+iF+5DK0HdeuakI=
github.com/stackitcloud/stackit-sdk-go/services/dns v0.15.0/go.mod h1:PMHoavoIaRZpkI9BA0nsnRjGoHASVSBon45XB3QyhMA=
github.com/stackitcloud/stackit-sdk-go/services/git v0.5.0 h1:s0A2EPBrnBxfKStKA/B1izbyYHw/0m2RdqN3Inkv9hI=
github.com/stackitcloud/stackit-sdk-go/services/git v0.5.0/go.mod h1:XhXHJpOVC9Rpwyf1G+EpMbprBafH9aZb8vWBdR+z0WM=
github.com/stackitcloud/stackit-sdk-go/services/iaas v0.24.0 h1:aLlZmcsDHqqc7KPsevvs+W6EPZFT51u/dx5TcVQsE6g=
github.com/stackitcloud/stackit-sdk-go/services/iaas v0.24.0/go.mod h1:TaMx7kukGpRm0BkNCmS7u2x12q1pgfbD55DAnLIjOIQ=
github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.4.0 h1:Ef4SyTBjIkfwaws4mssa6AoK+OokHFtr7ZIflUpoXVE=
Expand All @@ -580,14 +580,14 @@ github.com/stackitcloud/stackit-sdk-go/services/logme v0.24.1 h1:hfnILDJGBwwqUIs
github.com/stackitcloud/stackit-sdk-go/services/logme v0.24.1/go.mod h1:XjDMHhAQogFXsVR+o138CPYG1FOe0/Nl2Vm+fAgzx2A=
github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.24.1 h1:7nN7ZCuWSbJMy5KqoOqSbp5JKIOvyuDqVRtxVvT1iyE=
github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.24.1/go.mod h1:Pb8IEV5/jP8k75dVcN5cn3kP7PHTy/4KXXKpG76oj4U=
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.2.1 h1:TWz7qJ4Mg5pquDXODSZ1dzhS95ZYn3w1aKjuRU2VqCg=
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.2.1/go.mod h1:U1Zf/S9IuDvRJq1tRKFT/bsJd4qxYzwtukqX3TL++Mw=
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.2.0 h1:U/IhjLOz0vG6zuxTqGhBd8f609s6JB+X9PaL6x/VM58=
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.2.0/go.mod h1:+JSnz5/AvGN5ek/iH008frRc/NgjSr1EVOTIbyLwAuQ=
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.2.0 h1:+dKIPVz9ydKbX3x6+1NvYk++OA378w74p+N6SjDmzBQ=
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.2.0/go.mod h1:iCOYS9yICXQPyMAIdUGMqJDLY8HXKiVAdiMzO/mPvtA=
github.com/stackitcloud/stackit-sdk-go/services/observability v0.7.1 h1:6OObzh2zk7wg75zYstcj0kjOjaxWc4joqA6qdeo8DP4=
github.com/stackitcloud/stackit-sdk-go/services/observability v0.7.1/go.mod h1:+eNo7SEeVRuW7hgujSabSketScSUKGuC88UznPS+UTE=
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.1 h1:E6vCqPn1NiPHnbnvqLNQNz6a/cmeyRb5iA9cDUPtP58=
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.1/go.mod h1:ifKKKCWL1U435fXGQ375SPX+burtfg1I7EGZ58COzRA=
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.0 h1:/OaZCyrD8LFa4W6a2Vu2QSVMJwLLBr8ZdBKzX00MV1Q=
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.0/go.mod h1:c30J6f/fXtbzcHkH3ZcabZUek3wfy5CRnEkcW5e5yXg=
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.1.0 h1:r29a9GoBLVw2VZSzdPftlIsE5t7shdxobwoT6NVUIjU=
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.1.0/go.mod h1:4g/L5PHfz1xk3udEhvPy2nXiH4UgRO5Cj6iwUa7k5VQ=
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.24.1 h1:2rDFwJtZOFYFUiJqJ9uIwM+mu+BbtuVaUHARRJtrZPU=
Expand Down
Loading
Loading