Skip to content

Commit 2cab8b4

Browse files
committed
Onboard affinity-group command
- create - delete AFFINITY_GROUP_ID - describe AFFINITY_GROUP_ID - list
1 parent 1390b50 commit 2cab8b4

20 files changed

+1710
-23
lines changed

docs/stackit_beta.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ stackit beta [flags]
4141
### SEE ALSO
4242

4343
* [stackit](./stackit.md) - Manage STACKIT resources using the command line
44+
* [stackit beta affinity-group](./stackit_beta_affinity-group.md) - Manage server affinity groups
4445
* [stackit beta image](./stackit_beta_image.md) - Manage server images
4546
* [stackit beta key-pair](./stackit_beta_key-pair.md) - Provides functionality for SSH key pairs
4647
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for networks
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stackit beta affinity-group
2+
3+
Manage server affinity groups
4+
5+
### Synopsis
6+
7+
Manage the lifecycle of server affinity groups.
8+
9+
```
10+
stackit beta affinity-group [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit beta affinity-group"
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+
--region string Target region for region-specific requests
27+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
28+
```
29+
30+
### SEE ALSO
31+
32+
* [stackit beta](./stackit_beta.md) - Contains beta STACKIT CLI commands
33+
* [stackit beta affinity-group create](./stackit_beta_affinity-group_create.md) - Create affinity groups
34+
* [stackit beta affinity-group delete](./stackit_beta_affinity-group_delete.md) - Delete affinity group
35+
* [stackit beta affinity-group describe](./stackit_beta_affinity-group_describe.md) - Describes affinity group
36+
* [stackit beta affinity-group list](./stackit_beta_affinity-group_list.md) - Lists affinity groups
37+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## stackit beta affinity-group create
2+
3+
Create affinity groups
4+
5+
### Synopsis
6+
7+
Create affinity groups.
8+
9+
```
10+
stackit beta affinity-group create [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Create an affinity group with name "AFFINITY_GROUP_NAME" and policy "soft-affinity"
17+
$ stackit beta affinity-group create --name AFFINITY_GROUP_NAME --policy soft-affinity
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit beta affinity-group create"
24+
--name string The name of the affinity group.
25+
--policy string The policy for the affinity group. Valid values for the policy are: "hard-affinity", "hard-anti-affinity", "soft-affinity", "soft-anti-affinity"
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+
--region string Target region for region-specific requests
36+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
37+
```
38+
39+
### SEE ALSO
40+
41+
* [stackit beta affinity-group](./stackit_beta_affinity-group.md) - Manage server affinity groups
42+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## stackit beta affinity-group delete
2+
3+
Delete affinity group
4+
5+
### Synopsis
6+
7+
Delete affinity group.
8+
9+
```
10+
stackit beta affinity-group delete AFFINITY_GROUP [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Delete an affinity group with ID "xxx"
17+
$ stackit beta affinity-group delete xxx
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit beta affinity-group delete"
24+
```
25+
26+
### Options inherited from parent commands
27+
28+
```
29+
-y, --assume-yes If set, skips all confirmation prompts
30+
--async If set, runs the command asynchronously
31+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
32+
-p, --project-id string Project ID
33+
--region string Target region for region-specific requests
34+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
35+
```
36+
37+
### SEE ALSO
38+
39+
* [stackit beta affinity-group](./stackit_beta_affinity-group.md) - Manage server affinity groups
40+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## stackit beta affinity-group describe
2+
3+
Describes affinity group
4+
5+
### Synopsis
6+
7+
Describes affinity group by it's ID.
8+
9+
```
10+
stackit beta affinity-group describe AFFINITY_GROUP_ID [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Get details about an affinity group with the ID "xxx"
17+
$ stackit beta affinity-group describe xxx
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit beta affinity-group describe"
24+
```
25+
26+
### Options inherited from parent commands
27+
28+
```
29+
-y, --assume-yes If set, skips all confirmation prompts
30+
--async If set, runs the command asynchronously
31+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
32+
-p, --project-id string Project ID
33+
--region string Target region for region-specific requests
34+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
35+
```
36+
37+
### SEE ALSO
38+
39+
* [stackit beta affinity-group](./stackit_beta_affinity-group.md) - Manage server affinity groups
40+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## stackit beta affinity-group list
2+
3+
Lists affinity groups
4+
5+
### Synopsis
6+
7+
Lists affinity groups.
8+
9+
```
10+
stackit beta affinity-group list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
List all affinity groups
17+
$ stackit beta affinity-group list
18+
19+
List the first 5 affinity groups
20+
$ stackit beta affinity-group list --limit=10
21+
```
22+
23+
### Options
24+
25+
```
26+
-h, --help Help for "stackit beta affinity-group list"
27+
--limit int Limit the output to the first n elements
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+
--region string Target region for region-specific requests
38+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
39+
```
40+
41+
### SEE ALSO
42+
43+
* [stackit beta affinity-group](./stackit_beta_affinity-group.md) - Manage server affinity groups
44+

