Skip to content

Commit

Permalink
Add commands to attach/detach public IP from servers (#518)
Browse files Browse the repository at this point in the history
* feat: Add server public IP attach/detach commands

* feat: Generate docs

* fix: Linter

* feat: Improve comment

* feat: Improve unit test

* feat: Improvement after review

* feat: Remove --details flag from server describe
  • Loading branch information
joaopalet authored Dec 3, 2024
1 parent 4ee0f0e commit d01bfef
Show file tree
Hide file tree
Showing 65 changed files with 1,053 additions and 148 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ project-tools:

# Lint
lint-golangci-lint:
@echo "Linting with golangci-lint"
@echo ">> Linting with golangci-lint"
@golangci-lint run ${GOLANG_CI_ARGS}

lint-yamllint:
@echo "Linting with yamllint"
@echo ">> Linting with yamllint"
@yamllint -c .yamllint.yaml .

lint: lint-golangci-lint lint-yamllint

# Test
test:
@echo "Running tests for the CLI application"
@echo ">> Running tests for the CLI application"
@go test ./... -count=1

# Generate docs
generate-docs:
@echo "Generating docs..."
@echo ">> Generating docs..."
@go run $(SCRIPTS_BASE)/generate.go
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,28 @@ Help is available for any command by specifying the special flag `--help` (or si

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.

| Service | CLI Commands | Status |
| ---------------------------------- |----------------------------------------------------------------| ------------------------- |
| Observability | `observability` | :white_check_mark: |
| Infrastructure as a Service (IaaS) | `beta network-area` <br/> `beta network` <br/> `beta volume` <br/> `beta network-interface`| :white_check_mark: (beta) |
| Authorization | `project`, `organization` | :white_check_mark: |
| DNS | `dns` | :white_check_mark: |
| Kubernetes Engine (SKE) | `ske` | :white_check_mark: |
| Load Balancer | `load-balancer` | :white_check_mark: |
| LogMe | `logme` | :white_check_mark: |
| MariaDB | `mariadb` | :white_check_mark: |
| MongoDB Flex | `mongodbflex` | :white_check_mark: |
| Object Storage | `object-storage` | :white_check_mark: |
| OpenSearch | `opensearch` | :white_check_mark: |
| PostgreSQL Flex | `postgresflex` | :white_check_mark: |
| RabbitMQ | `rabbitmq` | :white_check_mark: |
| Redis | `redis` | :white_check_mark: |
| Resource Manager | `project` | :white_check_mark: |
| Secrets Manager | `secrets-manager` | :white_check_mark: |
| Server Backup Management | `beta server backup` | :white_check_mark: (beta) |
| Server Command (Run Command) | `beta server command` | :white_check_mark: (beta) |
| Service Account | `service-account` | :white_check_mark: |
| SQLServer Flex | `beta sqlserverflex` | :white_check_mark: (beta) |
| Service | CLI Commands | Status |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------- |
| Observability | `observability` | :white_check_mark: |
| Infrastructure as a Service (IaaS) | `beta network-area` <br/> `beta network` <br/> `beta volume` <br/> `beta network-interface` <br/> `beta server` | :white_check_mark: (beta) |
| Authorization | `project`, `organization` | :white_check_mark: |
| DNS | `dns` | :white_check_mark: |
| Kubernetes Engine (SKE) | `ske` | :white_check_mark: |
| Load Balancer | `load-balancer` | :white_check_mark: |
| LogMe | `logme` | :white_check_mark: |
| MariaDB | `mariadb` | :white_check_mark: |
| MongoDB Flex | `mongodbflex` | :white_check_mark: |
| Object Storage | `object-storage` | :white_check_mark: |
| OpenSearch | `opensearch` | :white_check_mark: |
| PostgreSQL Flex | `postgresflex` | :white_check_mark: |
| RabbitMQ | `rabbitmq` | :white_check_mark: |
| Redis | `redis` | :white_check_mark: |
| Resource Manager | `project` | :white_check_mark: |
| Secrets Manager | `secrets-manager` | :white_check_mark: |
| Server Backup Management | `beta server backup` | :white_check_mark: (beta) |
| Server Command (Run Command) | `beta server command` | :white_check_mark: (beta) |
| Service Account | `service-account` | :white_check_mark: |
| SQLServer Flex | `beta sqlserverflex` | :white_check_mark: (beta) |

## Authentication

Expand Down
8 changes: 4 additions & 4 deletions docs/stackit_beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ stackit beta [flags]
### SEE ALSO

* [stackit](./stackit.md) - Manage STACKIT resources using the command line
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for Network
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for networks
* [stackit beta network-area](./stackit_beta_network-area.md) - Provides functionality for STACKIT Network Area (SNA)
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for network interfaces
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for servers
* [stackit beta sqlserverflex](./stackit_beta_sqlserverflex.md) - Provides functionality for SQLServer Flex
* [stackit beta volume](./stackit_beta_volume.md) - Provides functionality for Volume
* [stackit beta volume](./stackit_beta_volume.md) - Provides functionality for volumes

4 changes: 2 additions & 2 deletions docs/stackit_beta_network-interface.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta network-interface

Provides functionality for Network Interface
Provides functionality for network interfaces

### Synopsis

Provides functionality for Network Interface.
Provides functionality for network interfaces.

```
stackit beta network-interface [flags]
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_beta_network-interface_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ stackit beta network-interface create [flags]

### SEE ALSO

* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for network interfaces

2 changes: 1 addition & 1 deletion docs/stackit_beta_network-interface_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ stackit beta network-interface delete [flags]

### SEE ALSO

* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for network interfaces

2 changes: 1 addition & 1 deletion docs/stackit_beta_network-interface_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ stackit beta network-interface describe [flags]

### SEE ALSO

* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for network interfaces

2 changes: 1 addition & 1 deletion docs/stackit_beta_network-interface_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ stackit beta network-interface list [flags]

### SEE ALSO

* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for network interfaces

2 changes: 1 addition & 1 deletion docs/stackit_beta_network-interface_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ stackit beta network-interface update [flags]

### SEE ALSO

* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for Network Interface
* [stackit beta network-interface](./stackit_beta_network-interface.md) - Provides functionality for network interfaces

4 changes: 2 additions & 2 deletions docs/stackit_beta_network.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta network

Provides functionality for Network
Provides functionality for networks

### Synopsis

Provides functionality for Network.
Provides functionality for networks.

```
stackit beta network [flags]
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_beta_network_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ stackit beta network create [flags]

### SEE ALSO

* [stackit beta network](./stackit_beta_network.md) - Provides functionality for Network
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for networks

2 changes: 1 addition & 1 deletion docs/stackit_beta_network_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ stackit beta network delete [flags]

### SEE ALSO

* [stackit beta network](./stackit_beta_network.md) - Provides functionality for Network
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for networks

2 changes: 1 addition & 1 deletion docs/stackit_beta_network_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ stackit beta network describe [flags]

### SEE ALSO

* [stackit beta network](./stackit_beta_network.md) - Provides functionality for Network
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for networks

2 changes: 1 addition & 1 deletion docs/stackit_beta_network_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ stackit beta network list [flags]

### SEE ALSO

* [stackit beta network](./stackit_beta_network.md) - Provides functionality for Network
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for networks

2 changes: 1 addition & 1 deletion docs/stackit_beta_network_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ stackit beta network update [flags]

### SEE ALSO

* [stackit beta network](./stackit_beta_network.md) - Provides functionality for Network
* [stackit beta network](./stackit_beta_network.md) - Provides functionality for networks

9 changes: 5 additions & 4 deletions docs/stackit_beta_server.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta server

Provides functionality for Server
Provides functionality for servers

### Synopsis

Provides functionality for Server.
Provides functionality for servers.

```
stackit beta server [flags]
Expand All @@ -29,12 +29,13 @@ stackit beta server [flags]
### SEE ALSO

* [stackit beta](./stackit_beta.md) - Contains beta STACKIT CLI commands
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups
* [stackit beta server command](./stackit_beta_server_command.md) - Provides functionality for Server Command
* [stackit beta server create](./stackit_beta_server_create.md) - Creates a server
* [stackit beta server delete](./stackit_beta_server_delete.md) - Deletes a server
* [stackit beta server describe](./stackit_beta_server_describe.md) - Shows details of a server
* [stackit beta server list](./stackit_beta_server_list.md) - Lists all servers of a project
* [stackit beta server public-ip](./stackit_beta_server_public-ip.md) - Allows attaching/detaching public IPs to servers
* [stackit beta server update](./stackit_beta_server_update.md) - Updates a server
* [stackit beta server volume](./stackit_beta_server_volume.md) - Provides functionality for Server volumes
* [stackit beta server volume](./stackit_beta_server_volume.md) - Provides functionality for server volumes

6 changes: 3 additions & 3 deletions docs/stackit_beta_server_backup.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta server backup

Provides functionality for Server Backup
Provides functionality for server backups

### Synopsis

Provides functionality for Server Backup.
Provides functionality for server backups.

```
stackit beta server backup [flags]
Expand All @@ -28,7 +28,7 @@ stackit beta server backup [flags]

### SEE ALSO

* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for servers
* [stackit beta server backup create](./stackit_beta_server_backup_create.md) - Creates a Server Backup.
* [stackit beta server backup delete](./stackit_beta_server_backup_delete.md) - Deletes a Server Backup.
* [stackit beta server backup describe](./stackit_beta_server_backup_describe.md) - Shows details of a Server Backup
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ stackit beta server backup create [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ stackit beta server backup delete BACKUP_ID [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ stackit beta server backup describe BACKUP_ID [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_disable.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ stackit beta server backup disable [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_enable.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ stackit beta server backup enable [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ stackit beta server backup list [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ stackit beta server backup restore BACKUP_ID [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stackit beta server backup schedule [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups
* [stackit beta server backup schedule create](./stackit_beta_server_backup_schedule_create.md) - Creates a Server Backup Schedule
* [stackit beta server backup schedule delete](./stackit_beta_server_backup_schedule_delete.md) - Deletes a Server Backup Schedule
* [stackit beta server backup schedule describe](./stackit_beta_server_backup_schedule_describe.md) - Shows details of a Server Backup Schedule
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_beta_server_backup_volume-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stackit beta server backup volume-backup [flags]

### SEE ALSO

* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for server backups
* [stackit beta server backup volume-backup delete](./stackit_beta_server_backup_volume-backup_delete.md) - Deletes a Server Volume Backup.
* [stackit beta server backup volume-backup restore](./stackit_beta_server_backup_volume-backup_restore.md) - Restore a Server Volume Backup to a volume.

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_command.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stackit beta server command [flags]

### SEE ALSO

* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for servers
* [stackit beta server command create](./stackit_beta_server_command_create.md) - Creates a Server Command
* [stackit beta server command describe](./stackit_beta_server_command_describe.md) - Shows details of a Server Command
* [stackit beta server command list](./stackit_beta_server_command_list.md) - Lists all server commands
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_beta_server_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ stackit beta server create [flags]

### SEE ALSO

* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for servers

2 changes: 1 addition & 1 deletion docs/stackit_beta_server_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ stackit beta server delete [flags]

### SEE ALSO

* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for servers

8 changes: 2 additions & 6 deletions docs/stackit_beta_server_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ stackit beta server describe [flags]
Show details of a server with ID "xxx"
$ stackit beta server describe xxx
Show detailed information of a server with ID "xxx"
$ stackit beta server describe xxx --details
Show details of a server with ID "xxx" in JSON format
$ stackit beta server describe xxx --output-format json
```

### Options

```
--details Show detailed information about server
-h, --help Help for "stackit beta server describe"
-h, --help Help for "stackit beta server describe"
```

### Options inherited from parent commands
Expand All @@ -42,5 +38,5 @@ stackit beta server describe [flags]

### SEE ALSO

* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
* [stackit beta server](./stackit_beta_server.md) - Provides functionality for servers

Loading

0 comments on commit d01bfef

Please sign in to comment.