Skip to content

Commit 2c23827

Browse files
committed
Onboard IaaS server volume commands
Supported commands: attach, detach, list, describe, update Signed-off-by: Alexander Dahmen <[email protected]>
1 parent a1aed69 commit 2c23827

19 files changed

+2228
-0
lines changed

docs/stackit_beta_server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ stackit beta server [flags]
3636
* [stackit beta server describe](./stackit_beta_server_describe.md) - Shows details of a server
3737
* [stackit beta server list](./stackit_beta_server_list.md) - Lists all servers of a project
3838
* [stackit beta server update](./stackit_beta_server_update.md) - Updates a server
39+
* [stackit beta server volume](./stackit_beta_server_volume.md) - Provides functionality for Server volumes
3940

docs/stackit_beta_server_volume.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stackit beta server volume
2+
3+
Provides functionality for Server volumes
4+
5+
### Synopsis
6+
7+
Provides functionality for Server volumes.
8+
9+
```
10+
stackit beta server volume [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit beta server volume"
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-y, --assume-yes If set, skips all confirmation prompts
23+
--async If set, runs the command asynchronously
24+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
25+
-p, --project-id string Project ID
26+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
27+
```
28+
29+
### SEE ALSO
30+
31+
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
32+
* [stackit beta server volume attach](./stackit_beta_server_volume_attach.md) - Attaches a volume to a server
33+
* [stackit beta server volume describe](./stackit_beta_server_volume_describe.md) - Describes a server volume attachment
34+
* [stackit beta server volume detach](./stackit_beta_server_volume_detach.md) - Detaches a volume from a server
35+
* [stackit beta server volume list](./stackit_beta_server_volume_list.md) - Lists all server volumes
36+
* [stackit beta server volume update](./stackit_beta_server_volume_update.md) - Updates an attached volume of a server
37+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## stackit beta server volume attach
2+
3+
Attaches a volume to a server
4+
5+
### Synopsis
6+
7+
Attaches a volume to a server.
8+
9+
```
10+
stackit beta server volume attach [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Attach a volume with ID "xxx" to a server with ID "yyy"
17+
$ stackit beta server volume attach xxx --server-id yyy
18+
19+
Attach a volume with ID "xxx" to a server with ID "yyy" and enable deletion on termination
20+
$ stackit beta server volume attach xxx --server-id yyy --delete-on-termination
21+
```
22+
23+
### Options
24+
25+
```
26+
-b, --delete-on-termination Delete the volume during the termination of the server. (default false)
27+
-h, --help Help for "stackit beta server volume attach"
28+
--server-id string Server ID
29+
```
30+
31+
### Options inherited from parent commands
32+
33+
```
34+
-y, --assume-yes If set, skips all confirmation prompts
35+
--async If set, runs the command asynchronously
36+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
37+
-p, --project-id string Project ID
38+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
39+
```
40+
41+
### SEE ALSO
42+
43+
* [stackit beta server volume](./stackit_beta_server_volume.md) - Provides functionality for Server volumes
44+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## stackit beta server volume describe
2+
3+
Describes a server volume attachment
4+
5+
### Synopsis
6+
7+
Describes a server volume attachment.
8+
9+
```
10+
stackit beta server volume describe [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Get details of the attachment of volume with ID "xxx" to server with ID "yyy"
17+
$ stackit beta server volume describe xxx --server-id yyy
18+
19+
Get details of the attachment of volume with ID "xxx" to server with ID "yyy" in JSON format
20+
$ stackit beta server volume describe xxx --server-id yyy --output-format json
21+
22+
Get details of the attachment of volume with ID "xxx" to server with ID "yyy" in yaml format
23+
$ stackit beta server volume describe xxx --server-id yyy --output-format yaml
24+
```
25+
26+
### Options
27+
28+
```
29+
-h, --help Help for "stackit beta server volume describe"
30+
--server-id string Server ID
31+
```
32+
33+
### Options inherited from parent commands
34+
35+
```
36+
-y, --assume-yes If set, skips all confirmation prompts
37+
--async If set, runs the command asynchronously
38+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
39+
-p, --project-id string Project ID
40+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
41+
```
42+
43+
### SEE ALSO
44+
45+
* [stackit beta server volume](./stackit_beta_server_volume.md) - Provides functionality for Server volumes
46+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## stackit beta server volume detach
2+
3+
Detaches a volume from a server
4+
5+
### Synopsis
6+
7+
Detaches a volume from a server.
8+
9+
```
10+
stackit beta server volume detach [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Detaches a volume with ID "xxx" from a server with ID "yyy"
17+
$ stackit beta server volume detach xxx --server-id yyy
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit beta server volume detach"
24+
--server-id string Server ID
25+
```
26+
27+
### Options inherited from parent commands
28+
29+
```
30+
-y, --assume-yes If set, skips all confirmation prompts
31+
--async If set, runs the command asynchronously
32+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
33+
-p, --project-id string Project ID
34+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
35+
```
36+
37+
### SEE ALSO
38+
39+
* [stackit beta server volume](./stackit_beta_server_volume.md) - Provides functionality for Server volumes
40+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## stackit beta server volume list
2+
3+
Lists all server volumes
4+
5+
### Synopsis
6+
7+
Lists all server volumes.
8+
9+
```
10+
stackit beta server volume list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
List all volumes for a server with ID "xxx"
17+
$ stackit beta server volume list --server-id xxx
18+
19+
List all volumes for a server with ID "xxx" in JSON format
20+
$ stackit beta server volumes list --server-id xxx --output-format json
21+
```
22+
23+
### Options
24+
25+
```
26+
-h, --help Help for "stackit beta server volume list"
27+
-s, --server-id string Server ID
28+
```
29+
30+
### Options inherited from parent commands
31+
32+
```
33+
-y, --assume-yes If set, skips all confirmation prompts
34+
--async If set, runs the command asynchronously
35+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
36+
-p, --project-id string Project ID
37+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
38+
```
39+
40+
### SEE ALSO
41+
42+
* [stackit beta server volume](./stackit_beta_server_volume.md) - Provides functionality for Server volumes
43+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## stackit beta server volume update
2+
3+
Updates an attached volume of a server
4+
5+
### Synopsis
6+
7+
Updates an attached volume of a server.
8+
9+
```
10+
stackit beta server volume update [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Update a volume with ID "xxx" of a server with ID "yyy" and enables delete on termination
17+
$ stackit beta server volume update xxx --server-id yyy --delete-on-termination
18+
```
19+
20+
### Options
21+
22+
```
23+
-b, --delete-on-termination Delete the volume during the termination of the server. (default false)
24+
-h, --help Help for "stackit beta server volume update"
25+
--server-id string Server ID
26+
```
27+
28+
### Options inherited from parent commands
29+
30+
```
31+
-y, --assume-yes If set, skips all confirmation prompts
32+
--async If set, runs the command asynchronously
33+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
34+
-p, --project-id string Project ID
35+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
36+
```
37+
38+
### SEE ALSO
39+
40+
* [stackit beta server volume](./stackit_beta_server_volume.md) - Provides functionality for Server volumes
41+

internal/cmd/beta/server/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server/describe"
99
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server/list"
1010
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server/update"
11+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server/volume"
1112
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
1213
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
1314
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
@@ -35,4 +36,5 @@ func addSubcommands(cmd *cobra.Command, p *print.Printer) {
3536
cmd.AddCommand(describe.NewCmd(p))
3637
cmd.AddCommand(list.NewCmd(p))
3738
cmd.AddCommand(update.NewCmd(p))
39+
cmd.AddCommand(volume.NewCmd(p))
3840
}

0 commit comments

Comments
 (0)