Skip to content

Commit 1f768c6

Browse files
committed
Onboard IaaS network interface command
Supported subcommands: create, delete, update, list, describe Signed-off-by: Alexander Dahmen <[email protected]>
1 parent a958145 commit 1f768c6

20 files changed

+2451
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Below you can find a list of the STACKIT services already available in the CLI (
6868
| Service | CLI Commands | Status |
6969
| ---------------------------------- |----------------------------------------------------------------| ------------------------- |
7070
| Observability | `observability` | :white_check_mark: |
71-
| Infrastructure as a Service (IaaS) | `beta network-area` <br/> `beta network` <br/> `beta volume` | :white_check_mark: (beta) |
71+
| Infrastructure as a Service (IaaS) | `beta network-area` <br/> `beta network` <br/> `beta volume` <br/> `beta network-interface`| :white_check_mark: (beta) |
7272
| Authorization | `project`, `organization` | :white_check_mark: |
7373
| DNS | `dns` | :white_check_mark: |
7474
| Kubernetes Engine (SKE) | `ske` | :white_check_mark: |

docs/stackit_beta.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ stackit beta [flags]
4242
* [stackit](./stackit.md) - Manage STACKIT resources using the command line
4343
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for Network
4444
* [stackit beta network-area](./stackit_beta_network-area.md) - Provides functionality for STACKIT Network Area (SNA)
45+
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
4546
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
4647
* [stackit beta sqlserverflex](./stackit_beta_sqlserverflex.md) - Provides functionality for SQLServer Flex
4748
* [stackit beta volume](./stackit_beta_volume.md) - Provides functionality for Volume
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stackit beta network-interface
2+
3+
Provides functionality for Network Interface
4+
5+
### Synopsis
6+
7+
Provides functionality for Network Interface.
8+
9+
```
10+
stackit beta network-interface [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit beta network-interface"
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](./stackit_beta.md) - Contains beta STACKIT CLI commands
32+
* [stackit beta network-interface create](./stackit_beta_network-interface_create.md) - Creates a network interface
33+
* [stackit beta network-interface delete](./stackit_beta_network-interface_delete.md) - Deletes a network interface
34+
* [stackit beta network-interface describe](./stackit_beta_network-interface_describe.md) - Describes a network interface
35+
* [stackit beta network-interface list](./stackit_beta_network-interface_list.md) - Lists all network interfaces of a network
36+
* [stackit beta network-interface update](./stackit_beta_network-interface_update.md) - Updates a network interface
37+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## stackit beta network-interface create
2+
3+
Creates a network interface
4+
5+
### Synopsis
6+
7+
Creates a network interface.
8+
9+
```
10+
stackit beta network-interface create [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Create a network interface for network with ID "xxx"
17+
$ stackit beta network-interface create --network-id xxx
18+
19+
Create a network interface with allowed addresses, labels, a name, security groups and nic security enabled for network with ID "xxx"
20+
$ stackit beta network-interface create --network-id xxx --allowed-addresses "1.1.1.1,8.8.8.8,9.9.9.9" --labels key=value,key2=value2 --name NAME --security-groups "UUID1,UUID2" --nic-security
21+
```
22+
23+
### Options
24+
25+
```
26+
--allowed-addresses strings List of allowed IPs
27+
-h, --help Help for "stackit beta network-interface create"
28+
-i, --ipv4 string IPv4 address
29+
-s, --ipv6 string IPv6 address
30+
--labels stringToString Labels are key-value string pairs which can be attached to a network-interface. E.g. '--labels key1=value1,key2=value2,...' (default [])
31+
-n, --name string Network interface name
32+
--network-id string Network ID
33+
-b, --nic-security If this is set to false, then no security groups will apply to this network interface. (default true)
34+
--security-groups strings List of security groups
35+
```
36+
37+
### Options inherited from parent commands
38+
39+
```
40+
-y, --assume-yes If set, skips all confirmation prompts
41+
--async If set, runs the command asynchronously
42+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
43+
-p, --project-id string Project ID
44+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
45+
```
46+
47+
### SEE ALSO
48+
49+
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
50+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## stackit beta network-interface delete
2+
3+
Deletes a network interface
4+
5+
### Synopsis
6+
7+
Deletes a network interface.
8+
9+
```
10+
stackit beta network-interface delete [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Delete network interface with nic id "xxx" and network ID "yyy"
17+
$ stackit beta network-interface delete xxx --network-id yyy
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit beta network-interface delete"
24+
--network-id string Network 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 network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
40+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## stackit beta network-interface describe
2+
3+
Describes a network interface
4+
5+
### Synopsis
6+
7+
Describes a network interface.
8+
9+
```
10+
stackit beta network-interface describe [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Describes network interface with nic id "xxx" and network ID "yyy"
17+
$ stackit beta network-interface describe xxx --network-id yyy
18+
19+
Describes network interface with nic id "xxx" and network ID "yyy" in JSON format
20+
$ stackit beta network-interface describe xxx --network-id yyy --output-format json
21+
22+
Describes network interface with nic id "xxx" and network ID "yyy" in yaml format
23+
$ stackit beta network-interface describe xxx --network-id yyy --output-format yaml
24+
```
25+
26+
### Options
27+
28+
```
29+
-h, --help Help for "stackit beta network-interface describe"
30+
--network-id string Network 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 network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
46+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## stackit beta network-interface list
2+
3+
Lists all network interfaces of a network
4+
5+
### Synopsis
6+
7+
Lists all network interfaces of a network.
8+
9+
```
10+
stackit beta network-interface list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Lists all network interfaces with network ID "xxx"
17+
$ stackit beta network-interface list --network-id xxx
18+
19+
Lists all network interfaces with network ID "xxx" which contains the label xxx
20+
$ stackit beta network-interface list --network-id xxx --label-selector xxx
21+
22+
Lists all network interfaces with network ID "xxx" in JSON format
23+
$ stackit beta network-interface list --network-id xxx --output-format json
24+
25+
Lists up to 10 network interfaces with network ID "xxx"
26+
$ stackit beta network-interface list --network-id xxx --limit 10
27+
```
28+
29+
### Options
30+
31+
```
32+
-h, --help Help for "stackit beta network-interface list"
33+
--label-selector string Filter by label
34+
--limit int Maximum number of entries to list
35+
--network-id string Network ID
36+
```
37+
38+
### Options inherited from parent commands
39+
40+
```
41+
-y, --assume-yes If set, skips all confirmation prompts
42+
--async If set, runs the command asynchronously
43+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
44+
-p, --project-id string Project ID
45+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
46+
```
47+
48+
### SEE ALSO
49+
50+
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
51+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## stackit beta network-interface update
2+
3+
Updates a network interface
4+
5+
### Synopsis
6+
7+
Updates a network interface.
8+
9+
```
10+
stackit beta network-interface update [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Updates a network interface with nic id "xxx" and network-id "yyy" to new allowed addresses "1.1.1.1,8.8.8.8,9.9.9.9" and new labels "key=value,key2=value2"
17+
$ stackit beta network-interface update xxx --network-id yyy --allowed-addresses "1.1.1.1,8.8.8.8,9.9.9.9" --labels key=value,key2=value2
18+
19+
Updates a network interface with nic id "xxx" and network-id "yyy" with new name "nic-name-new"
20+
$ stackit beta network-interface update xxx --network-id yyy --name nic-name-new
21+
22+
Updates a network interface with nic id "xxx" and network-id "yyy" to include the security group "zzz"
23+
$ stackit beta network-interface update xxx --network-id yyy --security-groups zzz
24+
```
25+
26+
### Options
27+
28+
```
29+
--allowed-addresses strings List of allowed IPs
30+
-h, --help Help for "stackit beta network-interface 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+
-n, --name string Network interface name
33+
--network-id string Network ID
34+
-b, --nic-security If this is set to false, then no security groups will apply to this network interface. (default true)
35+
--security-groups strings List of security groups
36+
```
37+
38+
### Options inherited from parent commands
39+
40+
```
41+
-y, --assume-yes If set, skips all confirmation prompts
42+
--async If set, runs the command asynchronously
43+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
44+
-p, --project-id string Project ID
45+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
46+
```
47+
48+
### SEE ALSO
49+
50+
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
51+

internal/cmd/beta/beta.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/network"
77
networkArea "github.com/stackitcloud/stackit-cli/internal/cmd/beta/network-area"
8+
networkinterface "github.com/stackitcloud/stackit-cli/internal/cmd/beta/network-interface"
89
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server"
910
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex"
1011
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/volume"
@@ -44,4 +45,5 @@ func addSubcommands(cmd *cobra.Command, p *print.Printer) {
4445
cmd.AddCommand(networkArea.NewCmd(p))
4546
cmd.AddCommand(network.NewCmd(p))
4647
cmd.AddCommand(volume.NewCmd(p))
48+
cmd.AddCommand(networkinterface.NewCmd(p))
4749
}

0 commit comments

Comments
 (0)