From 66c40e4b55a6e4874252e116e2e644b59c1e35b1 Mon Sep 17 00:00:00 2001 From: simisoft-exo <108657152+simisoft-exo@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:31:25 +0100 Subject: [PATCH] dbaas: external integrations (#636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/exoscale/dbaas-api/pull/296 # Description ## Checklist (For exoscale contributors) * [x] Changelog updated (under *Unreleased* block) * [x] Testing ## Testing ```bash go run . dbaas external-endpoint create datadog cli-test-name-6 \ --datadog-api-key asdfasdfsadfasd \ --datadog-site datadoghq.eu \ --datadog-tags '[{"comment": "blabla","tag":"sometag"}]' ✔ Creating DBaaS Datadog external Endpoint "cli-test-name-6" 0s ┼────────────────────────────────┼──────────────────────────────────────┼ │ DATADOG EXTERNAL ENDPOINT │ │ ┼────────────────────────────────┼──────────────────────────────────────┼ │ Endpoint ID │ c15f1766-2321-4684-b9a8-c7bcca22949c │ │ Endpoint Name │ cli-test-name-6 │ │ Endpoint Type │ datadog │ │ Datadog API Key │ asdfasdfsadfasd │ │ Site │ datadoghq.eu │ │ Disable Consumer Stats │ false │ │ Kafka Consumer Check Instances │ 0 │ │ Kafka Consumer Stats Timeout │ 0 │ │ Max Partition Contexts │ 0 │ │ Datadog Tags │ sometag (blabla) │ ┼────────────────────────────────┼──────────────────────────────────────┼ ``` ``` go run . dbaas external-endpoint show datadog e87cdc43-a902-4e46-80d1-22e2bc97931a ┼────────────────────────────────┼──────────────────────────────────────┼ │ DATADOG EXTERNAL ENDPOINT │ │ ┼────────────────────────────────┼──────────────────────────────────────┼ │ Endpoint ID │ e87cdc43-a902-4e46-80d1-22e2bc97931a │ │ Endpoint Name │ cli-test-name-4 │ │ Endpoint Type │ datadog │ │ Datadog API Key │ asdfasdfsadfasd │ │ Site │ datadoghq.eu │ │ Disable Consumer Stats │ false │ │ Kafka Consumer Check Instances │ 0 │ │ Kafka Consumer Stats Timeout │ 0 │ │ Max Partition Contexts │ 0 │ │ Datadog Tags │ sometag (blabla) │ ┼────────────────────────────────┼──────────────────────────────────────┼ ``` ```bash go run . dbaas external-endpoint create opensearch cli-test-name-opensearch \ --opensearch-ca "-----BEGIN CERTIFICATE----- .... -----END CERTIFICATE-----" \ --opensearch-index-days-max 30 \ --opensearch-index-prefix "logs-" \ --opensearch-timeout 30 \ --opensearch-url "https://some-opensearch-cluster.com:9200" ✔ Creating DBaaS OpenSearch external Endpoint "cli-test-name-opensearch" 0s ┼──────────────────────────────┼──────────────────────────────────────────┼ │ OPENSEARCH EXTERNAL ENDPOINT │ │ ┼──────────────────────────────┼──────────────────────────────────────────┼ │ Endpoint ID │ a1b175a4-27eb-4c9a-8bbd-5b03cd5d5c6f │ │ Endpoint Name │ cli-test-name-opensearch │ │ Endpoint Type │ opensearch │ │ OpenSearch URL │ https://some-opensearch-cluster.com:9200 │ │ Index Prefix │ logs- │ │ CA Certificate │ -----BEGIN CERTIFICATE----- │ │ │ MIICnTCCAiSgAwIBAgIMCL... │ │ Index Days Max │ 30 │ │ Timeout │ 30 │ ┼──────────────────────────────┼──────────────────────────────────────────┼ ``` ```bash go run . dbaas external-endpoint create prometheus cli-prometheus \ --prometheus-basic-auth-username prom-username \ --prometheus-basic-auth-password super-strong-secret ✔ Creating DBaaS Prometheus external Endpoint "cli-prometheus" 0s ┼──────────────────────────────┼──────────────────────────────────────┼ │ PROMETHEUS EXTERNAL ENDPOINT │ │ ┼──────────────────────────────┼──────────────────────────────────────┼ │ Endpoint ID │ eab185cf-8adc-4a72-9dec-39a01c08df7e │ │ Endpoint Name │ cli-prometheus │ │ Endpoint Type │ prometheus │ │ Basic Auth Username │ prom-username │ │ Basic Auth Password │ super-strong-secret │ ┼──────────────────────────────┼──────────────────────────────────────┼ ``` ```bash go run . dbaas external-endpoint show prometheus 0ffa5b3c-bde4-4888-b9f2-1bcdbf0f8c9f ┼──────────────────────────────┼──────────────────────────────────────┼ │ PROMETHEUS EXTERNAL ENDPOINT │ │ ┼──────────────────────────────┼──────────────────────────────────────┼ │ Endpoint ID │ 0ffa5b3c-bde4-4888-b9f2-1bcdbf0f8c9f │ │ Endpoint Name │ prom-settings │ │ Endpoint Type │ prometheus │ │ Basic Auth Username │ something │ │ Basic Auth Password │ fantastickkk │ ┼──────────────────────────────┼──────────────────────────────────────┼ ``` ```bash go run . dbaas external-endpoint create rsyslog create-rsyslog-demo \ --rsyslog-ca "$(openssl req -x509 -newkey rsa:4096 -keyout /dev/null -out /dev/stdout -days 365 -nodes -subj '/CN=DemoCA' 2>/dev/null)" \ --rsyslog-cert "$(openssl req -x509 -newkey rsa:4096 -keyout /dev/null -out /dev/stdout -days 365 -nodes -subj '/CN=DemoClient' 2>/dev/null)" \ --rsyslog-format "rfc5424" \ --rsyslog-key "$(openssl genpkey -algorithm RSA -out /dev/stdout 2>/dev/null)" \ --rsyslog-logline "%% % % % % % %" \ --rsyslog-max-message-size 1000000000 \ --rsyslog-port 40404 \ --rsyslog-sd "something" \ --rsyslog-server "192.168.55.5" \ --rsyslog-tls ✔ Creating DBaaS Rsyslog external Endpoint "create-rsyslog-demo" 0s ┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────┼ │ RSYSLOG EXTERNAL ENDPOINT │ │ ┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────┼ │ Endpoint ID │ ae4af2ae-7367-462d-a0ad-bdbde9153f28 │ │ Endpoint Name │ create-rsyslog-demo │ │ Endpoint Type │ rsyslog │ │ Server │ 192.168.55.5 │ │ Port │ 40404 │ │ Tls │ true │ │ CA Certificate │ -----BEGIN CERTIFICATE----- │ │ │ MIIE0TCCArmgAwIBAgIUZc... │ │ Client Certificate │ -----BEGIN CERTIFICATE----- │ │ │ MIIE2TCCAsGgAwIBAgIUS1... │ │ Client Key │ -----BEGIN PRIVATE KEY----- │ │ │ MIIEvAIBADANBgkqhkiG9w... │ │ Max Message Size │ 1000000000 │ │ Structured data block │ something │ │ Custom logline format │ %% % % % % % % │ │ Custom logline format │ %% % % % % % % │ ┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────┼ ``` --- CHANGELOG.md | 1 + cmd/dbaas_external_endpoint.go | 14 + cmd/dbaas_external_endpoint_create.go | 115 +++ cmd/dbaas_external_endpoint_create_datadog.go | 80 ++ ..._external_endpoint_create_elasticsearch.go | 59 ++ ...aas_external_endpoint_create_opensearch.go | 59 ++ ...aas_external_endpoint_create_prometheus.go | 50 + cmd/dbaas_external_endpoint_create_rsyslog.go | 74 ++ cmd/dbaas_external_endpoint_delete.go | 83 ++ cmd/dbaas_external_endpoint_list.go | 69 ++ cmd/dbaas_external_endpoint_show.go | 61 ++ cmd/dbaas_external_endpoint_show_datadog.go | 87 ++ ...as_external_endpoint_show_elasticsearch.go | 65 ++ ...dbaas_external_endpoint_show_opensearch.go | 65 ++ ...dbaas_external_endpoint_show_prometheus.go | 61 ++ cmd/dbaas_external_endpoint_show_rsyslog.go | 73 ++ cmd/dbaas_external_endpoint_update.go | 115 +++ cmd/dbaas_external_endpoint_update_datadog.go | 80 ++ ..._external_endpoint_update_elasticsearch.go | 59 ++ ...aas_external_endpoint_update_opensearch.go | 59 ++ ...aas_external_endpoint_update_prometheus.go | 50 + cmd/dbaas_external_endpoint_update_rsyslog.go | 74 ++ cmd/dbaas_external_integration.go | 14 + cmd/dbaas_external_integration_attach.go | 75 ++ cmd/dbaas_external_integration_detach.go | 73 ++ cmd/dbaas_external_integration_list.go | 81 ++ cmd/dbaas_external_integration_settings.go | 14 + ...baas_external_integration_settings_show.go | 42 + ...ernal_integration_settings_show_datadog.go | 44 + ...as_external_integration_settings_update.go | 54 + ...nal_integration_settings_update_datadog.go | 60 ++ cmd/dbaas_external_integration_show.go | 83 ++ go.mod | 2 +- go.sum | 4 +- .../github.com/exoscale/egoscale/v3/client.go | 135 ++- .../exoscale/egoscale/v3/operations.go | 975 +++++++++++------- .../exoscale/egoscale/v3/schemas.go | 305 +++++- .../exoscale/egoscale/v3/version.go | 2 +- vendor/modules.txt | 2 +- 39 files changed, 2980 insertions(+), 438 deletions(-) create mode 100644 cmd/dbaas_external_endpoint.go create mode 100644 cmd/dbaas_external_endpoint_create.go create mode 100644 cmd/dbaas_external_endpoint_create_datadog.go create mode 100644 cmd/dbaas_external_endpoint_create_elasticsearch.go create mode 100644 cmd/dbaas_external_endpoint_create_opensearch.go create mode 100644 cmd/dbaas_external_endpoint_create_prometheus.go create mode 100644 cmd/dbaas_external_endpoint_create_rsyslog.go create mode 100644 cmd/dbaas_external_endpoint_delete.go create mode 100644 cmd/dbaas_external_endpoint_list.go create mode 100644 cmd/dbaas_external_endpoint_show.go create mode 100644 cmd/dbaas_external_endpoint_show_datadog.go create mode 100644 cmd/dbaas_external_endpoint_show_elasticsearch.go create mode 100644 cmd/dbaas_external_endpoint_show_opensearch.go create mode 100644 cmd/dbaas_external_endpoint_show_prometheus.go create mode 100644 cmd/dbaas_external_endpoint_show_rsyslog.go create mode 100644 cmd/dbaas_external_endpoint_update.go create mode 100644 cmd/dbaas_external_endpoint_update_datadog.go create mode 100644 cmd/dbaas_external_endpoint_update_elasticsearch.go create mode 100644 cmd/dbaas_external_endpoint_update_opensearch.go create mode 100644 cmd/dbaas_external_endpoint_update_prometheus.go create mode 100644 cmd/dbaas_external_endpoint_update_rsyslog.go create mode 100644 cmd/dbaas_external_integration.go create mode 100644 cmd/dbaas_external_integration_attach.go create mode 100644 cmd/dbaas_external_integration_detach.go create mode 100644 cmd/dbaas_external_integration_list.go create mode 100644 cmd/dbaas_external_integration_settings.go create mode 100644 cmd/dbaas_external_integration_settings_show.go create mode 100644 cmd/dbaas_external_integration_settings_show_datadog.go create mode 100644 cmd/dbaas_external_integration_settings_update.go create mode 100644 cmd/dbaas_external_integration_settings_update_datadog.go create mode 100644 cmd/dbaas_external_integration_show.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ba528db..85a8e411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features - instance pool: added min-available flag to exo compute #629 +- dbaas: external endpoints and external integration commands and sub-commands ## 1.79.1 diff --git a/cmd/dbaas_external_endpoint.go b/cmd/dbaas_external_endpoint.go new file mode 100644 index 00000000..dc155617 --- /dev/null +++ b/cmd/dbaas_external_endpoint.go @@ -0,0 +1,14 @@ +package cmd + +import ( + "github.com/spf13/cobra" +) + +var dbaasExternalEndpointCmd = &cobra.Command{ + Use: "external-endpoint", + Short: "Manage DBaaS external endpoints", +} + +func init() { + dbaasCmd.AddCommand(dbaasExternalEndpointCmd) +} diff --git a/cmd/dbaas_external_endpoint_create.go b/cmd/dbaas_external_endpoint_create.go new file mode 100644 index 00000000..d07775b0 --- /dev/null +++ b/cmd/dbaas_external_endpoint_create.go @@ -0,0 +1,115 @@ +package cmd + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" +) + +type dbaasExternalEndpointCreateCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"create"` + + Type string `cli-arg:"#"` + Name 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"` + HelpOpensearch bool `cli-usage:"show usage for flags specific to the opensearch external endpoint type"` + HelpPrometheus bool `cli-usage:"show usage for flags specific to the prometheus external endpoint type"` + HelpRsyslog bool `cli-usage:"show usage for flags specific to the rsyslog external endpoint type"` + + DatadogAPIKey string `cli-flag:"datadog-api-key" cli-usage:"Datadog API key" cli-hidden:""` + DatadogSite string `cli-flag:"datadog-site" cli-usage:"Datadog intake site. Defaults to datadoghq.com" cli-hidden:""` + DatadogTags string `cli-flag:"datadog-tags" cli-usage:"Datadog tags. Example. '[{\"comment\": \"ex\", \"tag\": \"aiven-asdfasda\"}]'" cli-hidden:""` + DatadogDisableConsumerStats bool `cli-flag:"datadog-disable-consumer-stats" cli-usage:"Disable consumer group metrics" cli-hidden:""` + DatadogKafkaConsumerCheckInstances int64 `cli-flag:"datadog-kafka-consumer-check-instances" cli-usage:"Number of separate instances to fetch kafka consumer statistics with" cli-hidden:""` + DatadogKafkaConsumerStatsTimeout int64 `cli-flag:"datadog-kafka-consumer-stats-timeout" cli-usage:"Number of seconds that datadog will wait to get consumer statistics from brokers" cli-hidden:""` + DatadogMaxPartitionContexts int64 `cli-flag:"datadog-max-partition-contexts" cli-usage:"Maximum number of partition contexts to send" cli-hidden:""` + + ElasticsearchURL string `cli-flag:"elasticsearch-url" cli-usage:"Elasticsearch connection URL" cli-hidden:""` + ElasticsearchIndexPrefix string `cli-flag:"elasticsearch-index-prefix" cli-usage:"Elasticsearch index prefix" cli-hidden:""` + ElasticsearchCA string `cli-flag:"elasticsearch-ca" cli-usage:"PEM encoded CA certificate" cli-hidden:""` + ElasticsearchIndexDaysMax int64 `cli-flag:"elasticsearch-index-days-max" cli-usage:"Maximum number of days of logs to keep" cli-hidden:""` + ElasticsearchTimeout int64 `cli-flag:"elasticsearch-timeout" cli-usage:"Elasticsearch request timeout limit" cli-hidden:""` + + OpensearchURL string `cli-flag:"opensearch-url" cli-usage:"OpenSearch connection URL" cli-hidden:""` + OpensearchIndexPrefix string `cli-flag:"opensearch-index-prefix" cli-usage:"OpenSearch index prefix" cli-hidden:""` + OpensearchCA string `cli-flag:"opensearch-ca" cli-usage:"PEM encoded CA certificate" cli-hidden:""` + OpensearchIndexDaysMax int64 `cli-flag:"opensearch-index-days-max" cli-usage:"Maximum number of days of logs to keep" cli-hidden:""` + OpensearchTimeout int64 `cli-flag:"opensearch-timeout" cli-usage:"OpenSearch request timeout limit" cli-hidden:""` + + PrometheusBasicAuthUsername string `cli-flag:"prometheus-basic-auth-username" cli-usage:"Prometheus basic authentication username" cli-hidden:""` + PrometheusBasicAuthPassword string `cli-flag:"prometheus-basic-auth-password" cli-usage:"Prometheus basic authentication password" cli-hidden:""` + + RsyslogServer string `cli-flag:"rsyslog-server" cli-usage:"Rsyslog server IP address or hostname" cli-hidden:""` + RsyslogPort int64 `cli-flag:"rsyslog-port" cli-usage:"Rsyslog server port" cli-hidden:""` + RsyslogTls bool `cli-flag:"rsyslog-tls" cli-usage:"Require TLS" cli-hidden:""` + RsyslogFormat string `cli-flag:"rsyslog-format" cli-usage:"Message format" cli-hidden:""` + RsyslogKey string `cli-flag:"rsyslog-key" cli-usage:"PEM encoded client key" cli-hidden:""` + RsyslogLogline string `cli-flag:"rsyslog-logline" cli-usage:"Custom syslog message format" cli-hidden:""` + RsyslogCA string `cli-flag:"rsyslog-ca" cli-usage:"PEM encoded CA certificate" cli-hidden:""` + RsyslogCert string `cli-flag:"rsyslog-cert" cli-usage:"PEM encoded client certificate" cli-hidden:""` + RsyslogSD string `cli-flag:"rsyslog-sd" cli-usage:"Structured data block for log message" cli-hidden:""` + RsyslogMaxMessageSize int64 `cli-flag:"rsyslog-max-message-size" cli-usage:"Rsyslog max message size" cli-hidden:""` +} + +func (c *dbaasExternalEndpointCreateCmd) cmdPreRun(cmd *cobra.Command, args []string) error { + switch { + case cmd.Flags().Changed("help-datadog"): + cmdShowHelpFlags(cmd.Flags(), "datadog-") + os.Exit(0) + case cmd.Flags().Changed("help-elasticsearch"): + cmdShowHelpFlags(cmd.Flags(), "elasticsearch-") + os.Exit(0) + case cmd.Flags().Changed("help-opensearch"): + cmdShowHelpFlags(cmd.Flags(), "opensearch-") + os.Exit(0) + case cmd.Flags().Changed("help-prometheus"): + cmdShowHelpFlags(cmd.Flags(), "prometheus-") + os.Exit(0) + case cmd.Flags().Changed("help-rsyslog"): + cmdShowHelpFlags(cmd.Flags(), "rsyslog-") + os.Exit(0) + } + + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalEndpointCreateCmd) cmdAliases() []string { + return gCreateAlias +} + +func (c *dbaasExternalEndpointCreateCmd) cmdLong() string { + return "Create a new external endpoint for DBaaS" +} + +func (c *dbaasExternalEndpointCreateCmd) cmdShort() string { + return "Create a new external endpoint for DBaaS" +} + +func (c *dbaasExternalEndpointCreateCmd) cmdRun(cmd *cobra.Command, args []string) error { + switch c.Type { + case ExternalEndpointTypeDatadog: + return c.createDatadog(cmd, args) + case ExternalEndpointTypeOpensearch: + return c.createOpensearch(cmd, args) + case ExternalEndpointTypeElasticsearch: + return c.createElasticsearch(cmd, args) + case ExternalEndpointTypePrometheus: + return c.createPrometheus(cmd, args) + case ExternalEndpointTypeRsyslog: + return c.createRsyslog(cmd, args) + default: + return fmt.Errorf("unsupported external endpoint type %q", c.Type) + } + +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalEndpointCmd, &dbaasExternalEndpointCreateCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_endpoint_create_datadog.go b/cmd/dbaas_external_endpoint_create_datadog.go new file mode 100644 index 00000000..d5b65bf0 --- /dev/null +++ b/cmd/dbaas_external_endpoint_create_datadog.go @@ -0,0 +1,80 @@ +package cmd + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + v3 "github.com/exoscale/egoscale/v3" +) + +func (c *dbaasExternalEndpointCreateCmd) createDatadog(cmd *cobra.Command, _ []string) error { + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + var datadogTags []v3.DBAASDatadogTag + if c.DatadogTags != "" { + if err := json.Unmarshal([]byte(c.DatadogTags), &datadogTags); err != nil { + return fmt.Errorf("failed to parse datadog tags: %v", err) + } + } + + datadogRequestPayload := v3.DBAASEndpointDatadogInputCreate{ + Settings: &v3.DBAASEndpointDatadogInputCreateSettings{}, + } + + if c.DatadogAPIKey != "" { + datadogRequestPayload.Settings.DatadogAPIKey = c.DatadogAPIKey + } + if c.DatadogSite != "" { + datadogRequestPayload.Settings.Site = v3.EnumDatadogSite(c.DatadogSite) + } + if c.DatadogTags != "" { + datadogRequestPayload.Settings.DatadogTags = datadogTags + } + if cmd.Flags().Changed("datadog-disable-consumer-stats") { + datadogRequestPayload.Settings.DisableConsumerStats = v3.Bool(c.DatadogDisableConsumerStats) + } + if c.DatadogKafkaConsumerCheckInstances != 0 { + datadogRequestPayload.Settings.KafkaConsumerCheckInstances = int64(c.DatadogKafkaConsumerCheckInstances) + } + if c.DatadogKafkaConsumerStatsTimeout != 0 { + datadogRequestPayload.Settings.KafkaConsumerStatsTimeout = int64(c.DatadogKafkaConsumerStatsTimeout) + } + if c.DatadogMaxPartitionContexts != 0 { + datadogRequestPayload.Settings.MaxPartitionContexts = int64(c.DatadogMaxPartitionContexts) + } + + op, err := client.CreateDBAASExternalEndpointDatadog(ctx, c.Name, datadogRequestPayload) + + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Creating DBaaS Datadog external Endpoint %q", c.Name), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "datadog", + }).cmdRun(nil, nil) + } + + return nil +} diff --git a/cmd/dbaas_external_endpoint_create_elasticsearch.go b/cmd/dbaas_external_endpoint_create_elasticsearch.go new file mode 100644 index 00000000..074ed32c --- /dev/null +++ b/cmd/dbaas_external_endpoint_create_elasticsearch.go @@ -0,0 +1,59 @@ +package cmd + +import ( + "fmt" + "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 { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + elasticsearchRequestPayload := v3.DBAASEndpointElasticsearchInputCreate{ + Settings: &v3.DBAASEndpointElasticsearchInputCreateSettings{}, + } + + if c.ElasticsearchURL != "" { + elasticsearchRequestPayload.Settings.URL = c.ElasticsearchURL + } + if c.ElasticsearchIndexPrefix != "" { + elasticsearchRequestPayload.Settings.IndexPrefix = c.ElasticsearchIndexPrefix + } + if c.ElasticsearchCA != "" { + elasticsearchRequestPayload.Settings.CA = c.ElasticsearchCA + } + if c.ElasticsearchIndexDaysMax != 0 { + elasticsearchRequestPayload.Settings.IndexDaysMax = c.ElasticsearchIndexDaysMax + } + if c.ElasticsearchTimeout != 0 { + elasticsearchRequestPayload.Settings.Timeout = c.ElasticsearchTimeout + } + + op, err := client.CreateDBAASExternalEndpointElasticsearch(ctx, c.Name, elasticsearchRequestPayload) + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Creating DBaaS ElasticSearch external Endpoint %q", c.Name), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "elasticsearch", + }).cmdRun(nil, nil) + } + return nil +} diff --git a/cmd/dbaas_external_endpoint_create_opensearch.go b/cmd/dbaas_external_endpoint_create_opensearch.go new file mode 100644 index 00000000..9a58dc10 --- /dev/null +++ b/cmd/dbaas_external_endpoint_create_opensearch.go @@ -0,0 +1,59 @@ +package cmd + +import ( + "fmt" + "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 { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + opensearchRequestPayload := v3.DBAASEndpointOpensearchInputCreate{ + Settings: &v3.DBAASEndpointOpensearchInputCreateSettings{}, + } + + if c.OpensearchURL != "" { + opensearchRequestPayload.Settings.URL = c.OpensearchURL + } + if c.OpensearchIndexPrefix != "" { + opensearchRequestPayload.Settings.IndexPrefix = c.OpensearchIndexPrefix + } + if c.OpensearchCA != "" { + opensearchRequestPayload.Settings.CA = c.OpensearchCA + } + if c.OpensearchIndexDaysMax != 0 { + opensearchRequestPayload.Settings.IndexDaysMax = c.OpensearchIndexDaysMax + } + if c.OpensearchTimeout != 0 { + opensearchRequestPayload.Settings.Timeout = c.OpensearchTimeout + } + + op, err := client.CreateDBAASExternalEndpointOpensearch(ctx, c.Name, opensearchRequestPayload) + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Creating DBaaS OpenSearch external Endpoint %q", c.Name), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "opensearch", + }).cmdRun(nil, nil) + } + return nil +} diff --git a/cmd/dbaas_external_endpoint_create_prometheus.go b/cmd/dbaas_external_endpoint_create_prometheus.go new file mode 100644 index 00000000..4e08ebda --- /dev/null +++ b/cmd/dbaas_external_endpoint_create_prometheus.go @@ -0,0 +1,50 @@ +package cmd + +import ( + "fmt" + "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 { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + prometheusRequestPayload := v3.DBAASEndpointPrometheusPayload{ + Settings: &v3.DBAASEndpointPrometheusPayloadSettings{}, + } + + if c.PrometheusBasicAuthPassword != "" { + prometheusRequestPayload.Settings.BasicAuthPassword = c.PrometheusBasicAuthPassword + } + if c.PrometheusBasicAuthUsername != "" { + prometheusRequestPayload.Settings.BasicAuthUsername = c.PrometheusBasicAuthUsername + } + + op, err := client.CreateDBAASExternalEndpointPrometheus(ctx, c.Name, prometheusRequestPayload) + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Creating DBaaS Prometheus external Endpoint %q", c.Name), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "prometheus", + }).cmdRun(nil, nil) + } + return nil +} diff --git a/cmd/dbaas_external_endpoint_create_rsyslog.go b/cmd/dbaas_external_endpoint_create_rsyslog.go new file mode 100644 index 00000000..c7056087 --- /dev/null +++ b/cmd/dbaas_external_endpoint_create_rsyslog.go @@ -0,0 +1,74 @@ +package cmd + +import ( + "fmt" + "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 { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + rsyslogRequestPayload := v3.DBAASEndpointRsyslogInputCreate{ + Settings: &v3.DBAASEndpointRsyslogInputCreateSettings{}, + } + + if c.RsyslogCA != "" { + rsyslogRequestPayload.Settings.CA = c.RsyslogCA + } + if c.RsyslogCert != "" { + rsyslogRequestPayload.Settings.Cert = c.RsyslogCert + } + if c.RsyslogFormat != "" { + rsyslogRequestPayload.Settings.Format = v3.EnumRsyslogFormat(c.RsyslogFormat) + } + if c.RsyslogLogline != "" { + rsyslogRequestPayload.Settings.Logline = c.RsyslogLogline + } + if c.RsyslogKey != "" { + rsyslogRequestPayload.Settings.Key = c.RsyslogKey + } + if c.RsyslogPort != 0 { + rsyslogRequestPayload.Settings.Port = c.RsyslogPort + } + if c.RsyslogMaxMessageSize != 0 { + rsyslogRequestPayload.Settings.MaxMessageSize = c.RsyslogMaxMessageSize + } + if c.RsyslogSD != "" { + rsyslogRequestPayload.Settings.SD = c.RsyslogSD + } + if c.RsyslogServer != "" { + rsyslogRequestPayload.Settings.Server = c.RsyslogServer + } + if cmd.Flags().Changed("rsyslog-tls") { + rsyslogRequestPayload.Settings.Tls = v3.Bool(c.RsyslogTls) + } + + op, err := client.CreateDBAASExternalEndpointRsyslog(ctx, c.Name, rsyslogRequestPayload) + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Creating DBaaS Rsyslog external Endpoint %q", c.Name), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "rsyslog", + }).cmdRun(nil, nil) + } + return nil +} diff --git a/cmd/dbaas_external_endpoint_delete.go b/cmd/dbaas_external_endpoint_delete.go new file mode 100644 index 00000000..6a231e26 --- /dev/null +++ b/cmd/dbaas_external_endpoint_delete.go @@ -0,0 +1,83 @@ +package cmd + +import ( + "fmt" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" +) + +type dbaasExternalEndpointDeleteCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"delete"` + + Type string `cli-arg:"#"` + EndpointID string `cli-arg:"#"` +} + +func (c *dbaasExternalEndpointDeleteCmd) cmdAliases() []string { + return gDeleteAlias +} + +func (c *dbaasExternalEndpointDeleteCmd) cmdLong() string { + return "Delete a DBaaS external endpoint" +} + +func (c *dbaasExternalEndpointDeleteCmd) cmdShort() string { + return "Delete a DBaaS external endpoint" +} + +func (c *dbaasExternalEndpointDeleteCmd) cmdPreRun(cmd *cobra.Command, args []string) error { + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalEndpointDeleteCmd) cmdRun(cmd *cobra.Command, args []string) error { + + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + endpointUUID, err := v3.ParseUUID(c.EndpointID) + if err != nil { + return fmt.Errorf("invalid endpoint ID: %w", err) + } + + var op *v3.Operation + var errOp error + switch c.Type { + case "datadog": + op, errOp = client.DeleteDBAASExternalEndpointDatadog(ctx, endpointUUID) + case "opensearch": + op, errOp = client.DeleteDBAASExternalEndpointOpensearch(ctx, endpointUUID) + case "elasticsearch": + op, errOp = client.DeleteDBAASExternalEndpointElasticsearch(ctx, endpointUUID) + case "prometheus": + op, errOp = client.DeleteDBAASExternalEndpointPrometheus(ctx, endpointUUID) + case "rsyslog": + op, errOp = client.DeleteDBAASExternalEndpointRsyslog(ctx, endpointUUID) + default: + return fmt.Errorf("unsupported external endpoint type %q", c.Type) + } + + if errOp != nil { + return errOp + } + + decorateAsyncOperation(fmt.Sprintf("Deleting external endpoint %s %s", c.Type, endpointUUID), func() { + _, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + + return err +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalEndpointCmd, &dbaasExternalEndpointDeleteCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_endpoint_list.go b/cmd/dbaas_external_endpoint_list.go new file mode 100644 index 00000000..78309a5c --- /dev/null +++ b/cmd/dbaas_external_endpoint_list.go @@ -0,0 +1,69 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + v3 "github.com/exoscale/egoscale/v3" +) + +type dbaasExternalEndpointListItemOutput struct { + Name string `json:"name"` + ID string `json:"id"` + Type string `json:"type"` +} + +type dbaasExternalEndpointListOutput []dbaasExternalEndpointListItemOutput + +func (o *dbaasExternalEndpointListOutput) ToJSON() { output.JSON(o) } +func (o *dbaasExternalEndpointListOutput) ToText() { output.Text(o) } +func (o *dbaasExternalEndpointListOutput) ToTable() { output.Table(o) } + +type dbaasExternalEndpointListCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"list"` +} + +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) cmdPreRun(cmd *cobra.Command, args []string) error { + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalEndpointListCmd) cmdRun(_ *cobra.Command, _ []string) error { + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + res, err := client.ListDBAASExternalEndpoints(ctx) + if err != nil { + return fmt.Errorf("error listing endpoints: %w", err) + } + + out := make(dbaasExternalEndpointListOutput, 0) + + for _, endpoint := range res.DBAASEndpoints { + out = append(out, dbaasExternalEndpointListItemOutput{ + Name: endpoint.Name, + ID: string(endpoint.ID), + Type: string(endpoint.Type), + }) + } + + return c.outputFunc(&out, nil) +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalEndpointCmd, &dbaasExternalEndpointListCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_endpoint_show.go b/cmd/dbaas_external_endpoint_show.go new file mode 100644 index 00000000..912bdec4 --- /dev/null +++ b/cmd/dbaas_external_endpoint_show.go @@ -0,0 +1,61 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +const ( + ExternalEndpointTypeDatadog = "datadog" + ExternalEndpointTypeOpensearch = "opensearch" + ExternalEndpointTypeElasticsearch = "elasticsearch" + ExternalEndpointTypePrometheus = "prometheus" + ExternalEndpointTypeRsyslog = "rsyslog" +) + +type dbaasExternalEndpointShowCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"show"` + + Type string `cli-arg:"#"` + EndpointID string `cli-arg:"#"` +} + +func (c *dbaasExternalEndpointShowCmd) cmdAliases() []string { return gShowAlias } + +func (c *dbaasExternalEndpointShowCmd) cmdShort() string { + return "Show a Database External endpoint details" +} + +func (c *dbaasExternalEndpointShowCmd) cmdLong() string { + return "This command shows a Database Service external endpoint details." +} + +func (c *dbaasExternalEndpointShowCmd) cmdPreRun(cmd *cobra.Command, args []string) error { + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalEndpointShowCmd) cmdRun(cmd *cobra.Command, args []string) error { + switch c.Type { + case ExternalEndpointTypeDatadog: + return c.outputFunc(c.showDatadog()) + case ExternalEndpointTypeOpensearch: + return c.outputFunc(c.showOpensearch()) + case ExternalEndpointTypeElasticsearch: + return c.outputFunc(c.showElasticsearch()) + case ExternalEndpointTypePrometheus: + return c.outputFunc(c.showPrometheus()) + case ExternalEndpointTypeRsyslog: + return c.outputFunc(c.showRsyslog()) + default: + return fmt.Errorf("unsupported external endpoint type %q", c.Type) + } +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalEndpointCmd, &dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_endpoint_show_datadog.go b/cmd/dbaas_external_endpoint_show_datadog.go new file mode 100644 index 00000000..efcd96f7 --- /dev/null +++ b/cmd/dbaas_external_endpoint_show_datadog.go @@ -0,0 +1,87 @@ +package cmd + +import ( + "fmt" + "os" + "strconv" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + "github.com/exoscale/cli/table" + v3 "github.com/exoscale/egoscale/v3" +) + +type datadogOutput struct { + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Settings v3.DBAASExternalEndpointDatadogOutputSettings `json:"settings"` +} + +func (o *datadogOutput) ToJSON() { output.JSON(o) } + +func (o *datadogOutput) ToText() { output.Text(o) } + +func (o *datadogOutput) ToTable() { + t := table.NewTable(os.Stdout) + t.SetHeader([]string{"Datadog External Endpoint"}) + defer t.Render() + + t.Append([]string{"Endpoint ID", o.ID}) + t.Append([]string{"Endpoint Name", o.Name}) + t.Append([]string{"Endpoint Type", o.Type}) + + settings := o.Settings + t.Append([]string{"Site", string(settings.Site)}) + + disableConsumerStats := "false" + if settings.DisableConsumerStats != nil && *settings.DisableConsumerStats { + disableConsumerStats = "true" + } + + t.Append([]string{"Disable Consumer Stats", disableConsumerStats}) + t.Append([]string{"Kafka Consumer Check Instances", strconv.FormatInt(settings.KafkaConsumerCheckInstances, 10)}) + 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 { + tagLines[i] = fmt.Sprintf("%s (%s)", tag.Tag, tag.Comment) + } + t.Append([]string{"Datadog Tags", tagLines[0]}) + for _, line := range tagLines[1:] { + t.Append([]string{"", line}) + } + } else { + t.Append([]string{"Datadog Tags", "None"}) + } +} + +func (c *dbaasExternalEndpointShowCmd) showDatadog() (output.Outputter, error) { + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return nil, err + } + + endpointUUID, err := v3.ParseUUID(c.EndpointID) + if err != nil { + return nil, fmt.Errorf("invalid endpoint ID: %w", err) + } + endpointResponse, err := client.GetDBAASExternalEndpointDatadog(ctx, endpointUUID) + if err != nil { + return nil, fmt.Errorf("error getting Datadog external endpoint: %w", err) + } + + output := &datadogOutput{ + ID: endpointResponse.ID.String(), + Name: endpointResponse.Name, + Type: string(endpointResponse.Type), + Settings: *endpointResponse.Settings, + } + + return output, nil +} diff --git a/cmd/dbaas_external_endpoint_show_elasticsearch.go b/cmd/dbaas_external_endpoint_show_elasticsearch.go new file mode 100644 index 00000000..d81ec915 --- /dev/null +++ b/cmd/dbaas_external_endpoint_show_elasticsearch.go @@ -0,0 +1,65 @@ +package cmd + +import ( + "fmt" + "os" + "strconv" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + "github.com/exoscale/cli/table" + v3 "github.com/exoscale/egoscale/v3" +) + +type elasticsearchOutput struct { + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Settings v3.DBAASEndpointElasticsearchOptionalFields `json:"settings"` +} + +func (o *elasticsearchOutput) ToJSON() { output.JSON(o) } +func (o *elasticsearchOutput) ToText() { output.Text(o) } +func (o *elasticsearchOutput) ToTable() { + t := table.NewTable(os.Stdout) + t.SetHeader([]string{"Elasticsearch External Endpoint"}) + defer t.Render() + + t.Append([]string{"Endpoint ID", o.ID}) + t.Append([]string{"Endpoint Name", o.Name}) + t.Append([]string{"Endpoint Type", o.Type}) + + settings := o.Settings + t.Append([]string{"Elasticsearch URL", settings.URL}) + t.Append([]string{"Index Prefix", settings.IndexPrefix}) + t.Append([]string{"Index Days Max", strconv.FormatInt(settings.IndexDaysMax, 10)}) + t.Append([]string{"Timeout", strconv.FormatInt(settings.Timeout, 10)}) +} + +func (c *dbaasExternalEndpointShowCmd) showElasticsearch() (output.Outputter, error) { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return nil, err + } + + endpointUUID, err := v3.ParseUUID(c.EndpointID) + if err != nil { + return nil, fmt.Errorf("invalid endpoint ID: %w", err) + } + + endpointResponse, err := client.GetDBAASExternalEndpointElasticsearch(ctx, endpointUUID) + if err != nil { + return nil, fmt.Errorf("error getting ElasticSearch external endpoint: %w", err) + } + + output := &elasticsearchOutput{ + ID: endpointResponse.ID.String(), + Name: endpointResponse.Name, + Type: string(endpointResponse.Type), + Settings: *endpointResponse.Settings, + } + + return output, nil +} diff --git a/cmd/dbaas_external_endpoint_show_opensearch.go b/cmd/dbaas_external_endpoint_show_opensearch.go new file mode 100644 index 00000000..57419b48 --- /dev/null +++ b/cmd/dbaas_external_endpoint_show_opensearch.go @@ -0,0 +1,65 @@ +package cmd + +import ( + "fmt" + "os" + "strconv" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + "github.com/exoscale/cli/table" + v3 "github.com/exoscale/egoscale/v3" +) + +type opensearchOutput struct { + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Settings v3.DBAASEndpointOpensearchOptionalFields `json:"settings"` +} + +func (o *opensearchOutput) ToJSON() { output.JSON(o) } +func (o *opensearchOutput) ToText() { output.Text(o) } +func (o *opensearchOutput) ToTable() { + t := table.NewTable(os.Stdout) + t.SetHeader([]string{"OpenSearch External Endpoint"}) + defer t.Render() + + t.Append([]string{"Endpoint ID", o.ID}) + t.Append([]string{"Endpoint Name", o.Name}) + t.Append([]string{"Endpoint Type", o.Type}) + + settings := o.Settings + t.Append([]string{"OpenSearch URL", settings.URL}) + t.Append([]string{"Index Prefix", settings.IndexPrefix}) + t.Append([]string{"Index Days Max", strconv.FormatInt(settings.IndexDaysMax, 10)}) + t.Append([]string{"Timeout", strconv.FormatInt(settings.Timeout, 10)}) +} + +func (c *dbaasExternalEndpointShowCmd) showOpensearch() (output.Outputter, error) { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return nil, err + } + + endpointUUID, err := v3.ParseUUID(c.EndpointID) + if err != nil { + return nil, fmt.Errorf("invalid endpoint ID: %w", err) + } + + endpointResponse, err := client.GetDBAASExternalEndpointOpensearch(ctx, endpointUUID) + if err != nil { + return nil, fmt.Errorf("error getting OpenSearch external endpoint: %w", err) + } + + output := &opensearchOutput{ + ID: endpointResponse.ID.String(), + Name: endpointResponse.Name, + Type: string(endpointResponse.Type), + Settings: *endpointResponse.Settings, + } + + return output, nil +} diff --git a/cmd/dbaas_external_endpoint_show_prometheus.go b/cmd/dbaas_external_endpoint_show_prometheus.go new file mode 100644 index 00000000..44b013cf --- /dev/null +++ b/cmd/dbaas_external_endpoint_show_prometheus.go @@ -0,0 +1,61 @@ +package cmd + +import ( + "fmt" + "os" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + "github.com/exoscale/cli/table" + v3 "github.com/exoscale/egoscale/v3" +) + +type prometheusOutput struct { + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Settings v3.DBAASEndpointExternalPrometheusOutputSettings `json:"settings"` +} + +func (o *prometheusOutput) ToJSON() { output.JSON(o) } +func (o *prometheusOutput) ToText() { output.Text(o) } +func (o *prometheusOutput) ToTable() { + t := table.NewTable(os.Stdout) + t.SetHeader([]string{"Prometheus External Endpoint"}) + defer t.Render() + + t.Append([]string{"Endpoint ID", o.ID}) + t.Append([]string{"Endpoint Name", o.Name}) + t.Append([]string{"Endpoint Type", o.Type}) + + settings := o.Settings + t.Append([]string{"Basic Auth Username", settings.BasicAuthUsername}) +} + +func (c *dbaasExternalEndpointShowCmd) showPrometheus() (output.Outputter, error) { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return nil, err + } + + endpointUUID, err := v3.ParseUUID(c.EndpointID) + if err != nil { + return nil, fmt.Errorf("invalid endpoint ID: %w", err) + } + + endpointResponse, err := client.GetDBAASExternalEndpointPrometheus(ctx, endpointUUID) + if err != nil { + return nil, fmt.Errorf("error getting Prometheus external endpoint: %w", err) + } + + output := &prometheusOutput{ + ID: endpointResponse.ID.String(), + Name: endpointResponse.Name, + Type: string(endpointResponse.Type), + Settings: *endpointResponse.Settings, + } + + return output, nil +} diff --git a/cmd/dbaas_external_endpoint_show_rsyslog.go b/cmd/dbaas_external_endpoint_show_rsyslog.go new file mode 100644 index 00000000..415a59e7 --- /dev/null +++ b/cmd/dbaas_external_endpoint_show_rsyslog.go @@ -0,0 +1,73 @@ +package cmd + +import ( + "fmt" + "os" + "strconv" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + "github.com/exoscale/cli/table" + v3 "github.com/exoscale/egoscale/v3" +) + +type rsyslogOutput struct { + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Settings v3.DBAASEndpointRsyslogOptionalFields `json:"settings"` +} + +func (o *rsyslogOutput) ToJSON() { output.JSON(o) } +func (o *rsyslogOutput) ToText() { output.Text(o) } +func (o *rsyslogOutput) ToTable() { + t := table.NewTable(os.Stdout) + t.SetHeader([]string{"Rsyslog External Endpoint"}) + defer t.Render() + + t.Append([]string{"Endpoint ID", o.ID}) + t.Append([]string{"Endpoint Name", o.Name}) + t.Append([]string{"Endpoint Type", o.Type}) + + settings := o.Settings + tls := "false" + + 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{"Tls", tls}) + t.Append([]string{"Max Message Size", strconv.FormatInt(settings.MaxMessageSize, 10)}) + t.Append([]string{"Structured data block", settings.SD}) + t.Append([]string{"Custom logline format", settings.Logline}) +} + +func (c *dbaasExternalEndpointShowCmd) showRsyslog() (output.Outputter, error) { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return nil, err + } + + endpointUUID, err := v3.ParseUUID(c.EndpointID) + if err != nil { + return nil, fmt.Errorf("invalid endpoint ID: %w", err) + } + + endpointResponse, err := client.GetDBAASExternalEndpointRsyslog(ctx, endpointUUID) + if err != nil { + return nil, fmt.Errorf("error getting Rsyslog external endpoint: %w", err) + } + + output := &rsyslogOutput{ + ID: endpointResponse.ID.String(), + Name: endpointResponse.Name, + Type: string(endpointResponse.Type), + Settings: *endpointResponse.Settings, + } + + return output, nil +} diff --git a/cmd/dbaas_external_endpoint_update.go b/cmd/dbaas_external_endpoint_update.go new file mode 100644 index 00000000..d3682540 --- /dev/null +++ b/cmd/dbaas_external_endpoint_update.go @@ -0,0 +1,115 @@ +package cmd + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" +) + +type dbaasExternalEndpointUpdateCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"update"` + + Type 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"` + HelpOpensearch bool `cli-usage:"show usage for flags specific to the opensearch external endpoint type"` + HelpPrometheus bool `cli-usage:"show usage for flags specific to the prometheus external endpoint type"` + HelpRsyslog bool `cli-usage:"show usage for flags specific to the rsyslog external endpoint type"` + + DatadogAPIKey string `cli-flag:"datadog-api-key" cli-usage:"Datadog API key" cli-hidden:""` + DatadogSite string `cli-flag:"datadog-site" cli-usage:"Datadog intake site. Defaults to datadoghq.com" cli-hidden:""` + DatadogTags string `cli-flag:"datadog-tags" cli-usage:"Datadog tags. Example. '[{\"comment\": \"ex\", \"tag\": \"aiven-asdfasda\"}]'" cli-hidden:""` + DatadogDisableConsumerStats bool `cli-flag:"datadog-disable-consumer-stats" cli-usage:"Disable consumer group metrics" cli-hidden:""` + DatadogKafkaConsumerCheckInstances int64 `cli-flag:"datadog-kafka-consumer-check-instances" cli-usage:"Number of separate instances to fetch kafka consumer statistics with" cli-hidden:""` + DatadogKafkaConsumerStatsTimeout int64 `cli-flag:"datadog-kafka-consumer-stats-timeout" cli-usage:"Number of seconds that datadog will wait to get consumer statistics from brokers" cli-hidden:""` + DatadogMaxPartitionContexts int64 `cli-flag:"datadog-max-partition-contexts" cli-usage:"Maximum number of partition contexts to send" cli-hidden:""` + + ElasticsearchURL string `cli-flag:"elasticsearch-url" cli-usage:"Elasticsearch connection URL" cli-hidden:""` + ElasticsearchIndexPrefix string `cli-flag:"elasticsearch-index-prefix" cli-usage:"Elasticsearch index prefix" cli-hidden:""` + ElasticsearchCA string `cli-flag:"elasticsearch-ca" cli-usage:"PEM encoded CA certificate" cli-hidden:""` + ElasticsearchIndexDaysMax int64 `cli-flag:"elasticsearch-index-days-max" cli-usage:"Maximum number of days of logs to keep" cli-hidden:""` + ElasticsearchTimeout int64 `cli-flag:"elasticsearch-timeout" cli-usage:"Elasticsearch request timeout limit" cli-hidden:""` + + OpensearchURL string `cli-flag:"opensearch-url" cli-usage:"OpenSearch connection URL" cli-hidden:""` + OpensearchIndexPrefix string `cli-flag:"opensearch-index-prefix" cli-usage:"OpenSearch index prefix" cli-hidden:""` + OpensearchCA string `cli-flag:"opensearch-ca" cli-usage:"PEM encoded CA certificate" cli-hidden:""` + OpensearchIndexDaysMax int64 `cli-flag:"opensearch-index-days-max" cli-usage:"Maximum number of days of logs to keep" cli-hidden:""` + OpensearchTimeout int64 `cli-flag:"opensearch-timeout" cli-usage:"OpenSearch request timeout limit" cli-hidden:""` + + PrometheusBasicAuthUsername string `cli-flag:"prometheus-basic-auth-username" cli-usage:"Prometheus basic authentication username" cli-hidden:""` + PrometheusBasicAuthPassword string `cli-flag:"prometheus-basic-auth-password" cli-usage:"Prometheus basic authentication password" cli-hidden:""` + + RsyslogServer string `cli-flag:"rsyslog-server" cli-usage:"Rsyslog server IP address or hostname" cli-hidden:""` + RsyslogPort int64 `cli-flag:"rsyslog-port" cli-usage:"Rsyslog server port" cli-hidden:""` + RsyslogTls bool `cli-flag:"rsyslog-tls" cli-usage:"Require TLS" cli-hidden:""` + RsyslogFormat string `cli-flag:"rsyslog-format" cli-usage:"Message format" cli-hidden:""` + RsyslogKey string `cli-flag:"rsyslog-key" cli-usage:"PEM encoded client key" cli-hidden:""` + RsyslogLogline string `cli-flag:"rsyslog-logline" cli-usage:"Custom syslog message format" cli-hidden:""` + RsyslogCA string `cli-flag:"rsyslog-ca" cli-usage:"PEM encoded CA certificate" cli-hidden:""` + RsyslogCert string `cli-flag:"rsyslog-cert" cli-usage:"PEM encoded client certificate" cli-hidden:""` + RsyslogSD string `cli-flag:"rsyslog-sd" cli-usage:"Structured data block for log message" cli-hidden:""` + RsyslogMaxMessageSize int64 `cli-flag:"rsyslog-max-message-size" cli-usage:"Rsyslog max message size" cli-hidden:""` +} + +func (c *dbaasExternalEndpointUpdateCmd) cmdPreRun(cmd *cobra.Command, args []string) error { + switch { + case cmd.Flags().Changed("help-datadog"): + cmdShowHelpFlags(cmd.Flags(), "datadog-") + os.Exit(0) + case cmd.Flags().Changed("help-elasticsearch"): + cmdShowHelpFlags(cmd.Flags(), "elasticsearch-") + os.Exit(0) + case cmd.Flags().Changed("help-opensearch"): + cmdShowHelpFlags(cmd.Flags(), "opensearch-") + os.Exit(0) + case cmd.Flags().Changed("help-prometheus"): + cmdShowHelpFlags(cmd.Flags(), "prometheus-") + os.Exit(0) + case cmd.Flags().Changed("help-rsyslog"): + cmdShowHelpFlags(cmd.Flags(), "rsyslog-") + os.Exit(0) + } + + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalEndpointUpdateCmd) cmdAliases() []string { + return nil +} + +func (c *dbaasExternalEndpointUpdateCmd) cmdLong() string { + return "Update an existing external endpoint for DBaaS" +} + +func (c *dbaasExternalEndpointUpdateCmd) cmdShort() string { + return "Update an existing external endpoint for DBaaS" +} + +func (c *dbaasExternalEndpointUpdateCmd) cmdRun(cmd *cobra.Command, args []string) error { + switch c.Type { + case ExternalEndpointTypeDatadog: + return c.updateDatadog(cmd, args) + case ExternalEndpointTypeOpensearch: + return c.updateOpensearch(cmd, args) + case ExternalEndpointTypeElasticsearch: + return c.updateElasticsearch(cmd, args) + case ExternalEndpointTypePrometheus: + return c.updatePrometheus(cmd, args) + case ExternalEndpointTypeRsyslog: + return c.updateRsyslog(cmd, args) + default: + return fmt.Errorf("unsupported external endpoint type %q", c.Type) + } + +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalEndpointCmd, &dbaasExternalEndpointUpdateCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_endpoint_update_datadog.go b/cmd/dbaas_external_endpoint_update_datadog.go new file mode 100644 index 00000000..e397fe11 --- /dev/null +++ b/cmd/dbaas_external_endpoint_update_datadog.go @@ -0,0 +1,80 @@ +package cmd + +import ( + "encoding/json" + "fmt" + + "github.com/spf13/cobra" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + v3 "github.com/exoscale/egoscale/v3" +) + +func (c *dbaasExternalEndpointUpdateCmd) updateDatadog(cmd *cobra.Command, _ []string) error { + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + var datadogTags []v3.DBAASDatadogTag + if c.DatadogTags != "" { + if err := json.Unmarshal([]byte(c.DatadogTags), &datadogTags); err != nil { + return fmt.Errorf("failed to parse datadog tags: %v", err) + } + } + + datadogRequestPayload := v3.DBAASEndpointDatadogInputUpdate{ + Settings: &v3.DBAASEndpointDatadogInputUpdateSettings{}, + } + + if c.DatadogAPIKey != "" { + datadogRequestPayload.Settings.DatadogAPIKey = c.DatadogAPIKey + } + if c.DatadogSite != "" { + datadogRequestPayload.Settings.Site = v3.EnumDatadogSite(c.DatadogSite) + } + if c.DatadogTags != "" { + datadogRequestPayload.Settings.DatadogTags = datadogTags + } + if cmd.Flags().Changed("datadog-disable-consumer-stats") { + datadogRequestPayload.Settings.DisableConsumerStats = v3.Bool(c.DatadogDisableConsumerStats) + } + if c.DatadogKafkaConsumerCheckInstances != 0 { + datadogRequestPayload.Settings.KafkaConsumerCheckInstances = int64(c.DatadogKafkaConsumerCheckInstances) + } + if c.DatadogKafkaConsumerStatsTimeout != 0 { + datadogRequestPayload.Settings.KafkaConsumerStatsTimeout = int64(c.DatadogKafkaConsumerStatsTimeout) + } + if c.DatadogMaxPartitionContexts != 0 { + datadogRequestPayload.Settings.MaxPartitionContexts = int64(c.DatadogMaxPartitionContexts) + } + + op, err := client.UpdateDBAASExternalEndpointDatadog(ctx, v3.UUID(c.ID), datadogRequestPayload) + + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Updating DBaaS Datadog external Endpoint %q", c.ID), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "datadog", + }).cmdRun(nil, nil) + } + + return nil +} diff --git a/cmd/dbaas_external_endpoint_update_elasticsearch.go b/cmd/dbaas_external_endpoint_update_elasticsearch.go new file mode 100644 index 00000000..17788304 --- /dev/null +++ b/cmd/dbaas_external_endpoint_update_elasticsearch.go @@ -0,0 +1,59 @@ +package cmd + +import ( + "fmt" + "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 { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + elasticsearchRequestPayload := v3.DBAASEndpointElasticsearchInputUpdate{ + Settings: &v3.DBAASEndpointElasticsearchInputUpdateSettings{}, + } + + if c.ElasticsearchURL != "" { + elasticsearchRequestPayload.Settings.URL = c.ElasticsearchURL + } + if c.ElasticsearchIndexPrefix != "" { + elasticsearchRequestPayload.Settings.IndexPrefix = c.ElasticsearchIndexPrefix + } + if c.ElasticsearchCA != "" { + elasticsearchRequestPayload.Settings.CA = c.ElasticsearchCA + } + if c.ElasticsearchIndexDaysMax != 0 { + elasticsearchRequestPayload.Settings.IndexDaysMax = c.ElasticsearchIndexDaysMax + } + if c.ElasticsearchTimeout != 0 { + elasticsearchRequestPayload.Settings.Timeout = c.ElasticsearchTimeout + } + + op, err := client.UpdateDBAASExternalEndpointElasticsearch(ctx, v3.UUID(c.ID), elasticsearchRequestPayload) + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Updating DBaaS ElasticSearch external Endpoint %q", c.ID), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "elasticsearch", + }).cmdRun(nil, nil) + } + return nil +} diff --git a/cmd/dbaas_external_endpoint_update_opensearch.go b/cmd/dbaas_external_endpoint_update_opensearch.go new file mode 100644 index 00000000..63cd29da --- /dev/null +++ b/cmd/dbaas_external_endpoint_update_opensearch.go @@ -0,0 +1,59 @@ +package cmd + +import ( + "fmt" + "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 { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + opensearchRequestPayload := v3.DBAASEndpointOpensearchInputUpdate{ + Settings: &v3.DBAASEndpointOpensearchInputUpdateSettings{}, + } + + if c.OpensearchURL != "" { + opensearchRequestPayload.Settings.URL = c.OpensearchURL + } + if c.OpensearchIndexPrefix != "" { + opensearchRequestPayload.Settings.IndexPrefix = c.OpensearchIndexPrefix + } + if c.OpensearchCA != "" { + opensearchRequestPayload.Settings.CA = c.OpensearchCA + } + if c.OpensearchIndexDaysMax != 0 { + opensearchRequestPayload.Settings.IndexDaysMax = c.OpensearchIndexDaysMax + } + if c.OpensearchTimeout != 0 { + opensearchRequestPayload.Settings.Timeout = c.OpensearchTimeout + } + + op, err := client.UpdateDBAASExternalEndpointOpensearch(ctx, v3.UUID(c.ID), opensearchRequestPayload) + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Updating DBaaS OpenSearch external Endpoint %q", c.ID), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "opensearch", + }).cmdRun(nil, nil) + } + return nil +} diff --git a/cmd/dbaas_external_endpoint_update_prometheus.go b/cmd/dbaas_external_endpoint_update_prometheus.go new file mode 100644 index 00000000..118c822f --- /dev/null +++ b/cmd/dbaas_external_endpoint_update_prometheus.go @@ -0,0 +1,50 @@ +package cmd + +import ( + "fmt" + "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 { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + prometheusRequestPayload := v3.DBAASEndpointPrometheusPayload{ + Settings: &v3.DBAASEndpointPrometheusPayloadSettings{}, + } + + if c.PrometheusBasicAuthPassword != "" { + prometheusRequestPayload.Settings.BasicAuthPassword = c.PrometheusBasicAuthPassword + } + if c.PrometheusBasicAuthUsername != "" { + prometheusRequestPayload.Settings.BasicAuthUsername = c.PrometheusBasicAuthUsername + } + + op, err := client.UpdateDBAASExternalEndpointPrometheus(ctx, v3.UUID(c.ID), prometheusRequestPayload) + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Updating DBaaS Prometheus external Endpoint %q", c.ID), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "prometheus", + }).cmdRun(nil, nil) + } + return nil +} diff --git a/cmd/dbaas_external_endpoint_update_rsyslog.go b/cmd/dbaas_external_endpoint_update_rsyslog.go new file mode 100644 index 00000000..b4b2ae1e --- /dev/null +++ b/cmd/dbaas_external_endpoint_update_rsyslog.go @@ -0,0 +1,74 @@ +package cmd + +import ( + "fmt" + "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 { + ctx := gContext + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + rsyslogRequestPayload := v3.DBAASEndpointRsyslogInputUpdate{ + Settings: &v3.DBAASEndpointRsyslogInputUpdateSettings{}, + } + + if c.RsyslogCA != "" { + rsyslogRequestPayload.Settings.CA = c.RsyslogCA + } + if c.RsyslogCert != "" { + rsyslogRequestPayload.Settings.Cert = c.RsyslogCert + } + if c.RsyslogFormat != "" { + rsyslogRequestPayload.Settings.Format = v3.EnumRsyslogFormat(c.RsyslogFormat) + } + if c.RsyslogLogline != "" { + rsyslogRequestPayload.Settings.Logline = c.RsyslogLogline + } + if c.RsyslogKey != "" { + rsyslogRequestPayload.Settings.Key = c.RsyslogKey + } + if c.RsyslogPort != 0 { + rsyslogRequestPayload.Settings.Port = c.RsyslogPort + } + if c.RsyslogMaxMessageSize != 0 { + rsyslogRequestPayload.Settings.MaxMessageSize = c.RsyslogMaxMessageSize + } + if c.RsyslogSD != "" { + rsyslogRequestPayload.Settings.SD = c.RsyslogSD + } + if c.RsyslogServer != "" { + rsyslogRequestPayload.Settings.Server = c.RsyslogServer + } + if cmd.Flags().Changed("rsyslog-tls") { + rsyslogRequestPayload.Settings.Tls = v3.Bool(c.RsyslogTls) + } + + op, err := client.UpdateDBAASExternalEndpointRsyslog(ctx, v3.UUID(c.ID), rsyslogRequestPayload) + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Updating DBaaS Rsyslog external Endpoint %q", c.ID), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + if err != nil { + return err + } + + endpointID := op.Reference.ID.String() + if !globalstate.Quiet { + return (&dbaasExternalEndpointShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + EndpointID: endpointID, + Type: "rsyslog", + }).cmdRun(nil, nil) + } + return nil +} diff --git a/cmd/dbaas_external_integration.go b/cmd/dbaas_external_integration.go new file mode 100644 index 00000000..82d16063 --- /dev/null +++ b/cmd/dbaas_external_integration.go @@ -0,0 +1,14 @@ +package cmd + +import ( + "github.com/spf13/cobra" +) + +var dbaasExternalIntegrationCmd = &cobra.Command{ + Use: "external-integration", + Short: "Manage DBaaS external integrations", +} + +func init() { + dbaasCmd.AddCommand(dbaasExternalIntegrationCmd) +} diff --git a/cmd/dbaas_external_integration_attach.go b/cmd/dbaas_external_integration_attach.go new file mode 100644 index 00000000..beb43eee --- /dev/null +++ b/cmd/dbaas_external_integration_attach.go @@ -0,0 +1,75 @@ +package cmd + +import ( + "fmt" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" +) + +type dbaasExternalIntegrationAttachCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"attach"` + + Type string `cli-arg:"#"` + + SourceServiceName string `cli-flag:"source-service-name" cli-usage:"DBaaS source service name"` + DestinationEndpointID string `cli-flag:"destination-endpoint-id" cli-usage:"Destination external endpoint id"` +} + +func (c *dbaasExternalIntegrationAttachCmd) cmdAliases() []string { + return []string{"a"} +} + +func (c *dbaasExternalIntegrationAttachCmd) cmdLong() string { + return "Enable sending data from an existing DBaaS service to an external endpoint" +} + +func (c *dbaasExternalIntegrationAttachCmd) cmdShort() string { + return "Attach a DBaaS service to an external endpoint" +} + +func (c *dbaasExternalIntegrationAttachCmd) cmdPreRun(cmd *cobra.Command, args []string) error { + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalIntegrationAttachCmd) cmdRun(cmd *cobra.Command, args []string) error { + + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + endpointID, err := v3.ParseUUID(c.DestinationEndpointID) + if err != nil { + return fmt.Errorf("invalid endpoint ID: %w", err) + } + + req := v3.AttachDBAASServiceToEndpointRequest{ + DestEndpointID: endpointID, + Type: v3.EnumExternalEndpointTypes(c.Type), + } + + op, err := client.AttachDBAASServiceToEndpoint(ctx, c.SourceServiceName, req) + + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Attaching service %s to endpoint %s", c.SourceServiceName, endpointID), func() { + _, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + + return err +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalIntegrationCmd, &dbaasExternalIntegrationAttachCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_integration_detach.go b/cmd/dbaas_external_integration_detach.go new file mode 100644 index 00000000..9b3ce3ab --- /dev/null +++ b/cmd/dbaas_external_integration_detach.go @@ -0,0 +1,73 @@ +package cmd + +import ( + "fmt" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + v3 "github.com/exoscale/egoscale/v3" + "github.com/spf13/cobra" +) + +type dbaasExternalIntegrationDetachCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"detach"` + + SourceServiceName string `cli-arg:"#"` + + IntegrationID string `cli-flag:"integration-id" cli-usage:"External integration id"` +} + +func (c *dbaasExternalIntegrationDetachCmd) cmdAliases() []string { + return []string{"a"} +} + +func (c *dbaasExternalIntegrationDetachCmd) cmdLong() string { + return "Disable sending data from an existing DBaaS service to an external endpoint" +} + +func (c *dbaasExternalIntegrationDetachCmd) cmdShort() string { + return "Detach a DBaaS service from an external endpoint" +} + +func (c *dbaasExternalIntegrationDetachCmd) cmdPreRun(cmd *cobra.Command, args []string) error { + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalIntegrationDetachCmd) cmdRun(cmd *cobra.Command, args []string) error { + + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + integrationID, err := v3.ParseUUID(c.IntegrationID) + if err != nil { + return fmt.Errorf("invalid integration ID: %w", err) + } + + req := v3.DetachDBAASServiceFromEndpointRequest{ + IntegrationID: integrationID, + } + + op, err := client.DetachDBAASServiceFromEndpoint(ctx, c.SourceServiceName, req) + + if err != nil { + return err + } + + decorateAsyncOperation(fmt.Sprintf("Detaching service %s from endpoint %s", c.SourceServiceName, integrationID), func() { + _, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + + return err +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalIntegrationCmd, &dbaasExternalIntegrationDetachCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_integration_list.go b/cmd/dbaas_external_integration_list.go new file mode 100644 index 00000000..ce5d3dd3 --- /dev/null +++ b/cmd/dbaas_external_integration_list.go @@ -0,0 +1,81 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + v3 "github.com/exoscale/egoscale/v3" +) + +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"` + SourceServiceName string `json:"source-service-name"` + SourceServiceType string `json:"source-service-type"` + Type string `json:"type"` +} + +type dbaasExternalIntegrationListOutput []dbaasExternalIntegrationListItemOutput + +func (o *dbaasExternalIntegrationListOutput) ToJSON() { output.JSON(o) } +func (o *dbaasExternalIntegrationListOutput) ToText() { output.Text(o) } +func (o *dbaasExternalIntegrationListOutput) ToTable() { output.Table(o) } + +type dbaasExternalIntegrationListCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"list"` + + ServiceName string `cli-arg:"#"` +} + +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) cmdPreRun(cmd *cobra.Command, args []string) error { + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalIntegrationListCmd) cmdRun(_ *cobra.Command, _ []string) error { + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + res, err := client.ListDBAASExternalIntegrations(ctx, c.ServiceName) + if err != nil { + return fmt.Errorf("error listing integrations: %w", err) + } + + out := make(dbaasExternalIntegrationListOutput, 0) + + 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, + SourceServiceName: integration.SourceServiceName, + SourceServiceType: string(integration.SourceServiceType), + }) + } + + return c.outputFunc(&out, nil) +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalIntegrationCmd, &dbaasExternalIntegrationListCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_integration_settings.go b/cmd/dbaas_external_integration_settings.go new file mode 100644 index 00000000..cf875d5b --- /dev/null +++ b/cmd/dbaas_external_integration_settings.go @@ -0,0 +1,14 @@ +package cmd + +import ( + "github.com/spf13/cobra" +) + +var dbaasExternalIntegrationSettingsCmd = &cobra.Command{ + Use: "settings", + Short: "External integration settings management", +} + +func init() { + dbaasExternalIntegrationCmd.AddCommand(dbaasExternalIntegrationSettingsCmd) +} diff --git a/cmd/dbaas_external_integration_settings_show.go b/cmd/dbaas_external_integration_settings_show.go new file mode 100644 index 00000000..cfd65470 --- /dev/null +++ b/cmd/dbaas_external_integration_settings_show.go @@ -0,0 +1,42 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +type dbaasExternalIntegrationSettingsShowCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"show"` + + Type string `cli-arg:"#"` + IntegrationID string `cli-arg:"#"` +} + +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) cmdPreRun(cmd *cobra.Command, args []string) error { + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalIntegrationSettingsShowCmd) cmdRun(_ *cobra.Command, _ []string) error { + switch c.Type { + case ExternalEndpointTypeDatadog: + return c.outputFunc(c.showDatadog()) + default: + return fmt.Errorf("unsupported external integration settings for type %q", c.Type) + } +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalIntegrationSettingsCmd, &dbaasExternalIntegrationSettingsShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_integration_settings_show_datadog.go b/cmd/dbaas_external_integration_settings_show_datadog.go new file mode 100644 index 00000000..18278327 --- /dev/null +++ b/cmd/dbaas_external_integration_settings_show_datadog.go @@ -0,0 +1,44 @@ +package cmd + +import ( + "fmt" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + v3 "github.com/exoscale/egoscale/v3" +) + +type dbaasExternalIntegrationSettingsShowDatadogOutput struct { + DatadogDbmEnabled bool `json:"datadog-dbm-enabled"` + DatadogPgbouncerEnabled bool `json:"datadog-pgbouncer-enabled"` +} + +func (o *dbaasExternalIntegrationSettingsShowDatadogOutput) ToJSON() { output.JSON(o) } +func (o *dbaasExternalIntegrationSettingsShowDatadogOutput) ToText() { output.Text(o) } +func (o *dbaasExternalIntegrationSettingsShowDatadogOutput) ToTable() { output.Table(o) } + +func (c *dbaasExternalIntegrationSettingsShowCmd) showDatadog() (output.Outputter, error) { + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return nil, err + } + + integrationID, err := v3.ParseUUID(c.IntegrationID) + if err != nil { + return nil, fmt.Errorf("invalid integration ID: %w", err) + } + + res, err := client.GetDBAASExternalIntegrationSettingsDatadog(ctx, integrationID) + if err != nil { + return nil, fmt.Errorf("error getting settings for integration: %w", err) + } + + out := &dbaasExternalIntegrationSettingsShowDatadogOutput{ + DatadogDbmEnabled: *res.Settings.DatadogDbmEnabled, + DatadogPgbouncerEnabled: *res.Settings.DatadogPgbouncerEnabled, + } + return out, nil +} diff --git a/cmd/dbaas_external_integration_settings_update.go b/cmd/dbaas_external_integration_settings_update.go new file mode 100644 index 00000000..648e7572 --- /dev/null +++ b/cmd/dbaas_external_integration_settings_update.go @@ -0,0 +1,54 @@ +package cmd + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" +) + +type dbaasExternalIntegrationSettingsUpdateCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"update"` + + Type string `cli-arg:"#"` + IntegrationID string `cli-arg:"#"` + + HelpDatadog bool `cli-usage:"show usage for flags specific to the datadog external integration type"` + + DatadogDbmEnabled bool `cli-flag:"datadog-dbm-enabled" cli-usage:"Enable/Disable pg stats with Datadog"` + DatadogPgbouncerEnabled bool `cli-flag:"datadog-pgbouncer-enabled" cli-usage:"Enable/Disable pgbouncer stats with Datadog"` +} + +func (c *dbaasExternalIntegrationSettingsUpdateCmd) cmdAliases() []string { return nil } +func (c *dbaasExternalIntegrationSettingsUpdateCmd) cmdShort() string { + return "Update external integration settings" +} +func (c *dbaasExternalIntegrationSettingsUpdateCmd) cmdLong() string { + return "Update external integration settings" +} +func (c *dbaasExternalIntegrationSettingsUpdateCmd) cmdPreRun(cmd *cobra.Command, args []string) error { + switch { + case cmd.Flags().Changed("help-datadog"): + cmdShowHelpFlags(cmd.Flags(), "datadog-") + os.Exit(0) + } + + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalIntegrationSettingsUpdateCmd) cmdRun(cmd *cobra.Command, args []string) error { + switch c.Type { + case ExternalEndpointTypeDatadog: + return c.updateDatadog(cmd, args) + default: + return fmt.Errorf("unsupported updating external integration settings for type %q", c.Type) + } +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalIntegrationSettingsCmd, &dbaasExternalIntegrationSettingsUpdateCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/cmd/dbaas_external_integration_settings_update_datadog.go b/cmd/dbaas_external_integration_settings_update_datadog.go new file mode 100644 index 00000000..52a8973e --- /dev/null +++ b/cmd/dbaas_external_integration_settings_update_datadog.go @@ -0,0 +1,60 @@ +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" +) + +func (c *dbaasExternalIntegrationSettingsUpdateCmd) updateDatadog(cmd *cobra.Command, _ []string) error { + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return err + } + + integrationID, err := v3.ParseUUID(c.IntegrationID) + if err != nil { + return fmt.Errorf("invalid integration ID: %w", err) + } + + payload := v3.UpdateDBAASExternalIntegrationSettingsDatadogRequest{ + Settings: &v3.DBAASIntegrationSettingsDatadog{}, + } + + if cmd.Flags().Changed("datadog-dbm-enabled") { + payload.Settings.DatadogDbmEnabled = v3.Bool(c.DatadogDbmEnabled) + } + + if cmd.Flags().Changed("datadog-pgbouncer-enabled") { + payload.Settings.DatadogPgbouncerEnabled = v3.Bool(c.DatadogPgbouncerEnabled) + } + + op, err := client.UpdateDBAASExternalIntegrationSettingsDatadog(ctx, integrationID, payload) + if err != nil { + return fmt.Errorf("error updating settings for integration: %w", err) + } + + decorateAsyncOperation(fmt.Sprintf("Updating DBaaS Datadog external integration settings %q", c.IntegrationID), func() { + op, err = client.Wait(ctx, op, v3.OperationStateSuccess) + }) + + if err != nil { + return err + } + + if !globalstate.Quiet { + return (&dbaasExternalIntegrationSettingsShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + IntegrationID: string(integrationID), + Type: "datadog", + }).cmdRun(nil, nil) + } + + return nil +} diff --git a/cmd/dbaas_external_integration_show.go b/cmd/dbaas_external_integration_show.go new file mode 100644 index 00000000..3f3d3e28 --- /dev/null +++ b/cmd/dbaas_external_integration_show.go @@ -0,0 +1,83 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/exoscale/cli/pkg/account" + "github.com/exoscale/cli/pkg/globalstate" + "github.com/exoscale/cli/pkg/output" + v3 "github.com/exoscale/egoscale/v3" +) + +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"` + SourceServiceName string `json:"source-service-name"` + SourceServiceType string `json:"source-service-type"` + Type string `json:"type"` +} + +func (o *dbaasExternalIntegrationShowOutput) ToJSON() { output.JSON(o) } +func (o *dbaasExternalIntegrationShowOutput) ToText() { output.Text(o) } +func (o *dbaasExternalIntegrationShowOutput) ToTable() { output.Table(o) } + +type dbaasExternalIntegrationShowCmd struct { + cliCommandSettings `cli-cmd:"-"` + + _ bool `cli-cmd:"show"` + + IntegrationID string `cli-arg:"#"` +} + +func (c *dbaasExternalIntegrationShowCmd) showExternalIntegration() (output.Outputter, error) { + ctx := gContext + + client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) + if err != nil { + return nil, err + } + + integrationID, err := v3.ParseUUID(c.IntegrationID) + if err != nil { + return nil, fmt.Errorf("invalid integration ID: %w", err) + } + + res, err := client.GetDBAASExternalIntegration(ctx, integrationID) + if err != nil { + return nil, fmt.Errorf("error showing integration: %w", err) + } + + 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), + } + 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) cmdPreRun(cmd *cobra.Command, args []string) error { + return cliCommandDefaultPreRun(c, cmd, args) +} + +func (c *dbaasExternalIntegrationShowCmd) cmdRun(_ *cobra.Command, _ []string) error { + return c.outputFunc(c.showExternalIntegration()) +} + +func init() { + cobra.CheckErr(registerCLICommand(dbaasExternalIntegrationCmd, &dbaasExternalIntegrationShowCmd{ + cliCommandSettings: defaultCLICmdSettings(), + })) +} diff --git a/go.mod b/go.mod index e1553ea0..668173c6 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/aws/smithy-go v1.1.0 github.com/dustin/go-humanize v1.0.1 github.com/exoscale/egoscale v0.102.4 - github.com/exoscale/egoscale/v3 v3.1.4 + github.com/exoscale/egoscale/v3 v3.1.7 github.com/exoscale/openapi-cli-generator v1.1.0 github.com/fatih/camelcase v1.0.0 github.com/google/uuid v1.4.0 diff --git a/go.sum b/go.sum index 8acb30c3..39133857 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/exoscale/egoscale v0.102.4 h1:GBKsZMIOzwBfSu+4ZmWka3Ejf2JLiaBDHp4CQUgvp2E= github.com/exoscale/egoscale v0.102.4/go.mod h1:ROSmPtle0wvf91iLZb09++N/9BH2Jo9XxIpAEumvocA= -github.com/exoscale/egoscale/v3 v3.1.4 h1:xpKEGX58GIC3CHTsJdRB5+ij74DmgWPts/n8OrItJ6s= -github.com/exoscale/egoscale/v3 v3.1.4/go.mod h1:GHKucK/J26v8PGWztGdhxWNMjrjG9PbelxKCJ4YI11Q= +github.com/exoscale/egoscale/v3 v3.1.7 h1:Q6p9tOVY0IiOW0fUpaPQWY7ggGEuSPZLAGxFgDd2sCE= +github.com/exoscale/egoscale/v3 v3.1.7/go.mod h1:GHKucK/J26v8PGWztGdhxWNMjrjG9PbelxKCJ4YI11Q= github.com/exoscale/openapi-cli-generator v1.1.0 h1:fYjmPqHR5vxlOBrbvde7eo7bISNQIFxsGn4A5/acwKA= github.com/exoscale/openapi-cli-generator v1.1.0/go.mod h1:TZBnbT7f3hJ5ImyUphJwRM+X5xF/zCQZ6o8a42gQeTs= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= diff --git a/vendor/github.com/exoscale/egoscale/v3/client.go b/vendor/github.com/exoscale/egoscale/v3/client.go index a333d69a..ec497607 100644 --- a/vendor/github.com/exoscale/egoscale/v3/client.go +++ b/vendor/github.com/exoscale/egoscale/v3/client.go @@ -59,6 +59,7 @@ func (c Client) GetZoneAPIEndpoint(ctx context.Context, zoneName ZoneName) (Endp type Client struct { apiKey string apiSecret string + userAgent string serverEndpoint string httpClient *http.Client pollingInterval time.Duration @@ -73,12 +74,8 @@ type Client struct { // RequestInterceptorFn is the function signature for the RequestInterceptor callback function type RequestInterceptorFn func(ctx context.Context, req *http.Request) error -// UserAgent is the "User-Agent" HTTP request header added to outgoing HTTP requests. -var UserAgent = fmt.Sprintf("egoscale/%s (%s; %s/%s)", - Version, - runtime.Version(), - runtime.GOOS, - runtime.GOARCH) +// Deprecated: use ClientOptWithUserAgent instead. +var UserAgent = getDefaultUserAgent() const pollingInterval = 3 * time.Second @@ -93,6 +90,14 @@ func ClientOptWithTrace() ClientOpt { } } +// ClientOptWithUserAgent returns a ClientOpt setting the user agent header. +func ClientOptWithUserAgent(ua string) ClientOpt { + return func(c *Client) error { + c.userAgent = ua + " " + getDefaultUserAgent() + return nil + } +} + // ClientOptWithValidator returns a ClientOpt with a given validator. func ClientOptWithValidator(validate *validator.Validate) ClientOpt { return func(c *Client) error { @@ -131,6 +136,15 @@ func ClientOptWithHTTPClient(v *http.Client) ClientOpt { } } +// getDefaultUserAgent returns the "User-Agent" HTTP request header added to outgoing HTTP requests. +func getDefaultUserAgent() string { + return fmt.Sprintf("egoscale/%s (%s; %s/%s)", + Version, + runtime.Version(), + runtime.GOOS, + runtime.GOARCH) +} + // NewClient returns a new Exoscale API client. func NewClient(credentials *credentials.Credentials, opts ...ClientOpt) (*Client, error) { values, err := credentials.Get() @@ -145,6 +159,7 @@ func NewClient(credentials *credentials.Credentials, opts ...ClientOpt) (*Client httpClient: http.DefaultClient, pollingInterval: pollingInterval, validate: validator.New(), + userAgent: getDefaultUserAgent(), } for _, opt := range opts { @@ -156,60 +171,74 @@ func NewClient(credentials *credentials.Credentials, opts ...ClientOpt) (*Client return client, nil } +// getUserAgent only for compatibility with UserAgent. +func (c *Client) getUserAgent() string { + defaultUA := getDefaultUserAgent() + + if c.userAgent != defaultUA { + return c.userAgent + } + + if UserAgent != defaultUA { + return UserAgent + } + + return c.userAgent +} + // WithEndpoint returns a copy of Client with new zone Endpoint. func (c *Client) WithEndpoint(endpoint Endpoint) *Client { - return &Client{ - apiKey: c.apiKey, - apiSecret: c.apiSecret, - serverEndpoint: string(endpoint), - httpClient: c.httpClient, - requestInterceptors: c.requestInterceptors, - pollingInterval: c.pollingInterval, - trace: c.trace, - validate: c.validate, - } + clone := cloneClient(c) + + clone.serverEndpoint = string(endpoint) + + return clone +} + +// WithUserAgent returns a copy of Client with new User-Agent. +func (c *Client) WithUserAgent(ua string) *Client { + clone := cloneClient(c) + + clone.userAgent = ua + " " + getDefaultUserAgent() + + return clone } // WithTrace returns a copy of Client with tracing enabled. func (c *Client) WithTrace() *Client { - return &Client{ - apiKey: c.apiKey, - apiSecret: c.apiSecret, - serverEndpoint: c.serverEndpoint, - httpClient: c.httpClient, - requestInterceptors: c.requestInterceptors, - pollingInterval: c.pollingInterval, - trace: true, - validate: c.validate, - } + clone := cloneClient(c) + + clone.trace = true + + return clone } // WithHttpClient returns a copy of Client with new http.Client. +// Deprecated: use WithHTTPClient instead. func (c *Client) WithHttpClient(client *http.Client) *Client { - return &Client{ - apiKey: c.apiKey, - apiSecret: c.apiSecret, - serverEndpoint: c.serverEndpoint, - httpClient: client, - requestInterceptors: c.requestInterceptors, - pollingInterval: c.pollingInterval, - trace: c.trace, - validate: c.validate, - } + clone := cloneClient(c) + + clone.httpClient = client + + return clone +} + +// WithHTTPClient returns a copy of Client with new http.Client. +func (c *Client) WithHTTPClient(client *http.Client) *Client { + clone := cloneClient(c) + + clone.httpClient = client + + return clone } // WithRequestInterceptor returns a copy of Client with new RequestInterceptors. func (c *Client) WithRequestInterceptor(f ...RequestInterceptorFn) *Client { - return &Client{ - apiKey: c.apiKey, - apiSecret: c.apiSecret, - serverEndpoint: c.serverEndpoint, - httpClient: c.httpClient, - requestInterceptors: append(c.requestInterceptors, f...), - pollingInterval: c.pollingInterval, - trace: c.trace, - validate: c.validate, - } + clone := cloneClient(c) + + clone.requestInterceptors = append(clone.requestInterceptors, f...) + + return clone } func (c *Client) executeRequestInterceptors(ctx context.Context, req *http.Request) error { @@ -221,3 +250,17 @@ func (c *Client) executeRequestInterceptors(ctx context.Context, req *http.Reque return nil } + +func cloneClient(c *Client) *Client { + return &Client{ + apiKey: c.apiKey, + apiSecret: c.apiSecret, + userAgent: c.userAgent, + serverEndpoint: c.serverEndpoint, + httpClient: c.httpClient, + requestInterceptors: c.requestInterceptors, + pollingInterval: c.pollingInterval, + trace: c.trace, + validate: c.validate, + } +} diff --git a/vendor/github.com/exoscale/egoscale/v3/operations.go b/vendor/github.com/exoscale/egoscale/v3/operations.go index c5cbfbd3..298a89ae 100644 --- a/vendor/github.com/exoscale/egoscale/v3/operations.go +++ b/vendor/github.com/exoscale/egoscale/v3/operations.go @@ -35,7 +35,8 @@ func (c Client) ListAntiAffinityGroups(ctx context.Context) (*ListAntiAffinityGr if err != nil { return nil, fmt.Errorf("ListAntiAffinityGroups: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListAntiAffinityGroups: execute request editors: %w", err) @@ -90,7 +91,8 @@ func (c Client) CreateAntiAffinityGroup(ctx context.Context, req CreateAntiAffin if err != nil { return nil, fmt.Errorf("CreateAntiAffinityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -135,7 +137,8 @@ func (c Client) DeleteAntiAffinityGroup(ctx context.Context, id UUID) (*Operatio if err != nil { return nil, fmt.Errorf("DeleteAntiAffinityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteAntiAffinityGroup: execute request editors: %w", err) @@ -178,7 +181,8 @@ func (c Client) GetAntiAffinityGroup(ctx context.Context, id UUID) (*AntiAffinit if err != nil { return nil, fmt.Errorf("GetAntiAffinityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetAntiAffinityGroup: execute request editors: %w", err) @@ -236,7 +240,8 @@ func (c Client) ListAPIKeys(ctx context.Context) (*ListAPIKeysResponse, error) { if err != nil { return nil, fmt.Errorf("ListAPIKeys: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListAPIKeys: execute request editors: %w", err) @@ -291,7 +296,8 @@ func (c Client) CreateAPIKey(ctx context.Context, req CreateAPIKeyRequest) (*IAM if err != nil { return nil, fmt.Errorf("CreateAPIKey: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -336,7 +342,8 @@ func (c Client) DeleteAPIKey(ctx context.Context, id string) (*Operation, error) if err != nil { return nil, fmt.Errorf("DeleteAPIKey: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteAPIKey: execute request editors: %w", err) @@ -379,7 +386,8 @@ func (c Client) GetAPIKey(ctx context.Context, id string) (*IAMAPIKey, error) { if err != nil { return nil, fmt.Errorf("GetAPIKey: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetAPIKey: execute request editors: %w", err) @@ -445,7 +453,8 @@ func (c Client) ListBlockStorageVolumes(ctx context.Context, opts ...ListBlockSt if err != nil { return nil, fmt.Errorf("ListBlockStorageVolumes: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if len(opts) > 0 { q := request.URL.Query() @@ -512,7 +521,8 @@ func (c Client) CreateBlockStorageVolume(ctx context.Context, req CreateBlockSto if err != nil { return nil, fmt.Errorf("CreateBlockStorageVolume: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -572,7 +582,8 @@ func (c Client) ListBlockStorageSnapshots(ctx context.Context) (*ListBlockStorag if err != nil { return nil, fmt.Errorf("ListBlockStorageSnapshots: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListBlockStorageSnapshots: execute request editors: %w", err) @@ -615,7 +626,8 @@ func (c Client) DeleteBlockStorageSnapshot(ctx context.Context, id UUID) (*Opera if err != nil { return nil, fmt.Errorf("DeleteBlockStorageSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteBlockStorageSnapshot: execute request editors: %w", err) @@ -658,7 +670,8 @@ func (c Client) GetBlockStorageSnapshot(ctx context.Context, id UUID) (*BlockSto if err != nil { return nil, fmt.Errorf("GetBlockStorageSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetBlockStorageSnapshot: execute request editors: %w", err) @@ -712,7 +725,8 @@ func (c Client) UpdateBlockStorageSnapshot(ctx context.Context, id UUID, req Upd if err != nil { return nil, fmt.Errorf("UpdateBlockStorageSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -757,7 +771,8 @@ func (c Client) DeleteBlockStorageVolume(ctx context.Context, id UUID) (*Operati if err != nil { return nil, fmt.Errorf("DeleteBlockStorageVolume: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteBlockStorageVolume: execute request editors: %w", err) @@ -800,7 +815,8 @@ func (c Client) GetBlockStorageVolume(ctx context.Context, id UUID) (*BlockStora if err != nil { return nil, fmt.Errorf("GetBlockStorageVolume: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetBlockStorageVolume: execute request editors: %w", err) @@ -854,7 +870,8 @@ func (c Client) UpdateBlockStorageVolume(ctx context.Context, id UUID, req Updat if err != nil { return nil, fmt.Errorf("UpdateBlockStorageVolume: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -909,7 +926,8 @@ func (c Client) AttachBlockStorageVolumeToInstance(ctx context.Context, id UUID, if err != nil { return nil, fmt.Errorf("AttachBlockStorageVolumeToInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -965,7 +983,8 @@ func (c Client) CreateBlockStorageSnapshot(ctx context.Context, id UUID, req Cre if err != nil { return nil, fmt.Errorf("CreateBlockStorageSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1010,7 +1029,8 @@ func (c Client) DetachBlockStorageVolume(ctx context.Context, id UUID) (*Operati if err != nil { return nil, fmt.Errorf("DetachBlockStorageVolume: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DetachBlockStorageVolume: execute request editors: %w", err) @@ -1063,7 +1083,8 @@ func (c Client) ResizeBlockStorageVolume(ctx context.Context, id UUID, req Resiz if err != nil { return nil, fmt.Errorf("ResizeBlockStorageVolume: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1114,7 +1135,8 @@ func (c Client) GetConsoleProxyURL(ctx context.Context, id UUID) (*GetConsolePro if err != nil { return nil, fmt.Errorf("GetConsoleProxyURL: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetConsoleProxyURL: execute request editors: %w", err) @@ -1161,7 +1183,8 @@ func (c Client) GetDBAASCACertificate(ctx context.Context) (*GetDBAASCACertifica if err != nil { return nil, fmt.Errorf("GetDBAASCACertificate: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASCACertificate: execute request editors: %w", err) @@ -1197,14 +1220,15 @@ func (c Client) GetDBAASCACertificate(ctx context.Context) (*GetDBAASCACertifica } // [BETA] Delete DataDog external integration endpoint -func (c Client) DeleteDBAASExternalEndpointDatadog(ctx context.Context, id UUID) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-datadog/%v", id) +func (c Client) DeleteDBAASExternalEndpointDatadog(ctx context.Context, endpointID UUID) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-datadog/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "DELETE", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointDatadog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointDatadog: execute request editors: %w", err) @@ -1240,14 +1264,15 @@ func (c Client) DeleteDBAASExternalEndpointDatadog(ctx context.Context, id UUID) } // [BETA] Get DataDog external endpoint settings -func (c Client) GetDBAASExternalEndpointDatadog(ctx context.Context, id UUID) (*DBAASExternalEndpointDatadogOutput, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-datadog/%v", id) +func (c Client) GetDBAASExternalEndpointDatadog(ctx context.Context, endpointID UUID) (*DBAASExternalEndpointDatadogOutput, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-datadog/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointDatadog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointDatadog: execute request editors: %w", err) @@ -1282,13 +1307,9 @@ func (c Client) GetDBAASExternalEndpointDatadog(ctx context.Context, id UUID) (* return bodyresp, nil } -type UpdateDBAASExternalEndpointDatadogRequest struct { - Settings *DBAASEndpointDatadog `json:"settings,omitempty"` -} - // [BETA] Update DataDog external integration endpoint -func (c Client) UpdateDBAASExternalEndpointDatadog(ctx context.Context, id UUID, req UpdateDBAASExternalEndpointDatadogRequest) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-datadog/%v", id) +func (c Client) UpdateDBAASExternalEndpointDatadog(ctx context.Context, endpointID UUID, req DBAASEndpointDatadogInputUpdate) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-datadog/%v", endpointID) body, err := prepareJSONBody(req) if err != nil { @@ -1299,7 +1320,8 @@ func (c Client) UpdateDBAASExternalEndpointDatadog(ctx context.Context, id UUID, if err != nil { return nil, fmt.Errorf("UpdateDBAASExternalEndpointDatadog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1336,12 +1358,8 @@ func (c Client) UpdateDBAASExternalEndpointDatadog(ctx context.Context, id UUID, return bodyresp, nil } -type CreateDBAASExternalEndpointDatadogRequest struct { - Settings *DBAASEndpointDatadog `json:"settings,omitempty"` -} - // [BETA] Create DataDog external integration endpoint -func (c Client) CreateDBAASExternalEndpointDatadog(ctx context.Context, name string, req CreateDBAASExternalEndpointDatadogRequest) (*Operation, error) { +func (c Client) CreateDBAASExternalEndpointDatadog(ctx context.Context, name string, req DBAASEndpointDatadogInputCreate) (*Operation, error) { path := fmt.Sprintf("/dbaas-external-endpoint-datadog/%v", name) body, err := prepareJSONBody(req) @@ -1353,7 +1371,8 @@ func (c Client) CreateDBAASExternalEndpointDatadog(ctx context.Context, name str if err != nil { return nil, fmt.Errorf("CreateDBAASExternalEndpointDatadog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1391,14 +1410,15 @@ func (c Client) CreateDBAASExternalEndpointDatadog(ctx context.Context, name str } // [BETA] Delete ElasticSearch logs external integration endpoint -func (c Client) DeleteDBAASExternalEndpointElasticsearch(ctx context.Context, id UUID) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-elasticsearch/%v", id) +func (c Client) DeleteDBAASExternalEndpointElasticsearch(ctx context.Context, endpointID UUID) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-elasticsearch/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "DELETE", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointElasticsearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointElasticsearch: execute request editors: %w", err) @@ -1434,14 +1454,15 @@ func (c Client) DeleteDBAASExternalEndpointElasticsearch(ctx context.Context, id } // [BETA] Get ElasticSearch Logs external integration endpoint settings -func (c Client) GetDBAASExternalEndpointElasticsearch(ctx context.Context, id UUID) (*DBAASEndpointElasticsearchOutput, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-elasticsearch/%v", id) +func (c Client) GetDBAASExternalEndpointElasticsearch(ctx context.Context, endpointID UUID) (*DBAASEndpointElasticsearchOutput, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-elasticsearch/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointElasticsearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointElasticsearch: execute request editors: %w", err) @@ -1476,13 +1497,9 @@ func (c Client) GetDBAASExternalEndpointElasticsearch(ctx context.Context, id UU return bodyresp, nil } -type UpdateDBAASExternalEndpointElasticsearchRequest struct { - Settings *DBAASEndpointElasticsearch `json:"settings,omitempty"` -} - // [BETA] Update ElasticSearch Logs external integration endpoint -func (c Client) UpdateDBAASExternalEndpointElasticsearch(ctx context.Context, id UUID, req UpdateDBAASExternalEndpointElasticsearchRequest) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-elasticsearch/%v", id) +func (c Client) UpdateDBAASExternalEndpointElasticsearch(ctx context.Context, endpointID UUID, req DBAASEndpointElasticsearchInputUpdate) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-elasticsearch/%v", endpointID) body, err := prepareJSONBody(req) if err != nil { @@ -1493,7 +1510,8 @@ func (c Client) UpdateDBAASExternalEndpointElasticsearch(ctx context.Context, id if err != nil { return nil, fmt.Errorf("UpdateDBAASExternalEndpointElasticsearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1530,12 +1548,8 @@ func (c Client) UpdateDBAASExternalEndpointElasticsearch(ctx context.Context, id return bodyresp, nil } -type CreateDBAASExternalEndpointElasticsearchRequest struct { - Settings *DBAASEndpointElasticsearch `json:"settings,omitempty"` -} - // [BETA] Create ElasticSearch Logs external integration endpoint -func (c Client) CreateDBAASExternalEndpointElasticsearch(ctx context.Context, name string, req CreateDBAASExternalEndpointElasticsearchRequest) (*Operation, error) { +func (c Client) CreateDBAASExternalEndpointElasticsearch(ctx context.Context, name string, req DBAASEndpointElasticsearchInputCreate) (*Operation, error) { path := fmt.Sprintf("/dbaas-external-endpoint-elasticsearch/%v", name) body, err := prepareJSONBody(req) @@ -1547,7 +1561,8 @@ func (c Client) CreateDBAASExternalEndpointElasticsearch(ctx context.Context, na if err != nil { return nil, fmt.Errorf("CreateDBAASExternalEndpointElasticsearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1585,14 +1600,15 @@ func (c Client) CreateDBAASExternalEndpointElasticsearch(ctx context.Context, na } // [BETA] Delete OpenSearch logs external integration endpoint -func (c Client) DeleteDBAASExternalEndpointOpensearch(ctx context.Context, id UUID) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-opensearch/%v", id) +func (c Client) DeleteDBAASExternalEndpointOpensearch(ctx context.Context, endpointID UUID) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-opensearch/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "DELETE", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointOpensearch: execute request editors: %w", err) @@ -1628,14 +1644,15 @@ func (c Client) DeleteDBAASExternalEndpointOpensearch(ctx context.Context, id UU } // [BETA] Get OpenSearch Logs external integration endpoint settings -func (c Client) GetDBAASExternalEndpointOpensearch(ctx context.Context, id UUID) (*DBAASEndpointOpensearchOutput, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-opensearch/%v", id) +func (c Client) GetDBAASExternalEndpointOpensearch(ctx context.Context, endpointID UUID) (*DBAASEndpointOpensearchOutput, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-opensearch/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointOpensearch: execute request editors: %w", err) @@ -1670,13 +1687,9 @@ func (c Client) GetDBAASExternalEndpointOpensearch(ctx context.Context, id UUID) return bodyresp, nil } -type UpdateDBAASExternalEndpointOpensearchRequest struct { - Settings *DBAASEndpointOpensearch `json:"settings,omitempty"` -} - // [BETA] Update OpenSearch Logs external integration endpoint -func (c Client) UpdateDBAASExternalEndpointOpensearch(ctx context.Context, id UUID, req UpdateDBAASExternalEndpointOpensearchRequest) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-opensearch/%v", id) +func (c Client) UpdateDBAASExternalEndpointOpensearch(ctx context.Context, endpointID UUID, req DBAASEndpointOpensearchInputUpdate) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-opensearch/%v", endpointID) body, err := prepareJSONBody(req) if err != nil { @@ -1687,7 +1700,8 @@ func (c Client) UpdateDBAASExternalEndpointOpensearch(ctx context.Context, id UU if err != nil { return nil, fmt.Errorf("UpdateDBAASExternalEndpointOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1724,12 +1738,8 @@ func (c Client) UpdateDBAASExternalEndpointOpensearch(ctx context.Context, id UU return bodyresp, nil } -type CreateDBAASExternalEndpointOpensearchRequest struct { - Settings *DBAASEndpointOpensearch `json:"settings,omitempty"` -} - // [BETA] Create OpenSearch Logs external integration endpoint -func (c Client) CreateDBAASExternalEndpointOpensearch(ctx context.Context, name string, req CreateDBAASExternalEndpointOpensearchRequest) (*Operation, error) { +func (c Client) CreateDBAASExternalEndpointOpensearch(ctx context.Context, name string, req DBAASEndpointOpensearchInputCreate) (*Operation, error) { path := fmt.Sprintf("/dbaas-external-endpoint-opensearch/%v", name) body, err := prepareJSONBody(req) @@ -1741,7 +1751,8 @@ func (c Client) CreateDBAASExternalEndpointOpensearch(ctx context.Context, name if err != nil { return nil, fmt.Errorf("CreateDBAASExternalEndpointOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1779,14 +1790,15 @@ func (c Client) CreateDBAASExternalEndpointOpensearch(ctx context.Context, name } // [BETA] Delete Prometheus external integration endpoint -func (c Client) DeleteDBAASExternalEndpointPrometheus(ctx context.Context, id UUID) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-prometheus/%v", id) +func (c Client) DeleteDBAASExternalEndpointPrometheus(ctx context.Context, endpointID UUID) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-prometheus/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "DELETE", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointPrometheus: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointPrometheus: execute request editors: %w", err) @@ -1822,14 +1834,15 @@ func (c Client) DeleteDBAASExternalEndpointPrometheus(ctx context.Context, id UU } // [BETA] Get Prometheus external integration endpoint settings -func (c Client) GetDBAASExternalEndpointPrometheus(ctx context.Context, id UUID) (*DBAASEndpointExternalPrometheusOutput, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-prometheus/%v", id) +func (c Client) GetDBAASExternalEndpointPrometheus(ctx context.Context, endpointID UUID) (*DBAASEndpointExternalPrometheusOutput, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-prometheus/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointPrometheus: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointPrometheus: execute request editors: %w", err) @@ -1864,13 +1877,9 @@ func (c Client) GetDBAASExternalEndpointPrometheus(ctx context.Context, id UUID) return bodyresp, nil } -type UpdateDBAASExternalEndpointPrometheusRequest struct { - Settings *DBAASEndpointPrometheus `json:"settings,omitempty"` -} - // [BETA] Update Prometheus external integration endpoint -func (c Client) UpdateDBAASExternalEndpointPrometheus(ctx context.Context, id UUID, req UpdateDBAASExternalEndpointPrometheusRequest) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-prometheus/%v", id) +func (c Client) UpdateDBAASExternalEndpointPrometheus(ctx context.Context, endpointID UUID, req DBAASEndpointPrometheusPayload) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-prometheus/%v", endpointID) body, err := prepareJSONBody(req) if err != nil { @@ -1881,7 +1890,8 @@ func (c Client) UpdateDBAASExternalEndpointPrometheus(ctx context.Context, id UU if err != nil { return nil, fmt.Errorf("UpdateDBAASExternalEndpointPrometheus: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1918,12 +1928,8 @@ func (c Client) UpdateDBAASExternalEndpointPrometheus(ctx context.Context, id UU return bodyresp, nil } -type CreateDBAASExternalEndpointPrometheusRequest struct { - Settings *DBAASEndpointPrometheus `json:"settings,omitempty"` -} - // [BETA] Create Prometheus external integration endpoint -func (c Client) CreateDBAASExternalEndpointPrometheus(ctx context.Context, name string, req CreateDBAASExternalEndpointPrometheusRequest) (*Operation, error) { +func (c Client) CreateDBAASExternalEndpointPrometheus(ctx context.Context, name string, req DBAASEndpointPrometheusPayload) (*Operation, error) { path := fmt.Sprintf("/dbaas-external-endpoint-prometheus/%v", name) body, err := prepareJSONBody(req) @@ -1935,7 +1941,8 @@ func (c Client) CreateDBAASExternalEndpointPrometheus(ctx context.Context, name if err != nil { return nil, fmt.Errorf("CreateDBAASExternalEndpointPrometheus: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -1973,14 +1980,15 @@ func (c Client) CreateDBAASExternalEndpointPrometheus(ctx context.Context, name } // [BETA] Delete RSyslog external integration endpoint -func (c Client) DeleteDBAASExternalEndpointRsyslog(ctx context.Context, id UUID) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-rsyslog/%v", id) +func (c Client) DeleteDBAASExternalEndpointRsyslog(ctx context.Context, endpointID UUID) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-rsyslog/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "DELETE", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointRsyslog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASExternalEndpointRsyslog: execute request editors: %w", err) @@ -2016,14 +2024,15 @@ func (c Client) DeleteDBAASExternalEndpointRsyslog(ctx context.Context, id UUID) } // [BETA] Get RSyslog external integration endpoint settings -func (c Client) GetDBAASExternalEndpointRsyslog(ctx context.Context, id UUID) (*DBAASExternalEndpointRsyslogOutput, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-rsyslog/%v", id) +func (c Client) GetDBAASExternalEndpointRsyslog(ctx context.Context, endpointID UUID) (*DBAASExternalEndpointRsyslogOutput, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-rsyslog/%v", endpointID) request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointRsyslog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASExternalEndpointRsyslog: execute request editors: %w", err) @@ -2058,13 +2067,9 @@ func (c Client) GetDBAASExternalEndpointRsyslog(ctx context.Context, id UUID) (* return bodyresp, nil } -type UpdateDBAASExternalEndpointRsyslogRequest struct { - Settings *DBAASEndpointRsyslog `json:"settings,omitempty"` -} - // [BETA] Update RSyslog external integration endpoint -func (c Client) UpdateDBAASExternalEndpointRsyslog(ctx context.Context, id UUID, req UpdateDBAASExternalEndpointRsyslogRequest) (*Operation, error) { - path := fmt.Sprintf("/dbaas-external-endpoint-rsyslog/%v", id) +func (c Client) UpdateDBAASExternalEndpointRsyslog(ctx context.Context, endpointID UUID, req DBAASEndpointRsyslogInputUpdate) (*Operation, error) { + path := fmt.Sprintf("/dbaas-external-endpoint-rsyslog/%v", endpointID) body, err := prepareJSONBody(req) if err != nil { @@ -2075,7 +2080,8 @@ func (c Client) UpdateDBAASExternalEndpointRsyslog(ctx context.Context, id UUID, if err != nil { return nil, fmt.Errorf("UpdateDBAASExternalEndpointRsyslog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -2112,12 +2118,8 @@ func (c Client) UpdateDBAASExternalEndpointRsyslog(ctx context.Context, id UUID, return bodyresp, nil } -type CreateDBAASExternalEndpointRsyslogRequest struct { - Settings *DBAASEndpointRsyslog `json:"settings,omitempty"` -} - // [BETA] Create RSyslog external integration endpoint -func (c Client) CreateDBAASExternalEndpointRsyslog(ctx context.Context, name string, req CreateDBAASExternalEndpointRsyslogRequest) (*Operation, error) { +func (c Client) CreateDBAASExternalEndpointRsyslog(ctx context.Context, name string, req DBAASEndpointRsyslogInputCreate) (*Operation, error) { path := fmt.Sprintf("/dbaas-external-endpoint-rsyslog/%v", name) body, err := prepareJSONBody(req) @@ -2129,7 +2131,8 @@ func (c Client) CreateDBAASExternalEndpointRsyslog(ctx context.Context, name str if err != nil { return nil, fmt.Errorf("CreateDBAASExternalEndpointRsyslog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -2184,7 +2187,8 @@ func (c Client) ListDBAASExternalEndpointTypes(ctx context.Context) (*ListDBAASE if err != nil { return nil, fmt.Errorf("ListDBAASExternalEndpointTypes: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDBAASExternalEndpointTypes: execute request editors: %w", err) @@ -2238,7 +2242,8 @@ func (c Client) AttachDBAASServiceToEndpoint(ctx context.Context, sourceServiceN if err != nil { return nil, fmt.Errorf("AttachDBAASServiceToEndpoint: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -2293,7 +2298,8 @@ func (c Client) DetachDBAASServiceFromEndpoint(ctx context.Context, sourceServic if err != nil { return nil, fmt.Errorf("DetachDBAASServiceFromEndpoint: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -2353,7 +2359,8 @@ func (c Client) ListDBAASExternalEndpoints(ctx context.Context) (*ListDBAASExter if err != nil { return nil, fmt.Errorf("ListDBAASExternalEndpoints: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDBAASExternalEndpoints: execute request editors: %w", err) @@ -2400,7 +2407,8 @@ func (c Client) GetDBAASExternalIntegrationSettingsDatadog(ctx context.Context, if err != nil { return nil, fmt.Errorf("GetDBAASExternalIntegrationSettingsDatadog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASExternalIntegrationSettingsDatadog: execute request editors: %w", err) @@ -2452,7 +2460,8 @@ func (c Client) UpdateDBAASExternalIntegrationSettingsDatadog(ctx context.Contex if err != nil { return nil, fmt.Errorf("UpdateDBAASExternalIntegrationSettingsDatadog: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -2490,14 +2499,15 @@ func (c Client) UpdateDBAASExternalIntegrationSettingsDatadog(ctx context.Contex } // [BETA] Get a DBaaS external integration -func (c Client) GetDBAASExternalIntegration(ctx context.Context, id UUID) (*DBAASExternalIntegration, error) { - path := fmt.Sprintf("/dbaas-external-integration/%v", id) +func (c Client) GetDBAASExternalIntegration(ctx context.Context, integrationID UUID) (*DBAASExternalIntegration, error) { + path := fmt.Sprintf("/dbaas-external-integration/%v", integrationID) request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) if err != nil { return nil, fmt.Errorf("GetDBAASExternalIntegration: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASExternalIntegration: execute request editors: %w", err) @@ -2536,17 +2546,6 @@ type ListDBAASExternalIntegrationsResponse struct { ExternalIntegrations []DBAASExternalIntegration `json:"external-integrations,omitempty"` } -// FindDBAASExternalIntegration attempts to find an DBAASExternalIntegration by id. -func (l ListDBAASExternalIntegrationsResponse) FindDBAASExternalIntegration(id string) (DBAASExternalIntegration, error) { - for i, elem := range l.ExternalIntegrations { - if string(elem.ID) == id { - return l.ExternalIntegrations[i], nil - } - } - - return DBAASExternalIntegration{}, fmt.Errorf("%q not found in ListDBAASExternalIntegrationsResponse: %w", id, ErrNotFound) -} - // [BETA] List all DBaaS connections between services and external endpoints func (c Client) ListDBAASExternalIntegrations(ctx context.Context, serviceName string) (*ListDBAASExternalIntegrationsResponse, error) { path := fmt.Sprintf("/dbaas-external-integrations/%v", serviceName) @@ -2555,7 +2554,8 @@ func (c Client) ListDBAASExternalIntegrations(ctx context.Context, serviceName s if err != nil { return nil, fmt.Errorf("ListDBAASExternalIntegrations: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDBAASExternalIntegrations: execute request editors: %w", err) @@ -2598,7 +2598,8 @@ func (c Client) DeleteDBAASServiceGrafana(ctx context.Context, name string) (*Op if err != nil { return nil, fmt.Errorf("DeleteDBAASServiceGrafana: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASServiceGrafana: execute request editors: %w", err) @@ -2641,7 +2642,8 @@ func (c Client) GetDBAASServiceGrafana(ctx context.Context, name string) (*DBAAS if err != nil { return nil, fmt.Errorf("GetDBAASServiceGrafana: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASServiceGrafana: execute request editors: %w", err) @@ -2724,7 +2726,8 @@ func (c Client) CreateDBAASServiceGrafana(ctx context.Context, name string, req if err != nil { return nil, fmt.Errorf("CreateDBAASServiceGrafana: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -2808,7 +2811,8 @@ func (c Client) UpdateDBAASServiceGrafana(ctx context.Context, name string, req if err != nil { return nil, fmt.Errorf("UpdateDBAASServiceGrafana: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -2853,7 +2857,8 @@ func (c Client) StartDBAASGrafanaMaintenance(ctx context.Context, name string) ( if err != nil { return nil, fmt.Errorf("StartDBAASGrafanaMaintenance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StartDBAASGrafanaMaintenance: execute request editors: %w", err) @@ -2905,7 +2910,8 @@ func (c Client) ResetDBAASGrafanaUserPassword(ctx context.Context, serviceName s if err != nil { return nil, fmt.Errorf("ResetDBAASGrafanaUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -2950,7 +2956,8 @@ func (c Client) RevealDBAASGrafanaUserPassword(ctx context.Context, serviceName if err != nil { return nil, fmt.Errorf("RevealDBAASGrafanaUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RevealDBAASGrafanaUserPassword: execute request editors: %w", err) @@ -3006,7 +3013,8 @@ func (c Client) CreateDBAASIntegration(ctx context.Context, req CreateDBAASInteg if err != nil { return nil, fmt.Errorf("CreateDBAASIntegration: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -3064,7 +3072,8 @@ func (c Client) ListDBAASIntegrationSettings(ctx context.Context, integrationTyp if err != nil { return nil, fmt.Errorf("ListDBAASIntegrationSettings: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDBAASIntegrationSettings: execute request editors: %w", err) @@ -3111,7 +3120,8 @@ func (c Client) ListDBAASIntegrationTypes(ctx context.Context) (*ListDBAASIntegr if err != nil { return nil, fmt.Errorf("ListDBAASIntegrationTypes: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDBAASIntegrationTypes: execute request editors: %w", err) @@ -3154,7 +3164,8 @@ func (c Client) DeleteDBAASIntegration(ctx context.Context, id UUID) (*Operation if err != nil { return nil, fmt.Errorf("DeleteDBAASIntegration: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASIntegration: execute request editors: %w", err) @@ -3197,7 +3208,8 @@ func (c Client) GetDBAASIntegration(ctx context.Context, id UUID) (*DBAASIntegra if err != nil { return nil, fmt.Errorf("GetDBAASIntegration: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASIntegration: execute request editors: %w", err) @@ -3250,7 +3262,8 @@ func (c Client) UpdateDBAASIntegration(ctx context.Context, id UUID, req UpdateD if err != nil { return nil, fmt.Errorf("UpdateDBAASIntegration: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -3295,7 +3308,8 @@ func (c Client) DeleteDBAASServiceKafka(ctx context.Context, name string) (*Oper if err != nil { return nil, fmt.Errorf("DeleteDBAASServiceKafka: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASServiceKafka: execute request editors: %w", err) @@ -3338,7 +3352,8 @@ func (c Client) GetDBAASServiceKafka(ctx context.Context, name string) (*DBAASSe if err != nil { return nil, fmt.Errorf("GetDBAASServiceKafka: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASServiceKafka: execute request editors: %w", err) @@ -3444,7 +3459,8 @@ func (c Client) CreateDBAASServiceKafka(ctx context.Context, name string, req Cr if err != nil { return nil, fmt.Errorf("CreateDBAASServiceKafka: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -3552,7 +3568,8 @@ func (c Client) UpdateDBAASServiceKafka(ctx context.Context, name string, req Up if err != nil { return nil, fmt.Errorf("UpdateDBAASServiceKafka: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -3597,7 +3614,8 @@ func (c Client) GetDBAASKafkaAclConfig(ctx context.Context, name string) (*DBAAS if err != nil { return nil, fmt.Errorf("GetDBAASKafkaAclConfig: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASKafkaAclConfig: execute request editors: %w", err) @@ -3640,7 +3658,8 @@ func (c Client) StartDBAASKafkaMaintenance(ctx context.Context, name string) (*O if err != nil { return nil, fmt.Errorf("StartDBAASKafkaMaintenance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StartDBAASKafkaMaintenance: execute request editors: %w", err) @@ -3688,7 +3707,8 @@ func (c Client) CreateDBAASKafkaSchemaRegistryAclConfig(ctx context.Context, nam if err != nil { return nil, fmt.Errorf("CreateDBAASKafkaSchemaRegistryAclConfig: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -3733,7 +3753,8 @@ func (c Client) DeleteDBAASKafkaSchemaRegistryAclConfig(ctx context.Context, nam if err != nil { return nil, fmt.Errorf("DeleteDBAASKafkaSchemaRegistryAclConfig: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASKafkaSchemaRegistryAclConfig: execute request editors: %w", err) @@ -3781,7 +3802,8 @@ func (c Client) CreateDBAASKafkaTopicAclConfig(ctx context.Context, name string, if err != nil { return nil, fmt.Errorf("CreateDBAASKafkaTopicAclConfig: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -3826,7 +3848,8 @@ func (c Client) DeleteDBAASKafkaTopicAclConfig(ctx context.Context, name string, if err != nil { return nil, fmt.Errorf("DeleteDBAASKafkaTopicAclConfig: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASKafkaTopicAclConfig: execute request editors: %w", err) @@ -3869,7 +3892,8 @@ func (c Client) RevealDBAASKafkaConnectPassword(ctx context.Context, serviceName if err != nil { return nil, fmt.Errorf("RevealDBAASKafkaConnectPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RevealDBAASKafkaConnectPassword: execute request editors: %w", err) @@ -3921,7 +3945,8 @@ func (c Client) CreateDBAASKafkaUser(ctx context.Context, serviceName string, re if err != nil { return nil, fmt.Errorf("CreateDBAASKafkaUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -3966,7 +3991,8 @@ func (c Client) DeleteDBAASKafkaUser(ctx context.Context, serviceName string, us if err != nil { return nil, fmt.Errorf("DeleteDBAASKafkaUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASKafkaUser: execute request editors: %w", err) @@ -4018,7 +4044,8 @@ func (c Client) ResetDBAASKafkaUserPassword(ctx context.Context, serviceName str if err != nil { return nil, fmt.Errorf("ResetDBAASKafkaUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -4063,7 +4090,8 @@ func (c Client) RevealDBAASKafkaUserPassword(ctx context.Context, serviceName st if err != nil { return nil, fmt.Errorf("RevealDBAASKafkaUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RevealDBAASKafkaUserPassword: execute request editors: %w", err) @@ -4106,7 +4134,8 @@ func (c Client) GetDBAASMigrationStatus(ctx context.Context, name string) (*DBAA if err != nil { return nil, fmt.Errorf("GetDBAASMigrationStatus: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASMigrationStatus: execute request editors: %w", err) @@ -4149,7 +4178,8 @@ func (c Client) DeleteDBAASServiceMysql(ctx context.Context, name string) (*Oper if err != nil { return nil, fmt.Errorf("DeleteDBAASServiceMysql: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASServiceMysql: execute request editors: %w", err) @@ -4192,7 +4222,8 @@ func (c Client) GetDBAASServiceMysql(ctx context.Context, name string) (*DBAASSe if err != nil { return nil, fmt.Errorf("GetDBAASServiceMysql: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASServiceMysql: execute request editors: %w", err) @@ -4331,7 +4362,8 @@ func (c Client) CreateDBAASServiceMysql(ctx context.Context, name string, req Cr if err != nil { return nil, fmt.Errorf("CreateDBAASServiceMysql: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -4446,7 +4478,8 @@ func (c Client) UpdateDBAASServiceMysql(ctx context.Context, name string, req Up if err != nil { return nil, fmt.Errorf("UpdateDBAASServiceMysql: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -4491,7 +4524,8 @@ func (c Client) EnableDBAASMysqlWrites(ctx context.Context, name string) (*Opera if err != nil { return nil, fmt.Errorf("EnableDBAASMysqlWrites: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("EnableDBAASMysqlWrites: execute request editors: %w", err) @@ -4534,7 +4568,8 @@ func (c Client) StartDBAASMysqlMaintenance(ctx context.Context, name string) (*O if err != nil { return nil, fmt.Errorf("StartDBAASMysqlMaintenance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StartDBAASMysqlMaintenance: execute request editors: %w", err) @@ -4577,7 +4612,8 @@ func (c Client) StopDBAASMysqlMigration(ctx context.Context, name string) (*Oper if err != nil { return nil, fmt.Errorf("StopDBAASMysqlMigration: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StopDBAASMysqlMigration: execute request editors: %w", err) @@ -4629,7 +4665,8 @@ func (c Client) CreateDBAASMysqlDatabase(ctx context.Context, serviceName string if err != nil { return nil, fmt.Errorf("CreateDBAASMysqlDatabase: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -4674,7 +4711,8 @@ func (c Client) DeleteDBAASMysqlDatabase(ctx context.Context, serviceName string if err != nil { return nil, fmt.Errorf("DeleteDBAASMysqlDatabase: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASMysqlDatabase: execute request editors: %w", err) @@ -4727,7 +4765,8 @@ func (c Client) CreateDBAASMysqlUser(ctx context.Context, serviceName string, re if err != nil { return nil, fmt.Errorf("CreateDBAASMysqlUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -4772,7 +4811,8 @@ func (c Client) DeleteDBAASMysqlUser(ctx context.Context, serviceName string, us if err != nil { return nil, fmt.Errorf("DeleteDBAASMysqlUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASMysqlUser: execute request editors: %w", err) @@ -4825,7 +4865,8 @@ func (c Client) ResetDBAASMysqlUserPassword(ctx context.Context, serviceName str if err != nil { return nil, fmt.Errorf("ResetDBAASMysqlUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -4870,7 +4911,8 @@ func (c Client) RevealDBAASMysqlUserPassword(ctx context.Context, serviceName st if err != nil { return nil, fmt.Errorf("RevealDBAASMysqlUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RevealDBAASMysqlUserPassword: execute request editors: %w", err) @@ -4913,7 +4955,8 @@ func (c Client) DeleteDBAASServiceOpensearch(ctx context.Context, name string) ( if err != nil { return nil, fmt.Errorf("DeleteDBAASServiceOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASServiceOpensearch: execute request editors: %w", err) @@ -4956,7 +4999,8 @@ func (c Client) GetDBAASServiceOpensearch(ctx context.Context, name string) (*DB if err != nil { return nil, fmt.Errorf("GetDBAASServiceOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASServiceOpensearch: execute request editors: %w", err) @@ -5089,7 +5133,8 @@ func (c Client) CreateDBAASServiceOpensearch(ctx context.Context, name string, r if err != nil { return nil, fmt.Errorf("CreateDBAASServiceOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -5221,7 +5266,8 @@ func (c Client) UpdateDBAASServiceOpensearch(ctx context.Context, name string, r if err != nil { return nil, fmt.Errorf("UpdateDBAASServiceOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -5266,7 +5312,8 @@ func (c Client) GetDBAASOpensearchAclConfig(ctx context.Context, name string) (* if err != nil { return nil, fmt.Errorf("GetDBAASOpensearchAclConfig: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASOpensearchAclConfig: execute request editors: %w", err) @@ -5314,7 +5361,8 @@ func (c Client) UpdateDBAASOpensearchAclConfig(ctx context.Context, name string, if err != nil { return nil, fmt.Errorf("UpdateDBAASOpensearchAclConfig: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -5359,7 +5407,8 @@ func (c Client) StartDBAASOpensearchMaintenance(ctx context.Context, name string if err != nil { return nil, fmt.Errorf("StartDBAASOpensearchMaintenance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StartDBAASOpensearchMaintenance: execute request editors: %w", err) @@ -5411,7 +5460,8 @@ func (c Client) CreateDBAASOpensearchUser(ctx context.Context, serviceName strin if err != nil { return nil, fmt.Errorf("CreateDBAASOpensearchUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -5456,7 +5506,8 @@ func (c Client) DeleteDBAASOpensearchUser(ctx context.Context, serviceName strin if err != nil { return nil, fmt.Errorf("DeleteDBAASOpensearchUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASOpensearchUser: execute request editors: %w", err) @@ -5508,7 +5559,8 @@ func (c Client) ResetDBAASOpensearchUserPassword(ctx context.Context, serviceNam if err != nil { return nil, fmt.Errorf("ResetDBAASOpensearchUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -5553,7 +5605,8 @@ func (c Client) RevealDBAASOpensearchUserPassword(ctx context.Context, serviceNa if err != nil { return nil, fmt.Errorf("RevealDBAASOpensearchUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RevealDBAASOpensearchUserPassword: execute request editors: %w", err) @@ -5596,7 +5649,8 @@ func (c Client) DeleteDBAASServicePG(ctx context.Context, name string) (*Operati if err != nil { return nil, fmt.Errorf("DeleteDBAASServicePG: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASServicePG: execute request editors: %w", err) @@ -5639,7 +5693,8 @@ func (c Client) GetDBAASServicePG(ctx context.Context, name string) (*DBAASServi if err != nil { return nil, fmt.Errorf("GetDBAASServicePG: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASServicePG: execute request editors: %w", err) @@ -5787,7 +5842,8 @@ func (c Client) CreateDBAASServicePG(ctx context.Context, name string, req Creat if err != nil { return nil, fmt.Errorf("CreateDBAASServicePG: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -5914,7 +5970,8 @@ func (c Client) UpdateDBAASServicePG(ctx context.Context, name string, req Updat if err != nil { return nil, fmt.Errorf("UpdateDBAASServicePG: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -5959,7 +6016,8 @@ func (c Client) StartDBAASPGMaintenance(ctx context.Context, name string) (*Oper if err != nil { return nil, fmt.Errorf("StartDBAASPGMaintenance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StartDBAASPGMaintenance: execute request editors: %w", err) @@ -6002,7 +6060,8 @@ func (c Client) StopDBAASPGMigration(ctx context.Context, name string) (*Operati if err != nil { return nil, fmt.Errorf("StopDBAASPGMigration: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StopDBAASPGMigration: execute request editors: %w", err) @@ -6058,7 +6117,8 @@ func (c Client) CreateDBAASPGConnectionPool(ctx context.Context, serviceName str if err != nil { return nil, fmt.Errorf("CreateDBAASPGConnectionPool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6103,7 +6163,8 @@ func (c Client) DeleteDBAASPGConnectionPool(ctx context.Context, serviceName str if err != nil { return nil, fmt.Errorf("DeleteDBAASPGConnectionPool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASPGConnectionPool: execute request editors: %w", err) @@ -6158,7 +6219,8 @@ func (c Client) UpdateDBAASPGConnectionPool(ctx context.Context, serviceName str if err != nil { return nil, fmt.Errorf("UpdateDBAASPGConnectionPool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6216,7 +6278,8 @@ func (c Client) CreateDBAASPGDatabase(ctx context.Context, serviceName string, r if err != nil { return nil, fmt.Errorf("CreateDBAASPGDatabase: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6261,7 +6324,8 @@ func (c Client) DeleteDBAASPGDatabase(ctx context.Context, serviceName string, d if err != nil { return nil, fmt.Errorf("DeleteDBAASPGDatabase: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASPGDatabase: execute request editors: %w", err) @@ -6314,7 +6378,8 @@ func (c Client) CreateDBAASPostgresUser(ctx context.Context, serviceName string, if err != nil { return nil, fmt.Errorf("CreateDBAASPostgresUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6359,7 +6424,8 @@ func (c Client) DeleteDBAASPostgresUser(ctx context.Context, serviceName string, if err != nil { return nil, fmt.Errorf("DeleteDBAASPostgresUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASPostgresUser: execute request editors: %w", err) @@ -6411,7 +6477,8 @@ func (c Client) UpdateDBAASPostgresAllowReplication(ctx context.Context, service if err != nil { return nil, fmt.Errorf("UpdateDBAASPostgresAllowReplication: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6465,7 +6532,8 @@ func (c Client) ResetDBAASPostgresUserPassword(ctx context.Context, serviceName if err != nil { return nil, fmt.Errorf("ResetDBAASPostgresUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6510,7 +6578,8 @@ func (c Client) RevealDBAASPostgresUserPassword(ctx context.Context, serviceName if err != nil { return nil, fmt.Errorf("RevealDBAASPostgresUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RevealDBAASPostgresUserPassword: execute request editors: %w", err) @@ -6562,7 +6631,8 @@ func (c Client) CreateDBAASPGUpgradeCheck(ctx context.Context, service string, r if err != nil { return nil, fmt.Errorf("CreateDBAASPGUpgradeCheck: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6607,7 +6677,8 @@ func (c Client) DeleteDBAASServiceRedis(ctx context.Context, name string) (*Oper if err != nil { return nil, fmt.Errorf("DeleteDBAASServiceRedis: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASServiceRedis: execute request editors: %w", err) @@ -6650,7 +6721,8 @@ func (c Client) GetDBAASServiceRedis(ctx context.Context, name string) (*DBAASSe if err != nil { return nil, fmt.Errorf("GetDBAASServiceRedis: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASServiceRedis: execute request editors: %w", err) @@ -6756,7 +6828,8 @@ func (c Client) CreateDBAASServiceRedis(ctx context.Context, name string, req Cr if err != nil { return nil, fmt.Errorf("CreateDBAASServiceRedis: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6861,7 +6934,8 @@ func (c Client) UpdateDBAASServiceRedis(ctx context.Context, name string, req Up if err != nil { return nil, fmt.Errorf("UpdateDBAASServiceRedis: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -6906,7 +6980,8 @@ func (c Client) StartDBAASRedisMaintenance(ctx context.Context, name string) (*O if err != nil { return nil, fmt.Errorf("StartDBAASRedisMaintenance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StartDBAASRedisMaintenance: execute request editors: %w", err) @@ -6949,7 +7024,8 @@ func (c Client) StopDBAASRedisMigration(ctx context.Context, name string) (*Oper if err != nil { return nil, fmt.Errorf("StopDBAASRedisMigration: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StopDBAASRedisMigration: execute request editors: %w", err) @@ -7001,7 +7077,8 @@ func (c Client) CreateDBAASRedisUser(ctx context.Context, serviceName string, re if err != nil { return nil, fmt.Errorf("CreateDBAASRedisUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -7046,7 +7123,8 @@ func (c Client) DeleteDBAASRedisUser(ctx context.Context, serviceName string, us if err != nil { return nil, fmt.Errorf("DeleteDBAASRedisUser: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASRedisUser: execute request editors: %w", err) @@ -7098,7 +7176,8 @@ func (c Client) ResetDBAASRedisUserPassword(ctx context.Context, serviceName str if err != nil { return nil, fmt.Errorf("ResetDBAASRedisUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -7143,7 +7222,8 @@ func (c Client) RevealDBAASRedisUserPassword(ctx context.Context, serviceName st if err != nil { return nil, fmt.Errorf("RevealDBAASRedisUserPassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RevealDBAASRedisUserPassword: execute request editors: %w", err) @@ -7201,7 +7281,8 @@ func (c Client) ListDBAASServices(ctx context.Context) (*ListDBAASServicesRespon if err != nil { return nil, fmt.Errorf("ListDBAASServices: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDBAASServices: execute request editors: %w", err) @@ -7257,7 +7338,8 @@ func (c Client) GetDBAASServiceLogs(ctx context.Context, serviceName string, req if err != nil { return nil, fmt.Errorf("GetDBAASServiceLogs: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -7326,7 +7408,8 @@ func (c Client) GetDBAASServiceMetrics(ctx context.Context, serviceName string, if err != nil { return nil, fmt.Errorf("GetDBAASServiceMetrics: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -7386,7 +7469,8 @@ func (c Client) ListDBAASServiceTypes(ctx context.Context) (*ListDBAASServiceTyp if err != nil { return nil, fmt.Errorf("ListDBAASServiceTypes: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDBAASServiceTypes: execute request editors: %w", err) @@ -7429,7 +7513,8 @@ func (c Client) GetDBAASServiceType(ctx context.Context, serviceTypeName string) if err != nil { return nil, fmt.Errorf("GetDBAASServiceType: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASServiceType: execute request editors: %w", err) @@ -7472,7 +7557,8 @@ func (c Client) DeleteDBAASService(ctx context.Context, name string) (*Operation if err != nil { return nil, fmt.Errorf("DeleteDBAASService: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDBAASService: execute request editors: %w", err) @@ -7532,7 +7618,8 @@ func (c Client) GetDBAASSettingsGrafana(ctx context.Context) (*GetDBAASSettingsG if err != nil { return nil, fmt.Errorf("GetDBAASSettingsGrafana: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASSettingsGrafana: execute request editors: %w", err) @@ -7622,7 +7709,8 @@ func (c Client) GetDBAASSettingsKafka(ctx context.Context) (*GetDBAASSettingsKaf if err != nil { return nil, fmt.Errorf("GetDBAASSettingsKafka: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASSettingsKafka: execute request editors: %w", err) @@ -7682,7 +7770,8 @@ func (c Client) GetDBAASSettingsMysql(ctx context.Context) (*GetDBAASSettingsMys if err != nil { return nil, fmt.Errorf("GetDBAASSettingsMysql: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASSettingsMysql: execute request editors: %w", err) @@ -7742,7 +7831,8 @@ func (c Client) GetDBAASSettingsOpensearch(ctx context.Context) (*GetDBAASSettin if err != nil { return nil, fmt.Errorf("GetDBAASSettingsOpensearch: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASSettingsOpensearch: execute request editors: %w", err) @@ -7832,7 +7922,8 @@ func (c Client) GetDBAASSettingsPG(ctx context.Context) (*GetDBAASSettingsPGResp if err != nil { return nil, fmt.Errorf("GetDBAASSettingsPG: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASSettingsPG: execute request editors: %w", err) @@ -7892,7 +7983,8 @@ func (c Client) GetDBAASSettingsRedis(ctx context.Context) (*GetDBAASSettingsRed if err != nil { return nil, fmt.Errorf("GetDBAASSettingsRedis: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASSettingsRedis: execute request editors: %w", err) @@ -7948,7 +8040,8 @@ func (c Client) CreateDBAASTaskMigrationCheck(ctx context.Context, service strin if err != nil { return nil, fmt.Errorf("CreateDBAASTaskMigrationCheck: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -7993,7 +8086,8 @@ func (c Client) GetDBAASTask(ctx context.Context, service string, id UUID) (*DBA if err != nil { return nil, fmt.Errorf("GetDBAASTask: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDBAASTask: execute request editors: %w", err) @@ -8051,7 +8145,8 @@ func (c Client) ListDeployTargets(ctx context.Context) (*ListDeployTargetsRespon if err != nil { return nil, fmt.Errorf("ListDeployTargets: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDeployTargets: execute request editors: %w", err) @@ -8094,7 +8189,8 @@ func (c Client) GetDeployTarget(ctx context.Context, id UUID) (*DeployTarget, er if err != nil { return nil, fmt.Errorf("GetDeployTarget: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDeployTarget: execute request editors: %w", err) @@ -8152,7 +8248,8 @@ func (c Client) ListDNSDomains(ctx context.Context) (*ListDNSDomainsResponse, er if err != nil { return nil, fmt.Errorf("ListDNSDomains: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDNSDomains: execute request editors: %w", err) @@ -8206,7 +8303,8 @@ func (c Client) CreateDNSDomain(ctx context.Context, req CreateDNSDomainRequest) if err != nil { return nil, fmt.Errorf("CreateDNSDomain: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -8266,7 +8364,8 @@ func (c Client) ListDNSDomainRecords(ctx context.Context, domainID UUID) (*ListD if err != nil { return nil, fmt.Errorf("ListDNSDomainRecords: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListDNSDomainRecords: execute request editors: %w", err) @@ -8347,7 +8446,8 @@ func (c Client) CreateDNSDomainRecord(ctx context.Context, domainID UUID, req Cr if err != nil { return nil, fmt.Errorf("CreateDNSDomainRecord: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -8392,7 +8492,8 @@ func (c Client) DeleteDNSDomainRecord(ctx context.Context, domainID UUID, record if err != nil { return nil, fmt.Errorf("DeleteDNSDomainRecord: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDNSDomainRecord: execute request editors: %w", err) @@ -8435,7 +8536,8 @@ func (c Client) GetDNSDomainRecord(ctx context.Context, domainID UUID, recordID if err != nil { return nil, fmt.Errorf("GetDNSDomainRecord: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDNSDomainRecord: execute request editors: %w", err) @@ -8494,7 +8596,8 @@ func (c Client) UpdateDNSDomainRecord(ctx context.Context, domainID UUID, record if err != nil { return nil, fmt.Errorf("UpdateDNSDomainRecord: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -8539,7 +8642,8 @@ func (c Client) DeleteDNSDomain(ctx context.Context, id UUID) (*Operation, error if err != nil { return nil, fmt.Errorf("DeleteDNSDomain: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteDNSDomain: execute request editors: %w", err) @@ -8582,7 +8686,8 @@ func (c Client) GetDNSDomain(ctx context.Context, id UUID) (*DNSDomain, error) { if err != nil { return nil, fmt.Errorf("GetDNSDomain: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDNSDomain: execute request editors: %w", err) @@ -8629,7 +8734,8 @@ func (c Client) GetDNSDomainZoneFile(ctx context.Context, id UUID) (*GetDNSDomai if err != nil { return nil, fmt.Errorf("GetDNSDomainZoneFile: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDNSDomainZoneFile: execute request editors: %w", err) @@ -8687,7 +8793,8 @@ func (c Client) ListElasticIPS(ctx context.Context) (*ListElasticIPSResponse, er if err != nil { return nil, fmt.Errorf("ListElasticIPS: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListElasticIPS: execute request editors: %w", err) @@ -8752,7 +8859,8 @@ func (c Client) CreateElasticIP(ctx context.Context, req CreateElasticIPRequest) if err != nil { return nil, fmt.Errorf("CreateElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -8797,7 +8905,8 @@ func (c Client) DeleteElasticIP(ctx context.Context, id UUID) (*Operation, error if err != nil { return nil, fmt.Errorf("DeleteElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteElasticIP: execute request editors: %w", err) @@ -8840,7 +8949,8 @@ func (c Client) GetElasticIP(ctx context.Context, id UUID) (*ElasticIP, error) { if err != nil { return nil, fmt.Errorf("GetElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetElasticIP: execute request editors: %w", err) @@ -8896,7 +9006,8 @@ func (c Client) UpdateElasticIP(ctx context.Context, id UUID, req UpdateElasticI if err != nil { return nil, fmt.Errorf("UpdateElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -8947,7 +9058,8 @@ func (c Client) ResetElasticIPField(ctx context.Context, id UUID, field ResetEla if err != nil { return nil, fmt.Errorf("ResetElasticIPField: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetElasticIPField: execute request editors: %w", err) @@ -9000,7 +9112,8 @@ func (c Client) AttachInstanceToElasticIP(ctx context.Context, id UUID, req Atta if err != nil { return nil, fmt.Errorf("AttachInstanceToElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -9055,7 +9168,8 @@ func (c Client) DetachInstanceFromElasticIP(ctx context.Context, id UUID, req De if err != nil { return nil, fmt.Errorf("DetachInstanceFromElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -9116,7 +9230,8 @@ func (c Client) ListEvents(ctx context.Context, opts ...ListEventsOpt) ([]Event, if err != nil { return nil, fmt.Errorf("ListEvents: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if len(opts) > 0 { q := request.URL.Query() @@ -9167,7 +9282,8 @@ func (c Client) GetIAMOrganizationPolicy(ctx context.Context) (*IAMPolicy, error if err != nil { return nil, fmt.Errorf("GetIAMOrganizationPolicy: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetIAMOrganizationPolicy: execute request editors: %w", err) @@ -9215,7 +9331,8 @@ func (c Client) UpdateIAMOrganizationPolicy(ctx context.Context, req IAMPolicy) if err != nil { return nil, fmt.Errorf("UpdateIAMOrganizationPolicy: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -9275,7 +9392,8 @@ func (c Client) ListIAMRoles(ctx context.Context) (*ListIAMRolesResponse, error) if err != nil { return nil, fmt.Errorf("ListIAMRoles: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListIAMRoles: execute request editors: %w", err) @@ -9337,7 +9455,8 @@ func (c Client) CreateIAMRole(ctx context.Context, req CreateIAMRoleRequest) (*O if err != nil { return nil, fmt.Errorf("CreateIAMRole: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -9382,7 +9501,8 @@ func (c Client) DeleteIAMRole(ctx context.Context, id UUID) (*Operation, error) if err != nil { return nil, fmt.Errorf("DeleteIAMRole: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteIAMRole: execute request editors: %w", err) @@ -9425,7 +9545,8 @@ func (c Client) GetIAMRole(ctx context.Context, id UUID) (*IAMRole, error) { if err != nil { return nil, fmt.Errorf("GetIAMRole: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetIAMRole: execute request editors: %w", err) @@ -9481,7 +9602,8 @@ func (c Client) UpdateIAMRole(ctx context.Context, id UUID, req UpdateIAMRoleReq if err != nil { return nil, fmt.Errorf("UpdateIAMRole: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -9531,7 +9653,8 @@ func (c Client) UpdateIAMRolePolicy(ctx context.Context, id UUID, req IAMPolicy) if err != nil { return nil, fmt.Errorf("UpdateIAMRolePolicy: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -9658,7 +9781,8 @@ func (c Client) ListInstances(ctx context.Context, opts ...ListInstancesOpt) (*L if err != nil { return nil, fmt.Errorf("ListInstances: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if len(opts) > 0 { q := request.URL.Query() @@ -9743,7 +9867,8 @@ func (c Client) CreateInstance(ctx context.Context, req CreateInstanceRequest) ( if err != nil { return nil, fmt.Errorf("CreateInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -9803,7 +9928,8 @@ func (c Client) ListInstancePools(ctx context.Context) (*ListInstancePoolsRespon if err != nil { return nil, fmt.Errorf("ListInstancePools: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListInstancePools: execute request editors: %w", err) @@ -9899,7 +10025,8 @@ func (c Client) CreateInstancePool(ctx context.Context, req CreateInstancePoolRe if err != nil { return nil, fmt.Errorf("CreateInstancePool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -9944,7 +10071,8 @@ func (c Client) DeleteInstancePool(ctx context.Context, id UUID) (*Operation, er if err != nil { return nil, fmt.Errorf("DeleteInstancePool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteInstancePool: execute request editors: %w", err) @@ -9987,7 +10115,8 @@ func (c Client) GetInstancePool(ctx context.Context, id UUID) (*InstancePool, er if err != nil { return nil, fmt.Errorf("GetInstancePool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetInstancePool: execute request editors: %w", err) @@ -10080,7 +10209,8 @@ func (c Client) UpdateInstancePool(ctx context.Context, id UUID, req UpdateInsta if err != nil { return nil, fmt.Errorf("UpdateInstancePool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -10140,7 +10270,8 @@ func (c Client) ResetInstancePoolField(ctx context.Context, id UUID, field Reset if err != nil { return nil, fmt.Errorf("ResetInstancePoolField: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetInstancePoolField: execute request editors: %w", err) @@ -10192,7 +10323,8 @@ func (c Client) EvictInstancePoolMembers(ctx context.Context, id UUID, req Evict if err != nil { return nil, fmt.Errorf("EvictInstancePoolMembers: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -10247,7 +10379,8 @@ func (c Client) ScaleInstancePool(ctx context.Context, id UUID, req ScaleInstanc if err != nil { return nil, fmt.Errorf("ScaleInstancePool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -10307,7 +10440,8 @@ func (c Client) ListInstanceTypes(ctx context.Context) (*ListInstanceTypesRespon if err != nil { return nil, fmt.Errorf("ListInstanceTypes: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListInstanceTypes: execute request editors: %w", err) @@ -10350,7 +10484,8 @@ func (c Client) GetInstanceType(ctx context.Context, id UUID) (*InstanceType, er if err != nil { return nil, fmt.Errorf("GetInstanceType: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetInstanceType: execute request editors: %w", err) @@ -10393,7 +10528,8 @@ func (c Client) DeleteInstance(ctx context.Context, id UUID) (*Operation, error) if err != nil { return nil, fmt.Errorf("DeleteInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteInstance: execute request editors: %w", err) @@ -10436,7 +10572,8 @@ func (c Client) GetInstance(ctx context.Context, id UUID) (*Instance, error) { if err != nil { return nil, fmt.Errorf("GetInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetInstance: execute request editors: %w", err) @@ -10493,7 +10630,8 @@ func (c Client) UpdateInstance(ctx context.Context, id UUID, req UpdateInstanceR if err != nil { return nil, fmt.Errorf("UpdateInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -10544,7 +10682,8 @@ func (c Client) ResetInstanceField(ctx context.Context, id UUID, field ResetInst if err != nil { return nil, fmt.Errorf("ResetInstanceField: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetInstanceField: execute request editors: %w", err) @@ -10587,7 +10726,8 @@ func (c Client) AddInstanceProtection(ctx context.Context, id UUID) (*Operation, if err != nil { return nil, fmt.Errorf("AddInstanceProtection: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("AddInstanceProtection: execute request editors: %w", err) @@ -10630,7 +10770,8 @@ func (c Client) CreateSnapshot(ctx context.Context, id UUID) (*Operation, error) if err != nil { return nil, fmt.Errorf("CreateSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("CreateSnapshot: execute request editors: %w", err) @@ -10677,7 +10818,8 @@ func (c Client) RevealInstancePassword(ctx context.Context, id UUID) (*InstanceP if err != nil { return nil, fmt.Errorf("RevealInstancePassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RevealInstancePassword: execute request editors: %w", err) @@ -10720,7 +10862,8 @@ func (c Client) RebootInstance(ctx context.Context, id UUID) (*Operation, error) if err != nil { return nil, fmt.Errorf("RebootInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RebootInstance: execute request editors: %w", err) @@ -10763,7 +10906,8 @@ func (c Client) RemoveInstanceProtection(ctx context.Context, id UUID) (*Operati if err != nil { return nil, fmt.Errorf("RemoveInstanceProtection: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RemoveInstanceProtection: execute request editors: %w", err) @@ -10818,7 +10962,8 @@ func (c Client) ResetInstance(ctx context.Context, id UUID, req ResetInstanceReq if err != nil { return nil, fmt.Errorf("ResetInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -10863,7 +11008,8 @@ func (c Client) ResetInstancePassword(ctx context.Context, id UUID) (*Operation, if err != nil { return nil, fmt.Errorf("ResetInstancePassword: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetInstancePassword: execute request editors: %w", err) @@ -10916,7 +11062,8 @@ func (c Client) ResizeInstanceDisk(ctx context.Context, id UUID, req ResizeInsta if err != nil { return nil, fmt.Errorf("ResizeInstanceDisk: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -10971,7 +11118,8 @@ func (c Client) ScaleInstance(ctx context.Context, id UUID, req ScaleInstanceReq if err != nil { return nil, fmt.Errorf("ScaleInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -11033,7 +11181,8 @@ func (c Client) StartInstance(ctx context.Context, id UUID, req StartInstanceReq if err != nil { return nil, fmt.Errorf("StartInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -11078,7 +11227,8 @@ func (c Client) StopInstance(ctx context.Context, id UUID) (*Operation, error) { if err != nil { return nil, fmt.Errorf("StopInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("StopInstance: execute request editors: %w", err) @@ -11132,7 +11282,8 @@ func (c Client) RevertInstanceToSnapshot(ctx context.Context, instanceID UUID, r if err != nil { return nil, fmt.Errorf("RevertInstanceToSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -11192,7 +11343,8 @@ func (c Client) ListLoadBalancers(ctx context.Context) (*ListLoadBalancersRespon if err != nil { return nil, fmt.Errorf("ListLoadBalancers: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListLoadBalancers: execute request editors: %w", err) @@ -11248,7 +11400,8 @@ func (c Client) CreateLoadBalancer(ctx context.Context, req CreateLoadBalancerRe if err != nil { return nil, fmt.Errorf("CreateLoadBalancer: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -11293,7 +11446,8 @@ func (c Client) DeleteLoadBalancer(ctx context.Context, id UUID) (*Operation, er if err != nil { return nil, fmt.Errorf("DeleteLoadBalancer: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteLoadBalancer: execute request editors: %w", err) @@ -11336,7 +11490,8 @@ func (c Client) GetLoadBalancer(ctx context.Context, id UUID) (*LoadBalancer, er if err != nil { return nil, fmt.Errorf("GetLoadBalancer: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetLoadBalancer: execute request editors: %w", err) @@ -11392,7 +11547,8 @@ func (c Client) UpdateLoadBalancer(ctx context.Context, id UUID, req UpdateLoadB if err != nil { return nil, fmt.Errorf("UpdateLoadBalancer: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -11476,7 +11632,8 @@ func (c Client) AddServiceToLoadBalancer(ctx context.Context, id UUID, req AddSe if err != nil { return nil, fmt.Errorf("AddServiceToLoadBalancer: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -11521,7 +11678,8 @@ func (c Client) DeleteLoadBalancerService(ctx context.Context, id UUID, serviceI if err != nil { return nil, fmt.Errorf("DeleteLoadBalancerService: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteLoadBalancerService: execute request editors: %w", err) @@ -11564,7 +11722,8 @@ func (c Client) GetLoadBalancerService(ctx context.Context, id UUID, serviceID U if err != nil { return nil, fmt.Errorf("GetLoadBalancerService: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetLoadBalancerService: execute request editors: %w", err) @@ -11644,7 +11803,8 @@ func (c Client) UpdateLoadBalancerService(ctx context.Context, id UUID, serviceI if err != nil { return nil, fmt.Errorf("UpdateLoadBalancerService: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -11695,7 +11855,8 @@ func (c Client) ResetLoadBalancerServiceField(ctx context.Context, id UUID, serv if err != nil { return nil, fmt.Errorf("ResetLoadBalancerServiceField: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetLoadBalancerServiceField: execute request editors: %w", err) @@ -11745,7 +11906,8 @@ func (c Client) ResetLoadBalancerField(ctx context.Context, id UUID, field Reset if err != nil { return nil, fmt.Errorf("ResetLoadBalancerField: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetLoadBalancerField: execute request editors: %w", err) @@ -11788,7 +11950,8 @@ func (c Client) GetOperation(ctx context.Context, id UUID) (*Operation, error) { if err != nil { return nil, fmt.Errorf("GetOperation: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetOperation: execute request editors: %w", err) @@ -11831,7 +11994,8 @@ func (c Client) GetOrganization(ctx context.Context) (*Organization, error) { if err != nil { return nil, fmt.Errorf("GetOrganization: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetOrganization: execute request editors: %w", err) @@ -11889,7 +12053,8 @@ func (c Client) ListPrivateNetworks(ctx context.Context) (*ListPrivateNetworksRe if err != nil { return nil, fmt.Errorf("ListPrivateNetworks: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListPrivateNetworks: execute request editors: %w", err) @@ -11934,6 +12099,8 @@ type CreatePrivateNetworkRequest struct { Name string `json:"name" validate:"required,gte=1,lte=255"` // Private Network netmask Netmask net.IP `json:"netmask,omitempty"` + // Private Network DHCP Options + Options *PrivateNetworkOptions `json:"options,omitempty"` // Private Network start IP address StartIP net.IP `json:"start-ip,omitempty"` } @@ -11951,7 +12118,8 @@ func (c Client) CreatePrivateNetwork(ctx context.Context, req CreatePrivateNetwo if err != nil { return nil, fmt.Errorf("CreatePrivateNetwork: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -11996,7 +12164,8 @@ func (c Client) DeletePrivateNetwork(ctx context.Context, id UUID) (*Operation, if err != nil { return nil, fmt.Errorf("DeletePrivateNetwork: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeletePrivateNetwork: execute request editors: %w", err) @@ -12039,7 +12208,8 @@ func (c Client) GetPrivateNetwork(ctx context.Context, id UUID) (*PrivateNetwork if err != nil { return nil, fmt.Errorf("GetPrivateNetwork: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetPrivateNetwork: execute request editors: %w", err) @@ -12084,6 +12254,8 @@ type UpdatePrivateNetworkRequest struct { Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` // Private Network netmask Netmask net.IP `json:"netmask,omitempty"` + // Private Network DHCP Options + Options *PrivateNetworkOptions `json:"options,omitempty"` // Private Network start IP address StartIP net.IP `json:"start-ip,omitempty"` } @@ -12101,7 +12273,8 @@ func (c Client) UpdatePrivateNetwork(ctx context.Context, id UUID, req UpdatePri if err != nil { return nil, fmt.Errorf("UpdatePrivateNetwork: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -12152,7 +12325,8 @@ func (c Client) ResetPrivateNetworkField(ctx context.Context, id UUID, field Res if err != nil { return nil, fmt.Errorf("ResetPrivateNetworkField: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetPrivateNetworkField: execute request editors: %w", err) @@ -12213,7 +12387,8 @@ func (c Client) AttachInstanceToPrivateNetwork(ctx context.Context, id UUID, req if err != nil { return nil, fmt.Errorf("AttachInstanceToPrivateNetwork: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -12268,7 +12443,8 @@ func (c Client) DetachInstanceFromPrivateNetwork(ctx context.Context, id UUID, r if err != nil { return nil, fmt.Errorf("DetachInstanceFromPrivateNetwork: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -12329,7 +12505,8 @@ func (c Client) UpdatePrivateNetworkInstanceIP(ctx context.Context, id UUID, req if err != nil { return nil, fmt.Errorf("UpdatePrivateNetworkInstanceIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -12378,7 +12555,8 @@ func (c Client) ListQuotas(ctx context.Context) (*ListQuotasResponse, error) { if err != nil { return nil, fmt.Errorf("ListQuotas: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListQuotas: execute request editors: %w", err) @@ -12421,7 +12599,8 @@ func (c Client) GetQuota(ctx context.Context, entity string) (*Quota, error) { if err != nil { return nil, fmt.Errorf("GetQuota: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetQuota: execute request editors: %w", err) @@ -12464,7 +12643,8 @@ func (c Client) DeleteReverseDNSElasticIP(ctx context.Context, id UUID) (*Operat if err != nil { return nil, fmt.Errorf("DeleteReverseDNSElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteReverseDNSElasticIP: execute request editors: %w", err) @@ -12507,7 +12687,8 @@ func (c Client) GetReverseDNSElasticIP(ctx context.Context, id UUID) (*ReverseDN if err != nil { return nil, fmt.Errorf("GetReverseDNSElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetReverseDNSElasticIP: execute request editors: %w", err) @@ -12559,7 +12740,8 @@ func (c Client) UpdateReverseDNSElasticIP(ctx context.Context, id UUID, req Upda if err != nil { return nil, fmt.Errorf("UpdateReverseDNSElasticIP: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -12604,7 +12786,8 @@ func (c Client) DeleteReverseDNSInstance(ctx context.Context, id UUID) (*Operati if err != nil { return nil, fmt.Errorf("DeleteReverseDNSInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteReverseDNSInstance: execute request editors: %w", err) @@ -12647,7 +12830,8 @@ func (c Client) GetReverseDNSInstance(ctx context.Context, id UUID) (*ReverseDNS if err != nil { return nil, fmt.Errorf("GetReverseDNSInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetReverseDNSInstance: execute request editors: %w", err) @@ -12699,7 +12883,8 @@ func (c Client) UpdateReverseDNSInstance(ctx context.Context, id UUID, req Updat if err != nil { return nil, fmt.Errorf("UpdateReverseDNSInstance: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -12777,7 +12962,8 @@ func (c Client) ListSecurityGroups(ctx context.Context, opts ...ListSecurityGrou if err != nil { return nil, fmt.Errorf("ListSecurityGroups: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if len(opts) > 0 { q := request.URL.Query() @@ -12840,7 +13026,8 @@ func (c Client) CreateSecurityGroup(ctx context.Context, req CreateSecurityGroup if err != nil { return nil, fmt.Errorf("CreateSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -12885,7 +13072,8 @@ func (c Client) DeleteSecurityGroup(ctx context.Context, id UUID) (*Operation, e if err != nil { return nil, fmt.Errorf("DeleteSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteSecurityGroup: execute request editors: %w", err) @@ -12928,7 +13116,8 @@ func (c Client) GetSecurityGroup(ctx context.Context, id UUID) (*SecurityGroup, if err != nil { return nil, fmt.Errorf("GetSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetSecurityGroup: execute request editors: %w", err) @@ -13021,7 +13210,8 @@ func (c Client) AddRuleToSecurityGroup(ctx context.Context, id UUID, req AddRule if err != nil { return nil, fmt.Errorf("AddRuleToSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13066,7 +13256,8 @@ func (c Client) DeleteRuleFromSecurityGroup(ctx context.Context, id UUID, ruleID if err != nil { return nil, fmt.Errorf("DeleteRuleFromSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteRuleFromSecurityGroup: execute request editors: %w", err) @@ -13119,7 +13310,8 @@ func (c Client) AddExternalSourceToSecurityGroup(ctx context.Context, id UUID, r if err != nil { return nil, fmt.Errorf("AddExternalSourceToSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13174,7 +13366,8 @@ func (c Client) AttachInstanceToSecurityGroup(ctx context.Context, id UUID, req if err != nil { return nil, fmt.Errorf("AttachInstanceToSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13229,7 +13422,8 @@ func (c Client) DetachInstanceFromSecurityGroup(ctx context.Context, id UUID, re if err != nil { return nil, fmt.Errorf("DetachInstanceFromSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13284,7 +13478,8 @@ func (c Client) RemoveExternalSourceFromSecurityGroup(ctx context.Context, id UU if err != nil { return nil, fmt.Errorf("RemoveExternalSourceFromSecurityGroup: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13344,7 +13539,8 @@ func (c Client) ListSKSClusters(ctx context.Context) (*ListSKSClustersResponse, if err != nil { return nil, fmt.Errorf("ListSKSClusters: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListSKSClusters: execute request editors: %w", err) @@ -13426,7 +13622,8 @@ func (c Client) CreateSKSCluster(ctx context.Context, req CreateSKSClusterReques if err != nil { return nil, fmt.Errorf("CreateSKSCluster: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13471,7 +13668,8 @@ func (c Client) ListSKSClusterDeprecatedResources(ctx context.Context, id UUID) if err != nil { return nil, fmt.Errorf("ListSKSClusterDeprecatedResources: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListSKSClusterDeprecatedResources: execute request editors: %w", err) @@ -13523,7 +13721,8 @@ func (c Client) GenerateSKSClusterKubeconfig(ctx context.Context, id UUID, req S if err != nil { return nil, fmt.Errorf("GenerateSKSClusterKubeconfig: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13580,7 +13779,8 @@ func (c Client) ListSKSClusterVersions(ctx context.Context, opts ...ListSKSClust if err != nil { return nil, fmt.Errorf("ListSKSClusterVersions: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if len(opts) > 0 { q := request.URL.Query() @@ -13631,7 +13831,8 @@ func (c Client) DeleteSKSCluster(ctx context.Context, id UUID) (*Operation, erro if err != nil { return nil, fmt.Errorf("DeleteSKSCluster: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteSKSCluster: execute request editors: %w", err) @@ -13674,7 +13875,8 @@ func (c Client) GetSKSCluster(ctx context.Context, id UUID) (*SKSCluster, error) if err != nil { return nil, fmt.Errorf("GetSKSCluster: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetSKSCluster: execute request editors: %w", err) @@ -13736,7 +13938,8 @@ func (c Client) UpdateSKSCluster(ctx context.Context, id UUID, req UpdateSKSClus if err != nil { return nil, fmt.Errorf("UpdateSKSCluster: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13793,7 +13996,8 @@ func (c Client) GetSKSClusterAuthorityCert(ctx context.Context, id UUID, authori if err != nil { return nil, fmt.Errorf("GetSKSClusterAuthorityCert: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetSKSClusterAuthorityCert: execute request editors: %w", err) @@ -13838,7 +14042,8 @@ func (c Client) GetSKSClusterInspection(ctx context.Context, id UUID) (*GetSKSCl if err != nil { return nil, fmt.Errorf("GetSKSClusterInspection: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetSKSClusterInspection: execute request editors: %w", err) @@ -13926,7 +14131,8 @@ func (c Client) CreateSKSNodepool(ctx context.Context, id UUID, req CreateSKSNod if err != nil { return nil, fmt.Errorf("CreateSKSNodepool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -13971,7 +14177,8 @@ func (c Client) DeleteSKSNodepool(ctx context.Context, id UUID, sksNodepoolID UU if err != nil { return nil, fmt.Errorf("DeleteSKSNodepool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteSKSNodepool: execute request editors: %w", err) @@ -14014,7 +14221,8 @@ func (c Client) GetSKSNodepool(ctx context.Context, id UUID, sksNodepoolID UUID) if err != nil { return nil, fmt.Errorf("GetSKSNodepool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetSKSNodepool: execute request editors: %w", err) @@ -14096,7 +14304,8 @@ func (c Client) UpdateSKSNodepool(ctx context.Context, id UUID, sksNodepoolID UU if err != nil { return nil, fmt.Errorf("UpdateSKSNodepool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -14152,7 +14361,8 @@ func (c Client) ResetSKSNodepoolField(ctx context.Context, id UUID, sksNodepoolI if err != nil { return nil, fmt.Errorf("ResetSKSNodepoolField: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetSKSNodepoolField: execute request editors: %w", err) @@ -14204,7 +14414,8 @@ func (c Client) EvictSKSNodepoolMembers(ctx context.Context, id UUID, sksNodepoo if err != nil { return nil, fmt.Errorf("EvictSKSNodepoolMembers: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -14259,7 +14470,8 @@ func (c Client) ScaleSKSNodepool(ctx context.Context, id UUID, sksNodepoolID UUI if err != nil { return nil, fmt.Errorf("ScaleSKSNodepool: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -14304,7 +14516,8 @@ func (c Client) RotateSKSCcmCredentials(ctx context.Context, id UUID) (*Operatio if err != nil { return nil, fmt.Errorf("RotateSKSCcmCredentials: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RotateSKSCcmCredentials: execute request editors: %w", err) @@ -14347,7 +14560,8 @@ func (c Client) RotateSKSOperatorsCA(ctx context.Context, id UUID) (*Operation, if err != nil { return nil, fmt.Errorf("RotateSKSOperatorsCA: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("RotateSKSOperatorsCA: execute request editors: %w", err) @@ -14400,7 +14614,8 @@ func (c Client) UpgradeSKSCluster(ctx context.Context, id UUID, req UpgradeSKSCl if err != nil { return nil, fmt.Errorf("UpgradeSKSCluster: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -14445,7 +14660,8 @@ func (c Client) UpgradeSKSClusterServiceLevel(ctx context.Context, id UUID) (*Op if err != nil { return nil, fmt.Errorf("UpgradeSKSClusterServiceLevel: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("UpgradeSKSClusterServiceLevel: execute request editors: %w", err) @@ -14495,7 +14711,8 @@ func (c Client) ResetSKSClusterField(ctx context.Context, id UUID, field ResetSK if err != nil { return nil, fmt.Errorf("ResetSKSClusterField: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ResetSKSClusterField: execute request editors: %w", err) @@ -14553,7 +14770,8 @@ func (c Client) ListSnapshots(ctx context.Context) (*ListSnapshotsResponse, erro if err != nil { return nil, fmt.Errorf("ListSnapshots: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListSnapshots: execute request editors: %w", err) @@ -14596,7 +14814,8 @@ func (c Client) DeleteSnapshot(ctx context.Context, id UUID) (*Operation, error) if err != nil { return nil, fmt.Errorf("DeleteSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteSnapshot: execute request editors: %w", err) @@ -14639,7 +14858,8 @@ func (c Client) GetSnapshot(ctx context.Context, id UUID) (*Snapshot, error) { if err != nil { return nil, fmt.Errorf("GetSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetSnapshot: execute request editors: %w", err) @@ -14682,7 +14902,8 @@ func (c Client) ExportSnapshot(ctx context.Context, id UUID) (*Operation, error) if err != nil { return nil, fmt.Errorf("ExportSnapshot: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ExportSnapshot: execute request editors: %w", err) @@ -14743,7 +14964,8 @@ func (c Client) PromoteSnapshotToTemplate(ctx context.Context, id UUID, req Prom if err != nil { return nil, fmt.Errorf("PromoteSnapshotToTemplate: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -14803,7 +15025,8 @@ func (c Client) ListSOSBucketsUsage(ctx context.Context) (*ListSOSBucketsUsageRe if err != nil { return nil, fmt.Errorf("ListSOSBucketsUsage: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListSOSBucketsUsage: execute request editors: %w", err) @@ -14858,7 +15081,8 @@ func (c Client) GetSOSPresignedURL(ctx context.Context, bucket string, opts ...G if err != nil { return nil, fmt.Errorf("GetSOSPresignedURL: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if len(opts) > 0 { q := request.URL.Query() @@ -14924,7 +15148,8 @@ func (c Client) ListSSHKeys(ctx context.Context) (*ListSSHKeysResponse, error) { if err != nil { return nil, fmt.Errorf("ListSSHKeys: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListSSHKeys: execute request editors: %w", err) @@ -14979,7 +15204,8 @@ func (c Client) RegisterSSHKey(ctx context.Context, req RegisterSSHKeyRequest) ( if err != nil { return nil, fmt.Errorf("RegisterSSHKey: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -15024,7 +15250,8 @@ func (c Client) DeleteSSHKey(ctx context.Context, name string) (*Operation, erro if err != nil { return nil, fmt.Errorf("DeleteSSHKey: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteSSHKey: execute request editors: %w", err) @@ -15067,7 +15294,8 @@ func (c Client) GetSSHKey(ctx context.Context, name string) (*SSHKey, error) { if err != nil { return nil, fmt.Errorf("GetSSHKey: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetSSHKey: execute request editors: %w", err) @@ -15146,7 +15374,8 @@ func (c Client) ListTemplates(ctx context.Context, opts ...ListTemplatesOpt) (*L if err != nil { return nil, fmt.Errorf("ListTemplates: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if len(opts) > 0 { q := request.URL.Query() @@ -15236,7 +15465,8 @@ func (c Client) RegisterTemplate(ctx context.Context, req RegisterTemplateReques if err != nil { return nil, fmt.Errorf("RegisterTemplate: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -15281,7 +15511,8 @@ func (c Client) DeleteTemplate(ctx context.Context, id UUID) (*Operation, error) if err != nil { return nil, fmt.Errorf("DeleteTemplate: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("DeleteTemplate: execute request editors: %w", err) @@ -15324,7 +15555,8 @@ func (c Client) GetTemplate(ctx context.Context, id UUID) (*Template, error) { if err != nil { return nil, fmt.Errorf("GetTemplate: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetTemplate: execute request editors: %w", err) @@ -15377,7 +15609,8 @@ func (c Client) CopyTemplate(ctx context.Context, id UUID, req CopyTemplateReque if err != nil { return nil, fmt.Errorf("CopyTemplate: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -15434,7 +15667,8 @@ func (c Client) UpdateTemplate(ctx context.Context, id UUID, req UpdateTemplateR if err != nil { return nil, fmt.Errorf("UpdateTemplate: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) request.Header.Add("Content-Type", "application/json") @@ -15494,7 +15728,8 @@ func (c Client) ListZones(ctx context.Context) (*ListZonesResponse, error) { if err != nil { return nil, fmt.Errorf("ListZones: new request: %w", err) } - request.Header.Add("User-Agent", UserAgent) + + request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("ListZones: execute request editors: %w", err) diff --git a/vendor/github.com/exoscale/egoscale/v3/schemas.go b/vendor/github.com/exoscale/egoscale/v3/schemas.go index 95ddaea9..08611a50 100644 --- a/vendor/github.com/exoscale/egoscale/v3/schemas.go +++ b/vendor/github.com/exoscale/egoscale/v3/schemas.go @@ -198,7 +198,20 @@ type DBAASDatadogTag struct { Tag string `json:"tag" validate:"required,gte=1,lte=200"` } -type DBAASEndpointDatadog struct { +type DBAASEndpointDatadogCommon struct { + // Custom tags provided by user + DatadogTags []DBAASDatadogTag `json:"datadog-tags,omitempty"` + // Disable consumer group metrics + DisableConsumerStats *bool `json:"disable-consumer-stats,omitempty"` + // Number of separate instances to fetch kafka consumer statistics with + KafkaConsumerCheckInstances int64 `json:"kafka-consumer-check-instances,omitempty" validate:"omitempty,gte=1,lte=100"` + // Number of seconds that datadog will wait to get consumer statistics from brokers + KafkaConsumerStatsTimeout int64 `json:"kafka-consumer-stats-timeout,omitempty" validate:"omitempty,gte=2,lte=300"` + // Maximum number of partition contexts to send + MaxPartitionContexts int64 `json:"max-partition-contexts,omitempty" validate:"omitempty,gte=200,lte=200000"` +} + +type DBAASEndpointDatadogInputCreateSettings struct { // Datadog API key DatadogAPIKey string `json:"datadog-api-key" validate:"required,gte=1,lte=256"` // Custom tags provided by user @@ -214,7 +227,62 @@ type DBAASEndpointDatadog struct { Site EnumDatadogSite `json:"site" validate:"required"` } +type DBAASEndpointDatadogInputCreate struct { + Settings *DBAASEndpointDatadogInputCreateSettings `json:"settings,omitempty"` +} + +type DBAASEndpointDatadogInputUpdateSettings struct { + // Datadog API key + DatadogAPIKey string `json:"datadog-api-key,omitempty" validate:"omitempty,gte=1,lte=256"` + // Custom tags provided by user + DatadogTags []DBAASDatadogTag `json:"datadog-tags,omitempty"` + // Disable consumer group metrics + DisableConsumerStats *bool `json:"disable-consumer-stats,omitempty"` + // Number of separate instances to fetch kafka consumer statistics with + KafkaConsumerCheckInstances int64 `json:"kafka-consumer-check-instances,omitempty" validate:"omitempty,gte=1,lte=100"` + // Number of seconds that datadog will wait to get consumer statistics from brokers + KafkaConsumerStatsTimeout int64 `json:"kafka-consumer-stats-timeout,omitempty" validate:"omitempty,gte=2,lte=300"` + // Maximum number of partition contexts to send + MaxPartitionContexts int64 `json:"max-partition-contexts,omitempty" validate:"omitempty,gte=200,lte=200000"` + Site EnumDatadogSite `json:"site,omitempty"` +} + +type DBAASEndpointDatadogInputUpdate struct { + Settings *DBAASEndpointDatadogInputUpdateSettings `json:"settings,omitempty"` +} + +// External integration DataDog configuration +type DBAASEndpointDatadogSettingsSettings struct { + // Custom tags provided by user + DatadogTags []DBAASDatadogTag `json:"datadog-tags,omitempty"` + // Disable consumer group metrics + DisableConsumerStats *bool `json:"disable-consumer-stats,omitempty"` + // Number of separate instances to fetch kafka consumer statistics with + KafkaConsumerCheckInstances int64 `json:"kafka-consumer-check-instances,omitempty" validate:"omitempty,gte=1,lte=100"` + // Number of seconds that datadog will wait to get consumer statistics from brokers + KafkaConsumerStatsTimeout int64 `json:"kafka-consumer-stats-timeout,omitempty" validate:"omitempty,gte=2,lte=300"` + // Maximum number of partition contexts to send + MaxPartitionContexts int64 `json:"max-partition-contexts,omitempty" validate:"omitempty,gte=200,lte=200000"` + Site EnumDatadogSite `json:"site,omitempty"` +} + +type DBAASEndpointDatadogSettings struct { + // External integration DataDog configuration + Settings *DBAASEndpointDatadogSettingsSettings `json:"settings,omitempty"` +} + type DBAASEndpointElasticsearch struct { + // Maximum number of days of logs to keep + IndexDaysMax int64 `json:"index-days-max,omitempty" validate:"omitempty,gte=1,lte=10000"` + // Elasticsearch index prefix + IndexPrefix string `json:"index-prefix" validate:"required,gte=1,lte=1000"` + // Elasticsearch request timeout limit + Timeout int64 `json:"timeout,omitempty" validate:"omitempty,gte=10,lte=120"` + // Elasticsearch connection URL + URL string `json:"url" validate:"required,gte=12,lte=2048"` +} + +type DBAASEndpointElasticsearchInputCreateSettings struct { // PEM encoded CA certificate CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` // Maximum number of days of logs to keep @@ -227,25 +295,80 @@ type DBAASEndpointElasticsearch struct { URL string `json:"url" validate:"required,gte=12,lte=2048"` } +type DBAASEndpointElasticsearchInputCreate struct { + Settings *DBAASEndpointElasticsearchInputCreateSettings `json:"settings,omitempty"` +} + +type DBAASEndpointElasticsearchInputUpdateSettings struct { + // PEM encoded CA certificate + CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` + // Maximum number of days of logs to keep + IndexDaysMax int64 `json:"index-days-max,omitempty" validate:"omitempty,gte=1,lte=10000"` + // Elasticsearch index prefix + IndexPrefix string `json:"index-prefix,omitempty" validate:"omitempty,gte=1,lte=1000"` + // Elasticsearch request timeout limit + Timeout int64 `json:"timeout,omitempty" validate:"omitempty,gte=10,lte=120"` + // Elasticsearch connection URL + URL string `json:"url,omitempty" validate:"omitempty,gte=12,lte=2048"` +} + +type DBAASEndpointElasticsearchInputUpdate struct { + Settings *DBAASEndpointElasticsearchInputUpdateSettings `json:"settings,omitempty"` +} + +type DBAASEndpointElasticsearchOptionalFields struct { + // Maximum number of days of logs to keep + IndexDaysMax int64 `json:"index-days-max,omitempty" validate:"omitempty,gte=1,lte=10000"` + // Elasticsearch index prefix + IndexPrefix string `json:"index-prefix,omitempty" validate:"omitempty,gte=1,lte=1000"` + // Elasticsearch request timeout limit + Timeout int64 `json:"timeout,omitempty" validate:"omitempty,gte=10,lte=120"` + // Elasticsearch connection URL + URL string `json:"url,omitempty" validate:"omitempty,gte=12,lte=2048"` +} + type DBAASEndpointElasticsearchOutput struct { // External integration endpoint id ID UUID `json:"id,omitempty"` // External integration endpoint name - Name string `json:"name,omitempty"` - Settings *DBAASEndpointElasticsearch `json:"settings,omitempty"` - Type EnumExternalEndpointTypes `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Settings *DBAASEndpointElasticsearchOptionalFields `json:"settings,omitempty"` + Type EnumExternalEndpointTypes `json:"type,omitempty"` +} + +type DBAASEndpointElasticsearchSecrets struct { + // PEM encoded CA certificate + CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` +} + +// External integration Prometheus configuration +type DBAASEndpointExternalPrometheusOutputSettings struct { + // Prometheus basic authentication username + BasicAuthUsername string `json:"basic-auth-username,omitempty" validate:"omitempty,gte=5,lte=32"` } type DBAASEndpointExternalPrometheusOutput struct { // External integration endpoint id ID UUID `json:"id,omitempty"` // External integration endpoint name - Name string `json:"name,omitempty"` - Settings *DBAASEndpointPrometheus `json:"settings,omitempty"` - Type EnumExternalEndpointTypes `json:"type,omitempty"` + Name string `json:"name,omitempty"` + // External integration Prometheus configuration + Settings *DBAASEndpointExternalPrometheusOutputSettings `json:"settings,omitempty"` + Type EnumExternalEndpointTypes `json:"type,omitempty"` } type DBAASEndpointOpensearch struct { + // Maximum number of days of logs to keep + IndexDaysMax int64 `json:"index-days-max,omitempty" validate:"omitempty,gte=1,lte=10000"` + // OpenSearch index prefix + IndexPrefix string `json:"index-prefix" validate:"required,gte=1,lte=1000"` + // OpenSearch request timeout limit + Timeout int64 `json:"timeout,omitempty" validate:"omitempty,gte=10,lte=120"` + // OpenSearch connection URL + URL string `json:"url" validate:"required,gte=12,lte=2048"` +} + +type DBAASEndpointOpensearchInputCreateSettings struct { // PEM encoded CA certificate CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` // Maximum number of days of logs to keep @@ -258,23 +381,90 @@ type DBAASEndpointOpensearch struct { URL string `json:"url" validate:"required,gte=12,lte=2048"` } +type DBAASEndpointOpensearchInputCreate struct { + Settings *DBAASEndpointOpensearchInputCreateSettings `json:"settings,omitempty"` +} + +type DBAASEndpointOpensearchInputUpdateSettings struct { + // PEM encoded CA certificate + CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` + // Maximum number of days of logs to keep + IndexDaysMax int64 `json:"index-days-max,omitempty" validate:"omitempty,gte=1,lte=10000"` + // OpenSearch index prefix + IndexPrefix string `json:"index-prefix,omitempty" validate:"omitempty,gte=1,lte=1000"` + // OpenSearch request timeout limit + Timeout int64 `json:"timeout,omitempty" validate:"omitempty,gte=10,lte=120"` + // OpenSearch connection URL + URL string `json:"url,omitempty" validate:"omitempty,gte=12,lte=2048"` +} + +type DBAASEndpointOpensearchInputUpdate struct { + Settings *DBAASEndpointOpensearchInputUpdateSettings `json:"settings,omitempty"` +} + +type DBAASEndpointOpensearchOptionalFields struct { + // Maximum number of days of logs to keep + IndexDaysMax int64 `json:"index-days-max,omitempty" validate:"omitempty,gte=1,lte=10000"` + // OpenSearch index prefix + IndexPrefix string `json:"index-prefix,omitempty" validate:"omitempty,gte=1,lte=1000"` + // OpenSearch request timeout limit + Timeout int64 `json:"timeout,omitempty" validate:"omitempty,gte=10,lte=120"` + // OpenSearch connection URL + URL string `json:"url,omitempty" validate:"omitempty,gte=12,lte=2048"` +} + type DBAASEndpointOpensearchOutput struct { // External integration endpoint id ID UUID `json:"id,omitempty"` // External integration endpoint name - Name string `json:"name,omitempty"` - Settings *DBAASEndpointOpensearch `json:"settings,omitempty"` - Type EnumExternalEndpointTypes `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Settings *DBAASEndpointOpensearchOptionalFields `json:"settings,omitempty"` + Type EnumExternalEndpointTypes `json:"type,omitempty"` +} + +type DBAASEndpointOpensearchSecrets struct { + // PEM encoded CA certificate + CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` } type DBAASEndpointPrometheus struct { + // Prometheus basic authentication username + BasicAuthUsername string `json:"basic-auth-username,omitempty" validate:"omitempty,gte=5,lte=32"` +} + +type DBAASEndpointPrometheusPayloadSettings struct { // Prometheus basic authentication password BasicAuthPassword string `json:"basic-auth-password,omitempty" validate:"omitempty,gte=8,lte=64"` // Prometheus basic authentication username BasicAuthUsername string `json:"basic-auth-username,omitempty" validate:"omitempty,gte=5,lte=32"` } +type DBAASEndpointPrometheusPayload struct { + Settings *DBAASEndpointPrometheusPayloadSettings `json:"settings,omitempty"` +} + +type DBAASEndpointPrometheusSecrets struct { + // Prometheus basic authentication password + BasicAuthPassword string `json:"basic-auth-password,omitempty" validate:"omitempty,gte=8,lte=64"` +} + type DBAASEndpointRsyslog struct { + Format EnumRsyslogFormat `json:"format" validate:"required"` + // Custom syslog message format + Logline string `json:"logline,omitempty" validate:"omitempty,gte=1,lte=512"` + // Rsyslog max message size + MaxMessageSize int64 `json:"max-message-size,omitempty" validate:"omitempty,gte=2048,lte=2.147483647e+09"` + // Rsyslog server port + Port int64 `json:"port" validate:"required,gte=1,lte=65535"` + // Structured data block for log message + SD string `json:"sd,omitempty" validate:"omitempty,lte=1024"` + // Rsyslog server IP address or hostname + Server string `json:"server" validate:"required,gte=4,lte=255"` + // Require TLS + Tls *bool `json:"tls" validate:"required"` +} + +type DBAASEndpointRsyslogInputCreateSettings struct { // PEM encoded CA certificate CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` // PEM encoded client certificate @@ -296,6 +486,61 @@ type DBAASEndpointRsyslog struct { Tls *bool `json:"tls" validate:"required"` } +type DBAASEndpointRsyslogInputCreate struct { + Settings *DBAASEndpointRsyslogInputCreateSettings `json:"settings,omitempty"` +} + +type DBAASEndpointRsyslogInputUpdateSettings struct { + // PEM encoded CA certificate + CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` + // PEM encoded client certificate + Cert string `json:"cert,omitempty" validate:"omitempty,lte=16384"` + Format EnumRsyslogFormat `json:"format,omitempty"` + // PEM encoded client key + Key string `json:"key,omitempty" validate:"omitempty,lte=16384"` + // Custom syslog message format + Logline string `json:"logline,omitempty" validate:"omitempty,gte=1,lte=512"` + // Rsyslog max message size + MaxMessageSize int64 `json:"max-message-size,omitempty" validate:"omitempty,gte=2048,lte=2.147483647e+09"` + // Rsyslog server port + Port int64 `json:"port,omitempty" validate:"omitempty,gte=1,lte=65535"` + // Structured data block for log message + SD string `json:"sd,omitempty" validate:"omitempty,lte=1024"` + // Rsyslog server IP address or hostname + Server string `json:"server,omitempty" validate:"omitempty,gte=4,lte=255"` + // Require TLS + Tls *bool `json:"tls,omitempty"` +} + +type DBAASEndpointRsyslogInputUpdate struct { + Settings *DBAASEndpointRsyslogInputUpdateSettings `json:"settings,omitempty"` +} + +type DBAASEndpointRsyslogOptionalFields struct { + Format EnumRsyslogFormat `json:"format,omitempty"` + // Custom syslog message format + Logline string `json:"logline,omitempty" validate:"omitempty,gte=1,lte=512"` + // Rsyslog max message size + MaxMessageSize int64 `json:"max-message-size,omitempty" validate:"omitempty,gte=2048,lte=2.147483647e+09"` + // Rsyslog server port + Port int64 `json:"port,omitempty" validate:"omitempty,gte=1,lte=65535"` + // Structured data block for log message + SD string `json:"sd,omitempty" validate:"omitempty,lte=1024"` + // Rsyslog server IP address or hostname + Server string `json:"server,omitempty" validate:"omitempty,gte=4,lte=255"` + // Require TLS + Tls *bool `json:"tls,omitempty"` +} + +type DBAASEndpointRsyslogSecrets struct { + // PEM encoded CA certificate + CA string `json:"ca,omitempty" validate:"omitempty,lte=16384"` + // PEM encoded client certificate + Cert string `json:"cert,omitempty" validate:"omitempty,lte=16384"` + // PEM encoded client key + Key string `json:"key,omitempty" validate:"omitempty,lte=16384"` +} + type DBAASExternalEndpoint struct { // External integration endpoint id ID UUID `json:"id,omitempty"` @@ -304,22 +549,38 @@ type DBAASExternalEndpoint struct { Type EnumExternalEndpointTypes `json:"type,omitempty"` } +// External integration DataDog configuration +type DBAASExternalEndpointDatadogOutputSettings struct { + // Custom tags provided by user + DatadogTags []DBAASDatadogTag `json:"datadog-tags,omitempty"` + // Disable consumer group metrics + DisableConsumerStats *bool `json:"disable-consumer-stats,omitempty"` + // Number of separate instances to fetch kafka consumer statistics with + KafkaConsumerCheckInstances int64 `json:"kafka-consumer-check-instances,omitempty" validate:"omitempty,gte=1,lte=100"` + // Number of seconds that datadog will wait to get consumer statistics from brokers + KafkaConsumerStatsTimeout int64 `json:"kafka-consumer-stats-timeout,omitempty" validate:"omitempty,gte=2,lte=300"` + // Maximum number of partition contexts to send + MaxPartitionContexts int64 `json:"max-partition-contexts,omitempty" validate:"omitempty,gte=200,lte=200000"` + Site EnumDatadogSite `json:"site,omitempty"` +} + type DBAASExternalEndpointDatadogOutput struct { // External integration endpoint id ID UUID `json:"id,omitempty"` // External integration endpoint name - Name string `json:"name,omitempty"` - Settings *DBAASEndpointDatadog `json:"settings,omitempty"` - Type EnumExternalEndpointTypes `json:"type,omitempty"` + Name string `json:"name,omitempty"` + // External integration DataDog configuration + Settings *DBAASExternalEndpointDatadogOutputSettings `json:"settings,omitempty"` + Type EnumExternalEndpointTypes `json:"type,omitempty"` } type DBAASExternalEndpointRsyslogOutput struct { // External integration endpoint id ID UUID `json:"id,omitempty"` // External integration endpoint name - Name string `json:"name,omitempty"` - Settings *DBAASEndpointRsyslog `json:"settings,omitempty"` - Type EnumExternalEndpointTypes `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Settings *DBAASEndpointRsyslogOptionalFields `json:"settings,omitempty"` + Type EnumExternalEndpointTypes `json:"type,omitempty"` } // Integrations with other services @@ -331,7 +592,7 @@ type DBAASExternalIntegration struct { // External destination endpoint name DestEndpointName string `json:"dest-endpoint-name,omitempty"` // Endpoint integration UUID - ID UUID `json:"id,omitempty"` + IntegrationID UUID `json:"integration-id,omitempty"` // DBaaS source service name SourceServiceName string `json:"source-service-name" validate:"required"` SourceServiceType DBAASServiceTypeName `json:"source-service-type" validate:"required,gte=0,lte=64"` @@ -2426,6 +2687,8 @@ type PrivateNetwork struct { Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` // Private Network netmask Netmask net.IP `json:"netmask,omitempty"` + // Private Network DHCP Options + Options *PrivateNetworkOptions `json:"options,omitempty"` // Private Network start IP address StartIP net.IP `json:"start-ip,omitempty"` // Private Network VXLAN ID @@ -2440,6 +2703,14 @@ type PrivateNetworkLease struct { IP net.IP `json:"ip,omitempty"` } +// Private Network DHCP Options +type PrivateNetworkOptions struct { + // DNS Servers + DNSServers []net.IP `json:"dns-servers,omitempty"` + // Routers + Routers []net.IP `json:"routers,omitempty"` +} + type PublicIPAssignment string const ( diff --git a/vendor/github.com/exoscale/egoscale/v3/version.go b/vendor/github.com/exoscale/egoscale/v3/version.go index 02227f72..dc4b3e96 100644 --- a/vendor/github.com/exoscale/egoscale/v3/version.go +++ b/vendor/github.com/exoscale/egoscale/v3/version.go @@ -1,4 +1,4 @@ package v3 // Version represents the current egoscale v3 version. -const Version = "v3.1.4" +const Version = "v3.1.7" diff --git a/vendor/modules.txt b/vendor/modules.txt index 08788f4d..5a328208 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -220,7 +220,7 @@ github.com/exoscale/egoscale/v2 github.com/exoscale/egoscale/v2/api github.com/exoscale/egoscale/v2/oapi github.com/exoscale/egoscale/version -# github.com/exoscale/egoscale/v3 v3.1.4 +# github.com/exoscale/egoscale/v3 v3.1.7 ## explicit; go 1.22.0 github.com/exoscale/egoscale/v3 github.com/exoscale/egoscale/v3/credentials