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
2 changes: 1 addition & 1 deletion docs/stackit_logme_instance_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stackit logme instance create [flags]
$ stackit logme instance create --name my-instance --plan-id xxx

Create a LogMe instance with name "my-instance" and specify IP range which is allowed to access it
$ stackit logme instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24
$ stackit logme instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_logme_instance_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stackit logme instance update INSTANCE_ID [flags]
$ stackit logme instance update xxx --plan-id yyy

Update the range of IPs allowed to access a LogMe instance with ID "xxx"
$ stackit logme instance update xxx --acl 192.168.1.0/24
$ stackit logme instance update xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_mariadb_instance_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stackit mariadb instance create [flags]
$ stackit mariadb instance create --name my-instance --plan-id xxx

Create a MariaDB instance with name "my-instance" and specify IP range which is allowed to access it
$ stackit mariadb instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24
$ stackit mariadb instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_mariadb_instance_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stackit mariadb instance update INSTANCE_ID [flags]
$ stackit mariadb instance update xxx --plan-id yyy

Update the range of IPs allowed to access a MariaDB instance with ID "xxx"
$ stackit mariadb instance update xxx --acl 192.168.1.0/24
$ stackit mariadb instance update xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_opensearch_instance_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stackit opensearch instance create [flags]
$ stackit opensearch instance create --name my-instance --plan-id xxx

Create an OpenSearch instance with name "my-instance" and specify IP range which is allowed to access it
$ stackit opensearch instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24
$ stackit opensearch instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_opensearch_instance_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stackit opensearch instance update INSTANCE_ID [flags]
$ stackit opensearch instance update xxx --plan-id yyy

Update the range of IPs allowed to access an OpenSearch instance with ID "xxx"
$ stackit opensearch instance update xxx --acl 192.168.1.0/24
$ stackit opensearch instance update xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_rabbitmq_instance_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stackit rabbitmq instance create [flags]
$ stackit rabbitmq instance create --name my-instance --plan-id xxx

Create an RabbitMQ instance with name "my-instance" and specify IP range which is allowed to access it
$ stackit rabbitmq instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24
$ stackit rabbitmq instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_rabbitmq_instance_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stackit rabbitmq instance update INSTANCE_ID [flags]
$ stackit rabbitmq instance update xxx --plan-id yyy

Update the range of IPs allowed to access an RabbitMQ instance with ID "xxx"
$ stackit rabbitmq instance update xxx --acl 192.168.1.0/24
$ stackit rabbitmq instance update xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_redis_instance_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stackit redis instance create [flags]
$ stackit redis instance create --name my-instance --plan-id xxx

Create a Redis instance with name "my-instance" and specify IP range which is allowed to access it
$ stackit redis instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24
$ stackit redis instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_redis_instance_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stackit redis instance update INSTANCE_ID [flags]
$ stackit redis instance update xxx --plan-id yyy

