diff --git a/docs/stackit_postgresflex_backup_update-schedule.md b/docs/stackit_postgresflex_backup_update-schedule.md index 331980d75..02362430c 100644 --- a/docs/stackit_postgresflex_backup_update-schedule.md +++ b/docs/stackit_postgresflex_backup_update-schedule.md @@ -4,7 +4,7 @@ Updates backup schedule for a PostgreSQL Flex instance ### Synopsis -Updates backup schedule for a PostgreSQL Flex instance. +Updates backup schedule for a PostgreSQL Flex instance. The current backup schedule can be seen in the output of the "stackit postgresflex instance describe" command. ``` stackit postgresflex backup update-schedule [flags] diff --git a/go.mod b/go.mod index d4c33255a..76bf05339 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf - github.com/jedib0t/go-pretty/v6 v6.5.6 + github.com/jedib0t/go-pretty/v6 v6.5.8 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.18.2 diff --git a/go.sum b/go.sum index 98d8a51de..6668cd9a3 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf h1:FtEj8sfIcaaBfAKrE1Cwb61YDtYq9JxChK1c7AKce7s= github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf/go.mod h1:yrqSXGoD/4EKfF26AOGzscPOgTTJcyAwM2rpixWT+t4= -github.com/jedib0t/go-pretty/v6 v6.5.6 h1:nKXVLqPfAwY7sWcYXdNZZZ2fjqDpAtj9UeWupgfUxSg= -github.com/jedib0t/go-pretty/v6 v6.5.6/go.mod h1:5LQIxa52oJ/DlDSLv0HEkWOFMDGoWkJb9ss5KqPpJBg= +github.com/jedib0t/go-pretty/v6 v6.5.8 h1:8BCzJdSvUbaDuRba4YVh+SKMGcAAKdkcF3SVFbrHAtQ= +github.com/jedib0t/go-pretty/v6 v6.5.8/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= diff --git a/internal/cmd/load-balancer/describe/describe.go b/internal/cmd/load-balancer/describe/describe.go index bd0dd0eed..bfcb1ef6c 100644 --- a/internal/cmd/load-balancer/describe/describe.go +++ b/internal/cmd/load-balancer/describe/describe.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "strconv" "strings" "github.com/stackitcloud/stackit-cli/internal/pkg/args" @@ -179,9 +180,16 @@ func renderTargetPools(targetPools []loadbalancer.TargetPool) string { sessionPersistence = "Use Source IP" } - healthCheck := targetPool.ActiveHealthCheck + healthCheckInterval := "-" + healthCheckUnhealthyThreshold := "-" + healthCheckHealthyThreshold := "-" + if targetPool.ActiveHealthCheck != nil { + healthCheckInterval = *targetPool.ActiveHealthCheck.Interval + healthCheckUnhealthyThreshold = strconv.FormatInt(*targetPool.ActiveHealthCheck.UnhealthyThreshold, 10) + healthCheckHealthyThreshold = strconv.FormatInt(*targetPool.ActiveHealthCheck.HealthyThreshold, 10) + } - table.AddRow(*targetPool.Name, *targetPool.TargetPort, targets, sessionPersistence, *healthCheck.Interval, *healthCheck.UnhealthyThreshold, *healthCheck.HealthyThreshold) + table.AddRow(*targetPool.Name, *targetPool.TargetPort, targets, sessionPersistence, healthCheckInterval, healthCheckUnhealthyThreshold, healthCheckHealthyThreshold) } return table.Render() diff --git a/internal/cmd/postgresflex/backup/describe/describe.go b/internal/cmd/postgresflex/backup/describe/describe.go index e184f9dde..bf6322109 100644 --- a/internal/cmd/postgresflex/backup/describe/describe.go +++ b/internal/cmd/postgresflex/backup/describe/describe.go @@ -118,7 +118,7 @@ func outputResult(p *print.Printer, cmd *cobra.Command, outputFormat string, bac table := tables.NewTable() table.AddRow("ID", *backup.Id) table.AddSeparator() - table.AddRow("START TIME", *backup.StartTime) + table.AddRow("CREATED AT", *backup.StartTime) table.AddSeparator() table.AddRow("EXPIRES AT", backupExpireDate) table.AddSeparator() diff --git a/internal/cmd/postgresflex/backup/update-schedule/update_schedule.go b/internal/cmd/postgresflex/backup/update-schedule/update_schedule.go index 94ec2c20c..318425c0c 100644 --- a/internal/cmd/postgresflex/backup/update-schedule/update_schedule.go +++ b/internal/cmd/postgresflex/backup/update-schedule/update_schedule.go @@ -32,7 +32,7 @@ func NewCmd(p *print.Printer) *cobra.Command { cmd := &cobra.Command{ Use: "update-schedule", Short: "Updates backup schedule for a PostgreSQL Flex instance", - Long: "Updates backup schedule for a PostgreSQL Flex instance.", + Long: `Updates backup schedule for a PostgreSQL Flex instance. The current backup schedule can be seen in the output of the "stackit postgresflex instance describe" command.`, Args: args.NoArgs, Example: examples.Build( examples.NewExample( diff --git a/internal/cmd/postgresflex/instance/describe/describe.go b/internal/cmd/postgresflex/instance/describe/describe.go index 00be72fbe..4e69a21f3 100644 --- a/internal/cmd/postgresflex/instance/describe/describe.go +++ b/internal/cmd/postgresflex/instance/describe/describe.go @@ -124,6 +124,8 @@ func outputResult(p *print.Printer, outputFormat string, instance *postgresflex. table.AddSeparator() table.AddRow("RAM", *instance.Flavor.Memory) table.AddSeparator() + table.AddRow("BACKUP SCHEDULE (UTC)", *instance.BackupSchedule) + table.AddSeparator() err = table.Display(p) if err != nil { return fmt.Errorf("render table: %w", err)