You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

mygithub.libinneed.workers.dev/stackitcloud/stackit-cli

Package Overview
Dependencies
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mygithub.libinneed.workers.dev/stackitcloud/stackit-cli - go Package Compare versions

Comparing version
v0.4.0-prerelease.5
to
v0.4.0
+5
-5
docs/stackit_argus_grafana_describe.md

@@ -21,7 +21,7 @@ ## stackit argus grafana describe

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 show the initial admin password
$ stackit argus credentials describe xxx --show-password
Get details of the Grafana configuration of an Argus instance with ID "xxx" and show the initial admin password
$ stackit argus credentials describe xxx --output-format pretty --show-password
Get details of the Grafana configuration of an Argus instance with ID "xxx" in JSON format
$ stackit argus credentials describe xxx --output-format json
```

@@ -33,3 +33,3 @@

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

@@ -36,0 +36,0 @@

@@ -19,4 +19,4 @@ ## stackit argus instance describe

Get details of an Argus instance with ID "xxx" in a table format
$ stackit argus instance describe xxx --output-format pretty
Get details of an Argus instance with ID "xxx" in JSON format
$ stackit argus instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit argus scrape-config describe

Get details of a scrape configuration with name "my-config" from Argus instance "xxx" in a table format
$ stackit argus scrape-config describe my-config --output-format pretty
Get details of a scrape configuration with name "my-config" from Argus instance "xxx" in JSON format
$ stackit argus scrape-config describe my-config --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit dns record-set describe

Get details of DNS record set with ID "xxx" in zone with ID "yyy" in a table format
$ stackit dns record-set describe xxx --zone-id yyy --output-format pretty
Get details of DNS record set with ID "xxx" in zone with ID "yyy" in JSON format
$ stackit dns record-set describe xxx --zone-id yyy --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit dns zone describe

Get details of a DNS zone with ID "xxx" in a table format
$ stackit dns zone describe xxx --output-format pretty
Get details of a DNS zone with ID "xxx" in JSON format
$ stackit dns zone describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -28,3 +28,3 @@ ## stackit logme credentials create

--instance-id string Instance ID
--show-password Show password in output
-s, --show-password Show password in output
```

@@ -31,0 +31,0 @@

@@ -19,4 +19,4 @@ ## stackit logme credentials describe

Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format
$ stackit logme credentials describe xxx --instance-id yyy --output-format pretty
Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format
$ stackit logme credentials describe xxx --instance-id yyy --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit logme instance describe

Get details of a LogMe instance with ID "xxx" in a table format
$ stackit logme instance describe xxx --output-format pretty
Get details of a LogMe instance with ID "xxx" in JSON format
$ stackit logme instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -28,3 +28,3 @@ ## stackit mariadb credentials create

--instance-id string Instance ID
--show-password Show password in output
-s, --show-password Show password in output
```

@@ -31,0 +31,0 @@

@@ -19,4 +19,4 @@ ## stackit mariadb credentials describe

Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format
$ stackit mariadb credentials describe xxx --instance-id yyy --output-format pretty
Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format
$ stackit mariadb credentials describe xxx --instance-id yyy --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit mariadb instance describe

Get details of a MariaDB instance with ID "xxx" in a table format
$ stackit mariadb instance describe xxx --output-format pretty
Get details of a MariaDB instance with ID "xxx" in JSON format
$ stackit mariadb instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit mongodbflex instance describe

Get details of a MongoDB Flex instance with ID "xxx" in a table format
$ stackit mongodbflex instance describe xxx --output-format pretty
Get details of a MongoDB Flex instance with ID "xxx" in JSON format
$ stackit mongodbflex instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -21,4 +21,4 @@ ## stackit mongodbflex user describe

Get details of a MongoDB Flex user with ID "xxx" of instance with ID "yyy" in table format
$ stackit mongodbflex user list xxx --instance-id yyy --output-format pretty
Get details of a MongoDB Flex user with ID "xxx" of instance with ID "yyy" in JSON format
$ stackit mongodbflex user list xxx --instance-id yyy --output-format json
```

@@ -25,0 +25,0 @@

@@ -19,4 +19,4 @@ ## stackit object-storage bucket describe

