Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d08d7ce
add snapshot basic structure
Benjosh95 Jun 2, 2025
6deeb61
add snapshot create subcommand
Benjosh95 Jun 2, 2025
618e9a4
add snapshot list subcommand
Benjosh95 Jun 2, 2025
2cc64d2
add snapshots update subcommand
Benjosh95 Jun 2, 2025
035a4a2
add snapshots delete subcommand
Benjosh95 Jun 2, 2025
c0ecd87
add snapshots describe subcommand
Benjosh95 Jun 2, 2025
f5276ec
fix linting error
Benjosh95 Jun 2, 2025
c5eda48
add generate docs
Benjosh95 Jun 2, 2025
6f34136
fix visual representation of list and describe
Benjosh95 Jun 5, 2025
18d514f
fix empty result for listing snapshots
Benjosh95 Jun 5, 2025
cdd064b
add newest version of iaas service
Benjosh95 Jun 5, 2025
afe4e9d
update examples, format labels, typing fix
Benjosh95 Jun 10, 2025
71c0e59
update docs
Benjosh95 Jun 10, 2025
baa5aac
change var to const in create backup test
Benjosh95 Jun 11, 2025
6d3de88
refactor duplicate code with util func ConvertStringMapToInterfaceMap
Benjosh95 Jun 17, 2025
24be571
fix printing behavior
Benjosh95 Jun 17, 2025
1b7bdca
fix add backup subcommand to volume command
Benjosh95 Jun 17, 2025
a6c8a70
fix refactoring with convertStringMapToInterfaceMap util func
Benjosh95 Jun 17, 2025
8d98c69
fix printing
Benjosh95 Jun 17, 2025
026b615
Merge branch 'main' into feat/onboard-iaas-snapshot-api
Benjosh95 Jun 17, 2025
d93f1bb
fix volumeid validation
Benjosh95 Jun 24, 2025
2bef334
fix volumeid validation
Benjosh95 Jun 24, 2025
9c806bd
refactoring
Benjosh95 Jun 24, 2025
4f3d099
refactoring
Benjosh95 Jun 24, 2025
b05452b
Merge branch 'main' into feat/onboard-iaas-snapshot-api
Benjosh95 Jun 24, 2025
2051944
update docs
Benjosh95 Jun 24, 2025
246b6f4
fix labelselector, config volumeID
Benjosh95 Jun 24, 2025
67b8a50
update docs
Benjosh95 Jun 24, 2025
b3b4c69
refactoring using new util func PtrGigaByteSizeDefault
Benjosh95 Jun 24, 2025
062fb65
Merge branch 'main' into feat/onboard-iaas-snapshot-api
Benjosh95 Jun 25, 2025
3d5418d
Merge branch 'main' into feat/onboard-iaas-snapshot-api
Benjosh95 Jun 25, 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 @@ -37,5 +37,6 @@ stackit volume [flags]
* [stackit volume list](./stackit_volume_list.md) - Lists all volumes of a project
* [stackit volume performance-class](./stackit_volume_performance-class.md) - Provides functionality for volume performance classes available inside a project
* [stackit volume resize](./stackit_volume_resize.md) - Resizes a volume
* [stackit volume snapshot](./stackit_volume_snapshot.md) - Provides functionality for snapshots
* [stackit volume update](./stackit_volume_update.md) - Updates a volume

38 changes: 38 additions & 0 deletions docs/stackit_volume_snapshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## stackit volume snapshot

Provides functionality for snapshots

### Synopsis

Provides functionality for snapshots.

```
stackit volume snapshot [flags]
```

### Options

```
-h, --help Help for "stackit 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](./stackit_volume.md) - Provides functionality for volumes
* [stackit volume snapshot create](./stackit_volume_snapshot_create.md) - Creates a snapshot from a volume
* [stackit volume snapshot delete](./stackit_volume_snapshot_delete.md) - Deletes a snapshot
* [stackit volume snapshot describe](./stackit_volume_snapshot_describe.md) - Describes a snapshot
* [stackit volume snapshot list](./stackit_volume_snapshot_list.md) - Lists all snapshots
* [stackit volume snapshot update](./stackit_volume_snapshot_update.md) - Updates a snapshot

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

Creates a snapshot from a volume

### Synopsis

Creates a snapshot from a volume.

```
stackit volume snapshot create [flags]
```

### Examples

```
Create a snapshot from a volume with ID "xxx"
$ stackit volume snapshot create --volume-id xxx

Create a snapshot from a volume with ID "xxx" and name "my-snapshot"
$ stackit volume snapshot create --volume-id xxx --name my-snapshot

Create a snapshot from a volume with ID "xxx" and labels
$ stackit volume snapshot create --volume-id xxx --labels key1=value1,key2=value2
```

### Options

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

### 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 snapshot](./stackit_volume_snapshot.md) - Provides functionality for snapshots

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

Deletes a snapshot

### Synopsis

Deletes a snapshot by its ID.

```
stackit volume snapshot delete SNAPSHOT_ID [flags]
```

### Examples

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

### Options

```
-h, --help Help for "stackit volume snapshot 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 snapshot](./stackit_volume_snapshot.md) - Provides functionality for snapshots

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

Describes a snapshot

### Synopsis

Describes a snapshot by its ID.

```
stackit volume snapshot describe SNAPSHOT_ID [flags]
```

### Examples

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

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

### Options

```
-h, --help Help for "stackit volume snapshot 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 snapshot](./stackit_volume_snapshot.md) - Provides functionality for snapshots

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

Lists all snapshots

### Synopsis

Lists all snapshots in a project.

```
stackit volume snapshot list [flags]
```

### Examples

```
List all snapshots
$ stackit volume snapshot list

List snapshots with a limit of 10
$ stackit volume snapshot list --limit 10

List snapshots filtered by label
$ stackit volume snapshot list --label-selector key1=value1
```

### Options

```
-h, --help Help for "stackit volume snapshot list"
--label-selector string Filter snapshots 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 snapshot](./stackit_volume_snapshot.md) - Provides functionality for snapshots

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

Updates a snapshot

### Synopsis

Updates a snapshot by its ID.

```
stackit volume snapshot update SNAPSHOT_ID [flags]
```

### Examples

```
Update a snapshot name with ID "xxx"
$ stackit volume snapshot update xxx --name my-new-name

Update a snapshot labels with ID "xxx"
$ stackit volume snapshot update xxx --labels key1=value1,key2=value2
```

### Options

```
-h, --help Help for "stackit volume snapshot update"
--labels stringToString Key-value string pairs as labels (default [])
--name string Name of the 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 snapshot](./stackit_volume_snapshot.md) - Provides functionality for snapshots

8 changes: 2 additions & 6 deletions internal/cmd/volume/backup/update/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stackitcloud/stackit-cli/internal/cmd/params"
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
Expand Down Expand Up @@ -68,12 +69,7 @@ func fixtureRequest(mods ...func(request *iaas.ApiUpdateBackupRequest)) iaas.Api
payload := iaas.NewUpdateBackupPayloadWithDefaults()
payload.Name = &testName

// Convert test labels to map[string]interface{}
labelsMap := map[string]interface{}{}
for k, v := range testLabels {
labelsMap[k] = v
}
payload.Labels = &labelsMap
payload.Labels = utils.ConvertStringMapToInterfaceMap(utils.Ptr(testLabels))

request = request.UpdateBackupPayload(*payload)
for _, mod := range mods {
Expand Down
Loading
Loading