Skip to content

Commit 49589d5

Browse files
GokceGKFyusel
andauthored
Onboard IaaS security group rule commands (#523)
* onboard security group rule commands * fix NPE * Update internal/cmd/beta/security-group-rule/create/create.go Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de> * Update internal/cmd/beta/security-group-rule/create/create.go Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de> * Update internal/cmd/beta/security-group-rule/list/list.go Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de> * Update internal/cmd/beta/security-group-rule/create/create_test.go Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de> * fix unit tests * Update internal/cmd/beta/security-group-rule/delete/delete_test.go Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de> * Update internal/cmd/beta/security-group-rule/delete/delete_test.go Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de> * Update internal/cmd/beta/security-group-rule/delete/delete_test.go Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de> * fix unit tests * update docs * fix linter issues * fix unit tests * apply acceptance feedbacks * add check for protocol if port range info is provided * changed the flag description * remove the flag control (api errors are sufficient) * edit flag descriptions --------- Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 9324319 commit 49589d5

21 files changed

+2271
-36
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,28 @@ Help is available for any command by specifying the special flag `--help` (or si
6565

6666
Below you can find a list of the STACKIT services already available in the CLI (along with their respective command names) and the ones that are currently planned to be integrated.
6767

68-
| Service | CLI Commands | Status |
69-
| ---------------------------------- |----------------------------------------------------------------------------------------------------------------------| ------------------------- |
70-
| Observability | `observability` | :white_check_mark: |
71-
| Infrastructure as a Service (IaaS) | `beta network-area` <br/> `beta network` <br/> `beta volume` <br/> `beta network-interface` <br/> `beta public-ip` <br/> `beta key-pair` | :white_check_mark: (beta) |
72-
| Authorization | `project`, `organization` | :white_check_mark: |
73-
| DNS | `dns` | :white_check_mark: |
74-
| Kubernetes Engine (SKE) | `ske` | :white_check_mark: |
75-
| Load Balancer | `load-balancer` | :white_check_mark: |
76-
| LogMe | `logme` | :white_check_mark: |
77-
| MariaDB | `mariadb` | :white_check_mark: |
78-
| MongoDB Flex | `mongodbflex` | :white_check_mark: |
79-
| Object Storage | `object-storage` | :white_check_mark: |
80-
| OpenSearch | `opensearch` | :white_check_mark: |
81-
| PostgreSQL Flex | `postgresflex` | :white_check_mark: |
82-
| RabbitMQ | `rabbitmq` | :white_check_mark: |
83-
| Redis | `redis` | :white_check_mark: |
84-
| Resource Manager | `project` | :white_check_mark: |
85-
| Secrets Manager | `secrets-manager` | :white_check_mark: |
86-
| Server Backup Management | `beta server backup` | :white_check_mark: (beta) |
87-
| Server Command (Run Command) | `beta server command` | :white_check_mark: (beta) |
88-
| Service Account | `service-account` | :white_check_mark: |
89-
| SQLServer Flex | `beta sqlserverflex` | :white_check_mark: (beta) |
68+
| Service | CLI Commands | Status |
69+
| ---------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------| ------------------------- |
70+
| Observability | `observability` | :white_check_mark: |
71+
| Infrastructure as a Service (IaaS) | `beta network-area` <br/> `beta network` <br/> `beta volume` <br/> `beta network-interface` <br/> `beta public-ip` <br/> `beta security-group` <br/> `beta key-pair` | :white_check_mark: (beta) |
72+
| Authorization | `project`, `organization` | :white_check_mark: |
73+
| DNS | `dns` | :white_check_mark: |
74+
| Kubernetes Engine (SKE) | `ske` | :white_check_mark: |
75+
| Load Balancer | `load-balancer` | :white_check_mark: |
76+
| LogMe | `logme` | :white_check_mark: |
77+
| MariaDB | `mariadb` | :white_check_mark: |
78+
| MongoDB Flex | `mongodbflex` | :white_check_mark: |
79+
| Object Storage | `object-storage` | :white_check_mark: |
80+
| OpenSearch | `opensearch` | :white_check_mark: |
81+
| PostgreSQL Flex | `postgresflex` | :white_check_mark: |
82+
| RabbitMQ | `rabbitmq` | :white_check_mark: |
83+
| Redis | `redis` | :white_check_mark: |
84+
| Resource Manager | `project` | :white_check_mark: |
85+
| Secrets Manager | `secrets-manager` | :white_check_mark: |
86+
| Server Backup Management | `beta server backup` | :white_check_mark: (beta) |
87+
| Server Command (Run Command) | `beta server command` | :white_check_mark: (beta) |
88+
| Service Account | `service-account` | :white_check_mark: |
89+
| SQLServer Flex | `beta sqlserverflex` | :white_check_mark: (beta) |
9090

9191
## Authentication
9292

docs/stackit_beta.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ stackit beta [flags]
4545
* [stackit beta network-area](./stackit_beta_network-area.md) - Provides functionality for STACKIT Network Area (SNA)
4646
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for network interfaces
4747
* [stackit beta public-ip](./stackit_beta_public-ip.md) - Provides functionality for public IPs
48+
* [stackit beta security-group](./stackit_beta_security-group.md) - Provides functionality for security groups
4849
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for servers
4950
* [stackit beta sqlserverflex](./stackit_beta_sqlserverflex.md) - Provides functionality for SQLServer Flex
5051
* [stackit beta volume](./stackit_beta_volume.md) - Provides functionality for volumes
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## stackit beta security-group
2+
3+
Provides functionality for security groups
4+
5+
### Synopsis
6+
7+
Provides functionality for security groups.
8+
9+
```
10+
stackit beta security-group [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit beta security-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+
--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 security-group rule](./stackit_beta_security-group_rule.md) - Provides functionality for security group rules
33+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## stackit beta security-group rule
2+
3+
Provides functionality for security group rules
4+
5+
### Synopsis
6+
7+
Provides functionality for security group rules.
8+
9+
```
10+
stackit beta security-group rule [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit beta security-group rule"
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 security-group](./stackit_beta_security-group.md) - Provides functionality for security groups
32+
* [stackit beta security-group rule create](./stackit_beta_security-group_rule_create.md) - Creates a security group rule
33+
* [stackit beta security-group rule delete](./stackit_beta_security-group_rule_delete.md) - Deletes a security group rule
34+
* [stackit beta security-group rule describe](./stackit_beta_security-group_rule_describe.md) - Shows details of a security group rule
35+
* [stackit beta security-group rule list](./stackit_beta_security-group_rule_list.md) - Lists all security group rules in a security group of a project
36+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## stackit beta security-group rule create
2+
3+
Creates a security group rule
4+
5+
### Synopsis
6+
7+
Creates a security group rule.
8+
9+
```
10+
stackit beta security-group rule create [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Create a security group rule for security group with ID "xxx" with direction "ingress"
17+
$ stackit beta security-group rule create --security-group-id xxx --direction ingress
18+
19+
Create a security group rule for security group with ID "xxx" with direction "egress", protocol "icmp" and icmp parameters
20+
$ stackit beta security-group rule create --security-group-id xxx --direction egress --protocol-name icmp --icmp-parameter-code 0 --icmp-parameter-type 8
21+
22+
Create a security group rule for security group with ID "xxx" with direction "ingress", protocol "tcp" and port range values
23+
$ stackit beta security-group rule create --security-group-id xxx --direction ingress --protocol-name tcp --port-range-max 24 --port-range-min 22
24+
25+
Create a security group rule for security group with ID "xxx" with direction "ingress" and protocol number 1
26+
$ stackit beta security-group rule create --security-group-id xxx --direction ingress --protocol-number 1
27+
```
28+
29+
### Options
30+
31+
```
32+
--description string The rule description
33+
--direction string The direction of the traffic which the rule should match. The possible values are: "ingress", "egress"
34+
--ether-type string The ethertype which the rule should match
35+
-h, --help Help for "stackit beta security-group rule create"
36+
--icmp-parameter-code int ICMP code. Can be set if the protocol is ICMP
37+
--icmp-parameter-type int ICMP type. Can be set if the protocol is ICMP
38+
--ip-range string The remote IP range which the rule should match
39+
--port-range-max int The maximum port number. Should be greater or equal to the minimum. This should only be provided if the protocol is not ICMP
40+
--port-range-min int The minimum port number. Should be less or equal to the maximum. This should only be provided if the protocol is not ICMP
41+
--protocol-name string The protocol name which the rule should match. If a protocol is to be defined, either "protocol-name" or "protocol-number" must be provided
42+
--protocol-number int The protocol number which the rule should match. If a protocol is to be defined, either "protocol-name" or "protocol-number" must be provided
43+
--remote-security-group-id string The remote security group which the rule should match
44+
--security-group-id string The security group ID
45+
```
46+
47+
### Options inherited from parent commands
48+
49+
```
50+
-y, --assume-yes If set, skips all confirmation prompts
51+
--async If set, runs the command asynchronously
52+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
53+
-p, --project-id string Project ID
54+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
55+
```
56+
57+
### SEE ALSO
58+
59+
* [stackit beta security-group rule](./stackit_beta_security-group_rule.md) - Provides functionality for security group rules
60+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## stackit beta security-group rule delete
2+
3+
Deletes a security group rule
4+
5+
### Synopsis
6+
7+
Deletes a security group rule.
8+
If the security group rule is still in use, the deletion will fail
9+
10+
11+
```
12+
stackit beta security-group rule delete [flags]
13+
```
14+
15+
### Examples
16+
17+
```
18+
Delete security group rule with ID "xxx" in security group with ID "yyy"
19+
$ stackit beta security-group rule delete xxx --security-group-id yyy
20+
```
21+
22+
### Options
23+
24+
```
25+
-h, --help Help for "stackit beta security-group rule delete"
26+
--security-group-id string The security group ID
27+
```
28+
29+
### Options inherited from parent commands
30+
31+
```
32+
-y, --assume-yes If set, skips all confirmation prompts
33+
--async If set, runs the command asynchronously
34+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
35+
-p, --project-id string Project ID
36+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
37+
```
38+
39+
### SEE ALSO
40+
41+
* [stackit beta security-group rule](./stackit_beta_security-group_rule.md) - Provides functionality for security group rules
42+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## stackit beta security-group rule describe
2+
3+
Shows details of a security group rule
4+
5+
### Synopsis
6+
7+
Shows details of a security group rule.
8+
9+
```
10+
stackit beta security-group rule describe [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Show details of a security group rule with ID "xxx" in security group with ID "yyy"
17+
$ stackit beta security-group rule describe xxx --security-group-id yyy
18+
19+
Show details of a security group rule with ID "xxx" in security group with ID "yyy" in JSON format
20+
$ stackit beta security-group rule describe xxx --security-group-id yyy --output-format json
21+
```
22+
23+
### Options
24+
25+
```
26+
-h, --help Help for "stackit beta security-group rule describe"
27+
--security-group-id string The security group 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 security-group rule](./stackit_beta_security-group_rule.md) - Provides functionality for security group rules
43+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
## stackit beta security-group rule list
2+
3+
Lists all security group rules in a security group of a project
4+
5+
### Synopsis
6+
7+
Lists all security group rules in a security group of a project.
8+
9+
```
10+
stackit beta security-group rule list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Lists all security group rules in security group with ID "xxx"
17+
$ stackit beta security-group rule list --security-group-id xxx
18+
19+
Lists all security group rules in security group with ID "xxx" in JSON format
20+
$ stackit beta security-group rule list --security-group-id xxx --output-format json
21+
22+
Lists up to 10 security group rules in security group with ID "xxx"
23+
$ stackit beta security-group rule list --security-group-id xxx --limit 10
24+
```
25+
26+
### Options
27+
28+
```
29+
-h, --help Help for "stackit beta security-group rule list"
30+
--limit int Maximum number of entries to list
31+
--security-group-id string The security group ID
32+
```
33+
34+
### Options inherited from parent commands
35+
36+
```
37+
-y, --assume-yes If set, skips all confirmation prompts
38+
--async If set, runs the command asynchronously
39+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
40+
-p, --project-id string Project ID
41+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
42+
```
43+
44+
### SEE ALSO
45+
46+
* [stackit beta security-group rule](./stackit_beta_security-group_rule.md) - Provides functionality for security group rules
47+

0 commit comments

Comments
 (0)