docs/stackit_beta_image_update.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,26 @@ stackit beta image update IMAGE_ID [flags]
2323
### Options
2424

2525
```
26-
--boot-menu Enables the BIOS bootmenu.
27-
--cdrom-bus string Sets CDROM bus controller type.
28-
--disk-bus string Sets Disk bus controller type.
29-
--disk-format string The disk format of the image.
30-
-h, --help Help for "stackit beta image update"
31-
--labels stringToString Labels are key-value string pairs which can be attached to a network-interface. E.g. '--labels key1=value1,key2=value2,...' (default [])
32-
--local-file-path string The path to the local disk image file.
33-
--min-disk-size int Size in Gigabyte.
34-
--min-ram int Size in Megabyte.
35-
--name string The name of the image.
36-
--nic-model string Sets virtual nic model.
37-
--os string Enables OS specific optimizations.
38-
--os-distro string Operating System Distribution.
39-
--os-version string Version of the OS.
40-
--protected Protected VM.
41-
--rescue-bus string Sets the device bus when the image is used as a rescue image.
42-
--rescue-device string Sets the device when the image is used as a rescue image.
43-
--secure-boot Enables Secure Boot.
44-
--uefi Enables UEFI boot.
45-
--video-model string Sets Graphic device model.
46-
--virtio-scsi Enables the use of VirtIO SCSI to provide block device access. By default instances use VirtIO Block.
26+
--boot-menu Enables the BIOS bootmenu.
27+
--cdrom-bus string Sets CDROM bus controller type.
28+
--disk-bus string Sets Disk bus controller type.
29+
--disk-format string The disk format of the image.
30+
-h, --help Help for "stackit beta image update"
31+
--labels stringToString Labels are key-value string pairs which can be attached to a network-interface. E.g. '--labels key1=value1,key2=value2,...' (default [])
32+
--min-disk-size int Size in Gigabyte.
33+
--min-ram int Size in Megabyte.
34+
--name string The name of the image.
35+
--nic-model string Sets virtual nic model.
36+
--os string Enables OS specific optimizations.
37+
--os-distro string Operating System Distribution.
38+
--os-version string Version of the OS.
39+
--protected Protected VM.
40+
--rescue-bus string Sets the device bus when the image is used as a rescue image.
41+
--rescue-device string Sets the device when the image is used as a rescue image.
42+
--secure-boot Enables Secure Boot.
43+
--uefi Enables UEFI boot.
44+
--video-model string Sets Graphic device model.
45+
--virtio-scsi Enables the use of VirtIO SCSI to provide block device access. By default instances use VirtIO Block.
4746
```
4847

4948
### Options inherited from parent commands

docs/stackit_beta_quota_list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Lists quotas
44

55
### Synopsis
66

7-
Lists server quotas.
7+
Lists project quotas.
88

99
```
1010
stackit beta quota list [flags]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package affinity_groups
2+
3+
import (
4+
"github.com/spf13/cobra"
5+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/affinity-groups/create"
6+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/affinity-groups/delete"
7+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/affinity-groups/describe"
8+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/affinity-groups/list"
9+
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
10+
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
11+
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
12+
)
13+
14+
func NewCmd(p *print.Printer) *cobra.Command {
15+
cmd := &cobra.Command{
16+
Use: "affinity-group",
17+
Short: "Manage server affinity groups",
18+
Long: "Manage the lifecycle of server affinity groups.",
19+
Args: args.NoArgs,
20+
Run: utils.CmdHelp,
21+
}
22+
addSubcommands(cmd, p)
23+
return cmd
24+
}
25+
26+
func addSubcommands(cmd *cobra.Command, p *print.Printer) {
27+
cmd.AddCommand(
28+
create.NewCmd(p),
29+
delete.NewCmd(p),
30+
describe.NewCmd(p),
31+
list.NewCmd(p),
32+
)
33+
}

0 commit comments

Comments
 (0)