Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions docs/stackit_observability_grafana_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Shows details of the Grafana configuration of an Observability instance

Shows details of the Grafana configuration of an Observability 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 hidden by default, if you want to show it use the "--show-password" flag.

```
stackit observability grafana describe INSTANCE_ID [flags]
Expand All @@ -18,18 +17,14 @@ stackit observability grafana describe INSTANCE_ID [flags]
Get details of the Grafana configuration of an Observability instance with ID "xxx"
$ stackit observability grafana describe xxx

Get details of the Grafana configuration of an Observability instance with ID "xxx" and show the initial admin password
$ stackit observability grafana describe xxx --show-password

Get details of the Grafana configuration of an Observability instance with ID "xxx" in JSON format
$ stackit observability grafana describe xxx --output-format json
```

### Options

```
-h, --help Help for "stackit observability grafana describe"
-s, --show-password Show password in output
-h, --help Help for "stackit observability grafana describe"
```

### Options inherited from parent commands
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/services/logme v0.25.3
github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.25.3
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5
github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1
github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.25.3
github.com/stackitcloud/stackit-sdk-go/services/redis v0.25.3
github.com/stackitcloud/stackit-sdk-go/services/sfs v0.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,8 @@ github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.8 h1:S7t4wcT6SN
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.8/go.mod h1:CdrhFUsBO7/iJleCc2yQjDChIbG6YaxKNBQRNCjgcF4=
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5 h1:4gpvB6t7d2lLjInoTxcvjL9jCpBl5EDfYe5yUtR1MvA=
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5/go.mod h1:Bdcd59sRySyhfSUCy+5BNkp5w9PECmrywdvt+ORMKnI=
github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1 h1:zk+47GhutK2ajO4Yiek0laGm2PdXvY8BvFZc8yHFnSE=
github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1/go.mod h1:vapb/sJqbHlf+c7pZWdE9GqrbyI8wesGvUc9o7oJ1Xk=
github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1 h1:FKeW3uiMXRl6Oau3xE6yBriXh4t7CwPb8QH6PR0uQXM=
github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1/go.mod h1:RiknJnL3OuU9wb2lyb80Hu+EnlyDQMG8vejDV7B9a5U=
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.3 h1:CAgu3Wsmo8pA1/VWqnqLftMn7X26uDs5zctTci4WG7A=
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.3/go.mod h1:VC3vqIQIDN+8SAzhlMdrK4eXeiSaNE1JtjIGFzpgiRI=
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.3.2 h1:uQIpj0phDRGrV78/vhtULwxaO2cBdHwqZcFKYUrH1Hs=
Expand Down
13 changes: 7 additions & 6 deletions internal/cmd/observability/grafana/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import (
)

const (
instanceIdArg = "INSTANCE_ID"
instanceIdArg = "INSTANCE_ID"
// Deprecated: showPasswordFlag is deprecated and will be removed on 2026-07-05.
showPasswordFlag = "show-password"
)

Expand All @@ -35,19 +36,15 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("describe %s", instanceIdArg),
Short: "Shows details of the Grafana configuration of an Observability instance",
Long: fmt.Sprintf("%s\n%s\n%s",
Long: fmt.Sprintf("%s\n%s",
"Shows details of the Grafana configuration of an Observability 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 hidden by default, if you want to show it use the "--show-password" flag.`,
),
Args: args.SingleArg(instanceIdArg, utils.ValidateUUID),
Example: examples.Build(
examples.NewExample(
`Get details of the Grafana configuration of an Observability instance with ID "xxx"`,
"$ stackit observability grafana describe xxx"),
examples.NewExample(
`Get details of the Grafana configuration of an Observability instance with ID "xxx" and show the initial admin password`,
"$ stackit observability grafana describe xxx --show-password"),
examples.NewExample(
`Get details of the Grafana configuration of an Observability instance with ID "xxx" in JSON format`,
"$ stackit observability grafana describe xxx --output-format json"),
Expand Down Expand Up @@ -86,6 +83,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {

func configureFlags(cmd *cobra.Command) {
cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output")
cobra.CheckErr(cmd.Flags().MarkDeprecated(showPasswordFlag, "This flag is deprecated and will be removed on 2026-07-05."))
}

func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) {
Expand Down Expand Up @@ -122,8 +120,10 @@ func outputResult(p *print.Printer, outputFormat string, showPassword bool, graf
} else if grafanaConfigs == nil {
return fmt.Errorf("grafanaConfigs is nil")
}
p.Warn("GrafanaAdminPassword and GrafanaAdminUser are deprecated and will be removed on 2026-07-05.")

return p.OutputResult(outputFormat, grafanaConfigs, func() error {
//nolint:staticcheck // field is deprecated but still supported until 2026-07-05
initialAdminPassword := utils.PtrString(instance.Instance.GrafanaAdminPassword)
if !showPassword {
initialAdminPassword = "<hidden>"
Expand All @@ -136,6 +136,7 @@ func outputResult(p *print.Printer, outputFormat string, showPassword bool, graf
table.AddSeparator()
table.AddRow("SINGLE SIGN-ON", utils.PtrString(grafanaConfigs.UseStackitSso))
table.AddSeparator()
//nolint:staticcheck // field is deprecated but still supported until 2026-07-05
table.AddRow("INITIAL ADMIN USER (DEFAULT)", utils.PtrString(instance.Instance.GrafanaAdminUser))
table.AddSeparator()
table.AddRow("INITIAL ADMIN PASSWORD (DEFAULT)", initialAdminPassword)
Expand Down
Loading