Get details of an Object Storage bucket with name "my-bucket" in a table format
$ stackit object-storage bucket describe my-bucket --output-format pretty
Get details of an Object Storage bucket with name "my-bucket" in JSON format
$ stackit object-storage bucket describe my-bucket --output-format json
```

@@ -23,0 +23,0 @@

@@ -28,3 +28,3 @@ ## stackit opensearch credentials create

--instance-id string Instance ID
--show-password Show password in output
-s, --show-password Show password in output
```

@@ -31,0 +31,0 @@

@@ -19,4 +19,4 @@ ## stackit opensearch credentials describe

Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format
$ stackit opensearch credentials describe xxx --instance-id yyy --output-format pretty
Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format
$ stackit opensearch credentials describe xxx --instance-id yyy --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit opensearch instance describe

Get details of an OpenSearch instance with ID "xxx" in a table format
$ stackit opensearch instance describe xxx --output-format pretty
Get details of an OpenSearch instance with ID "xxx" in JSON format
$ stackit opensearch instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit postgresflex backup describe

Get details of a backup with ID "xxx" for a PostgreSQL Flex instance with ID "yyy" in a table format
$ stackit postgresflex backup describe xxx --instance-id yyy --output-format pretty
Get details of a backup with ID "xxx" for a PostgreSQL Flex instance with ID "yyy" in JSON format
$ stackit postgresflex backup describe xxx --instance-id yyy --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit postgresflex instance describe

Get details of a PostgreSQL Flex instance with ID "xxx" in a table format
$ stackit postgresflex instance describe xxx --output-format pretty
Get details of a PostgreSQL Flex instance with ID "xxx" in JSON format
$ stackit postgresflex instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -21,4 +21,4 @@ ## stackit postgresflex user describe

Get details of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" in table format
$ stackit postgresflex user list xxx --instance-id yyy --output-format pretty
Get details of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" in JSON format
$ stackit postgresflex user list xxx --instance-id yyy --output-format json
```

@@ -25,0 +25,0 @@

@@ -28,3 +28,3 @@ ## stackit rabbitmq credentials create

--instance-id string Instance ID
--show-password Show password in output
-s, --show-password Show password in output
```

@@ -31,0 +31,0 @@

@@ -19,4 +19,4 @@ ## stackit rabbitmq credentials describe

Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format
$ stackit rabbitmq credentials describe xxx --instance-id yyy --output-format pretty
Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format
$ stackit rabbitmq credentials describe xxx --instance-id yyy --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit rabbitmq instance describe

Get details of a RabbitMQ instance with ID "xxx" in a table format
$ stackit rabbitmq instance describe xxx --output-format pretty
Get details of a RabbitMQ instance with ID "xxx" in JSON format
$ stackit rabbitmq instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -28,3 +28,3 @@ ## stackit redis credentials create

--instance-id string Instance ID
--show-password Show password in output
-s, --show-password Show password in output
```

@@ -31,0 +31,0 @@

@@ -19,4 +19,4 @@ ## stackit redis credentials describe

Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format
$ stackit redis credentials describe xxx --instance-id yyy --output-format pretty
Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format
$ stackit redis credentials describe xxx --instance-id yyy --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit redis instance describe

Get details of a Redis instance with ID "xxx" in a table format
$ stackit redis instance describe xxx --output-format pretty
Get details of a Redis instance with ID "xxx" in JSON format
$ stackit redis instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit secrets-manager instance describe

Get details of a Secrets Manager instance with ID "xxx" in a table format
$ stackit secrets-manager instance describe xxx --output-format pretty
Get details of a Secrets Manager instance with ID "xxx" in JSON format
$ stackit secrets-manager instance describe xxx --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit secrets-manager user describe

Get details of a Secrets Manager user with ID "xxx" of instance with ID "yyy" in table format
$ stackit secrets-manager user describe xxx --instance-id yyy --output-format pretty
Get details of a Secrets Manager user with ID "xxx" of instance with ID "yyy" in JSON format
$ stackit secrets-manager user describe xxx --instance-id yyy --output-format json
```

@@ -23,0 +23,0 @@

@@ -19,4 +19,4 @@ ## stackit ske cluster describe