Update the range of IPs allowed to access a Redis instance with ID "xxx"
$ stackit redis instance update xxx --acl 192.168.1.0/24
$ stackit redis instance update xxx --acl 1.2.3.0/24
```

### Options
Expand Down
6 changes: 5 additions & 1 deletion internal/cmd/logme/credentials/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ func NewCmd() *cobra.Command {
}

cmd.Printf("Created credentials for instance %s. Credentials ID: %s\n\n", instanceLabel, *resp.Id)
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
// The username field cannot be set by the user so we only display it if it's not returned empty
username := *resp.Raw.Credentials.Username
if username != "" {
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
}
if model.HidePassword {
cmd.Printf("Password: <hidden>\n")
} else {
Expand Down
8 changes: 6 additions & 2 deletions internal/cmd/logme/credentials/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ func outputResult(cmd *cobra.Command, outputFormat string, credentials *logme.Cr
table := tables.NewTable()
table.AddRow("ID", *credentials.Id)
table.AddSeparator()
table.AddRow("USERNAME", *credentials.Raw.Credentials.Username)
table.AddSeparator()
// The username field cannot be set by the user so we only display it if it's not returned empty
username := *credentials.Raw.Credentials.Username
if username != "" {
table.AddRow("USERNAME", *credentials.Raw.Credentials.Username)
table.AddSeparator()
}
table.AddRow("PASSWORD", *credentials.Raw.Credentials.Password)
table.AddSeparator()
table.AddRow("URI", *credentials.Raw.Credentials.Uri)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/logme/instance/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewCmd() *cobra.Command {
"$ stackit logme instance create --name my-instance --plan-id xxx"),
examples.NewExample(
`Create a LogMe instance with name "my-instance" and specify IP range which is allowed to access it`,
"$ stackit logme instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24"),
"$ stackit logme instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
13 changes: 13 additions & 0 deletions internal/cmd/logme/instance/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (

const (
instanceIdArg = "INSTANCE_ID"

aclParameterKey = "sgw_acl"
)

type inputModel struct {
Expand Down Expand Up @@ -95,6 +97,17 @@ func outputResult(cmd *cobra.Command, outputFormat string, instance *logme.Insta
table.AddRow("LAST OPERATION TYPE", *instance.LastOperation.Type)
table.AddSeparator()
table.AddRow("LAST OPERATION STATE", *instance.LastOperation.State)
table.AddSeparator()
table.AddRow("PLAN ID", *instance.PlanId)
// Only show ACL if it's present and not empty
acl := (*instance.Parameters)[aclParameterKey]
aclStr, ok := acl.(string)
if ok {
if aclStr != "" {
table.AddSeparator()
table.AddRow("ACL", aclStr)
}
}
err := table.Display(cmd)
if err != nil {
return fmt.Errorf("render table: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/logme/instance/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewCmd() *cobra.Command {
"$ stackit logme instance update xxx --plan-id yyy"),
examples.NewExample(
`Update the range of IPs allowed to access a LogMe instance with ID "xxx"`,
"$ stackit logme instance update xxx --acl 192.168.1.0/24"),
"$ stackit logme instance update xxx --acl 1.2.3.0/24"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
6 changes: 5 additions & 1 deletion internal/cmd/mariadb/credentials/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ func NewCmd() *cobra.Command {
}

cmd.Printf("Created credentials for instance %s. Credentials ID: %s\n\n", instanceLabel, *resp.Id)
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
// The username field cannot be set by the user so we only display it if it's not returned empty
username := *resp.Raw.Credentials.Username
if username != "" {
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
}
if model.HidePassword {
cmd.Printf("Password: <hidden>\n")
} else {
Expand Down
8 changes: 6 additions & 2 deletions internal/cmd/mariadb/credentials/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ func outputResult(cmd *cobra.Command, outputFormat string, credentials *mariadb.
table := tables.NewTable()
table.AddRow("ID", *credentials.Id)
table.AddSeparator()
table.AddRow("USERNAME", *credentials.Raw.Credentials.Username)
table.AddSeparator()
// The username field cannot be set by the user so we only display it if it's not returned empty
username := *credentials.Raw.Credentials.Username
if username != "" {
table.AddRow("USERNAME", *credentials.Raw.Credentials.Username)
table.AddSeparator()
}
table.AddRow("PASSWORD", *credentials.Raw.Credentials.Password)
table.AddSeparator()
table.AddRow("URI", *credentials.Raw.Credentials.Uri)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/mariadb/instance/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewCmd() *cobra.Command {
"$ stackit mariadb instance create --name my-instance --plan-id xxx"),
examples.NewExample(
`Create a MariaDB instance with name "my-instance" and specify IP range which is allowed to access it`,
"$ stackit mariadb instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24"),
"$ stackit mariadb instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
13 changes: 13 additions & 0 deletions internal/cmd/mariadb/instance/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (

const (
instanceIdArg = "INSTANCE_ID"

aclParameterKey = "sgw_acl"
)

type inputModel struct {
Expand Down Expand Up @@ -95,6 +97,17 @@ func outputResult(cmd *cobra.Command, outputFormat string, instance *mariadb.Ins
table.AddRow("LAST OPERATION TYPE", *instance.LastOperation.Type)
table.AddSeparator()
table.AddRow("LAST OPERATION STATE", *instance.LastOperation.State)
table.AddSeparator()
table.AddRow("PLAN ID", *instance.PlanId)
// Only show ACL if it's present and not empty
acl := (*instance.Parameters)[aclParameterKey]
aclStr, ok := acl.(string)
if ok {
if aclStr != "" {
table.AddSeparator()
table.AddRow("ACL", aclStr)
}
}
err := table.Display(cmd)
if err != nil {
return fmt.Errorf("render table: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/mariadb/instance/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewCmd() *cobra.Command {
"$ stackit mariadb instance update xxx --plan-id yyy"),
examples.NewExample(
`Update the range of IPs allowed to access a MariaDB instance with ID "xxx"`,
"$ stackit mariadb instance update xxx --acl 192.168.1.0/24"),
"$ stackit mariadb instance update xxx --acl 1.2.3.0/24"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/opensearch/credentials/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ func NewCmd() *cobra.Command {
return fmt.Errorf("create OpenSearch credentials: %w", err)
}

cmd.Printf("Created credentials for instance %s. Credentials ID: %s\n\n", instanceLabel, *resp.Id)
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
cmd.Printf("Created credentials for instance %s. Credentials ID: %s\n\n", instanceLabel, *resp.Id) // The username field cannot be set by the user so we only display it if it's not returned empty
username := *resp.Raw.Credentials.Username
if username != "" {
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
}
if model.HidePassword {
cmd.Printf("Password: <hidden>\n")
} else {
Expand Down
8 changes: 6 additions & 2 deletions internal/cmd/opensearch/credentials/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ func outputResult(cmd *cobra.Command, outputFormat string, credentials *opensear
table := tables.NewTable()
table.AddRow("ID", *credentials.Id)
table.AddSeparator()
table.AddRow("USERNAME", *credentials.Raw.Credentials.Username)
table.AddSeparator()
// The username field cannot be set by the user so we only display it if it's not returned empty
username := *credentials.Raw.Credentials.Username
if username != "" {
table.AddRow("USERNAME", *credentials.Raw.Credentials.Username)
table.AddSeparator()
}
table.AddRow("PASSWORD", *credentials.Raw.Credentials.Password)
table.AddSeparator()
table.AddRow("URI", *credentials.Raw.Credentials.Uri)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/opensearch/instance/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewCmd() *cobra.Command {
"$ stackit opensearch instance create --name my-instance --plan-id xxx"),
examples.NewExample(
`Create an OpenSearch instance with name "my-instance" and specify IP range which is allowed to access it`,
"$ stackit opensearch instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24"),
"$ stackit opensearch instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
13 changes: 13 additions & 0 deletions internal/cmd/opensearch/instance/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (

const (
instanceIdArg = "INSTANCE_ID"

aclParameterKey = "sgw_acl"
)

type inputModel struct {
Expand Down Expand Up @@ -95,6 +97,17 @@ func outputResult(cmd *cobra.Command, outputFormat string, instance *opensearch.
table.AddRow("LAST OPERATION TYPE", *instance.LastOperation.Type)
table.AddSeparator()
table.AddRow("LAST OPERATION STATE", *instance.LastOperation.State)
table.AddSeparator()
table.AddRow("PLAN ID", *instance.PlanId)
// Only show ACL if it's present and not empty
acl := (*instance.Parameters)[aclParameterKey]
aclStr, ok := acl.(string)
if ok {
if aclStr != "" {
table.AddSeparator()
table.AddRow("ACL", aclStr)
}
}
err := table.Display(cmd)
if err != nil {
return fmt.Errorf("render table: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/opensearch/instance/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewCmd() *cobra.Command {
"$ stackit opensearch instance update xxx --plan-id yyy"),
examples.NewExample(
`Update the range of IPs allowed to access an OpenSearch instance with ID "xxx"`,
"$ stackit opensearch instance update xxx --acl 192.168.1.0/24"),
"$ stackit opensearch instance update xxx --acl 1.2.3.0/24"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
6 changes: 5 additions & 1 deletion internal/cmd/rabbitmq/credentials/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ func NewCmd() *cobra.Command {
}

cmd.Printf("Created credentials for instance %s. Credentials ID: %s\n\n", instanceLabel, *resp.Id)
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
// The username field cannot be set by the user so we only display it if it's not returned empty
username := *resp.Raw.Credentials.Username
if username != "" {
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
}
if model.HidePassword {
cmd.Printf("Password: <hidden>\n")
} else {
Expand Down
8 changes: 6 additions & 2 deletions internal/cmd/rabbitmq/credentials/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ func outputResult(cmd *cobra.Command, outputFormat string, credentials *rabbitmq
table := tables.NewTable()
table.AddRow("ID", *credentials.Id)
table.AddSeparator()
table.AddRow("USERNAME", *credentials.Raw.Credentials.Username)
table.AddSeparator()
// The username field cannot be set by the user so we only display it if it's not returned empty
username := *credentials.Raw.Credentials.Username
if username != "" {
table.AddRow("USERNAME", *credentials.Raw.Credentials.Username)
table.AddSeparator()
}
table.AddRow("PASSWORD", *credentials.Raw.Credentials.Password)
table.AddSeparator()
table.AddRow("URI", *credentials.Raw.Credentials.Uri)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/rabbitmq/instance/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewCmd() *cobra.Command {
"$ stackit rabbitmq instance create --name my-instance --plan-id xxx"),
examples.NewExample(
`Create an RabbitMQ instance with name "my-instance" and specify IP range which is allowed to access it`,
"$ stackit rabbitmq instance create --name my-instance --plan-id xxx --acl 192.168.1.0/24"),
"$ stackit rabbitmq instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
13 changes: 13 additions & 0 deletions internal/cmd/rabbitmq/instance/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (

const (
instanceIdArg = "INSTANCE_ID"

aclParameterKey = "sgw_acl"
)

type inputModel struct {
Expand Down Expand Up @@ -95,6 +97,17 @@ func outputResult(cmd *cobra.Command, outputFormat string, instance *rabbitmq.In
table.AddRow("LAST OPERATION TYPE", *instance.LastOperation.Type)
table.AddSeparator()
table.AddRow("LAST OPERATION STATE", *instance.LastOperation.State)
table.AddSeparator()
table.AddRow("PLAN ID", *instance.PlanId)
// Only show ACL if it's present and not empty
acl := (*instance.Parameters)[aclParameterKey]
aclStr, ok := acl.(string)
if ok {
if aclStr != "" {
table.AddSeparator()
table.AddRow("ACL", aclStr)
}
}
err := table.Display(cmd)
if err != nil {
return fmt.Errorf("render table: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/rabbitmq/instance/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewCmd() *cobra.Command {
"$ stackit rabbitmq instance update xxx --plan-id yyy"),
examples.NewExample(
`Update the range of IPs allowed to access an RabbitMQ instance with ID "xxx"`,
"$ stackit rabbitmq instance update xxx --acl 192.168.1.0/24"),
"$ stackit rabbitmq instance update xxx --acl 1.2.3.0/24"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
6 changes: 5 additions & 1 deletion internal/cmd/redis/credentials/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ func NewCmd() *cobra.Command {
}

cmd.Printf("Created credentials for instance %s. Credentials ID: %s\n\n", instanceLabel, *resp.Id)
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
// The username field cannot be set by the user so we only display it if it's not returned empty
username := *resp.Raw.Credentials.Username
if username != "" {
cmd.Printf("Username: %s\n", *resp.Raw.Credentials.Username)
}
if model.HidePassword {
cmd.Printf("Password: <hidden>\n")
} else {
Expand Down
Loading