Skip to content

Commit 0949071

Browse files
vicentepinto98GokceGKstackit-pipelinerenovate-botjoaopalet
authored
Onboard first set of Load Balancer functionality (#260)
* initial setup for the load balancer (#252) * initial setup for the load balancer * generate docs * add load-balancer to set and unset config commands * Onboard Load Balancer generate-payload command (#250) * onboard load-balancer generate-payload command * add go mod * generate docs * remove version from the default payload which will be used for create commands * Update description Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * Update description Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * split create and update payloads * move default create payload to a const * delete unused utils files * update docs * remove redundant var declaration --------- Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com> * LoadBalancer Describe, List and Quota commands (#254) * initial setup for the load balancer * generate docs * Describe, list, quota * Remove duplicate * Uniformize descriptipnm * Add tables for listeners and target pools * Improve column name --------- Co-authored-by: Gökçe Gök Klingel <goekce.goek_klingel@mail.schwarz> * Add config key (#261) * Fix LB describe (#262) * fix(deps): update module github.com/jedib0t/go-pretty/v6 to v6.5.8 (#257) Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> * Postgresflex backup command improvements (#259) * change title to created at * add note about current backup schedule in long description * add backup schedule to the instance describe output * Update internal/cmd/postgresflex/backup/update-schedule/update_schedule.go Co-authored-by: João Palet <joao.palet@outlook.com> * update docs --------- Co-authored-by: João Palet <joao.palet@outlook.com> * Add config key * Fix nil pointer exception --------- Co-authored-by: stackit-pipeline <142982727+stackit-pipeline@users.noreply.github.com> Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> Co-authored-by: João Palet <joao.palet@outlook.com> * Fixes to lb list and describe (#265) * Fixes to lb list and describe * Add separator * Remove columns * Remove separators * remove separator * Merge changes from main (#269) * fix(deps): update module github.com/jedib0t/go-pretty/v6 to v6.5.8 (#257) Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> * Postgresflex backup command improvements (#259) * change title to created at * add note about current backup schedule in long description * add backup schedule to the instance describe output * Update internal/cmd/postgresflex/backup/update-schedule/update_schedule.go Co-authored-by: João Palet <joao.palet@outlook.com> * update docs --------- Co-authored-by: João Palet <joao.palet@outlook.com> * Update changelog generation implementation (#263) * change recovery date format (#266) * update description and generate docs (#267) * Add debug logs to the CLI (#258) * Initial debug implementation * improve implementation * remove unused code * add documentation * address PR comments * fix linting * sort map keys before building debug string * Add testing to debug string builders * address PR comments * improve debug string construction * Debug the input model on all commands * add input model debugging to contribution guidelines --------- Co-authored-by: stackit-pipeline <142982727+stackit-pipeline@users.noreply.github.com> Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> Co-authored-by: Diogo Ferrão <diogo.ferrao@freiheit.com> * Load balancer delete command (#270) * fix(deps): update module github.com/jedib0t/go-pretty/v6 to v6.5.8 (#257) Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> * Postgresflex backup command improvements (#259) * change title to created at * add note about current backup schedule in long description * add backup schedule to the instance describe output * Update internal/cmd/postgresflex/backup/update-schedule/update_schedule.go Co-authored-by: João Palet <joao.palet@outlook.com> * update docs --------- Co-authored-by: João Palet <joao.palet@outlook.com> * Update changelog generation implementation (#263) * change recovery date format (#266) * Delete loadbalancer command * Update internal/cmd/load-balancer/delete/delete.go Co-authored-by: Diogo Ferrão <diogo.ferrao@freiheit.com> * Update internal/cmd/load-balancer/delete/delete_test.go Co-authored-by: Diogo Ferrão <diogo.ferrao@freiheit.com> * Changes after review --------- Co-authored-by: stackit-pipeline <142982727+stackit-pipeline@users.noreply.github.com> Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> Co-authored-by: João Palet <joao.palet@outlook.com> Co-authored-by: Diogo Ferrão <diogo.ferrao@freiheit.com> * Onboard load balancer create & update commands (#268) * onboard-create-command * remove fields that are not needed for create * remove fields that are not needed for create from default payload * remove privateAddress from update payload (read only field) * update generate payload to remove read-only fields from updatePayload * onboard update load balancer command * update description of update command * Update internal/cmd/load-balancer/create/create.go Co-authored-by: João Palet <joao.palet@outlook.com> * Update internal/cmd/load-balancer/create/create.go Co-authored-by: João Palet <joao.palet@outlook.com> * add GetProjectName * change instance name to load balancer name * set listener name to nil * abstract set listener name to nil in a function // add unit test * add debug logs to the create command * add debug logs to the generate payload command * add debug logs to the update command * Update test func name Co-authored-by: João Palet <joao.palet@outlook.com> * add additional listener to the unit test --------- Co-authored-by: João Palet <joao.palet@outlook.com> * LoadBalancer observability-credentials commands (#264) * Lb observability-credentials add command * Describe and update commands * Improve update command * List command * Generate docs * Add debug logs, uniformize descriptions * Fix unit tests * Update internal/cmd/load-balancer/observability-credentials/observability-credentials.go Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> * Update internal/cmd/load-balancer/observability-credentials/delete/delete_test.go Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> --------- Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> * Nil checks on lb describe (#273) * Fix examples (#275) * Implement `lb target-pool add-target` command (#281) * Add debug logs to list, describe and quota * Add utils and tests * Implement add-target command * Fix lb list test * Improvements after review * Add docs * Implement `lb target-pool remove-target` command (#283) * Implement lb target-pool remove-target command * Add util to get target name * Generate docs * Fix linter * Make target pool name the argument and LB name a flag * Update docs * Load balancer target pool commands improvements (#294) * Fix command example * Add n shorthand to target-name flag * Onboard load-balancer target-pool describe (#292) * initial describe command implementation * generate docs, fix linting * remove unused vars * rename flag * generate docs * rename vars * address PR comments * make JSON output match table * Tidy go.mod * Make pretty the default output for LB describe commands * Prompt for password when adding credentials before prompt for confirmation * Fix capitalization in example * Add middleware to LB client if verbosity is debug * change flag name in the example * update docs * Move password prompt before confirmation prompt in credentials update * Make IP an argument in add-target and remove-target * Support reading password from flag in add and update observablity credentials * Add error description to LB describe table * Update docs * Improve examples of LB observability credentials commands * Extend example --------- Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com> Co-authored-by: Gökçe Gök Klingel <goekce.goek_klingel@mail.schwarz> Co-authored-by: stackit-pipeline <142982727+stackit-pipeline@users.noreply.github.com> Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: João Palet <joao.palet@outlook.com> Co-authored-by: Diogo Ferrão <diogo.ferrao@freiheit.com> Co-authored-by: João Palet <joao.palet@freiheit.com>
1 parent b9dd3c8 commit 0949071

File tree

65 files changed

+8176
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+8176
-3
lines changed

docs/stackit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ stackit [flags]
3131
* [stackit config](./stackit_config.md) - Provides functionality for CLI configuration options
3232
* [stackit curl](./stackit_curl.md) - Executes an authenticated HTTP request to an endpoint
3333
* [stackit dns](./stackit_dns.md) - Provides functionality for DNS
34+
* [stackit load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer
3435
* [stackit logme](./stackit_logme.md) - Provides functionality for LogMe
3536
* [stackit mariadb](./stackit_mariadb.md) - Provides functionality for MariaDB
3637
* [stackit mongodbflex](./stackit_mongodbflex.md) - Provides functionality for MongoDB Flex

docs/stackit_config_set.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ stackit config set [flags]
3333
--authorization-custom-endpoint string Authorization API base URL, used in calls to this API
3434
--dns-custom-endpoint string DNS API base URL, used in calls to this API
3535
-h, --help Help for "stackit config set"
36+
--load-balancer-custom-endpoint string Load Balancer API base URL, used in calls to this API
3637
--logme-custom-endpoint string LogMe API base URL, used in calls to this API
3738
--mariadb-custom-endpoint string MariaDB API base URL, used in calls to this API
3839
--mongodbflex-custom-endpoint string MongoDB Flex API base URL, used in calls to this API

docs/stackit_config_unset.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ stackit config unset [flags]
3131
--authorization-custom-endpoint Authorization API base URL. If unset, uses the default base URL
3232
--dns-custom-endpoint DNS API base URL. If unset, uses the default base URL
3333
-h, --help Help for "stackit config unset"
34+
--load-balancer-custom-endpoint Load Balancer API base URL. If unset, uses the default base URL
3435
--logme-custom-endpoint LogMe API base URL. If unset, uses the default base URL
3536
--mariadb-custom-endpoint MariaDB API base URL. If unset, uses the default base URL
3637
--mongodbflex-custom-endpoint MongoDB Flex API base URL. If unset, uses the default base URL

docs/stackit_load-balancer.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## stackit load-balancer
2+
3+
Provides functionality for Load Balancer
4+
5+
### Synopsis
6+
7+
Provides functionality for Load Balancer.
8+
9+
```
10+
stackit load-balancer [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit load-balancer"
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"]
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](./stackit.md) - Manage STACKIT resources using the command line
32+
* [stackit load-balancer create](./stackit_load-balancer_create.md) - Creates a Load Balancer
33+
* [stackit load-balancer delete](./stackit_load-balancer_delete.md) - Deletes a Load Balancer
34+
* [stackit load-balancer describe](./stackit_load-balancer_describe.md) - Shows details of a Load Balancer
35+
* [stackit load-balancer generate-payload](./stackit_load-balancer_generate-payload.md) - Generates a payload to create/update a Load Balancer
36+
* [stackit load-balancer list](./stackit_load-balancer_list.md) - Lists all Load Balancers
37+
* [stackit load-balancer observability-credentials](./stackit_load-balancer_observability-credentials.md) - Provides functionality for Load Balancer observability credentials
38+
* [stackit load-balancer quota](./stackit_load-balancer_quota.md) - Shows the configured Load Balancer quota
39+
* [stackit load-balancer target-pool](./stackit_load-balancer_target-pool.md) - Provides functionality for target pools
40+
* [stackit load-balancer update](./stackit_load-balancer_update.md) - Updates a Load Balancer
41+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## stackit load-balancer create
2+
3+
Creates a Load Balancer
4+
5+
### Synopsis
6+
7+
Creates a Load Balancer.
8+
The payload can be provided as a JSON string or a file path prefixed with "@".
9+
See https://docs.api.stackit.cloud/documentation/load-balancer/version/v1#tag/Load-Balancer/operation/APIService_CreateLoadBalancer for information regarding the payload structure.
10+
11+
```
12+
stackit load-balancer create [flags]
13+
```
14+
15+
### Examples
16+
17+
```
18+
Create a load balancer using an API payload sourced from the file "./payload.json"
19+
$ stackit load-balancer create --payload @./payload.json
20+
21+
Create a load balancer using an API payload provided as a JSON string
22+
$ stackit load-balancer create --payload "{...}"
23+
24+
Generate a payload with default values, and adapt it with custom values for the different configuration options
25+
$ stackit load-balancer generate-payload > ./payload.json
26+
<Modify payload in file>
27+
$ stackit load-balancer create --payload @./payload.json
28+
```
29+
30+
### Options
31+
32+
```
33+
-h, --help Help for "stackit load-balancer create"
34+
--payload string Request payload (JSON). Can be a string or a file path, if prefixed with "@" (example: @./payload.json).
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"]
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 load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer
50+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## stackit load-balancer delete
2+
3+
Deletes a Load Balancer
4+
5+
### Synopsis
6+
7+
Deletes a Load Balancer.
8+
9+
```
10+
stackit load-balancer delete LOAD_BALANCER_NAME [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Deletes a load balancer with name "my-load-balancer"
17+
$ stackit load-balancer delete my-load-balancer
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit load-balancer 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"]
32+
-p, --project-id string Project ID
33+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
34+
```
35+
36+
### SEE ALSO
37+
38+
* [stackit load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer
39+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## stackit load-balancer describe
2+
3+
Shows details of a Load Balancer
4+
5+
### Synopsis
6+
7+
Shows details of a Load Balancer.
8+
9+
```
10+
stackit load-balancer describe LOAD_BALANCER_NAME [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Get details of a load balancer with name "my-load-balancer"
17+
$ stackit load-balancer describe my-load-balancer
18+
19+
Get details of a load-balancer with name "my-load-balancer" in a JSON format
20+
$ stackit load-balancer describe my-load-balancer --output-format json
21+
```
22+
23+
### Options
24+
25+
```
26+
-h, --help Help for "stackit load-balancer describe"
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"]
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 load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer
42+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## stackit load-balancer generate-payload
2+
3+
Generates a payload to create/update a Load Balancer
4+
5+
### Synopsis
6+
7+
Generates a JSON payload with values to be used as --payload input for load balancer creation or update.
8+
See https://docs.api.stackit.cloud/documentation/load-balancer/version/v1#tag/Load-Balancer/operation/APIService_CreateLoadBalancer for information regarding the payload structure.
9+
10+
```
11+
stackit load-balancer generate-payload [flags]
12+
```
13+
14+
### Examples
15+
16+
```
17+
Generate a payload, and adapt it with custom values for the different configuration options
18+
$ stackit load-balancer generate-payload > ./payload.json
19+
<Modify payload in file, if needed>
20+
$ stackit load-balancer create --payload @./payload.json
21+
22+
Generate a payload with values of an existing load balancer, and adapt it with custom values for the different configuration options
23+
$ stackit load-balancer generate-payload --lb-name xxx > ./payload.json
24+
<Modify payload in file>
25+
$ stackit load-balancer update xxx --payload @./payload.json
26+
```
27+
28+
### Options
29+
30+
```
31+
-h, --help Help for "stackit load-balancer generate-payload"
32+
-n, --lb-name string If set, generates the payload with the current values of the given load balancer. If unset, generates the payload with empty values
33+
```
34+
35+
### Options inherited from parent commands
36+
37+
```
38+
-y, --assume-yes If set, skips all confirmation prompts
39+
--async If set, runs the command asynchronously
40+
-o, --output-format string Output format, one of ["json" "pretty" "none"]
41+
-p, --project-id string Project ID
42+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
43+
```
44+
45+
### SEE ALSO
46+
47+
* [stackit load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer
48+

docs/stackit_load-balancer_list.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## stackit load-balancer list
2+
3+
Lists all Load Balancers
4+
5+
### Synopsis
6+
7+
Lists all Load Balancers.
8+
9+
```
10+
stackit load-balancer list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
List all load balancers
17+
$ stackit load-balancer list
18+
19+
List all loadbalancers in JSON format
20+
$ stackit load-balancer list --output-format json
21+
22+
List up to 10 load balancers
23+
$ stackit load-balancer list --limit 10
24+
```
25+
26+
### Options
27+
28+
```
29+
-h, --help Help for "stackit load-balancer list"
30+
--limit int Maximum number of entries to list
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"]
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 load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer
46+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stackit load-balancer observability-credentials
2+
3+
Provides functionality for Load Balancer observability credentials
4+
5+
### Synopsis
6+
7+
Provides functionality for Load Balancer observability credentials. These commands can be used to store and update existing credentials, which are valid to be used for Load Balancer observability. This means, e.g. when using Argus, first of all these credentials must be created for that Argus instance (by using "stackit argus credentials create") and then can be managed for a Load Balancer by using the commands in this group.
8+
9+
```
10+
stackit load-balancer observability-credentials [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit load-balancer observability-credentials"
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"]
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 load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer
32+
* [stackit load-balancer observability-credentials add](./stackit_load-balancer_observability-credentials_add.md) - Adds observability credentials to Load Balancer
33+
* [stackit load-balancer observability-credentials delete](./stackit_load-balancer_observability-credentials_delete.md) - Deletes observability credentials for Load Balancer
34+
* [stackit load-balancer observability-credentials describe](./stackit_load-balancer_observability-credentials_describe.md) - Shows details of observability credentials for Load Balancer
35+
* [stackit load-balancer observability-credentials list](./stackit_load-balancer_observability-credentials_list.md) - Lists all observability credentials for Load Balancer
36+
* [stackit load-balancer observability-credentials update](./stackit_load-balancer_observability-credentials_update.md) - Updates observability credentials for Load Balancer
37+

0 commit comments

Comments
 (0)