Skip to content

Commit bdae139

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

20 files changed

+2471
-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 Interfaces
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 Interfaces
4+
5+
### Synopsis
6+
7+
Provides functionality for Network Interfaces.
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: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 with allowed addresses "1.1.1.1,8.8.8.8,9.9.9.9" with ipv4 address "1.2.3.4" with label "key=value" with name "NAME" with security groups "UUID1,UUID2" with nic security enabled for network with ID "xxx"
17+
$ stackit beta network-interface create --network-id xxx --allowed-addresses "1.1.1.1,8.8.8.8,9.9.9.9" --ipv4 1.2.3.4 --labels key=value --name NAME --security-groups "UUID1,UUID2" --nic-security"
18+
19+
Create a network interface without allowed addresses with ipv4 address "1.2.3.4" with nic security disabled for network with ID "xxx"
20+
$ stackit beta network-interface create --network-id xxx --ipv4 1.2.3.4 --nic-security=false"
21+
22+
Create a network interface with allowed addresses "1.1.1.1,8.8.8.8" with ipv4 address "1.2.3.4" with ipv6 address "2001:0db8:85a3:08d3::0370:7344" with nic security enabled for network with ID "xxx"
23+
$ stackit beta network-interface create --network-id xxx --allowed-addresses "1.1.1.1,8.8.8.8" --ipv4 1.2.3.4 --ipv6 2001:0db8:85a3:08d3::0370:7344"
24+
```
25+
26+
### Options
27+
28+
```
29+
--allowed-addresses strings List of allowed IPs
30+
-h, --help Help for "stackit beta network-interface create"
31+
-i, --ipv4 string IPv4 address
32+
-s, --ipv6 string IPv6 address
33+
--labels stringToString Labels are key-value string pairs which can be attached to a network-interface. A label can be provided with the format key=value and the flag can be used multiple times to provide a list of labels (default [])
34+
-n, --name string Network interface name
35+
--network-id string Network ID
36+
-b, --nic-security If this is set to false, then no security groups will apply to this network interface. (default true)
37+
--security-groups strings List of security groups
38+
```
39+
40+
### Options inherited from parent commands
41+
42+
```
43+
-y, --assume-yes If set, skips all confirmation prompts
44+
--async If set, runs the command asynchronously
45+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
46+
-p, --project-id string Project ID
47+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
48+
```
49+
50+
### SEE ALSO
51+
52+
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interfaces
53+
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 Interfaces
40+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit beta network-interface describe"
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 Interfaces
40+
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 Interfaces
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" with new allowed addresses "1.1.1.1,8.8.8.8,9.9.9.9" and with new label "key=value"
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"
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" with security groups removed and with nic-security disabled
23+
$ stackit beta network-interface update xxx --network-id yyy --nic-security=false --security-groups """
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. A label can be provided with the format key=value and the flag can be used multiple times to provide a list of labels (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 Interfaces
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)