diff --git a/cmd/dbaas_external_endpoint_create_datadog.go b/cmd/dbaas_external_endpoint_create_datadog.go index d589abb2..d5b65bf0 100644 --- a/cmd/dbaas_external_endpoint_create_datadog.go +++ b/cmd/dbaas_external_endpoint_create_datadog.go @@ -71,8 +71,8 @@ func (c *dbaasExternalEndpointCreateCmd) createDatadog(cmd *cobra.Command, _ []s if !globalstate.Quiet { return (&dbaasExternalEndpointShowCmd{ cliCommandSettings: defaultCLICmdSettings(), - EndpointID: endpointID, - Type: "datadog", + EndpointID: endpointID, + Type: "datadog", }).cmdRun(nil, nil) } diff --git a/cmd/dbaas_external_endpoint_create_elasticsearch.go b/cmd/dbaas_external_endpoint_create_elasticsearch.go index 59cba1ee..074ed32c 100644 --- a/cmd/dbaas_external_endpoint_create_elasticsearch.go +++ b/cmd/dbaas_external_endpoint_create_elasticsearch.go @@ -2,10 +2,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "github.com/exoscale/cli/pkg/account" "github.com/exoscale/cli/pkg/globalstate" v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" ) func (c *dbaasExternalEndpointCreateCmd) createElasticsearch(_ *cobra.Command, _ []string) error { diff --git a/cmd/dbaas_external_endpoint_create_opensearch.go b/cmd/dbaas_external_endpoint_create_opensearch.go index 2d672a06..9a58dc10 100644 --- a/cmd/dbaas_external_endpoint_create_opensearch.go +++ b/cmd/dbaas_external_endpoint_create_opensearch.go @@ -2,10 +2,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "github.com/exoscale/cli/pkg/account" "github.com/exoscale/cli/pkg/globalstate" v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" ) func (c *dbaasExternalEndpointCreateCmd) createOpensearch(_ *cobra.Command, _ []string) error { diff --git a/cmd/dbaas_external_endpoint_create_prometheus.go b/cmd/dbaas_external_endpoint_create_prometheus.go index fd1f0e54..4e08ebda 100644 --- a/cmd/dbaas_external_endpoint_create_prometheus.go +++ b/cmd/dbaas_external_endpoint_create_prometheus.go @@ -2,10 +2,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "github.com/exoscale/cli/pkg/account" "github.com/exoscale/cli/pkg/globalstate" v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" ) func (c *dbaasExternalEndpointCreateCmd) createPrometheus(_ *cobra.Command, _ []string) error { @@ -20,10 +20,10 @@ func (c *dbaasExternalEndpointCreateCmd) createPrometheus(_ *cobra.Command, _ [] } if c.PrometheusBasicAuthPassword != "" { - prometheusRequestPayload.Settings.BasicAuthPassword= c.PrometheusBasicAuthPassword + prometheusRequestPayload.Settings.BasicAuthPassword = c.PrometheusBasicAuthPassword } if c.PrometheusBasicAuthUsername != "" { - prometheusRequestPayload.Settings.BasicAuthUsername= c.PrometheusBasicAuthUsername + prometheusRequestPayload.Settings.BasicAuthUsername = c.PrometheusBasicAuthUsername } op, err := client.CreateDBAASExternalEndpointPrometheus(ctx, c.Name, prometheusRequestPayload) diff --git a/cmd/dbaas_external_endpoint_create_rsyslog.go b/cmd/dbaas_external_endpoint_create_rsyslog.go index c86f0559..c7056087 100644 --- a/cmd/dbaas_external_endpoint_create_rsyslog.go +++ b/cmd/dbaas_external_endpoint_create_rsyslog.go @@ -2,10 +2,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "github.com/exoscale/cli/pkg/account" "github.com/exoscale/cli/pkg/globalstate" v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" ) func (c *dbaasExternalEndpointCreateCmd) createRsyslog(cmd *cobra.Command, _ []string) error { diff --git a/cmd/dbaas_external_endpoint_list.go b/cmd/dbaas_external_endpoint_list.go index d890b083..78309a5c 100644 --- a/cmd/dbaas_external_endpoint_list.go +++ b/cmd/dbaas_external_endpoint_list.go @@ -30,8 +30,8 @@ type dbaasExternalEndpointListCmd struct { } func (c *dbaasExternalEndpointListCmd) cmdAliases() []string { return gListAlias } -func (c *dbaasExternalEndpointListCmd) cmdShort() string { return "List External Endpoints"} -func (c *dbaasExternalEndpointListCmd) cmdLong() string { return "List External Endpoints"} +func (c *dbaasExternalEndpointListCmd) cmdShort() string { return "List External Endpoints" } +func (c *dbaasExternalEndpointListCmd) cmdLong() string { return "List External Endpoints" } func (c *dbaasExternalEndpointListCmd) cmdPreRun(cmd *cobra.Command, args []string) error { return cliCommandDefaultPreRun(c, cmd, args) } diff --git a/cmd/dbaas_external_endpoint_show_datadog.go b/cmd/dbaas_external_endpoint_show_datadog.go index 4014100c..efcd96f7 100644 --- a/cmd/dbaas_external_endpoint_show_datadog.go +++ b/cmd/dbaas_external_endpoint_show_datadog.go @@ -13,9 +13,9 @@ import ( ) type datadogOutput struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` Settings v3.DBAASExternalEndpointDatadogOutputSettings `json:"settings"` } @@ -45,7 +45,6 @@ func (o *datadogOutput) ToTable() { t.Append([]string{"Kafka Consumer Stats Timeout", strconv.FormatInt(settings.KafkaConsumerStatsTimeout, 10)}) t.Append([]string{"Max Partition Contexts", strconv.FormatInt(settings.MaxPartitionContexts, 10)}) - if len(settings.DatadogTags) > 0 { tagLines := make([]string, len(settings.DatadogTags)) for i, tag := range settings.DatadogTags { diff --git a/cmd/dbaas_external_endpoint_show_elasticsearch.go b/cmd/dbaas_external_endpoint_show_elasticsearch.go index a4aeb85f..d81ec915 100644 --- a/cmd/dbaas_external_endpoint_show_elasticsearch.go +++ b/cmd/dbaas_external_endpoint_show_elasticsearch.go @@ -13,9 +13,9 @@ import ( ) type elasticsearchOutput struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` Settings v3.DBAASEndpointElasticsearchOptionalFields `json:"settings"` } diff --git a/cmd/dbaas_external_endpoint_show_opensearch.go b/cmd/dbaas_external_endpoint_show_opensearch.go index f711e57b..57419b48 100644 --- a/cmd/dbaas_external_endpoint_show_opensearch.go +++ b/cmd/dbaas_external_endpoint_show_opensearch.go @@ -13,9 +13,9 @@ import ( ) type opensearchOutput struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` Settings v3.DBAASEndpointOpensearchOptionalFields `json:"settings"` } diff --git a/cmd/dbaas_external_endpoint_show_prometheus.go b/cmd/dbaas_external_endpoint_show_prometheus.go index 5372122c..44b013cf 100644 --- a/cmd/dbaas_external_endpoint_show_prometheus.go +++ b/cmd/dbaas_external_endpoint_show_prometheus.go @@ -12,9 +12,9 @@ import ( ) type prometheusOutput struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` Settings v3.DBAASEndpointExternalPrometheusOutputSettings `json:"settings"` } diff --git a/cmd/dbaas_external_endpoint_show_rsyslog.go b/cmd/dbaas_external_endpoint_show_rsyslog.go index 17fdf64b..415a59e7 100644 --- a/cmd/dbaas_external_endpoint_show_rsyslog.go +++ b/cmd/dbaas_external_endpoint_show_rsyslog.go @@ -13,9 +13,9 @@ import ( ) type rsyslogOutput struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` Settings v3.DBAASEndpointRsyslogOptionalFields `json:"settings"` } @@ -31,14 +31,14 @@ func (o *rsyslogOutput) ToTable() { t.Append([]string{"Endpoint Type", o.Type}) settings := o.Settings - tls := "false" + tls := "false" -if settings.Tls != nil && *settings.Tls { + if settings.Tls != nil && *settings.Tls { tls = "true" } t.Append([]string{"Server", settings.Server}) - t.Append([]string{"Port", strconv.FormatInt(settings.Port,10)}) + t.Append([]string{"Port", strconv.FormatInt(settings.Port, 10)}) t.Append([]string{"Tls", tls}) t.Append([]string{"Max Message Size", strconv.FormatInt(settings.MaxMessageSize, 10)}) t.Append([]string{"Structured data block", settings.SD}) diff --git a/cmd/dbaas_external_endpoint_update.go b/cmd/dbaas_external_endpoint_update.go index 2ce3990f..ba62331c 100644 --- a/cmd/dbaas_external_endpoint_update.go +++ b/cmd/dbaas_external_endpoint_update.go @@ -13,7 +13,7 @@ type dbaasExternalEndpointUpdateCmd struct { _ bool `cli-cmd:"update"` Type string `cli-arg:"#"` - ID string `cli-arg:"#"` + ID string `cli-arg:"#"` HelpDatadog bool `cli-usage:"show usage for flags specific to the datadog external endpoint type"` HelpElasticsearch bool `cli-usage:"show usage for flags specific to the elasticsearch external endpoint type"` diff --git a/cmd/dbaas_external_endpoint_update_datadog.go b/cmd/dbaas_external_endpoint_update_datadog.go index 1d6b24c8..e397fe11 100644 --- a/cmd/dbaas_external_endpoint_update_datadog.go +++ b/cmd/dbaas_external_endpoint_update_datadog.go @@ -71,8 +71,8 @@ func (c *dbaasExternalEndpointUpdateCmd) updateDatadog(cmd *cobra.Command, _ []s if !globalstate.Quiet { return (&dbaasExternalEndpointShowCmd{ cliCommandSettings: defaultCLICmdSettings(), - EndpointID: endpointID, - Type: "datadog", + EndpointID: endpointID, + Type: "datadog", }).cmdRun(nil, nil) } diff --git a/cmd/dbaas_external_endpoint_update_elasticsearch.go b/cmd/dbaas_external_endpoint_update_elasticsearch.go index 6babc4b3..17788304 100644 --- a/cmd/dbaas_external_endpoint_update_elasticsearch.go +++ b/cmd/dbaas_external_endpoint_update_elasticsearch.go @@ -2,10 +2,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "github.com/exoscale/cli/pkg/account" "github.com/exoscale/cli/pkg/globalstate" v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" ) func (c *dbaasExternalEndpointUpdateCmd) updateElasticsearch(_ *cobra.Command, _ []string) error { diff --git a/cmd/dbaas_external_endpoint_update_opensearch.go b/cmd/dbaas_external_endpoint_update_opensearch.go index bb5ea360..63cd29da 100644 --- a/cmd/dbaas_external_endpoint_update_opensearch.go +++ b/cmd/dbaas_external_endpoint_update_opensearch.go @@ -2,10 +2,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "github.com/exoscale/cli/pkg/account" "github.com/exoscale/cli/pkg/globalstate" v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" ) func (c *dbaasExternalEndpointUpdateCmd) updateOpensearch(_ *cobra.Command, _ []string) error { diff --git a/cmd/dbaas_external_endpoint_update_prometheus.go b/cmd/dbaas_external_endpoint_update_prometheus.go index 4b0fab12..118c822f 100644 --- a/cmd/dbaas_external_endpoint_update_prometheus.go +++ b/cmd/dbaas_external_endpoint_update_prometheus.go @@ -2,10 +2,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "github.com/exoscale/cli/pkg/account" "github.com/exoscale/cli/pkg/globalstate" v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" ) func (c *dbaasExternalEndpointUpdateCmd) updatePrometheus(_ *cobra.Command, _ []string) error { @@ -20,10 +20,10 @@ func (c *dbaasExternalEndpointUpdateCmd) updatePrometheus(_ *cobra.Command, _ [] } if c.PrometheusBasicAuthPassword != "" { - prometheusRequestPayload.Settings.BasicAuthPassword= c.PrometheusBasicAuthPassword + prometheusRequestPayload.Settings.BasicAuthPassword = c.PrometheusBasicAuthPassword } if c.PrometheusBasicAuthUsername != "" { - prometheusRequestPayload.Settings.BasicAuthUsername= c.PrometheusBasicAuthUsername + prometheusRequestPayload.Settings.BasicAuthUsername = c.PrometheusBasicAuthUsername } op, err := client.UpdateDBAASExternalEndpointPrometheus(ctx, v3.UUID(c.ID), prometheusRequestPayload) diff --git a/cmd/dbaas_external_endpoint_update_rsyslog.go b/cmd/dbaas_external_endpoint_update_rsyslog.go index 0594bb1e..b4b2ae1e 100644 --- a/cmd/dbaas_external_endpoint_update_rsyslog.go +++ b/cmd/dbaas_external_endpoint_update_rsyslog.go @@ -2,10 +2,10 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "github.com/exoscale/cli/pkg/account" "github.com/exoscale/cli/pkg/globalstate" v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" ) func (c *dbaasExternalEndpointUpdateCmd) updateRsyslog(cmd *cobra.Command, _ []string) error { diff --git a/cmd/dbaas_external_integration_attach.go b/cmd/dbaas_external_integration_attach.go index 83fa1f01..beb43eee 100644 --- a/cmd/dbaas_external_integration_attach.go +++ b/cmd/dbaas_external_integration_attach.go @@ -36,7 +36,7 @@ func (c *dbaasExternalIntegrationAttachCmd) cmdPreRun(cmd *cobra.Command, args [ return cliCommandDefaultPreRun(c, cmd, args) } -func(c *dbaasExternalIntegrationAttachCmd) cmdRun(cmd *cobra.Command, args []string) error { +func (c *dbaasExternalIntegrationAttachCmd) cmdRun(cmd *cobra.Command, args []string) error { ctx := gContext @@ -52,7 +52,7 @@ func(c *dbaasExternalIntegrationAttachCmd) cmdRun(cmd *cobra.Command, args []str req := v3.AttachDBAASServiceToEndpointRequest{ DestEndpointID: endpointID, - Type: v3.EnumExternalEndpointTypes(c.Type), + Type: v3.EnumExternalEndpointTypes(c.Type), } op, err := client.AttachDBAASServiceToEndpoint(ctx, c.SourceServiceName, req) diff --git a/cmd/dbaas_external_integration_detach.go b/cmd/dbaas_external_integration_detach.go index dc3f20b1..9b3ce3ab 100644 --- a/cmd/dbaas_external_integration_detach.go +++ b/cmd/dbaas_external_integration_detach.go @@ -35,7 +35,7 @@ func (c *dbaasExternalIntegrationDetachCmd) cmdPreRun(cmd *cobra.Command, args [ return cliCommandDefaultPreRun(c, cmd, args) } -func(c *dbaasExternalIntegrationDetachCmd) cmdRun(cmd *cobra.Command, args []string) error { +func (c *dbaasExternalIntegrationDetachCmd) cmdRun(cmd *cobra.Command, args []string) error { ctx := gContext diff --git a/cmd/dbaas_external_integration_list.go b/cmd/dbaas_external_integration_list.go index d8921b7c..ce5d3dd3 100644 --- a/cmd/dbaas_external_integration_list.go +++ b/cmd/dbaas_external_integration_list.go @@ -12,14 +12,14 @@ import ( ) type dbaasExternalIntegrationListItemOutput struct { - Description string `json:"description"` - DestEndpointName string `json:"dest-endpoint-name"` - DestEndpointID string `json:"dest-endpoint-id"` - IntegrationID string `json:"id"` - Status string `json:"status"` + Description string `json:"description"` + DestEndpointName string `json:"dest-endpoint-name"` + DestEndpointID string `json:"dest-endpoint-id"` + IntegrationID string `json:"id"` + Status string `json:"status"` SourceServiceName string `json:"source-service-name"` SourceServiceType string `json:"source-service-type"` - Type string `json:"type"` + Type string `json:"type"` } type dbaasExternalIntegrationListOutput []dbaasExternalIntegrationListItemOutput @@ -37,8 +37,8 @@ type dbaasExternalIntegrationListCmd struct { } func (c *dbaasExternalIntegrationListCmd) cmdAliases() []string { return gListAlias } -func (c *dbaasExternalIntegrationListCmd) cmdShort() string { return "List External Integrations"} -func (c *dbaasExternalIntegrationListCmd) cmdLong() string { return "List External Integrations"} +func (c *dbaasExternalIntegrationListCmd) cmdShort() string { return "List External Integrations" } +func (c *dbaasExternalIntegrationListCmd) cmdLong() string { return "List External Integrations" } func (c *dbaasExternalIntegrationListCmd) cmdPreRun(cmd *cobra.Command, args []string) error { return cliCommandDefaultPreRun(c, cmd, args) } @@ -51,7 +51,7 @@ func (c *dbaasExternalIntegrationListCmd) cmdRun(_ *cobra.Command, _ []string) e return err } - res, err := client.ListDBAASExternalIntegrations(ctx,c.ServiceName) + res, err := client.ListDBAASExternalIntegrations(ctx, c.ServiceName) if err != nil { return fmt.Errorf("error listing integrations: %w", err) } @@ -60,12 +60,12 @@ func (c *dbaasExternalIntegrationListCmd) cmdRun(_ *cobra.Command, _ []string) e for _, integration := range res.ExternalIntegrations { out = append(out, dbaasExternalIntegrationListItemOutput{ - IntegrationID: string(integration.IntegrationID), - Type: string(integration.Type), - Description: integration.Description, - DestEndpointName: integration.DestEndpointName, - DestEndpointID: integration.DestEndpointID, - Status: integration.Status, + IntegrationID: string(integration.IntegrationID), + Type: string(integration.Type), + Description: integration.Description, + DestEndpointName: integration.DestEndpointName, + DestEndpointID: integration.DestEndpointID, + Status: integration.Status, SourceServiceName: integration.SourceServiceName, SourceServiceType: string(integration.SourceServiceType), }) diff --git a/cmd/dbaas_external_integration_settings_show.go b/cmd/dbaas_external_integration_settings_show.go index d8dce28f..458a2f21 100644 --- a/cmd/dbaas_external_integration_settings_show.go +++ b/cmd/dbaas_external_integration_settings_show.go @@ -1,4 +1,5 @@ package cmd + import ( "fmt" "github.com/spf13/cobra" @@ -14,8 +15,12 @@ type dbaasExternalIntegrationSettingsShowCmd struct { } func (c *dbaasExternalIntegrationSettingsShowCmd) cmdAliases() []string { return gShowAlias } -func (c *dbaasExternalIntegrationSettingsShowCmd) cmdShort() string { return "Show External Integration Settings"} -func (c *dbaasExternalIntegrationSettingsShowCmd) cmdLong() string { return "Show External Integration Settings"} +func (c *dbaasExternalIntegrationSettingsShowCmd) cmdShort() string { + return "Show External Integration Settings" +} +func (c *dbaasExternalIntegrationSettingsShowCmd) cmdLong() string { + return "Show External Integration Settings" +} func (c *dbaasExternalIntegrationSettingsShowCmd) cmdPreRun(cmd *cobra.Command, args []string) error { return cliCommandDefaultPreRun(c, cmd, args) } diff --git a/cmd/dbaas_external_integration_settings_show_datadog.go b/cmd/dbaas_external_integration_settings_show_datadog.go index fc750f96..18278327 100644 --- a/cmd/dbaas_external_integration_settings_show_datadog.go +++ b/cmd/dbaas_external_integration_settings_show_datadog.go @@ -10,7 +10,7 @@ import ( ) type dbaasExternalIntegrationSettingsShowDatadogOutput struct { - DatadogDbmEnabled bool `json:"datadog-dbm-enabled"` + DatadogDbmEnabled bool `json:"datadog-dbm-enabled"` DatadogPgbouncerEnabled bool `json:"datadog-pgbouncer-enabled"` } @@ -37,7 +37,7 @@ func (c *dbaasExternalIntegrationSettingsShowCmd) showDatadog() (output.Outputte } out := &dbaasExternalIntegrationSettingsShowDatadogOutput{ - DatadogDbmEnabled: *res.Settings.DatadogDbmEnabled, + DatadogDbmEnabled: *res.Settings.DatadogDbmEnabled, DatadogPgbouncerEnabled: *res.Settings.DatadogPgbouncerEnabled, } return out, nil diff --git a/cmd/dbaas_external_integration_show.go b/cmd/dbaas_external_integration_show.go index a7c1c1ad..3f3d3e28 100644 --- a/cmd/dbaas_external_integration_show.go +++ b/cmd/dbaas_external_integration_show.go @@ -12,14 +12,14 @@ import ( ) type dbaasExternalIntegrationShowOutput struct { - Description string `json:"description"` - DestEndpointName string `json:"dest-endpoint-name"` - DestEndpointID string `json:"dest-endpoint-id"` - IntegrationID string `json:"id"` - Status string `json:"status"` + Description string `json:"description"` + DestEndpointName string `json:"dest-endpoint-name"` + DestEndpointID string `json:"dest-endpoint-id"` + IntegrationID string `json:"id"` + Status string `json:"status"` SourceServiceName string `json:"source-service-name"` SourceServiceType string `json:"source-service-type"` - Type string `json:"type"` + Type string `json:"type"` } func (o *dbaasExternalIntegrationShowOutput) ToJSON() { output.JSON(o) } @@ -53,21 +53,21 @@ func (c *dbaasExternalIntegrationShowCmd) showExternalIntegration() (output.Outp } out := &dbaasExternalIntegrationShowOutput{ - IntegrationID: string(res.IntegrationID), - Type: string(res.Type), - Description: res.Description, - DestEndpointName: res.DestEndpointName, - DestEndpointID: res.DestEndpointID, - Status: res.Status, - SourceServiceName: res.SourceServiceName, - SourceServiceType: string(res.SourceServiceType), - } + IntegrationID: string(res.IntegrationID), + Type: string(res.Type), + Description: res.Description, + DestEndpointName: res.DestEndpointName, + DestEndpointID: res.DestEndpointID, + Status: res.Status, + SourceServiceName: res.SourceServiceName, + SourceServiceType: string(res.SourceServiceType), + } return out, nil } func (c *dbaasExternalIntegrationShowCmd) cmdAliases() []string { return gShowAlias } -func (c *dbaasExternalIntegrationShowCmd) cmdShort() string { return "Show External Integration"} -func (c *dbaasExternalIntegrationShowCmd) cmdLong() string { return "Show External Integration"} +func (c *dbaasExternalIntegrationShowCmd) cmdShort() string { return "Show External Integration" } +func (c *dbaasExternalIntegrationShowCmd) cmdLong() string { return "Show External Integration" } func (c *dbaasExternalIntegrationShowCmd) cmdPreRun(cmd *cobra.Command, args []string) error { return cliCommandDefaultPreRun(c, cmd, args) }