From 5d46f53df2fc8a63733fc48319700e5bb1d13383 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Mon, 15 Feb 2021 14:49:28 +0300 Subject: [PATCH] Revert "Revert "Changes from 2.15 (#137)" (#138)" This reverts commit 40d9b2d2d00f1c8daa82d21a02f269aa2ec812ef. --- Gopkg.lock | 5 +- commands/base.go | 16 + commands/config.go | 15 +- commands/config_test.go | 25 + .../inventory/add_agent_external_exporter.go | 10 +- .../inventory/add_agent_mongodb_exporter.go | 4 + .../inventory/add_agent_mysqld_exporter.go | 4 + commands/inventory/add_agent_node_exporter.go | 16 +- .../inventory/add_agent_postgres_exporter.go | 4 + .../inventory/add_agent_proxysql_exporter.go | 4 + commands/inventory/list_services.go | 1 + commands/management/add_external.go | 6 +- .../management/add_external_serverless.go | 7 +- commands/management/add_mongodb.go | 27 +- commands/management/add_mysql.go | 27 +- commands/management/add_postgresql.go | 27 +- commands/management/add_proxysql.go | 28 +- commands/management/register.go | 31 +- .../agents/add_mongo_db_exporter_responses.go | 6 + .../add_my_s_q_ld_exporter_responses.go | 6 + .../agents/add_node_exporter_responses.go | 6 + .../agents/add_postgres_exporter_responses.go | 6 + .../add_proxy_sql_exporter_responses.go | 6 + .../change_mongo_db_exporter_responses.go | 3 + .../change_my_s_q_ld_exporter_responses.go | 3 + .../agents/change_node_exporter_responses.go | 3 + .../change_postgres_exporter_responses.go | 3 + .../change_proxy_sql_exporter_responses.go | 3 + .../json/client/agents/get_agent_responses.go | 15 + .../client/agents/list_agents_responses.go | 15 + .../add_ha_proxy_service_parameters.go | 131 ++++ .../add_ha_proxy_service_responses.go | 349 +++++++++ .../client/services/get_service_responses.go | 75 ++ .../services/list_services_responses.go | 92 ++- .../json/client/services/services_client.go | 35 + .../api/inventorypb/types/service_types.go | 2 + .../json/client/actions/actions_client.go | 35 + ...t_pt_mongo_db_summary_action_parameters.go | 131 ++++ ...rt_pt_mongo_db_summary_action_responses.go | 263 +++++++ .../ha_proxy/add_ha_proxy_parameters.go | 131 ++++ .../client/ha_proxy/add_ha_proxy_responses.go | 701 ++++++++++++++++++ .../json/client/ha_proxy/ha_proxy_client.go | 69 ++ .../client/mongo_db/add_mongo_db_responses.go | 6 + .../client/my_sql/add_my_sql_responses.go | 6 + .../client/node/register_node_responses.go | 3 + .../json/client/pmm_management_client.go | 5 + .../postgre_sql/add_postgre_sql_responses.go | 6 + .../proxy_sql/add_proxy_sql_responses.go | 6 + .../json/client/rds/add_rds_responses.go | 3 + .../get_security_check_results_responses.go | 3 + .../service/remove_service_responses.go | 7 +- 51 files changed, 2310 insertions(+), 81 deletions(-) create mode 100644 vendor/github.com/percona/pmm/api/inventorypb/json/client/services/add_ha_proxy_service_parameters.go create mode 100644 vendor/github.com/percona/pmm/api/inventorypb/json/client/services/add_ha_proxy_service_responses.go create mode 100644 vendor/github.com/percona/pmm/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_parameters.go create mode 100644 vendor/github.com/percona/pmm/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_responses.go create mode 100644 vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/add_ha_proxy_parameters.go create mode 100644 vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/add_ha_proxy_responses.go create mode 100644 vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/ha_proxy_client.go diff --git a/Gopkg.lock b/Gopkg.lock index 7c4833c4..1498f6e7 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -241,7 +241,7 @@ [[projects]] branch = "PMM-2.0" - digest = "1:203c55805004e8f13cd4f28ef65c015a17115e9d45cdc28f7565bd2c76d3d96a" + digest = "1:0b55cc70802a3d417bc8cabe030255107001bfd4e32408bfdcb3503e23e83781" name = "github.com/percona/pmm" packages = [ "api/agentlocalpb/json/client", @@ -255,6 +255,7 @@ "api/managementpb/json/client/actions", "api/managementpb/json/client/annotation", "api/managementpb/json/client/external", + "api/managementpb/json/client/ha_proxy", "api/managementpb/json/client/mongo_db", "api/managementpb/json/client/my_sql", "api/managementpb/json/client/node", @@ -270,7 +271,7 @@ "version", ] pruneopts = "NUT" - revision = "c4ee3d8bfe5b0b556e49afba553d6700308f3d25" + revision = "4559713b8bc01ab2538bd183bca387cebe624966" [[projects]] digest = "1:14715f705ff5dfe0ffd6571d7d201dd8e921030f8070321a79380d8ca4ec1a24" diff --git a/commands/base.go b/commands/base.go index 6288b177..497715dd 100644 --- a/commands/base.go +++ b/commands/base.go @@ -144,6 +144,22 @@ func ParseCustomLabels(labels string) (map[string]string, error) { return result, nil } +// ParseDisableCollectors parses --disable-collectors flag value. +func ParseDisableCollectors(collectors string) []string { + var disableCollectors []string + + if collectors != "" { + for _, v := range strings.Split(collectors, ",") { + disableCollector := strings.TrimSpace(v) + if disableCollector != "" { + disableCollectors = append(disableCollectors, disableCollector) + } + } + } + + return disableCollectors +} + // ReadFile reads file from filepath if filepath is not empty. func ReadFile(filepath string) (string, error) { if filepath == "" { diff --git a/commands/config.go b/commands/config.go index 720e39d6..f4834eb6 100644 --- a/commands/config.go +++ b/commands/config.go @@ -47,10 +47,11 @@ type configCommand struct { NodeType string NodeName string - NodeModel string - Region string - Az string - MetricsMode string + NodeModel string + Region string + Az string + MetricsMode string + DisableCollectors string Force bool } @@ -103,6 +104,11 @@ func (cmd *configCommand) args() (res []string, switchedToTLS bool) { if cmd.MetricsMode != "" { res = append(res, fmt.Sprintf("--metrics-mode=%s", cmd.MetricsMode)) } + + if cmd.DisableCollectors != "" { + res = append(res, fmt.Sprintf("--disable-collectors=%s", cmd.DisableCollectors)) + } + res = append(res, cmd.NodeAddress, cmd.NodeType, cmd.NodeName) return //nolint:nakedret } @@ -155,4 +161,5 @@ func init() { ConfigC.Flag("force", "Remove Node with that name with all dependent Services and Agents if one exist").BoolVar(&Config.Force) ConfigC.Flag("metrics-mode", "Metrics flow mode for agents node-exporter, can be push - agent will push metrics,"+ " pull - server scrape metrics from agent or auto - chosen by server.").Default("auto").EnumVar(&Config.MetricsMode, "auto", "push", "pull") + ConfigC.Flag("disable-collectors", "Comma-separated list of collector names to exclude from exporter").StringVar(&Config.DisableCollectors) } diff --git a/commands/config_test.go b/commands/config_test.go index 173c7893..7e781435 100644 --- a/commands/config_test.go +++ b/commands/config_test.go @@ -68,4 +68,29 @@ func TestConfigCommandArgs(t *testing.T) { assert.Equal(t, expected, args) assert.True(t, switchedToTLS) }) + t.Run("DisableCollectors", func(t *testing.T) { + cmd := &configCommand{ + NodeAddress: "1.2.3.4", + NodeType: "generic", + NodeName: "node1", + DisableCollectors: "cpu,diskstats", + } + u, err := url.Parse("http://admin:admin@127.0.0.1") + require.NoError(t, err) + GlobalFlags = &globalFlagsValues{ + ServerURL: u, + } + args, switchedToTLS := cmd.args() + expected := []string{ + "--server-address=127.0.0.1:443", + "--server-username=admin", + "--server-password=admin", + "--server-insecure-tls", + "setup", + "--disable-collectors=cpu,diskstats", + "1.2.3.4", "generic", "node1", + } + assert.Equal(t, expected, args) + assert.True(t, switchedToTLS) + }) } diff --git a/commands/inventory/add_agent_external_exporter.go b/commands/inventory/add_agent_external_exporter.go index 595312b5..83ff2510 100644 --- a/commands/inventory/add_agent_external_exporter.go +++ b/commands/inventory/add_agent_external_exporter.go @@ -16,6 +16,9 @@ package inventory import ( + "fmt" + "strings" + "github.com/percona/pmm/api/inventorypb/json/client" "github.com/percona/pmm/api/inventorypb/json/client/agents" @@ -63,6 +66,11 @@ func (cmd *addAgentExternalExporterCommand) Run() (commands.Result, error) { if err != nil { return nil, err } + + if !strings.HasPrefix(cmd.MetricsPath, "/") { + cmd.MetricsPath = fmt.Sprintf("/%s", cmd.MetricsPath) + } + params := &agents.AddExternalExporterParams{ Body: agents.AddExternalExporterBody{ RunsOnNodeID: cmd.RunsOnNodeID, @@ -98,7 +106,7 @@ func init() { AddAgentExternalExporterC.Flag("service-id", "Service identifier").Required().StringVar(&AddAgentExternalExporter.ServiceID) AddAgentExternalExporterC.Flag("username", "HTTP Basic auth username for scraping metrics").StringVar(&AddAgentExternalExporter.Username) AddAgentExternalExporterC.Flag("password", "HTTP Basic auth password for scraping metrics").StringVar(&AddAgentExternalExporter.Password) - AddAgentExternalExporterC.Flag("scheme", "Scheme to generate URI to exporter metrics endpoints").StringVar(&AddAgentExternalExporter.Scheme) + AddAgentExternalExporterC.Flag("scheme", "Scheme to generate URI to exporter metrics endpoints (http, https)").StringVar(&AddAgentExternalExporter.Scheme) AddAgentExternalExporterC.Flag("metrics-path", "Path under which metrics are exposed, used to generate URI").StringVar(&AddAgentExternalExporter.MetricsPath) AddAgentExternalExporterC.Flag("listen-port", "Listen port for scraping metrics").Required().Int64Var(&AddAgentExternalExporter.ListenPort) AddAgentExternalExporterC.Flag("custom-labels", "Custom user-assigned labels").StringVar(&AddAgentExternalExporter.CustomLabels) diff --git a/commands/inventory/add_agent_mongodb_exporter.go b/commands/inventory/add_agent_mongodb_exporter.go index 37ca38a6..c8bfacc0 100644 --- a/commands/inventory/add_agent_mongodb_exporter.go +++ b/commands/inventory/add_agent_mongodb_exporter.go @@ -60,6 +60,7 @@ type addAgentMongodbExporterCommand struct { TLSCertificateKeyFilePassword string TLSCaFile string PushMetrics bool + DisableCollectors string } func (cmd *addAgentMongodbExporterCommand) Run() (commands.Result, error) { @@ -91,6 +92,7 @@ func (cmd *addAgentMongodbExporterCommand) Run() (commands.Result, error) { TLSCertificateKeyFilePassword: cmd.TLSCertificateKeyFilePassword, TLSCa: tlsCa, PushMetrics: cmd.PushMetrics, + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -124,4 +126,6 @@ func init() { AddAgentMongodbExporterC.Flag("tls-ca-file", "Path to certificate authority file").StringVar(&AddAgentMongodbExporter.TLSCaFile) AddAgentMongodbExporterC.Flag("push-metrics", "Enables push metrics model flow,"+ " it will be sent to the server by an agent").BoolVar(&AddAgentMongodbExporter.PushMetrics) + AddAgentMongodbExporterC.Flag("disable-collectors", + "Comma-separated list of collector names to exclude from exporter").StringVar(&AddAgentMongodbExporter.DisableCollectors) } diff --git a/commands/inventory/add_agent_mysqld_exporter.go b/commands/inventory/add_agent_mysqld_exporter.go index ba8e65bd..61559b41 100644 --- a/commands/inventory/add_agent_mysqld_exporter.go +++ b/commands/inventory/add_agent_mysqld_exporter.go @@ -91,6 +91,7 @@ type addAgentMysqldExporterCommand struct { TLSSkipVerify bool TablestatsGroupTableLimit int32 PushMetrics bool + DisableCollectors string } func (cmd *addAgentMysqldExporterCommand) Run() (commands.Result, error) { @@ -110,6 +111,7 @@ func (cmd *addAgentMysqldExporterCommand) Run() (commands.Result, error) { TLSSkipVerify: cmd.TLSSkipVerify, TablestatsGroupTableLimit: cmd.TablestatsGroupTableLimit, PushMetrics: cmd.PushMetrics, + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -145,4 +147,6 @@ func init() { Int32Var(&AddAgentMysqldExporter.TablestatsGroupTableLimit) AddAgentMysqldExporterC.Flag("push-metrics", "Enables push metrics model flow,"+ " it will be sent to the server by an agent").BoolVar(&AddAgentMysqldExporter.PushMetrics) + AddAgentMysqldExporterC.Flag("disable-collectors", + "Comma-separated list of collector names to exclude from exporter").StringVar(&AddAgentMysqldExporter.DisableCollectors) } diff --git a/commands/inventory/add_agent_node_exporter.go b/commands/inventory/add_agent_node_exporter.go index f93fb6b0..1269b001 100644 --- a/commands/inventory/add_agent_node_exporter.go +++ b/commands/inventory/add_agent_node_exporter.go @@ -44,9 +44,10 @@ func (res *addAgentNodeExporterResult) String() string { } type addAgentNodeExporterCommand struct { - PMMAgentID string - CustomLabels string - PushMetrics bool + PMMAgentID string + CustomLabels string + PushMetrics bool + DisableCollectors string } func (cmd *addAgentNodeExporterCommand) Run() (commands.Result, error) { @@ -56,9 +57,10 @@ func (cmd *addAgentNodeExporterCommand) Run() (commands.Result, error) { } params := &agents.AddNodeExporterParams{ Body: agents.AddNodeExporterBody{ - PMMAgentID: cmd.PMMAgentID, - CustomLabels: customLabels, - PushMetrics: cmd.PushMetrics, + PMMAgentID: cmd.PMMAgentID, + CustomLabels: customLabels, + PushMetrics: cmd.PushMetrics, + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -83,4 +85,6 @@ func init() { AddAgentNodeExporterC.Flag("custom-labels", "Custom user-assigned labels").StringVar(&AddAgentNodeExporter.CustomLabels) AddAgentNodeExporterC.Flag("push-metrics", "Enables push metrics model flow,"+ " it will be sent to the server by an agent").BoolVar(&AddAgentNodeExporter.PushMetrics) + AddAgentNodeExporterC.Flag("disable-collectors", + "Comma-separated list of collector names to exclude from exporter").StringVar(&AddAgentNodeExporter.DisableCollectors) } diff --git a/commands/inventory/add_agent_postgres_exporter.go b/commands/inventory/add_agent_postgres_exporter.go index 9e08fd13..f178b845 100644 --- a/commands/inventory/add_agent_postgres_exporter.go +++ b/commands/inventory/add_agent_postgres_exporter.go @@ -57,6 +57,7 @@ type addAgentPostgresExporterCommand struct { TLS bool TLSSkipVerify bool PushMetrics bool + DisableCollectors string } func (cmd *addAgentPostgresExporterCommand) Run() (commands.Result, error) { @@ -75,6 +76,7 @@ func (cmd *addAgentPostgresExporterCommand) Run() (commands.Result, error) { TLS: cmd.TLS, TLSSkipVerify: cmd.TLSSkipVerify, PushMetrics: cmd.PushMetrics, + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -105,4 +107,6 @@ func init() { AddAgentPostgresExporterC.Flag("tls-skip-verify", "Skip TLS certificates validation").BoolVar(&AddAgentPostgresExporter.TLSSkipVerify) AddAgentPostgresExporterC.Flag("push-metrics", "Enables push metrics model flow,"+ " it will be sent to the server by an agent").BoolVar(&AddAgentPostgresExporter.PushMetrics) + AddAgentPostgresExporterC.Flag("disable-collectors", + "Comma-separated list of collector names to exclude from exporter").StringVar(&AddAgentPostgresExporter.DisableCollectors) } diff --git a/commands/inventory/add_agent_proxysql_exporter.go b/commands/inventory/add_agent_proxysql_exporter.go index 128cdc56..289e0284 100644 --- a/commands/inventory/add_agent_proxysql_exporter.go +++ b/commands/inventory/add_agent_proxysql_exporter.go @@ -57,6 +57,7 @@ type addAgentProxysqlExporterCommand struct { TLS bool TLSSkipVerify bool PushMetrics bool + DisableCollectors string } func (cmd *addAgentProxysqlExporterCommand) Run() (commands.Result, error) { @@ -75,6 +76,7 @@ func (cmd *addAgentProxysqlExporterCommand) Run() (commands.Result, error) { TLS: cmd.TLS, TLSSkipVerify: cmd.TLSSkipVerify, PushMetrics: cmd.PushMetrics, + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -105,4 +107,6 @@ func init() { AddAgentProxysqlExporterC.Flag("tls-skip-verify", "Skip TLS certificates validation").BoolVar(&AddAgentProxysqlExporter.TLSSkipVerify) AddAgentProxysqlExporterC.Flag("push-metrics", "Enables push metrics model flow,"+ " it will be sent to the server by an agent").BoolVar(&AddAgentProxysqlExporter.PushMetrics) + AddAgentProxysqlExporterC.Flag("disable-collectors", + "Comma-separated list of collector names to exclude from exporter").StringVar(&AddAgentProxysqlExporter.DisableCollectors) } diff --git a/commands/inventory/list_services.go b/commands/inventory/list_services.go index e942c895..cb254672 100644 --- a/commands/inventory/list_services.go +++ b/commands/inventory/list_services.go @@ -157,4 +157,5 @@ var ( func init() { ListServicesC.Flag("node-id", "Filter by Node identifier").StringVar(&ListServices.filters.NodeID) ListServicesC.Flag("service-type", "Filter by Service type").StringVar(&ListServices.ServiceType) + ListServicesC.Flag("external-group", "Filter by external group").StringVar(&ListServices.filters.ExternalGroup) } diff --git a/commands/management/add_external.go b/commands/management/add_external.go index 04e6ffe1..80e8842a 100644 --- a/commands/management/add_external.go +++ b/commands/management/add_external.go @@ -93,6 +93,10 @@ func (cmd *addExternalCommand) Run() (commands.Result, error) { cmd.ServiceName = fmt.Sprintf("%s-%s", strings.TrimSuffix(cmd.ServiceName, defaultServiceNameSuffix), cmd.Group) } + if !strings.HasPrefix(cmd.MetricsPath, "/") { + cmd.MetricsPath = fmt.Sprintf("/%s", cmd.MetricsPath) + } + params := &external.AddExternalParams{ Body: external.AddExternalBody{ RunsOnNodeID: cmd.RunsOnNodeID, @@ -139,7 +143,7 @@ func init() { AddExternalC.Flag("username", "External username").StringVar(&AddExternal.Username) AddExternalC.Flag("password", "External password").StringVar(&AddExternal.Password) - AddExternalC.Flag("scheme", "Scheme to generate URI to exporter metrics endpoints").StringVar(&AddExternal.Scheme) + AddExternalC.Flag("scheme", "Scheme to generate URI to exporter metrics endpoints (http, https)").StringVar(&AddExternal.Scheme) AddExternalC.Flag("metrics-path", "Path under which metrics are exposed, used to generate URI.").StringVar(&AddExternal.MetricsPath) AddExternalC.Flag("listen-port", "Listen port of external exporter for scraping metrics.").Required().Uint16Var(&AddExternal.ListenPort) diff --git a/commands/management/add_external_serverless.go b/commands/management/add_external_serverless.go index 2e2de396..6aad1dd1 100644 --- a/commands/management/add_external_serverless.go +++ b/commands/management/add_external_serverless.go @@ -20,6 +20,7 @@ import ( "net" "net/url" "strconv" + "strings" "github.com/AlekSi/pointer" "github.com/percona/pmm/api/managementpb/json/client" @@ -88,6 +89,10 @@ func (cmd *addExternalServerlessCommand) Run() (commands.Result, error) { serviceName = fmt.Sprintf("%s-external", address) } + if !strings.HasPrefix(cmd.MetricsPath, "/") { + cmd.MetricsPath = fmt.Sprintf("/%s", cmd.MetricsPath) + } + params := &external.AddExternalParams{ Body: external.AddExternalBody{ AddNode: &external.AddExternalParamsBodyAddNode{ @@ -179,7 +184,7 @@ func init() { AddExternalServerlessC.Flag("username", "External username").StringVar(&AddExternalServerless.Username) AddExternalServerlessC.Flag("password", "External password").StringVar(&AddExternalServerless.Password) - AddExternalServerlessC.Flag("scheme", "Scheme to generate URL to exporter metrics endpoints").StringVar(&AddExternalServerless.Scheme) + AddExternalServerlessC.Flag("scheme", "Scheme to generate URL to exporter metrics endpoints (http, https)").StringVar(&AddExternalServerless.Scheme) AddExternalServerlessC.Flag("url", "Full URL to exporter metrics endpoints").StringVar(&AddExternalServerless.URL) AddExternalServerlessC.Flag("address", "External exporter address and port").StringVar(&AddExternalServerless.Address) AddExternalServerlessC.Flag("host", "External exporters hostname or IP address").StringVar(&AddExternalServerless.Host) diff --git a/commands/management/add_mongodb.go b/commands/management/add_mongodb.go index 285fdf67..3338369e 100644 --- a/commands/management/add_mongodb.go +++ b/commands/management/add_mongodb.go @@ -50,18 +50,19 @@ func (res *addMongoDBResult) String() string { } type addMongoDBCommand struct { - Address string - Socket string - NodeID string - PMMAgentID string - ServiceName string - Username string - Password string - Environment string - Cluster string - ReplicationSet string - CustomLabels string - MetricsMode string + Address string + Socket string + NodeID string + PMMAgentID string + ServiceName string + Username string + Password string + Environment string + Cluster string + ReplicationSet string + CustomLabels string + MetricsMode string + DisableCollectors string QuerySource string @@ -146,6 +147,7 @@ func (cmd *addMongoDBCommand) Run() (commands.Result, error) { TLSCertificateKeyFilePassword: cmd.TLSCertificateKeyFilePassword, TLSCa: tlsCa, MetricsMode: pointer.ToString(strings.ToUpper(cmd.MetricsMode)), + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -198,6 +200,7 @@ func init() { " pull - server scrape metrics from agent or auto - chosen by server."). Default("auto"). EnumVar(&AddMongoDB.MetricsMode, metricsModes...) + AddMongoDBC.Flag("disable-collectors", "Comma-separated list of collector names to exclude from exporter").StringVar(&AddMongoDB.DisableCollectors) addGlobalFlags(AddMongoDBC) AddMongoDBC.Flag("socket", "Path to socket").StringVar(&AddMongoDB.Socket) } diff --git a/commands/management/add_mysql.go b/commands/management/add_mysql.go index f0038581..0ebc6aac 100644 --- a/commands/management/add_mysql.go +++ b/commands/management/add_mysql.go @@ -86,18 +86,19 @@ func (res *addMySQLResult) TablestatStatus() string { } type addMySQLCommand struct { - Address string - Socket string - NodeID string - PMMAgentID string - ServiceName string - Username string - Password string - Environment string - Cluster string - ReplicationSet string - CustomLabels string - MetricsMode string + Address string + Socket string + NodeID string + PMMAgentID string + ServiceName string + Username string + Password string + Environment string + Cluster string + ReplicationSet string + CustomLabels string + MetricsMode string + DisableCollectors string QuerySource string @@ -190,6 +191,7 @@ func (cmd *addMySQLCommand) Run() (commands.Result, error) { TLSSkipVerify: cmd.TLSSkipVerify, TablestatsGroupTableLimit: tablestatsGroupTableLimit, MetricsMode: pointer.ToString(strings.ToUpper(cmd.MetricsMode)), + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -249,5 +251,6 @@ func init() { " pull - server scrape metrics from agent or auto - chosen by server."). Default("auto"). EnumVar(&AddMySQL.MetricsMode, metricsModes...) + AddMySQLC.Flag("disable-collectors", "Comma-separated list of collector names to exclude from exporter").StringVar(&AddMySQL.DisableCollectors) addGlobalFlags(AddMySQLC) } diff --git a/commands/management/add_postgresql.go b/commands/management/add_postgresql.go index 7ac8777a..88173fb0 100644 --- a/commands/management/add_postgresql.go +++ b/commands/management/add_postgresql.go @@ -45,18 +45,19 @@ func (res *addPostgreSQLResult) String() string { } type addPostgreSQLCommand struct { - Address string - Socket string - NodeID string - PMMAgentID string - ServiceName string - Username string - Password string - Environment string - Cluster string - ReplicationSet string - CustomLabels string - MetricsMode string + Address string + Socket string + NodeID string + PMMAgentID string + ServiceName string + Username string + Password string + Environment string + Cluster string + ReplicationSet string + CustomLabels string + MetricsMode string + DisableCollectors string QuerySource string @@ -140,6 +141,7 @@ func (cmd *addPostgreSQLCommand) Run() (commands.Result, error) { TLSSkipVerify: cmd.TLSSkipVerify, DisableQueryExamples: cmd.DisableQueryExamples, MetricsMode: pointer.ToString(strings.ToUpper(cmd.MetricsMode)), + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -191,6 +193,7 @@ func init() { " pull - server scrape metrics from agent or auto - chosen by server."). Default("auto"). EnumVar(&AddPostgreSQL.MetricsMode, metricsModes...) + AddPostgreSQLC.Flag("disable-collectors", "Comma-separated list of collector names to exclude from exporter").StringVar(&AddPostgreSQL.DisableCollectors) addGlobalFlags(AddPostgreSQLC) } diff --git a/commands/management/add_proxysql.go b/commands/management/add_proxysql.go index 5444c7ea..486a766c 100644 --- a/commands/management/add_proxysql.go +++ b/commands/management/add_proxysql.go @@ -45,18 +45,19 @@ func (res *addProxySQLResult) String() string { } type addProxySQLCommand struct { - Address string - Socket string - NodeID string - PMMAgentID string - ServiceName string - Username string - Password string - Environment string - Cluster string - ReplicationSet string - CustomLabels string - MetricsMode string + Address string + Socket string + NodeID string + PMMAgentID string + ServiceName string + Username string + Password string + Environment string + Cluster string + ReplicationSet string + CustomLabels string + MetricsMode string + DisableCollectors string SkipConnectionCheck bool TLS bool @@ -122,6 +123,7 @@ func (cmd *addProxySQLCommand) Run() (commands.Result, error) { TLS: cmd.TLS, TLSSkipVerify: cmd.TLSSkipVerify, MetricsMode: pointer.ToString(strings.ToUpper(cmd.MetricsMode)), + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -169,5 +171,7 @@ func init() { Default("auto"). EnumVar(&AddProxySQL.MetricsMode, metricsModes...) + AddProxySQLC.Flag("disable-collectors", "Comma-separated list of collector names to exclude from exporter").StringVar(&AddProxySQL.DisableCollectors) + addGlobalFlags(AddProxySQLC) } diff --git a/commands/management/register.go b/commands/management/register.go index d09d55f5..f733bcc3 100644 --- a/commands/management/register.go +++ b/commands/management/register.go @@ -48,18 +48,19 @@ func (res *registerResult) String() string { } type registerCommand struct { - NodeType string - NodeName string - MachineID string - Distro string - ContainerID string - ContainerName string - NodeModel string - Region string - Az string - CustomLabels string - Address string - MetricsMode string + NodeType string + NodeName string + MachineID string + Distro string + ContainerID string + ContainerName string + NodeModel string + Region string + Az string + CustomLabels string + Address string + MetricsMode string + DisableCollectors string Force bool } @@ -84,8 +85,9 @@ func (cmd *registerCommand) Run() (commands.Result, error) { CustomLabels: customLabels, Address: cmd.Address, - Reregister: cmd.Force, - MetricsMode: pointer.ToString(strings.ToUpper(cmd.MetricsMode)), + Reregister: cmd.Force, + MetricsMode: pointer.ToString(strings.ToUpper(cmd.MetricsMode)), + DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors), }, Context: commands.Ctx, } @@ -142,4 +144,5 @@ func init() { RegisterC.Flag("force", "Remove Node with that name with all dependent Services and Agents if one exist").BoolVar(&Register.Force) RegisterC.Flag("metrics-mode", "Metrics flow mode, can be push - agent will push metrics,"+ " pull - server scrape metrics from agent or auto - chosen by server.").Default("auto").EnumVar(&Register.MetricsMode, "auto", "pull", "push") + RegisterC.Flag("disable-collectors", "Comma-separated list of collector names to exclude from exporter").StringVar(&Register.DisableCollectors) } diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_mongo_db_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_mongo_db_exporter_responses.go index e2034dfc..6295dcee 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_mongo_db_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_mongo_db_exporter_responses.go @@ -159,6 +159,9 @@ type AddMongoDBExporterBody struct { // Enables push metrics mode for exporter. PushMetrics bool `json:"push_metrics,omitempty"` + + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` } // Validate validates this add mongo DB exporter body @@ -350,6 +353,9 @@ type AddMongoDBExporterOKBodyMongodbExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_responses.go index 085d94e9..cdc30a48 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_responses.go @@ -155,6 +155,9 @@ type AddMySQLdExporterBody struct { // Enables push metrics mode for exporter. PushMetrics bool `json:"push_metrics,omitempty"` + + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` } // Validate validates this add my s q ld exporter body @@ -354,6 +357,9 @@ type AddMySQLdExporterOKBodyMysqldExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_node_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_node_exporter_responses.go index 7f87221a..2e9c204c 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_node_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_node_exporter_responses.go @@ -132,6 +132,9 @@ type AddNodeExporterBody struct { // Enables push metrics mode for exporter. PushMetrics bool `json:"push_metrics,omitempty"` + + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` } // Validate validates this add node exporter body @@ -311,6 +314,9 @@ type AddNodeExporterOKBodyNodeExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_postgres_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_postgres_exporter_responses.go index 6b3751d7..f93009c8 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_postgres_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_postgres_exporter_responses.go @@ -150,6 +150,9 @@ type AddPostgresExporterBody struct { // Enables push metrics mode for exporter. PushMetrics bool `json:"push_metrics,omitempty"` + + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` } // Validate validates this add postgres exporter body @@ -341,6 +344,9 @@ type AddPostgresExporterOKBodyPostgresExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_proxy_sql_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_proxy_sql_exporter_responses.go index 1130b367..648559ee 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_proxy_sql_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/add_proxy_sql_exporter_responses.go @@ -150,6 +150,9 @@ type AddProxySQLExporterBody struct { // Enables push metrics mode for exporter. PushMetrics bool `json:"push_metrics,omitempty"` + + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` } // Validate validates this add proxy SQL exporter body @@ -341,6 +344,9 @@ type AddProxySQLExporterOKBodyProxysqlExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_mongo_db_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_mongo_db_exporter_responses.go index 12acdc0b..bbe8bcfd 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_mongo_db_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_mongo_db_exporter_responses.go @@ -347,6 +347,9 @@ type ChangeMongoDBExporterOKBodyMongodbExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_responses.go index 584e9ffd..9df8967f 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_responses.go @@ -352,6 +352,9 @@ type ChangeMySQLdExporterOKBodyMysqldExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_node_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_node_exporter_responses.go index f814ea6b..e60aa064 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_node_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_node_exporter_responses.go @@ -335,6 +335,9 @@ type ChangeNodeExporterOKBodyNodeExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_postgres_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_postgres_exporter_responses.go index de61251b..f5a27bdc 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_postgres_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_postgres_exporter_responses.go @@ -347,6 +347,9 @@ type ChangePostgresExporterOKBodyPostgresExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_proxy_sql_exporter_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_proxy_sql_exporter_responses.go index 6a49a570..3c3034a6 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_proxy_sql_exporter_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/change_proxy_sql_exporter_responses.go @@ -347,6 +347,9 @@ type ChangeProxySQLExporterOKBodyProxysqlExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/get_agent_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/get_agent_responses.go index 0897f4f2..cfa3a08c 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/get_agent_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/get_agent_responses.go @@ -701,6 +701,9 @@ type GetAgentOKBodyMongodbExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -839,6 +842,9 @@ type GetAgentOKBodyMysqldExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -963,6 +969,9 @@ type GetAgentOKBodyNodeExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1137,6 +1146,9 @@ type GetAgentOKBodyPostgresExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1270,6 +1282,9 @@ type GetAgentOKBodyProxysqlExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/list_agents_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/list_agents_responses.go index 1f1d715d..0cc27693 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/list_agents_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/agents/list_agents_responses.go @@ -903,6 +903,9 @@ type MongodbExporterItems0 struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1041,6 +1044,9 @@ type MysqldExporterItems0 struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1165,6 +1171,9 @@ type NodeExporterItems0 struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1339,6 +1348,9 @@ type PostgresExporterItems0 struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1472,6 +1484,9 @@ type ProxysqlExporterItems0 struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/add_ha_proxy_service_parameters.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/add_ha_proxy_service_parameters.go new file mode 100644 index 00000000..4ea5f06a --- /dev/null +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/add_ha_proxy_service_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewAddHAProxyServiceParams creates a new AddHAProxyServiceParams object +// with the default values initialized. +func NewAddHAProxyServiceParams() *AddHAProxyServiceParams { + var () + return &AddHAProxyServiceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAddHAProxyServiceParamsWithTimeout creates a new AddHAProxyServiceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAddHAProxyServiceParamsWithTimeout(timeout time.Duration) *AddHAProxyServiceParams { + var () + return &AddHAProxyServiceParams{ + + timeout: timeout, + } +} + +// NewAddHAProxyServiceParamsWithContext creates a new AddHAProxyServiceParams object +// with the default values initialized, and the ability to set a context for a request +func NewAddHAProxyServiceParamsWithContext(ctx context.Context) *AddHAProxyServiceParams { + var () + return &AddHAProxyServiceParams{ + + Context: ctx, + } +} + +// NewAddHAProxyServiceParamsWithHTTPClient creates a new AddHAProxyServiceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAddHAProxyServiceParamsWithHTTPClient(client *http.Client) *AddHAProxyServiceParams { + var () + return &AddHAProxyServiceParams{ + HTTPClient: client, + } +} + +/*AddHAProxyServiceParams contains all the parameters to send to the API endpoint +for the add HA proxy service operation typically these are written to a http.Request +*/ +type AddHAProxyServiceParams struct { + + /*Body*/ + Body AddHAProxyServiceBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the add HA proxy service params +func (o *AddHAProxyServiceParams) WithTimeout(timeout time.Duration) *AddHAProxyServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add HA proxy service params +func (o *AddHAProxyServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add HA proxy service params +func (o *AddHAProxyServiceParams) WithContext(ctx context.Context) *AddHAProxyServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add HA proxy service params +func (o *AddHAProxyServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add HA proxy service params +func (o *AddHAProxyServiceParams) WithHTTPClient(client *http.Client) *AddHAProxyServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add HA proxy service params +func (o *AddHAProxyServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add HA proxy service params +func (o *AddHAProxyServiceParams) WithBody(body AddHAProxyServiceBody) *AddHAProxyServiceParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add HA proxy service params +func (o *AddHAProxyServiceParams) SetBody(body AddHAProxyServiceBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddHAProxyServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/add_ha_proxy_service_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/add_ha_proxy_service_responses.go new file mode 100644 index 00000000..3dc5047a --- /dev/null +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/add_ha_proxy_service_responses.go @@ -0,0 +1,349 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AddHAProxyServiceReader is a Reader for the AddHAProxyService structure. +type AddHAProxyServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddHAProxyServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddHAProxyServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewAddHAProxyServiceDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewAddHAProxyServiceOK creates a AddHAProxyServiceOK with default headers values +func NewAddHAProxyServiceOK() *AddHAProxyServiceOK { + return &AddHAProxyServiceOK{} +} + +/*AddHAProxyServiceOK handles this case with default header values. + +A successful response. +*/ +type AddHAProxyServiceOK struct { + Payload *AddHAProxyServiceOKBody +} + +func (o *AddHAProxyServiceOK) Error() string { + return fmt.Sprintf("[POST /v1/inventory/Services/AddHAProxyService][%d] addHaProxyServiceOk %+v", 200, o.Payload) +} + +func (o *AddHAProxyServiceOK) GetPayload() *AddHAProxyServiceOKBody { + return o.Payload +} + +func (o *AddHAProxyServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(AddHAProxyServiceOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAddHAProxyServiceDefault creates a AddHAProxyServiceDefault with default headers values +func NewAddHAProxyServiceDefault(code int) *AddHAProxyServiceDefault { + return &AddHAProxyServiceDefault{ + _statusCode: code, + } +} + +/*AddHAProxyServiceDefault handles this case with default header values. + +An unexpected error response. +*/ +type AddHAProxyServiceDefault struct { + _statusCode int + + Payload *AddHAProxyServiceDefaultBody +} + +// Code gets the status code for the add HA proxy service default response +func (o *AddHAProxyServiceDefault) Code() int { + return o._statusCode +} + +func (o *AddHAProxyServiceDefault) Error() string { + return fmt.Sprintf("[POST /v1/inventory/Services/AddHAProxyService][%d] AddHAProxyService default %+v", o._statusCode, o.Payload) +} + +func (o *AddHAProxyServiceDefault) GetPayload() *AddHAProxyServiceDefaultBody { + return o.Payload +} + +func (o *AddHAProxyServiceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(AddHAProxyServiceDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*AddHAProxyServiceBody add HA proxy service body +swagger:model AddHAProxyServiceBody +*/ +type AddHAProxyServiceBody struct { + + // Unique across all Services user-defined name. Required. + ServiceName string `json:"service_name,omitempty"` + + // Node identifier where this instance runs. Required. + NodeID string `json:"node_id,omitempty"` + + // Environment name. + Environment string `json:"environment,omitempty"` + + // Cluster name. + Cluster string `json:"cluster,omitempty"` + + // Replication set name. + ReplicationSet string `json:"replication_set,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add HA proxy service body +func (o *AddHAProxyServiceBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyServiceBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyServiceBody) UnmarshalBinary(b []byte) error { + var res AddHAProxyServiceBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*AddHAProxyServiceDefaultBody add HA proxy service default body +swagger:model AddHAProxyServiceDefaultBody +*/ +type AddHAProxyServiceDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*DetailsItems0 `json:"details"` +} + +// Validate validates this add HA proxy service default body +func (o *AddHAProxyServiceDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddHAProxyServiceDefaultBody) validateDetails(formats strfmt.Registry) error { + + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddHAProxyService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyServiceDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyServiceDefaultBody) UnmarshalBinary(b []byte) error { + var res AddHAProxyServiceDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*AddHAProxyServiceOKBody add HA proxy service OK body +swagger:model AddHAProxyServiceOKBody +*/ +type AddHAProxyServiceOKBody struct { + + // haproxy + Haproxy *AddHAProxyServiceOKBodyHaproxy `json:"haproxy,omitempty"` +} + +// Validate validates this add HA proxy service OK body +func (o *AddHAProxyServiceOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateHaproxy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddHAProxyServiceOKBody) validateHaproxy(formats strfmt.Registry) error { + + if swag.IsZero(o.Haproxy) { // not required + return nil + } + + if o.Haproxy != nil { + if err := o.Haproxy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addHaProxyServiceOk" + "." + "haproxy") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyServiceOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyServiceOKBody) UnmarshalBinary(b []byte) error { + var res AddHAProxyServiceOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*AddHAProxyServiceOKBodyHaproxy HAProxyService represents a generic HAProxy service instance. +swagger:model AddHAProxyServiceOKBodyHaproxy +*/ +type AddHAProxyServiceOKBodyHaproxy struct { + + // Unique randomly generated instance identifier. + ServiceID string `json:"service_id,omitempty"` + + // Unique across all Services user-defined name. + ServiceName string `json:"service_name,omitempty"` + + // Node identifier where this service instance runs. + NodeID string `json:"node_id,omitempty"` + + // Environment name. + Environment string `json:"environment,omitempty"` + + // Cluster name. + Cluster string `json:"cluster,omitempty"` + + // Replication set name. + ReplicationSet string `json:"replication_set,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add HA proxy service OK body haproxy +func (o *AddHAProxyServiceOKBodyHaproxy) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyServiceOKBodyHaproxy) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyServiceOKBodyHaproxy) UnmarshalBinary(b []byte) error { + var res AddHAProxyServiceOKBodyHaproxy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/get_service_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/get_service_responses.go index 3b535b6a..b92f7cf5 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/get_service_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/get_service_responses.go @@ -232,6 +232,9 @@ type GetServiceOKBody struct { // external External *GetServiceOKBodyExternal `json:"external,omitempty"` + // haproxy + Haproxy *GetServiceOKBodyHaproxy `json:"haproxy,omitempty"` + // mongodb Mongodb *GetServiceOKBodyMongodb `json:"mongodb,omitempty"` @@ -253,6 +256,10 @@ func (o *GetServiceOKBody) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := o.validateHaproxy(formats); err != nil { + res = append(res, err) + } + if err := o.validateMongodb(formats); err != nil { res = append(res, err) } @@ -293,6 +300,24 @@ func (o *GetServiceOKBody) validateExternal(formats strfmt.Registry) error { return nil } +func (o *GetServiceOKBody) validateHaproxy(formats strfmt.Registry) error { + + if swag.IsZero(o.Haproxy) { // not required + return nil + } + + if o.Haproxy != nil { + if err := o.Haproxy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getServiceOk" + "." + "haproxy") + } + return err + } + } + + return nil +} + func (o *GetServiceOKBody) validateMongodb(formats strfmt.Registry) error { if swag.IsZero(o.Mongodb) { // not required @@ -436,6 +461,56 @@ func (o *GetServiceOKBodyExternal) UnmarshalBinary(b []byte) error { return nil } +/*GetServiceOKBodyHaproxy HAProxyService represents a generic HAProxy service instance. +swagger:model GetServiceOKBodyHaproxy +*/ +type GetServiceOKBodyHaproxy struct { + + // Unique randomly generated instance identifier. + ServiceID string `json:"service_id,omitempty"` + + // Unique across all Services user-defined name. + ServiceName string `json:"service_name,omitempty"` + + // Node identifier where this service instance runs. + NodeID string `json:"node_id,omitempty"` + + // Environment name. + Environment string `json:"environment,omitempty"` + + // Cluster name. + Cluster string `json:"cluster,omitempty"` + + // Replication set name. + ReplicationSet string `json:"replication_set,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this get service OK body haproxy +func (o *GetServiceOKBodyHaproxy) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetServiceOKBodyHaproxy) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetServiceOKBodyHaproxy) UnmarshalBinary(b []byte) error { + var res GetServiceOKBodyHaproxy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetServiceOKBodyMongodb MongoDBService represents a generic MongoDB instance. swagger:model GetServiceOKBodyMongodb */ diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/list_services_responses.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/list_services_responses.go index be8a7870..47d5d8be 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/list_services_responses.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/list_services_responses.go @@ -172,6 +172,56 @@ func (o *ExternalItems0) UnmarshalBinary(b []byte) error { return nil } +/*HaproxyItems0 HAProxyService represents a generic HAProxy service instance. +swagger:model HaproxyItems0 +*/ +type HaproxyItems0 struct { + + // Unique randomly generated instance identifier. + ServiceID string `json:"service_id,omitempty"` + + // Unique across all Services user-defined name. + ServiceName string `json:"service_name,omitempty"` + + // Node identifier where this service instance runs. + NodeID string `json:"node_id,omitempty"` + + // Environment name. + Environment string `json:"environment,omitempty"` + + // Cluster name. + Cluster string `json:"cluster,omitempty"` + + // Replication set name. + ReplicationSet string `json:"replication_set,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this haproxy items0 +func (o *HaproxyItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *HaproxyItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *HaproxyItems0) UnmarshalBinary(b []byte) error { + var res HaproxyItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ListServicesBody list services body swagger:model ListServicesBody */ @@ -181,8 +231,11 @@ type ListServicesBody struct { NodeID string `json:"node_id,omitempty"` // ServiceType describes supported Service types. - // Enum: [SERVICE_TYPE_INVALID MYSQL_SERVICE MONGODB_SERVICE POSTGRESQL_SERVICE PROXYSQL_SERVICE EXTERNAL_SERVICE] + // Enum: [SERVICE_TYPE_INVALID MYSQL_SERVICE MONGODB_SERVICE POSTGRESQL_SERVICE PROXYSQL_SERVICE HAPROXY_SERVICE EXTERNAL_SERVICE] ServiceType *string `json:"service_type,omitempty"` + + // Return only services in this external group. + ExternalGroup string `json:"external_group,omitempty"` } // Validate validates this list services body @@ -203,7 +256,7 @@ var listServicesBodyTypeServiceTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["SERVICE_TYPE_INVALID","MYSQL_SERVICE","MONGODB_SERVICE","POSTGRESQL_SERVICE","PROXYSQL_SERVICE","EXTERNAL_SERVICE"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["SERVICE_TYPE_INVALID","MYSQL_SERVICE","MONGODB_SERVICE","POSTGRESQL_SERVICE","PROXYSQL_SERVICE","HAPROXY_SERVICE","EXTERNAL_SERVICE"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -228,6 +281,9 @@ const ( // ListServicesBodyServiceTypePROXYSQLSERVICE captures enum value "PROXYSQL_SERVICE" ListServicesBodyServiceTypePROXYSQLSERVICE string = "PROXYSQL_SERVICE" + // ListServicesBodyServiceTypeHAPROXYSERVICE captures enum value "HAPROXY_SERVICE" + ListServicesBodyServiceTypeHAPROXYSERVICE string = "HAPROXY_SERVICE" + // ListServicesBodyServiceTypeEXTERNALSERVICE captures enum value "EXTERNAL_SERVICE" ListServicesBodyServiceTypeEXTERNALSERVICE string = "EXTERNAL_SERVICE" ) @@ -364,6 +420,9 @@ type ListServicesOKBody struct { // proxysql Proxysql []*ProxysqlItems0 `json:"proxysql"` + // haproxy + Haproxy []*HaproxyItems0 `json:"haproxy"` + // external External []*ExternalItems0 `json:"external"` } @@ -388,6 +447,10 @@ func (o *ListServicesOKBody) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := o.validateHaproxy(formats); err != nil { + res = append(res, err) + } + if err := o.validateExternal(formats); err != nil { res = append(res, err) } @@ -498,6 +561,31 @@ func (o *ListServicesOKBody) validateProxysql(formats strfmt.Registry) error { return nil } +func (o *ListServicesOKBody) validateHaproxy(formats strfmt.Registry) error { + + if swag.IsZero(o.Haproxy) { // not required + return nil + } + + for i := 0; i < len(o.Haproxy); i++ { + if swag.IsZero(o.Haproxy[i]) { // not required + continue + } + + if o.Haproxy[i] != nil { + if err := o.Haproxy[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listServicesOk" + "." + "haproxy" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (o *ListServicesOKBody) validateExternal(formats strfmt.Registry) error { if swag.IsZero(o.External) { // not required diff --git a/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/services_client.go b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/services_client.go index cac23f4d..450cedea 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/services_client.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/json/client/services/services_client.go @@ -27,6 +27,8 @@ type Client struct { type ClientService interface { AddExternalService(params *AddExternalServiceParams) (*AddExternalServiceOK, error) + AddHAProxyService(params *AddHAProxyServiceParams) (*AddHAProxyServiceOK, error) + AddMongoDBService(params *AddMongoDBServiceParams) (*AddMongoDBServiceOK, error) AddMySQLService(params *AddMySQLServiceParams) (*AddMySQLServiceOK, error) @@ -77,6 +79,39 @@ func (a *Client) AddExternalService(params *AddExternalServiceParams) (*AddExter return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + AddHAProxyService adds HA proxy service adds HA proxy service +*/ +func (a *Client) AddHAProxyService(params *AddHAProxyServiceParams) (*AddHAProxyServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddHAProxyServiceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "AddHAProxyService", + Method: "POST", + PathPattern: "/v1/inventory/Services/AddHAProxyService", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddHAProxyServiceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*AddHAProxyServiceOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*AddHAProxyServiceDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* AddMongoDBService adds mongo DB service adds mongo DB service */ diff --git a/vendor/github.com/percona/pmm/api/inventorypb/types/service_types.go b/vendor/github.com/percona/pmm/api/inventorypb/types/service_types.go index ce54a7fd..546ba65a 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/types/service_types.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/types/service_types.go @@ -8,6 +8,7 @@ const ( ServiceTypeMongoDBService = "MONGODB_SERVICE" ServiceTypePostgreSQLService = "POSTGRESQL_SERVICE" ServiceTypeProxySQLService = "PROXYSQL_SERVICE" + ServiceTypeHAProxyService = "HAPROXY_SERVICE" ServiceTypeExternalService = "EXTERNAL_SERVICE" ) @@ -17,6 +18,7 @@ var serviceTypeNames = map[string]string{ ServiceTypeMongoDBService: "MongoDB", ServiceTypePostgreSQLService: "PostgreSQL", ServiceTypeProxySQLService: "ProxySQL", + ServiceTypeHAProxyService: "HAProxy", ServiceTypeExternalService: "External", } diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/actions_client.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/actions_client.go index 9bd35bfc..d0605379 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/actions_client.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/actions_client.go @@ -43,6 +43,8 @@ type ClientService interface { StartMySQLShowTableStatusAction(params *StartMySQLShowTableStatusActionParams) (*StartMySQLShowTableStatusActionOK, error) + StartPTMongoDBSummaryAction(params *StartPTMongoDBSummaryActionParams) (*StartPTMongoDBSummaryActionOK, error) + StartPTSummaryAction(params *StartPTSummaryActionParams) (*StartPTSummaryActionOK, error) StartPostgreSQLShowCreateTableAction(params *StartPostgreSQLShowCreateTableActionParams) (*StartPostgreSQLShowCreateTableActionOK, error) @@ -349,6 +351,39 @@ func (a *Client) StartMySQLShowTableStatusAction(params *StartMySQLShowTableStat return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + StartPTMongoDBSummaryAction starts PT mongo DB summary action starts pt mongodb summary action +*/ +func (a *Client) StartPTMongoDBSummaryAction(params *StartPTMongoDBSummaryActionParams) (*StartPTMongoDBSummaryActionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStartPTMongoDBSummaryActionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StartPTMongoDBSummaryAction", + Method: "POST", + PathPattern: "/v1/management/Actions/StartPTMongoDBSummary", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &StartPTMongoDBSummaryActionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StartPTMongoDBSummaryActionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StartPTMongoDBSummaryActionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* StartPTSummaryAction starts PT summary action starts pt summary action */ diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_parameters.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_parameters.go new file mode 100644 index 00000000..35231aa8 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package actions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStartPTMongoDBSummaryActionParams creates a new StartPTMongoDBSummaryActionParams object +// with the default values initialized. +func NewStartPTMongoDBSummaryActionParams() *StartPTMongoDBSummaryActionParams { + var () + return &StartPTMongoDBSummaryActionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStartPTMongoDBSummaryActionParamsWithTimeout creates a new StartPTMongoDBSummaryActionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStartPTMongoDBSummaryActionParamsWithTimeout(timeout time.Duration) *StartPTMongoDBSummaryActionParams { + var () + return &StartPTMongoDBSummaryActionParams{ + + timeout: timeout, + } +} + +// NewStartPTMongoDBSummaryActionParamsWithContext creates a new StartPTMongoDBSummaryActionParams object +// with the default values initialized, and the ability to set a context for a request +func NewStartPTMongoDBSummaryActionParamsWithContext(ctx context.Context) *StartPTMongoDBSummaryActionParams { + var () + return &StartPTMongoDBSummaryActionParams{ + + Context: ctx, + } +} + +// NewStartPTMongoDBSummaryActionParamsWithHTTPClient creates a new StartPTMongoDBSummaryActionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStartPTMongoDBSummaryActionParamsWithHTTPClient(client *http.Client) *StartPTMongoDBSummaryActionParams { + var () + return &StartPTMongoDBSummaryActionParams{ + HTTPClient: client, + } +} + +/*StartPTMongoDBSummaryActionParams contains all the parameters to send to the API endpoint +for the start PT mongo DB summary action operation typically these are written to a http.Request +*/ +type StartPTMongoDBSummaryActionParams struct { + + /*Body*/ + Body StartPTMongoDBSummaryActionBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the start PT mongo DB summary action params +func (o *StartPTMongoDBSummaryActionParams) WithTimeout(timeout time.Duration) *StartPTMongoDBSummaryActionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the start PT mongo DB summary action params +func (o *StartPTMongoDBSummaryActionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the start PT mongo DB summary action params +func (o *StartPTMongoDBSummaryActionParams) WithContext(ctx context.Context) *StartPTMongoDBSummaryActionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the start PT mongo DB summary action params +func (o *StartPTMongoDBSummaryActionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the start PT mongo DB summary action params +func (o *StartPTMongoDBSummaryActionParams) WithHTTPClient(client *http.Client) *StartPTMongoDBSummaryActionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the start PT mongo DB summary action params +func (o *StartPTMongoDBSummaryActionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the start PT mongo DB summary action params +func (o *StartPTMongoDBSummaryActionParams) WithBody(body StartPTMongoDBSummaryActionBody) *StartPTMongoDBSummaryActionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the start PT mongo DB summary action params +func (o *StartPTMongoDBSummaryActionParams) SetBody(body StartPTMongoDBSummaryActionBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *StartPTMongoDBSummaryActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_responses.go new file mode 100644 index 00000000..3669db13 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_responses.go @@ -0,0 +1,263 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package actions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StartPTMongoDBSummaryActionReader is a Reader for the StartPTMongoDBSummaryAction structure. +type StartPTMongoDBSummaryActionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StartPTMongoDBSummaryActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStartPTMongoDBSummaryActionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStartPTMongoDBSummaryActionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStartPTMongoDBSummaryActionOK creates a StartPTMongoDBSummaryActionOK with default headers values +func NewStartPTMongoDBSummaryActionOK() *StartPTMongoDBSummaryActionOK { + return &StartPTMongoDBSummaryActionOK{} +} + +/*StartPTMongoDBSummaryActionOK handles this case with default header values. + +A successful response. +*/ +type StartPTMongoDBSummaryActionOK struct { + Payload *StartPTMongoDBSummaryActionOKBody +} + +func (o *StartPTMongoDBSummaryActionOK) Error() string { + return fmt.Sprintf("[POST /v1/management/Actions/StartPTMongoDBSummary][%d] startPtMongoDbSummaryActionOk %+v", 200, o.Payload) +} + +func (o *StartPTMongoDBSummaryActionOK) GetPayload() *StartPTMongoDBSummaryActionOKBody { + return o.Payload +} + +func (o *StartPTMongoDBSummaryActionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(StartPTMongoDBSummaryActionOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStartPTMongoDBSummaryActionDefault creates a StartPTMongoDBSummaryActionDefault with default headers values +func NewStartPTMongoDBSummaryActionDefault(code int) *StartPTMongoDBSummaryActionDefault { + return &StartPTMongoDBSummaryActionDefault{ + _statusCode: code, + } +} + +/*StartPTMongoDBSummaryActionDefault handles this case with default header values. + +An unexpected error response. +*/ +type StartPTMongoDBSummaryActionDefault struct { + _statusCode int + + Payload *StartPTMongoDBSummaryActionDefaultBody +} + +// Code gets the status code for the start PT mongo DB summary action default response +func (o *StartPTMongoDBSummaryActionDefault) Code() int { + return o._statusCode +} + +func (o *StartPTMongoDBSummaryActionDefault) Error() string { + return fmt.Sprintf("[POST /v1/management/Actions/StartPTMongoDBSummary][%d] StartPTMongoDBSummaryAction default %+v", o._statusCode, o.Payload) +} + +func (o *StartPTMongoDBSummaryActionDefault) GetPayload() *StartPTMongoDBSummaryActionDefaultBody { + return o.Payload +} + +func (o *StartPTMongoDBSummaryActionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(StartPTMongoDBSummaryActionDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*StartPTMongoDBSummaryActionBody Message to prepare pt-mongodb-summary data +swagger:model StartPTMongoDBSummaryActionBody +*/ +type StartPTMongoDBSummaryActionBody struct { + + // pmm-agent ID where to run this Action. + PMMAgentID string `json:"pmm_agent_id,omitempty"` + + // Service ID for this Action. + ServiceID string `json:"service_id,omitempty"` +} + +// Validate validates this start PT mongo DB summary action body +func (o *StartPTMongoDBSummaryActionBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartPTMongoDBSummaryActionBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartPTMongoDBSummaryActionBody) UnmarshalBinary(b []byte) error { + var res StartPTMongoDBSummaryActionBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*StartPTMongoDBSummaryActionDefaultBody start PT mongo DB summary action default body +swagger:model StartPTMongoDBSummaryActionDefaultBody +*/ +type StartPTMongoDBSummaryActionDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*DetailsItems0 `json:"details"` +} + +// Validate validates this start PT mongo DB summary action default body +func (o *StartPTMongoDBSummaryActionDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *StartPTMongoDBSummaryActionDefaultBody) validateDetails(formats strfmt.Registry) error { + + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartPTMongoDBSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *StartPTMongoDBSummaryActionDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartPTMongoDBSummaryActionDefaultBody) UnmarshalBinary(b []byte) error { + var res StartPTMongoDBSummaryActionDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*StartPTMongoDBSummaryActionOKBody Message to retrieve the prepared pt-mongodb-summary data +swagger:model StartPTMongoDBSummaryActionOKBody +*/ +type StartPTMongoDBSummaryActionOKBody struct { + + // Unique Action ID. + ActionID string `json:"action_id,omitempty"` + + // pmm-agent ID where to this Action was started. + PMMAgentID string `json:"pmm_agent_id,omitempty"` +} + +// Validate validates this start PT mongo DB summary action OK body +func (o *StartPTMongoDBSummaryActionOKBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartPTMongoDBSummaryActionOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartPTMongoDBSummaryActionOKBody) UnmarshalBinary(b []byte) error { + var res StartPTMongoDBSummaryActionOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/add_ha_proxy_parameters.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/add_ha_proxy_parameters.go new file mode 100644 index 00000000..aa94c239 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/add_ha_proxy_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ha_proxy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewAddHAProxyParams creates a new AddHAProxyParams object +// with the default values initialized. +func NewAddHAProxyParams() *AddHAProxyParams { + var () + return &AddHAProxyParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAddHAProxyParamsWithTimeout creates a new AddHAProxyParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAddHAProxyParamsWithTimeout(timeout time.Duration) *AddHAProxyParams { + var () + return &AddHAProxyParams{ + + timeout: timeout, + } +} + +// NewAddHAProxyParamsWithContext creates a new AddHAProxyParams object +// with the default values initialized, and the ability to set a context for a request +func NewAddHAProxyParamsWithContext(ctx context.Context) *AddHAProxyParams { + var () + return &AddHAProxyParams{ + + Context: ctx, + } +} + +// NewAddHAProxyParamsWithHTTPClient creates a new AddHAProxyParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAddHAProxyParamsWithHTTPClient(client *http.Client) *AddHAProxyParams { + var () + return &AddHAProxyParams{ + HTTPClient: client, + } +} + +/*AddHAProxyParams contains all the parameters to send to the API endpoint +for the add HA proxy operation typically these are written to a http.Request +*/ +type AddHAProxyParams struct { + + /*Body*/ + Body AddHAProxyBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the add HA proxy params +func (o *AddHAProxyParams) WithTimeout(timeout time.Duration) *AddHAProxyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add HA proxy params +func (o *AddHAProxyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add HA proxy params +func (o *AddHAProxyParams) WithContext(ctx context.Context) *AddHAProxyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add HA proxy params +func (o *AddHAProxyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add HA proxy params +func (o *AddHAProxyParams) WithHTTPClient(client *http.Client) *AddHAProxyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add HA proxy params +func (o *AddHAProxyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add HA proxy params +func (o *AddHAProxyParams) WithBody(body AddHAProxyBody) *AddHAProxyParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add HA proxy params +func (o *AddHAProxyParams) SetBody(body AddHAProxyBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddHAProxyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/add_ha_proxy_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/add_ha_proxy_responses.go new file mode 100644 index 00000000..d34ae597 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/add_ha_proxy_responses.go @@ -0,0 +1,701 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ha_proxy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AddHAProxyReader is a Reader for the AddHAProxy structure. +type AddHAProxyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddHAProxyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddHAProxyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewAddHAProxyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewAddHAProxyOK creates a AddHAProxyOK with default headers values +func NewAddHAProxyOK() *AddHAProxyOK { + return &AddHAProxyOK{} +} + +/*AddHAProxyOK handles this case with default header values. + +A successful response. +*/ +type AddHAProxyOK struct { + Payload *AddHAProxyOKBody +} + +func (o *AddHAProxyOK) Error() string { + return fmt.Sprintf("[POST /v1/management/HAProxy/Add][%d] addHaProxyOk %+v", 200, o.Payload) +} + +func (o *AddHAProxyOK) GetPayload() *AddHAProxyOKBody { + return o.Payload +} + +func (o *AddHAProxyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(AddHAProxyOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAddHAProxyDefault creates a AddHAProxyDefault with default headers values +func NewAddHAProxyDefault(code int) *AddHAProxyDefault { + return &AddHAProxyDefault{ + _statusCode: code, + } +} + +/*AddHAProxyDefault handles this case with default header values. + +An unexpected error response. +*/ +type AddHAProxyDefault struct { + _statusCode int + + Payload *AddHAProxyDefaultBody +} + +// Code gets the status code for the add HA proxy default response +func (o *AddHAProxyDefault) Code() int { + return o._statusCode +} + +func (o *AddHAProxyDefault) Error() string { + return fmt.Sprintf("[POST /v1/management/HAProxy/Add][%d] AddHAProxy default %+v", o._statusCode, o.Payload) +} + +func (o *AddHAProxyDefault) GetPayload() *AddHAProxyDefaultBody { + return o.Payload +} + +func (o *AddHAProxyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(AddHAProxyDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*AddHAProxyBody add HA proxy body +swagger:model AddHAProxyBody +*/ +type AddHAProxyBody struct { + + // Node identifier on which an external exporter is been running. + // Exactly one of these parameters should be present: node_id, node_name, add_node. + NodeID string `json:"node_id,omitempty"` + + // Node name on which a service and node is been running. + // Exactly one of these parameters should be present: node_id, node_name, add_node. + NodeName string `json:"node_name,omitempty"` + + // Node and Exporter access address (DNS name or IP). + // address always should be passed with add_node. + Address string `json:"address,omitempty"` + + // Unique across all Services user-defined name. Required. + ServiceName string `json:"service_name,omitempty"` + + // HTTP basic auth username for collecting metrics. + Username string `json:"username,omitempty"` + + // HTTP basic auth password for collecting metrics. + Password string `json:"password,omitempty"` + + // Scheme to generate URI to exporter metrics endpoints. + Scheme string `json:"scheme,omitempty"` + + // Path under which metrics are exposed, used to generate URI. + MetricsPath string `json:"metrics_path,omitempty"` + + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + + // Environment name. + Environment string `json:"environment,omitempty"` + + // Cluster name. + Cluster string `json:"cluster,omitempty"` + + // Replication set name. + ReplicationSet string `json:"replication_set,omitempty"` + + // Custom user-assigned labels for Service. + CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // Enum: [AUTO PULL PUSH] + MetricsMode *string `json:"metrics_mode,omitempty"` + + // add node + AddNode *AddHAProxyParamsBodyAddNode `json:"add_node,omitempty"` +} + +// Validate validates this add HA proxy body +func (o *AddHAProxyBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateMetricsMode(formats); err != nil { + res = append(res, err) + } + + if err := o.validateAddNode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var addHaProxyBodyTypeMetricsModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AUTO","PULL","PUSH"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addHaProxyBodyTypeMetricsModePropEnum = append(addHaProxyBodyTypeMetricsModePropEnum, v) + } +} + +const ( + + // AddHAProxyBodyMetricsModeAUTO captures enum value "AUTO" + AddHAProxyBodyMetricsModeAUTO string = "AUTO" + + // AddHAProxyBodyMetricsModePULL captures enum value "PULL" + AddHAProxyBodyMetricsModePULL string = "PULL" + + // AddHAProxyBodyMetricsModePUSH captures enum value "PUSH" + AddHAProxyBodyMetricsModePUSH string = "PUSH" +) + +// prop value enum +func (o *AddHAProxyBody) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addHaProxyBodyTypeMetricsModePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddHAProxyBody) validateMetricsMode(formats strfmt.Registry) error { + + if swag.IsZero(o.MetricsMode) { // not required + return nil + } + + // value enum + if err := o.validateMetricsModeEnum("body"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + return err + } + + return nil +} + +func (o *AddHAProxyBody) validateAddNode(formats strfmt.Registry) error { + + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "add_node") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyBody) UnmarshalBinary(b []byte) error { + var res AddHAProxyBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*AddHAProxyDefaultBody add HA proxy default body +swagger:model AddHAProxyDefaultBody +*/ +type AddHAProxyDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*DetailsItems0 `json:"details"` +} + +// Validate validates this add HA proxy default body +func (o *AddHAProxyDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddHAProxyDefaultBody) validateDetails(formats strfmt.Registry) error { + + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddHAProxy default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyDefaultBody) UnmarshalBinary(b []byte) error { + var res AddHAProxyDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*AddHAProxyOKBody add HA proxy OK body +swagger:model AddHAProxyOKBody +*/ +type AddHAProxyOKBody struct { + + // external exporter + ExternalExporter *AddHAProxyOKBodyExternalExporter `json:"external_exporter,omitempty"` + + // service + Service *AddHAProxyOKBodyService `json:"service,omitempty"` +} + +// Validate validates this add HA proxy OK body +func (o *AddHAProxyOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateExternalExporter(formats); err != nil { + res = append(res, err) + } + + if err := o.validateService(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddHAProxyOKBody) validateExternalExporter(formats strfmt.Registry) error { + + if swag.IsZero(o.ExternalExporter) { // not required + return nil + } + + if o.ExternalExporter != nil { + if err := o.ExternalExporter.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addHaProxyOk" + "." + "external_exporter") + } + return err + } + } + + return nil +} + +func (o *AddHAProxyOKBody) validateService(formats strfmt.Registry) error { + + if swag.IsZero(o.Service) { // not required + return nil + } + + if o.Service != nil { + if err := o.Service.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addHaProxyOk" + "." + "service") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyOKBody) UnmarshalBinary(b []byte) error { + var res AddHAProxyOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*AddHAProxyOKBodyExternalExporter ExternalExporter runs on any Node type, including Remote Node. +swagger:model AddHAProxyOKBodyExternalExporter +*/ +type AddHAProxyOKBodyExternalExporter struct { + + // Unique randomly generated instance identifier. + AgentID string `json:"agent_id,omitempty"` + + // Node identifier where this instance runs. + RunsOnNodeID string `json:"runs_on_node_id,omitempty"` + + // If disabled, metrics from this exporter will not be collected. + Disabled bool `json:"disabled,omitempty"` + + // Service identifier. + ServiceID string `json:"service_id,omitempty"` + + // HTTP basic auth username for collecting metrics. + Username string `json:"username,omitempty"` + + // Scheme to generate URI to exporter metrics endpoints. + Scheme string `json:"scheme,omitempty"` + + // Path under which metrics are exposed, used to generate URI. + MetricsPath string `json:"metrics_path,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + + // True if exporter uses push metrics mode. + PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` +} + +// Validate validates this add HA proxy OK body external exporter +func (o *AddHAProxyOKBodyExternalExporter) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyOKBodyExternalExporter) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyOKBodyExternalExporter) UnmarshalBinary(b []byte) error { + var res AddHAProxyOKBodyExternalExporter + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*AddHAProxyOKBodyService HAProxyService represents a generic HAProxy service instance. +swagger:model AddHAProxyOKBodyService +*/ +type AddHAProxyOKBodyService struct { + + // Unique randomly generated instance identifier. + ServiceID string `json:"service_id,omitempty"` + + // Unique across all Services user-defined name. + ServiceName string `json:"service_name,omitempty"` + + // Node identifier where this service instance runs. + NodeID string `json:"node_id,omitempty"` + + // Environment name. + Environment string `json:"environment,omitempty"` + + // Cluster name. + Cluster string `json:"cluster,omitempty"` + + // Replication set name. + ReplicationSet string `json:"replication_set,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add HA proxy OK body service +func (o *AddHAProxyOKBodyService) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyOKBodyService) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyOKBodyService) UnmarshalBinary(b []byte) error { + var res AddHAProxyOKBodyService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*AddHAProxyParamsBodyAddNode AddNodeParams is a params to add new node to inventory while adding new service. +swagger:model AddHAProxyParamsBodyAddNode +*/ +type AddHAProxyParamsBodyAddNode struct { + + // NodeType describes supported Node types. + // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE] + NodeType *string `json:"node_type,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Linux machine-id. + MachineID string `json:"machine_id,omitempty"` + + // Linux distribution name and version. + Distro string `json:"distro,omitempty"` + + // Container identifier. If specified, must be a unique Docker container identifier. + ContainerID string `json:"container_id,omitempty"` + + // Container name. + ContainerName string `json:"container_name,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels for Node. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add HA proxy params body add node +func (o *AddHAProxyParamsBodyAddNode) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateNodeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var addHaProxyParamsBodyAddNodeTypeNodeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["NODE_TYPE_INVALID","GENERIC_NODE","CONTAINER_NODE","REMOTE_NODE","REMOTE_RDS_NODE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + addHaProxyParamsBodyAddNodeTypeNodeTypePropEnum = append(addHaProxyParamsBodyAddNodeTypeNodeTypePropEnum, v) + } +} + +const ( + + // AddHAProxyParamsBodyAddNodeNodeTypeNODETYPEINVALID captures enum value "NODE_TYPE_INVALID" + AddHAProxyParamsBodyAddNodeNodeTypeNODETYPEINVALID string = "NODE_TYPE_INVALID" + + // AddHAProxyParamsBodyAddNodeNodeTypeGENERICNODE captures enum value "GENERIC_NODE" + AddHAProxyParamsBodyAddNodeNodeTypeGENERICNODE string = "GENERIC_NODE" + + // AddHAProxyParamsBodyAddNodeNodeTypeCONTAINERNODE captures enum value "CONTAINER_NODE" + AddHAProxyParamsBodyAddNodeNodeTypeCONTAINERNODE string = "CONTAINER_NODE" + + // AddHAProxyParamsBodyAddNodeNodeTypeREMOTENODE captures enum value "REMOTE_NODE" + AddHAProxyParamsBodyAddNodeNodeTypeREMOTENODE string = "REMOTE_NODE" + + // AddHAProxyParamsBodyAddNodeNodeTypeREMOTERDSNODE captures enum value "REMOTE_RDS_NODE" + AddHAProxyParamsBodyAddNodeNodeTypeREMOTERDSNODE string = "REMOTE_RDS_NODE" +) + +// prop value enum +func (o *AddHAProxyParamsBodyAddNode) validateNodeTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, addHaProxyParamsBodyAddNodeTypeNodeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *AddHAProxyParamsBodyAddNode) validateNodeType(formats strfmt.Registry) error { + + if swag.IsZero(o.NodeType) { // not required + return nil + } + + // value enum + if err := o.validateNodeTypeEnum("body"+"."+"add_node"+"."+"node_type", "body", *o.NodeType); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyParamsBodyAddNode) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyParamsBodyAddNode) UnmarshalBinary(b []byte) error { + var res AddHAProxyParamsBodyAddNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*DetailsItems0 details items0 +swagger:model DetailsItems0 +*/ +type DetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this details items0 +func (o *DetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *DetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DetailsItems0) UnmarshalBinary(b []byte) error { + var res DetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/ha_proxy_client.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/ha_proxy_client.go new file mode 100644 index 00000000..acef55c6 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/ha_proxy/ha_proxy_client.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ha_proxy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new ha proxy API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for ha proxy API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + AddHAProxy(params *AddHAProxyParams) (*AddHAProxyOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + AddHAProxy adds HA proxy adds HA proxy service and adds external exporter it automatically adds a service to inventory which is running on provided node id then adds an external exporter agent to inventory +*/ +func (a *Client) AddHAProxy(params *AddHAProxyParams) (*AddHAProxyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddHAProxyParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "AddHAProxy", + Method: "POST", + PathPattern: "/v1/management/HAProxy/Add", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddHAProxyReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*AddHAProxyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*AddHAProxyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/mongo_db/add_mongo_db_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/mongo_db/add_mongo_db_responses.go index dc847195..cea16371 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/mongo_db/add_mongo_db_responses.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/mongo_db/add_mongo_db_responses.go @@ -194,6 +194,9 @@ type AddMongoDBBody struct { // Enum: [AUTO PULL PUSH] MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` + // add node AddNode *AddMongoDBParamsBodyAddNode `json:"add_node,omitempty"` } @@ -514,6 +517,9 @@ type AddMongoDBOKBodyMongodbExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/my_sql/add_my_sql_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/my_sql/add_my_sql_responses.go index 77a46bd1..4c2fb591 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/my_sql/add_my_sql_responses.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/my_sql/add_my_sql_responses.go @@ -201,6 +201,9 @@ type AddMySQLBody struct { // Enum: [AUTO PULL PUSH] MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` + // add node AddNode *AddMySQLParamsBodyAddNode `json:"add_node,omitempty"` } @@ -554,6 +557,9 @@ type AddMySQLOKBodyMysqldExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/node/register_node_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/node/register_node_responses.go index 00d692a5..af1264b3 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/node/register_node_responses.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/node/register_node_responses.go @@ -201,6 +201,9 @@ type RegisterNodeBody struct { // it can be pull, push or auto mode chosen by server. // Enum: [AUTO PULL PUSH] MetricsMode *string `json:"metrics_mode,omitempty"` + + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` } // Validate validates this register node body diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/pmm_management_client.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/pmm_management_client.go index b9d9ea3f..388af913 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/pmm_management_client.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/pmm_management_client.go @@ -13,6 +13,7 @@ import ( "github.com/percona/pmm/api/managementpb/json/client/actions" "github.com/percona/pmm/api/managementpb/json/client/annotation" "github.com/percona/pmm/api/managementpb/json/client/external" + "github.com/percona/pmm/api/managementpb/json/client/ha_proxy" "github.com/percona/pmm/api/managementpb/json/client/mongo_db" "github.com/percona/pmm/api/managementpb/json/client/my_sql" "github.com/percona/pmm/api/managementpb/json/client/node" @@ -68,6 +69,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMManagem cli.Actions = actions.New(transport, formats) cli.Annotation = annotation.New(transport, formats) cli.External = external.New(transport, formats) + cli.HAProxy = ha_proxy.New(transport, formats) cli.MongoDB = mongo_db.New(transport, formats) cli.MySQL = my_sql.New(transport, formats) cli.Node = node.New(transport, formats) @@ -126,6 +128,8 @@ type PMMManagement struct { External external.ClientService + HAProxy ha_proxy.ClientService + MongoDB mongo_db.ClientService MySQL my_sql.ClientService @@ -151,6 +155,7 @@ func (c *PMMManagement) SetTransport(transport runtime.ClientTransport) { c.Actions.SetTransport(transport) c.Annotation.SetTransport(transport) c.External.SetTransport(transport) + c.HAProxy.SetTransport(transport) c.MongoDB.SetTransport(transport) c.MySQL.SetTransport(transport) c.Node.SetTransport(transport) diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/postgre_sql/add_postgre_sql_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/postgre_sql/add_postgre_sql_responses.go index e0ec7e22..d4884b45 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/postgre_sql/add_postgre_sql_responses.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/postgre_sql/add_postgre_sql_responses.go @@ -191,6 +191,9 @@ type AddPostgreSQLBody struct { // Enum: [AUTO PULL PUSH] MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` + // add node AddNode *AddPostgreSQLParamsBodyAddNode `json:"add_node,omitempty"` } @@ -536,6 +539,9 @@ type AddPostgreSQLOKBodyPostgresExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/proxy_sql/add_proxy_sql_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/proxy_sql/add_proxy_sql_responses.go index c3e42a8b..61586ddf 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/proxy_sql/add_proxy_sql_responses.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/proxy_sql/add_proxy_sql_responses.go @@ -182,6 +182,9 @@ type AddProxySQLBody struct { // Enum: [AUTO PULL PUSH] MetricsMode *string `json:"metrics_mode,omitempty"` + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` + // add node AddNode *AddProxySQLParamsBodyAddNode `json:"add_node,omitempty"` } @@ -477,6 +480,9 @@ type AddProxySQLOKBodyProxysqlExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/rds/add_rds_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/rds/add_rds_responses.go index 2d4c3905..392a7b05 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/rds/add_rds_responses.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/rds/add_rds_responses.go @@ -672,6 +672,9 @@ type AddRDSOKBodyMysqldExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + // List of disabled collector names. + DisabledCollectors []string `json:"disabled_collectors"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/security_checks/get_security_check_results_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/security_checks/get_security_check_results_responses.go index 2e7e6eba..c8ad9b77 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/security_checks/get_security_check_results_responses.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/security_checks/get_security_check_results_responses.go @@ -277,6 +277,9 @@ type ResultsItems0 struct { // labels Labels map[string]string `json:"labels,omitempty"` + + // URL containing information on how to resolve an issue detected by an STT check. + ReadMoreURL string `json:"read_more_url,omitempty"` } // Validate validates this results items0 diff --git a/vendor/github.com/percona/pmm/api/managementpb/json/client/service/remove_service_responses.go b/vendor/github.com/percona/pmm/api/managementpb/json/client/service/remove_service_responses.go index e2da945e..8dca008c 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/json/client/service/remove_service_responses.go +++ b/vendor/github.com/percona/pmm/api/managementpb/json/client/service/remove_service_responses.go @@ -159,7 +159,7 @@ swagger:model RemoveServiceBody type RemoveServiceBody struct { // ServiceType describes supported Service types. - // Enum: [SERVICE_TYPE_INVALID MYSQL_SERVICE MONGODB_SERVICE POSTGRESQL_SERVICE PROXYSQL_SERVICE EXTERNAL_SERVICE] + // Enum: [SERVICE_TYPE_INVALID MYSQL_SERVICE MONGODB_SERVICE POSTGRESQL_SERVICE PROXYSQL_SERVICE HAPROXY_SERVICE EXTERNAL_SERVICE] ServiceType *string `json:"service_type,omitempty"` // Service ID or Service Name is required. @@ -188,7 +188,7 @@ var removeServiceBodyTypeServiceTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["SERVICE_TYPE_INVALID","MYSQL_SERVICE","MONGODB_SERVICE","POSTGRESQL_SERVICE","PROXYSQL_SERVICE","EXTERNAL_SERVICE"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["SERVICE_TYPE_INVALID","MYSQL_SERVICE","MONGODB_SERVICE","POSTGRESQL_SERVICE","PROXYSQL_SERVICE","HAPROXY_SERVICE","EXTERNAL_SERVICE"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -213,6 +213,9 @@ const ( // RemoveServiceBodyServiceTypePROXYSQLSERVICE captures enum value "PROXYSQL_SERVICE" RemoveServiceBodyServiceTypePROXYSQLSERVICE string = "PROXYSQL_SERVICE" + // RemoveServiceBodyServiceTypeHAPROXYSERVICE captures enum value "HAPROXY_SERVICE" + RemoveServiceBodyServiceTypeHAPROXYSERVICE string = "HAPROXY_SERVICE" + // RemoveServiceBodyServiceTypeEXTERNALSERVICE captures enum value "EXTERNAL_SERVICE" RemoveServiceBodyServiceTypeEXTERNALSERVICE string = "EXTERNAL_SERVICE" )