Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e3379d7
Add `argus grafana describe` command (#221)
joaopalet Apr 16, 2024
36e1c33
Update GitHub actions (#223)
GokceGK Apr 17, 2024
bf75e9f
Implemnt util for Argus grafana configuration commands (#224)
joaopalet Apr 17, 2024
0758f90
Add `argus grafana single-sign-on` commands (#228)
joaopalet Apr 17, 2024
b89639c
Add repology packaging status badge to INSTALLATION docs (#215)
Kumm-Kai Apr 17, 2024
3de5783
Add argus grafana `public-read-access` commands (#229)
joaopalet Apr 17, 2024
ef0fa19
Change config handling: only create config file & directory if needed…
Kumm-Kai Apr 17, 2024
37de439
chore(deps): update renovatebot/github-action action to v40.1.9 (#225)
stackit-pipeline Apr 18, 2024
f7cc6ea
fix(deps): update module github.com/stackitcloud/stackit-sdk-go/servi…
stackit-pipeline Apr 18, 2024
e400797
Improvements for argus grafana commands (#230)
joaopalet Apr 18, 2024
4592142
Add debug error logs (#217)
GokceGK Apr 19, 2024
65f9386
change order of debug and error logs (#232)
GokceGK Apr 22, 2024
4b36af5
Output format none (#234)
vicentepinto98 Apr 22, 2024
dd1309f
Signature (#237)
stackit-pipeline Apr 22, 2024
9fcbc2d
update docs for output format none addition (#239)
GokceGK Apr 23, 2024
a7bb83e
Add json output format (#238)
GokceGK Apr 24, 2024
ce61281
Update docs (#244)
joaopalet Apr 24, 2024
d5a495f
Onboard Argus scrape configurations (#242)
DiogoFerrao Apr 24, 2024
f202ce4
Merge branch 'main' into feature/argus-credentials
DiogoFerrao Apr 24, 2024
146d165
Add error level debug logs to commands
DiogoFerrao Apr 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Self-hosted Renovate
uses: renovatebot/github-action@v40.1.0
uses: renovatebot/github-action@v40.1.9
with:
configurationFile: .github/renovate.json
token: ${{ secrets.RENOVATE_TOKEN }}
16 changes: 8 additions & 8 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type inputModel struct {
}

// "bar" command constructor
func NewCmd() *cobra.Command {
func NewCmd(p *print.Printer) *cobra.Command {
cmd := &cobra.Command{
Use: "bar",
Short: "Short description of the command (is shown in the help of parent command)",
Expand All @@ -88,13 +88,13 @@ func NewCmd() *cobra.Command {
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
model, err := parseInput(cmd, args)
model, err := parseInput(p, cmd, args)
if err != nil {
return err
}

// Configure API client
apiClient, err := client.ConfigureClient(cmd)
apiClient, err := client.ConfigureClient(p, cmd)
if err != nil {
return err
}
Expand All @@ -106,7 +106,7 @@ func NewCmd() *cobra.Command {
return fmt.Errorf("(...): %w", err)
}

projectLabel, err := projectname.GetProjectName(ctx, cmd)
projectLabel, err := projectname.GetProjectName(ctx, p, cmd)
if err != nil {
projectLabel = model.ProjectId
}
Expand All @@ -116,7 +116,7 @@ func NewCmd() *cobra.Command {
p.Info("(...)", projectLabel)
return nil
}
return outputResult(cmd, model.OutputFormat, instances)
return outputResult(p, cmd, model.OutputFormat, instances)
},
}

Expand Down Expand Up @@ -152,9 +152,9 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *foo.APIClie
}

// Output result based on the configured output format
func outputResult(cmd *cobra.Command, outputFormat string, resources []foo.Resource) error {
func outputResult(p *print.Printer, cmd *cobra.Command, outputFormat string, resources []foo.Resource) error {
switch outputFormat {
case globalflags.JSONOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(resources, "", " ")
if err != nil {
return fmt.Errorf("marshal resource list: %w", err)
Expand All @@ -177,7 +177,7 @@ func outputResult(cmd *cobra.Command, outputFormat string, resources []foo.Resou
}
```

Please remeber to always add unit tests for `parseInput`, `buildRequest` (in `bar_test.go`), and any other util functions used.
Please remember to always add unit tests for `parseInput`, `buildRequest` (in `bar_test.go`), and any other util functions used.

If the new command `bar` is the first command in the CLI using a STACKIT service `foo`, please refer to [Onboarding a new STACKIT service](./CONTRIBUTION.md/#onboarding-a-new-stackit-service).

Expand Down
2 changes: 2 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Package managers

[![Packaging status](https://repology.org/badge/vertical-allrepos/stackit-cli.svg?columns=3)](https://repology.org/project/stackit-cli/versions)

### macOS

The STACKIT CLI can be installed through the [Homebrew](https://brew.sh/) package manager.
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ stackit [flags]
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-h, --help Help for "stackit"
-o, --output-format string Output format, one of ["json" "pretty"]
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
-v, --version Show "stackit" version
Expand Down
4 changes: 3 additions & 1 deletion docs/stackit_argus.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stackit argus [flags]
```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty"]
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```
Expand All @@ -30,6 +30,8 @@ stackit argus [flags]

* [stackit](./stackit.md) - Manage STACKIT resources using the command line
* [stackit argus credentials](./stackit_argus_credentials.md) - Provides functionality for Argus credentials
* [stackit argus grafana](./stackit_argus_grafana.md) - Provides functionality for the Grafana configuration of Argus instances
* [stackit argus instance](./stackit_argus_instance.md) - Provides functionality for Argus instances
* [stackit argus plans](./stackit_argus_plans.md) - Lists all Argus service plans
* [stackit argus scrape-config](./stackit_argus_scrape-config.md) - Provides functionality for scrape configurations in Argus

2 changes: 1 addition & 1 deletion docs/stackit_argus_credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stackit argus credentials [flags]
```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty"]
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_argus_credentials_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ stackit argus credentials create [flags]
```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty"]
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_argus_credentials_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ stackit argus credentials delete USERNAME [flags]
```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty"]
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_argus_credentials_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ stackit argus credentials list [flags]
```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty"]
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```
Expand Down
35 changes: 35 additions & 0 deletions docs/stackit_argus_grafana.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## stackit argus grafana

Provides functionality for the Grafana configuration of Argus instances

### Synopsis

Provides functionality for the Grafana configuration of Argus instances.

```
stackit argus grafana [flags]
```

### Options

```
-h, --help Help for "stackit argus grafana"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus](./stackit_argus.md) - Provides functionality for Argus
* [stackit argus grafana describe](./stackit_argus_grafana_describe.md) - Shows details of the Grafana configuration of an Argus instance
* [stackit argus grafana public-read-access](./stackit_argus_grafana_public-read-access.md) - Enable or disable public read access for Grafana in Argus instances
* [stackit argus grafana single-sign-on](./stackit_argus_grafana_single-sign-on.md) - Enable or disable single sign-on for Grafana in Argus instances

48 changes: 48 additions & 0 deletions docs/stackit_argus_grafana_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## stackit argus grafana describe

Shows details of the Grafana configuration of an Argus instance

### Synopsis

Shows details of the Grafana configuration of an Argus instance.
The Grafana dashboard URL and initial credentials (admin user and password) will be shown in the "pretty" output format. These credentials are only valid for first login. Please change the password after first login. After changing, the initial password is no longer valid.
The initial password is shown by default, if you want to hide it use the "--hide-password" flag.

```
stackit argus grafana describe INSTANCE_ID [flags]
```

### Examples

```
Get details of the Grafana configuration of an Argus instance with ID "xxx"
$ stackit argus credentials describe xxx

Get details of the Grafana configuration of an Argus instance with ID "xxx" in a table format
$ stackit argus credentials describe xxx --output-format pretty

Get details of the Grafana configuration of an Argus instance with ID "xxx" and hide the initial admin password
$ stackit argus credentials describe xxx --output-format pretty --hide-password
```

### Options

```
-h, --help Help for "stackit argus grafana describe"
--hide-password Show the initial admin password in the "pretty" output format
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus grafana](./stackit_argus_grafana.md) - Provides functionality for the Grafana configuration of Argus instances

35 changes: 35 additions & 0 deletions docs/stackit_argus_grafana_public-read-access.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## stackit argus grafana public-read-access

Enable or disable public read access for Grafana in Argus instances

### Synopsis

Enable or disable public read access for Grafana in Argus instances.
When enabled, anyone can access the Grafana dashboards of the instance without logging in. Otherwise, a login is required.

```
stackit argus grafana public-read-access [flags]
```

### Options

```
-h, --help Help for "stackit argus grafana public-read-access"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus grafana](./stackit_argus_grafana.md) - Provides functionality for the Grafana configuration of Argus instances
* [stackit argus grafana public-read-access disable](./stackit_argus_grafana_public-read-access_disable.md) - Disables public read access for Grafana on Argus instances
* [stackit argus grafana public-read-access enable](./stackit_argus_grafana_public-read-access_enable.md) - Enables public read access for Grafana on Argus instances

40 changes: 40 additions & 0 deletions docs/stackit_argus_grafana_public-read-access_disable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit argus grafana public-read-access disable

Disables public read access for Grafana on Argus instances

### Synopsis

Disables public read access for Grafana on Argus instances.
When disabled, a login is required to access the Grafana dashboards of the instance. Otherwise, anyone can access the dashboards.

```
stackit argus grafana public-read-access disable INSTANCE_ID [flags]
```

### Examples

```
Disable public read access for Grafana on an Argus instance with ID "xxx"
$ stackit argus grafana public-read-access disable xxx
```

### Options

```
-h, --help Help for "stackit argus grafana public-read-access disable"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus grafana public-read-access](./stackit_argus_grafana_public-read-access.md) - Enable or disable public read access for Grafana in Argus instances

40 changes: 40 additions & 0 deletions docs/stackit_argus_grafana_public-read-access_enable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## stackit argus grafana public-read-access enable

Enables public read access for Grafana on Argus instances

### Synopsis

Enables public read access for Grafana on Argus instances.
When enabled, anyone can access the Grafana dashboards of the instance without logging in. Otherwise, a login is required.

```
stackit argus grafana public-read-access enable INSTANCE_ID [flags]
```

### Examples

```
Enable public read access for Grafana on an Argus instance with ID "xxx"
$ stackit argus grafana public-read-access enable xxx
```

### Options

```
-h, --help Help for "stackit argus grafana public-read-access enable"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus grafana public-read-access](./stackit_argus_grafana_public-read-access.md) - Enable or disable public read access for Grafana in Argus instances

35 changes: 35 additions & 0 deletions docs/stackit_argus_grafana_single-sign-on.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## stackit argus grafana single-sign-on

Enable or disable single sign-on for Grafana in Argus instances

### Synopsis

Enable or disable single sign-on for Grafana in Argus instances.
When enabled for an instance, overwrites the generic OAuth2 authentication and configures STACKIT single sign-on for that instance.

```
stackit argus grafana single-sign-on [flags]
```

### Options

```
-h, --help Help for "stackit argus grafana single-sign-on"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none"]
-p, --project-id string Project ID
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit argus grafana](./stackit_argus_grafana.md) - Provides functionality for the Grafana configuration of Argus instances
* [stackit argus grafana single-sign-on disable](./stackit_argus_grafana_single-sign-on_disable.md) - Disables single sign-on for Grafana on Argus instances
* [stackit argus grafana single-sign-on enable](./stackit_argus_grafana_single-sign-on_enable.md) - Enables single sign-on for Grafana on Argus instances

Loading