Get details of an SKE cluster with name "my-cluster" in a table format
$ stackit ske cluster describe my-cluster --output-format pretty
Get details of an SKE cluster with name "my-cluster" in JSON format
$ stackit ske cluster describe my-cluster --output-format json
```

@@ -23,0 +23,0 @@

@@ -48,7 +48,7 @@ package describe

examples.NewExample(
`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 show the initial admin password`,
"$ stackit argus credentials describe xxx --show-password"),
examples.NewExample(
`Get details of the Grafana configuration of an Argus instance with ID "xxx" and show the initial admin password`,
"$ stackit argus credentials describe xxx --output-format pretty --show-password"),
`Get details of the Grafana configuration of an Argus instance with ID "xxx" in JSON format`,
"$ stackit argus credentials describe xxx --output-format json"),
),

@@ -88,3 +88,3 @@ RunE: func(cmd *cobra.Command, args []string) error {

func configureFlags(cmd *cobra.Command) {
cmd.Flags().Bool(showPasswordFlag, false, `Show the initial admin password in the "pretty" output format`)
cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output")
}

@@ -130,3 +130,11 @@

switch inputModel.OutputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(grafanaConfigs, "", " ")
if err != nil {
return fmt.Errorf("marshal Grafana configs: %w", err)
}
p.Outputln(string(details))
return nil
default:
initialAdminPassword := *instance.Instance.GrafanaAdminPassword

@@ -153,11 +161,3 @@ if !inputModel.ShowPassword {

return nil
default:
details, err := json.MarshalIndent(grafanaConfigs, "", " ")
if err != nil {
return fmt.Errorf("marshal Grafana configs: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -41,4 +41,4 @@ package describe

examples.NewExample(
`Get details of an Argus instance with ID "xxx" in a table format`,
"$ stackit argus instance describe xxx --output-format pretty"),
`Get details of an Argus instance with ID "xxx" in JSON format`,
"$ stackit argus instance describe xxx --output-format json"),
),

@@ -102,4 +102,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal Argus instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -132,11 +139,3 @@ table.AddRow("ID", *instance.Id)

return nil
default:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal Argus instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -45,4 +45,4 @@ package describe

examples.NewExample(
`Get details of a scrape configuration with name "my-config" from Argus instance "xxx" in a table format`,
"$ stackit argus scrape-config describe my-config --output-format pretty"),
`Get details of a scrape configuration with name "my-config" from Argus instance "xxx" in JSON format`,
"$ stackit argus scrape-config describe my-config --output-format json"),
),

@@ -104,4 +104,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(config, "", " ")
if err != nil {
return fmt.Errorf("marshal scrape configuration: %w", err)
}
p.Outputln(string(details))
return nil
default:
saml2Enabled := "Enabled"

@@ -169,11 +176,3 @@ if config.Params != nil {

return nil
default:
details, err := json.MarshalIndent(config, "", " ")
if err != nil {
return fmt.Errorf("marshal scrape configuration: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -46,4 +46,4 @@ package describe

examples.NewExample(
`Get details of DNS record set with ID "xxx" in zone with ID "yyy" in a table format`,
"$ stackit dns record-set describe xxx --zone-id yyy --output-format pretty"),
`Get details of DNS record set with ID "xxx" in zone with ID "yyy" in JSON format`,
"$ stackit dns record-set describe xxx --zone-id yyy --output-format json"),
),

@@ -118,3 +118,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(recordSet, "", " ")
if err != nil {
return fmt.Errorf("marshal DNS record set: %w", err)
}
p.Outputln(string(details))
return nil
default:
recordsData := make([]string, 0, len(*recordSet.Records))

@@ -144,11 +152,3 @@ for _, r := range *recordSet.Records {

return nil
default:
details, err := json.MarshalIndent(recordSet, "", " ")
if err != nil {
return fmt.Errorf("marshal DNS record set: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -41,4 +41,4 @@ package describe

examples.NewExample(
`Get details of a DNS zone with ID "xxx" in a table format`,
"$ stackit dns zone describe xxx --output-format pretty"),
`Get details of a DNS zone with ID "xxx" in JSON format`,
"$ stackit dns zone describe xxx --output-format json"),
),

@@ -103,3 +103,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(zone, "", " ")
if err != nil {
return fmt.Errorf("marshal DNS zone: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -141,11 +149,3 @@ table.AddRow("ID", *zone.Id)

return nil
default:
details, err := json.MarshalIndent(zone, "", " ")
if err != nil {
return fmt.Errorf("marshal DNS zone: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -16,2 +16,3 @@ package create

logmeUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/logme/utils"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

@@ -90,3 +91,3 @@ "github.com/spf13/cobra"

cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID")
cmd.Flags().Bool(showPasswordFlag, false, "Show password in output")
cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output")

@@ -129,2 +130,5 @@ err := flags.MarkFlagsRequired(cmd, instanceIdFlag)

case print.JSONOutputFormat:
if !model.ShowPassword {
resp.Raw.Credentials.Password = utils.Ptr("hidden")
}
details, err := json.MarshalIndent(resp, "", " ")

@@ -131,0 +135,0 @@ if err != nil {

@@ -45,4 +45,4 @@ package describe

examples.NewExample(
`Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format`,
"$ stackit logme credentials describe xxx --instance-id yyy --output-format pretty"),
`Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format`,
"$ stackit logme credentials describe xxx --instance-id yyy --output-format json"),
),

@@ -116,3 +116,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal LogMe credentials: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -136,11 +144,3 @@ table.AddRow("ID", *credentials.Id)

return nil
default:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal LogMe credentials: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -43,4 +43,4 @@ package describe

examples.NewExample(
`Get details of a LogMe instance with ID "xxx" in a table format`,
"$ stackit logme instance describe xxx --output-format pretty"),
`Get details of a LogMe instance with ID "xxx" in JSON format`,
"$ stackit logme instance describe xxx --output-format json"),
),

@@ -104,3 +104,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal LogMe instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -131,11 +139,3 @@ table.AddRow("ID", *instance.InstanceId)

return nil
default:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal LogMe instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -16,2 +16,3 @@ package create

mariadbUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/mariadb/utils"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

@@ -90,3 +91,3 @@ "github.com/spf13/cobra"

cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID")
cmd.Flags().Bool(showPasswordFlag, false, "Show password in output")
cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output")

@@ -129,2 +130,5 @@ err := flags.MarkFlagsRequired(cmd, instanceIdFlag)

case print.JSONOutputFormat:
if !model.ShowPassword {
resp.Raw.Credentials.Password = utils.Ptr("hidden")
}
details, err := json.MarshalIndent(resp, "", " ")

@@ -131,0 +135,0 @@ if err != nil {

@@ -45,4 +45,4 @@ package describe

examples.NewExample(
`Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format`,
"$ stackit mariadb credentials describe xxx --instance-id yyy --output-format pretty"),
`Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format`,
"$ stackit mariadb credentials describe xxx --instance-id yyy --output-format json"),
),

@@ -116,3 +116,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal MariaDB credentials: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -136,11 +144,3 @@ table.AddRow("ID", *credentials.Id)

return nil
default:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal MariaDB credentials: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -43,4 +43,4 @@ package describe

examples.NewExample(
`Get details of a MariaDB instance with ID "xxx" in a table format`,
"$ stackit mariadb instance describe xxx --output-format pretty"),
`Get details of a MariaDB instance with ID "xxx" in JSON format`,
"$ stackit mariadb instance describe xxx --output-format json"),
),

@@ -104,3 +104,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal MariaDB instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -131,11 +139,3 @@ table.AddRow("ID", *instance.InstanceId)

return nil
default:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal MariaDB instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -43,4 +43,4 @@ package describe

examples.NewExample(
`Get details of a MongoDB Flex instance with ID "xxx" in a table format`,
"$ stackit mongodbflex instance describe xxx --output-format pretty"),
`Get details of a MongoDB Flex instance with ID "xxx" in JSON format`,
"$ stackit mongodbflex instance describe xxx --output-format json"),
),

@@ -104,3 +104,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal MongoDB Flex instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
aclsArray := *instance.Acl.Items

@@ -144,11 +152,3 @@ acls := strings.Join(aclsArray, ",")

return nil
default:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal MongoDB Flex instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -49,4 +49,4 @@ package describe

examples.NewExample(
`Get details of a MongoDB Flex user with ID "xxx" of instance with ID "yyy" in table format`,
"$ stackit mongodbflex user list xxx --instance-id yyy --output-format pretty"),
`Get details of a MongoDB Flex user with ID "xxx" of instance with ID "yyy" in JSON format`,
"$ stackit mongodbflex user list xxx --instance-id yyy --output-format json"),
),

@@ -122,3 +122,11 @@ Args: args.SingleArg(userIdArg, utils.ValidateUUID),

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(user, "", " ")
if err != nil {
return fmt.Errorf("marshal MongoDB Flex user: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -143,11 +151,3 @@ table.AddRow("ID", *user.Id)

return nil
default:
details, err := json.MarshalIndent(user, "", " ")
if err != nil {
return fmt.Errorf("marshal MongoDB Flex user: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -40,4 +40,4 @@ package describe

examples.NewExample(
`Get details of an Object Storage bucket with name "my-bucket" in a table format`,
"$ stackit object-storage bucket describe my-bucket --output-format pretty"),
`Get details of an Object Storage bucket with name "my-bucket" in JSON format`,
"$ stackit object-storage bucket describe my-bucket --output-format json"),
),

@@ -101,3 +101,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(bucket, "", " ")
if err != nil {
return fmt.Errorf("marshal Object Storage bucket: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -118,11 +126,3 @@ table.AddRow("Name", *bucket.Name)

return nil
default:
details, err := json.MarshalIndent(bucket, "", " ")
if err != nil {
return fmt.Errorf("marshal Object Storage bucket: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -16,2 +16,3 @@ package create

opensearchUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/opensearch/utils"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

@@ -90,3 +91,3 @@ "github.com/spf13/cobra"

cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID")
cmd.Flags().Bool(showPasswordFlag, false, "Show password in output")
cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output")

@@ -129,2 +130,5 @@ err := flags.MarkFlagsRequired(cmd, instanceIdFlag)

case print.JSONOutputFormat:
if !model.ShowPassword {
resp.Raw.Credentials.Password = utils.Ptr("hidden")
}
details, err := json.MarshalIndent(resp, "", " ")

@@ -131,0 +135,0 @@ if err != nil {

@@ -45,4 +45,4 @@ package describe

examples.NewExample(
`Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format`,
"$ stackit opensearch credentials describe xxx --instance-id yyy --output-format pretty"),
`Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format`,
"$ stackit opensearch credentials describe xxx --instance-id yyy --output-format json"),
),

@@ -116,3 +116,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal OpenSearch credentials: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -136,11 +144,3 @@ table.AddRow("ID", *credentials.Id)

return nil
default:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal OpenSearch credentials: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -43,4 +43,4 @@ package describe

examples.NewExample(
`Get details of an OpenSearch instance with ID "xxx" in a table format`,
"$ stackit opensearch instance describe xxx --output-format pretty"),
`Get details of an OpenSearch instance with ID "xxx" in JSON format`,
"$ stackit opensearch instance describe xxx --output-format json"),
),

@@ -104,3 +104,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal OpenSearch instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -131,11 +139,3 @@ table.AddRow("ID", *instance.InstanceId)

return nil
default:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal OpenSearch instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -50,4 +50,4 @@ package describe

examples.NewExample(
`Get details of a backup with ID "xxx" for a PostgreSQL Flex instance with ID "yyy" in a table format`,
"$ stackit postgresflex backup describe xxx --instance-id yyy --output-format pretty"),
`Get details of a backup with ID "xxx" for a PostgreSQL Flex instance with ID "yyy" in JSON format`,
"$ stackit postgresflex backup describe xxx --instance-id yyy --output-format json"),
),

@@ -118,3 +118,11 @@ Args: args.SingleArg(backupIdArg, nil),

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(backup, "", " ")
if err != nil {
return fmt.Errorf("marshal backup for PostgreSQL Flex backup: %w", err)
}
cmd.Println(string(details))
return nil
default:
table := tables.NewTable()

@@ -135,11 +143,3 @@ table.AddRow("ID", *backup.Id)

return nil
default:
details, err := json.MarshalIndent(backup, "", " ")
if err != nil {
return fmt.Errorf("marshal backup for PostgreSQL Flex instance: %w", err)
}
cmd.Println(string(details))
return nil
}
}

@@ -45,4 +45,4 @@ package describe

examples.NewExample(
`Get details of a PostgreSQL Flex instance with ID "xxx" in a table format`,
"$ stackit postgresflex instance describe xxx --output-format pretty"),
`Get details of a PostgreSQL Flex instance with ID "xxx" in JSON format`,
"$ stackit postgresflex instance describe xxx --output-format json"),
),

@@ -106,3 +106,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal PostgreSQL Flex instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
aclsArray := *instance.Acl.Items

@@ -148,11 +156,3 @@ acls := strings.Join(aclsArray, ",")

return nil
default:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal PostgreSQL Flex instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -48,4 +48,4 @@ package describe

examples.NewExample(
`Get details of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" in table format`,
"$ stackit postgresflex user list xxx --instance-id yyy --output-format pretty"),
`Get details of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" in JSON format`,
"$ stackit postgresflex user list xxx --instance-id yyy --output-format json"),
),

@@ -121,3 +121,11 @@ Args: args.SingleArg(userIdArg, nil),

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(user, "", " ")
if err != nil {
return fmt.Errorf("marshal PostgreSQL Flex user: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -140,11 +148,3 @@ table.AddRow("ID", *user.Id)

return nil
default:
details, err := json.MarshalIndent(user, "", " ")
if err != nil {
return fmt.Errorf("marshal MongoDB Flex user: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -122,3 +122,11 @@ package describe

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(project, "", " ")
if err != nil {
return fmt.Errorf("marshal project details: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -140,11 +148,3 @@ table.AddRow("ID", *project.ProjectId)

return nil
default:
details, err := json.MarshalIndent(project, "", " ")
if err != nil {
return fmt.Errorf("marshal project details: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -16,2 +16,3 @@ package create

rabbitmqUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/rabbitmq/utils"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

@@ -90,3 +91,3 @@ "github.com/spf13/cobra"

cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID")
cmd.Flags().Bool(showPasswordFlag, false, "Show password in output")
cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output")

@@ -129,2 +130,5 @@ err := flags.MarkFlagsRequired(cmd, instanceIdFlag)

case print.JSONOutputFormat:
if !model.ShowPassword {
resp.Raw.Credentials.Password = utils.Ptr("hidden")
}
details, err := json.MarshalIndent(resp, "", " ")

@@ -131,0 +135,0 @@ if err != nil {

@@ -45,4 +45,4 @@ package describe

examples.NewExample(
`Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format`,
"$ stackit rabbitmq credentials describe xxx --instance-id yyy --output-format pretty"),
`Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format`,
"$ stackit rabbitmq credentials describe xxx --instance-id yyy --output-format json"),
),

@@ -116,3 +116,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal RabbitMQ credentials: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -136,11 +144,3 @@ table.AddRow("ID", *credentials.Id)

return nil
default:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal RabbitMQ credentials: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -43,4 +43,4 @@ package describe

examples.NewExample(
`Get details of a RabbitMQ instance with ID "xxx" in a table format`,
"$ stackit rabbitmq instance describe xxx --output-format pretty"),
`Get details of a RabbitMQ instance with ID "xxx" in JSON format`,
"$ stackit rabbitmq instance describe xxx --output-format json"),
),

@@ -104,3 +104,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal RabbitMQ instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -131,11 +139,3 @@ table.AddRow("ID", *instance.InstanceId)

return nil
default:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal RabbitMQ instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -16,2 +16,3 @@ package create

redisUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/redis/utils"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

@@ -90,3 +91,3 @@ "github.com/spf13/cobra"

cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID")
cmd.Flags().Bool(showPasswordFlag, false, "Show password in output")
cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output")

@@ -129,2 +130,5 @@ err := flags.MarkFlagsRequired(cmd, instanceIdFlag)

case print.JSONOutputFormat:
if !model.ShowPassword {
resp.Raw.Credentials.Password = utils.Ptr("hidden")
}
details, err := json.MarshalIndent(resp, "", " ")

@@ -131,0 +135,0 @@ if err != nil {

@@ -45,4 +45,4 @@ package describe

examples.NewExample(
`Get details of credentials with ID "xxx" from instance with ID "yyy" in a table format`,
"$ stackit redis credentials describe xxx --instance-id yyy --output-format pretty"),
`Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format`,
"$ stackit redis credentials describe xxx --instance-id yyy --output-format json"),
),

@@ -116,3 +116,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal Redis credentials: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -136,11 +144,3 @@ table.AddRow("ID", *credentials.Id)

return nil
default:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal Redis credentials: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -43,4 +43,4 @@ package describe

examples.NewExample(
`Get details of a Redis instance with ID "xxx" in a table format`,
"$ stackit redis instance describe xxx --output-format pretty"),
`Get details of a Redis instance with ID "xxx" in JSON format`,
"$ stackit redis instance describe xxx --output-format json"),
),

@@ -104,3 +104,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal Redis instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -131,11 +139,3 @@ table.AddRow("ID", *instance.InstanceId)

return nil
default:
details, err := json.MarshalIndent(instance, "", " ")
if err != nil {
return fmt.Errorf("marshal Redis instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -42,4 +42,4 @@ package describe

examples.NewExample(
`Get details of a Secrets Manager instance with ID "xxx" in a table format`,
"$ stackit secrets-manager instance describe xxx --output-format pretty"),
`Get details of a Secrets Manager instance with ID "xxx" in JSON format`,
"$ stackit secrets-manager instance describe xxx --output-format json"),
),

@@ -115,4 +115,16 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
output := struct {
*secretsmanager.Instance
*secretsmanager.AclList
}{instance, aclList}
details, err := json.MarshalIndent(output, "", " ")
if err != nil {
return fmt.Errorf("marshal Secrets Manager instance: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -147,16 +159,3 @@ table.AddRow("ID", *instance.Id)

return nil
default:
output := struct {
*secretsmanager.Instance
*secretsmanager.AclList
}{instance, aclList}
details, err := json.MarshalIndent(output, "", " ")
if err != nil {
return fmt.Errorf("marshal Secrets Manager instance: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -45,4 +45,4 @@ package describe

examples.NewExample(
`Get details of a Secrets Manager user with ID "xxx" of instance with ID "yyy" in table format`,
"$ stackit secrets-manager user describe xxx --instance-id yyy --output-format pretty"),
`Get details of a Secrets Manager user with ID "xxx" of instance with ID "yyy" in JSON format`,
"$ stackit secrets-manager user describe xxx --instance-id yyy --output-format json"),
),

@@ -118,3 +118,11 @@ Args: args.SingleArg(userIdArg, utils.ValidateUUID),

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(user, "", " ")
if err != nil {
return fmt.Errorf("marshal Secrets Manager user: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -141,11 +149,3 @@ table.AddRow("ID", *user.Id)

return nil
default:
details, err := json.MarshalIndent(user, "", " ")
if err != nil {
return fmt.Errorf("marshal Secrets Manager user: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -40,4 +40,4 @@ package describe

examples.NewExample(
`Get details of an SKE cluster with name "my-cluster" in a table format`,
"$ stackit ske cluster describe my-cluster --output-format pretty"),
`Get details of an SKE cluster with name "my-cluster" in JSON format`,
"$ stackit ske cluster describe my-cluster --output-format json"),
),

@@ -101,4 +101,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(cluster, "", " ")
if err != nil {
return fmt.Errorf("marshal SKE cluster: %w", err)
}
p.Outputln(string(details))
return nil
default:
acl := []string{}

@@ -123,11 +130,3 @@ if cluster.Extensions != nil && cluster.Extensions.Acl != nil {

return nil
default:
details, err := json.MarshalIndent(cluster, "", " ")
if err != nil {
return fmt.Errorf("marshal SKE cluster: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -47,4 +47,4 @@ package describe

examples.NewExample(
`Get details of the credentials associated to the SKE cluster with name "my-cluster" in a table format`,
"$ stackit ske credentials describe my-cluster --output-format pretty"),
`Get details of the credentials associated to the SKE cluster with name "my-cluster" in JSON format`,
"$ stackit ske credentials describe my-cluster --output-format json"),
),

@@ -118,3 +118,11 @@ RunE: func(cmd *cobra.Command, args []string) error {

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal SKE credentials: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -130,11 +138,3 @@ table.AddRow("SERVER", *credentials.Server)

return nil
default:
details, err := json.MarshalIndent(credentials, "", " ")
if err != nil {
return fmt.Errorf("marshal SKE credentials: %w", err)
}
p.Outputln(string(details))
return nil
}
}

@@ -89,3 +89,11 @@ package describe

switch outputFormat {
case print.PrettyOutputFormat:
case print.JSONOutputFormat:
details, err := json.MarshalIndent(project, "", " ")
if err != nil {
return fmt.Errorf("marshal SKE project details: %w", err)
}
p.Outputln(string(details))
return nil
default:
table := tables.NewTable()

@@ -101,11 +109,3 @@ table.AddRow("ID", *project.ProjectId)

return nil
default:
details, err := json.MarshalIndent(project, "", " ")
if err != nil {
return fmt.Errorf("marshal SKE project details: %w", err)
}
p.Outputln(string(details))
return nil
}
}