From d9874474125b905dee940a0b1a37a08e9c552acd Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 26 Jun 2023 18:55:18 +0200 Subject: [PATCH 01/22] PMM-11079 Remove Integrated Alerting --- Makefile.include | 5 +- api-tests/init.go | 2 - api-tests/management/alerts_test.go | 748 +++++ api-tests/management/ia/alerts_test.go | 39 - api-tests/management/ia/channels_test.go | 387 --- api-tests/management/ia/rules_test.go | 748 ----- api/managementpb/ia/alerts.pb.go | 591 ---- api/managementpb/ia/alerts.pb.gw.go | 248 -- api/managementpb/ia/alerts.pb.validate.go | 737 ----- api/managementpb/ia/alerts.proto | 86 - api/managementpb/ia/alerts_grpc.pb.go | 157 - api/managementpb/ia/channels.pb.go | 1694 ---------- api/managementpb/ia/channels.pb.gw.go | 410 --- api/managementpb/ia/channels.pb.validate.go | 2347 -------------- api/managementpb/ia/channels.proto | 233 -- api/managementpb/ia/channels_grpc.pb.go | 243 -- .../ia/json/client/alerts/alerts_client.go | 117 - .../client/alerts/list_alerts_parameters.go | 144 - .../client/alerts/list_alerts_responses.go | 2711 ---------------- .../client/alerts/toggle_alerts_parameters.go | 144 - .../client/alerts/toggle_alerts_responses.go | 361 --- .../client/channels/add_channel_parameters.go | 144 - .../client/channels/add_channel_responses.go | 999 ------ .../channels/change_channel_parameters.go | 144 - .../channels/change_channel_responses.go | 963 ------ .../json/client/channels/channels_client.go | 193 -- .../channels/list_channels_parameters.go | 144 - .../channels/list_channels_responses.go | 1277 -------- .../channels/remove_channel_parameters.go | 144 - .../channels/remove_channel_responses.go | 295 -- .../pmm_integrated_alerting_api_client.go | 122 - .../rules/create_alert_rule_parameters.go | 144 - .../rules/create_alert_rule_responses.go | 757 ----- .../rules/delete_alert_rule_parameters.go | 144 - .../rules/delete_alert_rule_responses.go | 295 -- .../rules/list_alert_rules_parameters.go | 144 - .../rules/list_alert_rules_responses.go | 2438 --------------- .../ia/json/client/rules/rules_client.go | 232 -- .../rules/toggle_alert_rule_parameters.go | 144 - .../rules/toggle_alert_rule_responses.go | 360 --- .../rules/update_alert_rule_parameters.go | 144 - .../rules/update_alert_rule_responses.go | 715 ----- api/managementpb/ia/json/header.json | 11 - api/managementpb/ia/json/ia.json | 2727 ----------------- api/managementpb/ia/rules.pb.go | 1671 ---------- api/managementpb/ia/rules.pb.gw.go | 491 --- api/managementpb/ia/rules.pb.validate.go | 2008 ------------ api/managementpb/ia/rules.proto | 243 -- api/managementpb/ia/rules_grpc.pb.go | 286 -- api/managementpb/ia/status.dot | 20 - api/managementpb/ia/status.pb.go | 160 - api/managementpb/ia/status.pb.validate.go | 36 - api/managementpb/ia/status.proto | 19 - api/swagger/swagger-dev.json | 2718 +--------------- descriptor.bin | Bin 726545 -> 734766 bytes managed/cmd/pmm-managed/main.go | 17 - managed/models/channel.go | 165 - managed/models/channel_helpers.go | 391 --- managed/models/channel_helpers_test.go | 494 --- managed/models/channel_reform.go | 176 -- managed/models/database.go | 5 + managed/models/rule_helpers.go | 291 -- managed/models/rule_helpers_test.go | 355 --- managed/models/rule_model.go | 255 +- managed/models/rule_model_reform.go | 221 -- managed/models/settings.go | 2 +- managed/models/template_model.go | 4 +- managed/models/template_model_reform.go | 6 +- managed/services/alertmanager/alertmanager.go | 378 +-- .../services/alertmanager/email_template.html | 288 -- managed/services/alertmanager/emailer.go | 114 - .../services/management/alerting/service.go | 43 +- .../services/management/ia/alerts_service.go | 266 -- .../management/ia/alerts_service_test.go | 383 --- .../management/ia/channels_service.go | 406 --- managed/services/management/ia/common.go | 187 -- managed/services/management/ia/deps.go | 48 - .../management/ia/mock_alert_manager_test.go | 96 - .../ia/mock_templates_service_test.go | 30 - .../management/ia/mock_vm_alert_test.go | 15 - .../services/management/ia/rules_service.go | 708 ----- .../management/ia/rules_service_test.go | 380 --- managed/services/server/server.go | 41 - 83 files changed, 870 insertions(+), 37379 deletions(-) create mode 100644 api-tests/management/alerts_test.go delete mode 100644 api-tests/management/ia/alerts_test.go delete mode 100644 api-tests/management/ia/channels_test.go delete mode 100644 api-tests/management/ia/rules_test.go delete mode 100644 api/managementpb/ia/alerts.pb.go delete mode 100644 api/managementpb/ia/alerts.pb.gw.go delete mode 100644 api/managementpb/ia/alerts.pb.validate.go delete mode 100644 api/managementpb/ia/alerts.proto delete mode 100644 api/managementpb/ia/alerts_grpc.pb.go delete mode 100644 api/managementpb/ia/channels.pb.go delete mode 100644 api/managementpb/ia/channels.pb.gw.go delete mode 100644 api/managementpb/ia/channels.pb.validate.go delete mode 100644 api/managementpb/ia/channels.proto delete mode 100644 api/managementpb/ia/channels_grpc.pb.go delete mode 100644 api/managementpb/ia/json/client/alerts/alerts_client.go delete mode 100644 api/managementpb/ia/json/client/alerts/list_alerts_parameters.go delete mode 100644 api/managementpb/ia/json/client/alerts/list_alerts_responses.go delete mode 100644 api/managementpb/ia/json/client/alerts/toggle_alerts_parameters.go delete mode 100644 api/managementpb/ia/json/client/alerts/toggle_alerts_responses.go delete mode 100644 api/managementpb/ia/json/client/channels/add_channel_parameters.go delete mode 100644 api/managementpb/ia/json/client/channels/add_channel_responses.go delete mode 100644 api/managementpb/ia/json/client/channels/change_channel_parameters.go delete mode 100644 api/managementpb/ia/json/client/channels/change_channel_responses.go delete mode 100644 api/managementpb/ia/json/client/channels/channels_client.go delete mode 100644 api/managementpb/ia/json/client/channels/list_channels_parameters.go delete mode 100644 api/managementpb/ia/json/client/channels/list_channels_responses.go delete mode 100644 api/managementpb/ia/json/client/channels/remove_channel_parameters.go delete mode 100644 api/managementpb/ia/json/client/channels/remove_channel_responses.go delete mode 100644 api/managementpb/ia/json/client/pmm_integrated_alerting_api_client.go delete mode 100644 api/managementpb/ia/json/client/rules/create_alert_rule_parameters.go delete mode 100644 api/managementpb/ia/json/client/rules/create_alert_rule_responses.go delete mode 100644 api/managementpb/ia/json/client/rules/delete_alert_rule_parameters.go delete mode 100644 api/managementpb/ia/json/client/rules/delete_alert_rule_responses.go delete mode 100644 api/managementpb/ia/json/client/rules/list_alert_rules_parameters.go delete mode 100644 api/managementpb/ia/json/client/rules/list_alert_rules_responses.go delete mode 100644 api/managementpb/ia/json/client/rules/rules_client.go delete mode 100644 api/managementpb/ia/json/client/rules/toggle_alert_rule_parameters.go delete mode 100644 api/managementpb/ia/json/client/rules/toggle_alert_rule_responses.go delete mode 100644 api/managementpb/ia/json/client/rules/update_alert_rule_parameters.go delete mode 100644 api/managementpb/ia/json/client/rules/update_alert_rule_responses.go delete mode 100644 api/managementpb/ia/json/header.json delete mode 100644 api/managementpb/ia/json/ia.json delete mode 100644 api/managementpb/ia/rules.pb.go delete mode 100644 api/managementpb/ia/rules.pb.gw.go delete mode 100644 api/managementpb/ia/rules.pb.validate.go delete mode 100644 api/managementpb/ia/rules.proto delete mode 100644 api/managementpb/ia/rules_grpc.pb.go delete mode 100644 api/managementpb/ia/status.dot delete mode 100644 api/managementpb/ia/status.pb.go delete mode 100644 api/managementpb/ia/status.pb.validate.go delete mode 100644 api/managementpb/ia/status.proto delete mode 100644 managed/models/channel.go delete mode 100644 managed/models/channel_helpers.go delete mode 100644 managed/models/channel_helpers_test.go delete mode 100644 managed/models/channel_reform.go delete mode 100644 managed/models/rule_helpers.go delete mode 100644 managed/models/rule_helpers_test.go delete mode 100644 managed/models/rule_model_reform.go delete mode 100644 managed/services/alertmanager/email_template.html delete mode 100644 managed/services/alertmanager/emailer.go delete mode 100644 managed/services/management/ia/alerts_service.go delete mode 100644 managed/services/management/ia/alerts_service_test.go delete mode 100644 managed/services/management/ia/channels_service.go delete mode 100644 managed/services/management/ia/common.go delete mode 100644 managed/services/management/ia/deps.go delete mode 100644 managed/services/management/ia/mock_alert_manager_test.go delete mode 100644 managed/services/management/ia/mock_templates_service_test.go delete mode 100644 managed/services/management/ia/mock_vm_alert_test.go delete mode 100644 managed/services/management/ia/rules_service.go delete mode 100644 managed/services/management/ia/rules_service_test.go diff --git a/Makefile.include b/Makefile.include index 7c59505c85..63ed571c11 100644 --- a/Makefile.include +++ b/Makefile.include @@ -47,7 +47,7 @@ gen-api: ## Generate PMM API bin/buf generate -v api - for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/dbaas api/managementpb/ia api/managementpb/alerting api/managementpb/backup api/managementpb/azure api/managementpb/role api/qanpb api/managementpb/agent api/managementpb/node api/managementpb/service api/platformpb api/userpb; do \ + for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/dbaas api/managementpb/alerting api/managementpb/backup api/managementpb/azure api/managementpb/role api/qanpb api/managementpb/agent api/managementpb/node api/managementpb/service api/platformpb api/userpb; do \ set -x ; \ bin/swagger mixin $$API/json/header.json $$API/*.swagger.json --output=$$API/json/$$(basename $$API).json --keep-spec-order; \ bin/swagger flatten --with-flatten=expand --with-flatten=remove-unused $$API/json/$$(basename $$API).json --output=$$API/json/$$(basename $$API).json ; \ @@ -88,7 +88,6 @@ gen-api: ## Generate PMM API api/inventorypb/json/inventorypb.json \ api/managementpb/json/managementpb.json \ api/managementpb/dbaas/json/dbaas.json \ - api/managementpb/ia/json/ia.json \ api/managementpb/alerting/json/alerting.json \ api/managementpb/backup/json/backup.json \ api/managementpb/azure/json/azure.json \ @@ -127,7 +126,7 @@ clean: clean_swagger ## Remove generated files find api -name '*.pb.gw.go' -print -delete find api -name '*.validate.go' -print -delete - for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/dbaas api/managementpb/ia api/managementpb/alerting api/managementpb/backup api/managementpb/role api/managementpb/agent api/managementpb/node api/managementpb/service api/qanpb api/platformpb ; do \ + for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/dbaas api/managementpb/alerting api/managementpb/backup api/managementpb/role api/managementpb/agent api/managementpb/node api/managementpb/service api/qanpb api/platformpb ; do \ rm -fr $$API/json/client $$API/json/models $$API/json/$$(basename $$API).json ; \ done rm -f api/swagger/swagger.json api/swagger/swagger-dev.json diff --git a/api-tests/init.go b/api-tests/init.go index a750ed683f..f79450d255 100644 --- a/api-tests/init.go +++ b/api-tests/init.go @@ -41,7 +41,6 @@ import ( alertingClient "github.com/percona/pmm/api/managementpb/alerting/json/client" backupsClient "github.com/percona/pmm/api/managementpb/backup/json/client" dbaasClient "github.com/percona/pmm/api/managementpb/dbaas/json/client" - iaClient "github.com/percona/pmm/api/managementpb/ia/json/client" managementClient "github.com/percona/pmm/api/managementpb/json/client" platformClient "github.com/percona/pmm/api/platformpb/json/client" serverClient "github.com/percona/pmm/api/serverpb/json/client" @@ -223,7 +222,6 @@ func init() { dbaasClient.Default = dbaasClient.New(transport, nil) serverClient.Default = serverClient.New(transport, nil) amclient.Default = amclient.New(alertmanagerTransport, nil) - iaClient.Default = iaClient.New(transport, nil) backupsClient.Default = backupsClient.New(transport, nil) platformClient.Default = platformClient.New(transport, nil) alertingClient.Default = alertingClient.New(transport, nil) diff --git a/api-tests/management/alerts_test.go b/api-tests/management/alerts_test.go new file mode 100644 index 0000000000..4a217cac04 --- /dev/null +++ b/api-tests/management/alerts_test.go @@ -0,0 +1,748 @@ +// // Copyright (C) 2017 Percona LLC +// // +// // This program is free software: you can redistribute it and/or modify +// // it under the terms of the GNU Affero General Public License as published by +// // the Free Software Foundation, either version 3 of the License, or +// // (at your option) any later version. +// // +// // This program is distributed in the hope that it will be useful, +// // but WITHOUT ANY WARRANTY; without even the implied warranty of +// // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// // GNU Affero General Public License for more details. +// // +// // You should have received a copy of the GNU Affero General Public License +// // along with this program. If not, see . +package management + +// +// import ( +// "fmt" +// "os" +// "testing" +// +// "github.com/AlekSi/pointer" +// "github.com/brianvoe/gofakeit/v6" +// "github.com/google/uuid" +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/require" +// "google.golang.org/grpc/codes" +// +// pmmapitests "github.com/percona/pmm/api-tests" +// alertingClient "github.com/percona/pmm/api/managementpb/alerting/json/client" +// "github.com/percona/pmm/api/managementpb/alerting/json/client/alerting" +// "github.com/percona/pmm/api/managementpb/ia/json/client" +// "github.com/percona/pmm/api/managementpb/ia/json/client/channels" +// "github.com/percona/pmm/api/managementpb/ia/json/client/rules" +// ) +// +// // Note: Even though the IA services check for alerting enabled or disabled before returning results +// // we don't enable or disable IA explicit in our tests since it is enabled by default through +// // ENABLE_ALERTING env var. +// func TestRulesAPI(t *testing.T) { +// t.Parallel() +// rulesClient := client.Default.Rules +// templatesClient := alertingClient.Default.Alerting +// channelsClient := client.Default.Channels +// +// dummyFilter := &rules.CreateAlertRuleParamsBodyFiltersItems0{ +// Type: pointer.ToString("EQUAL"), +// Key: "threshold", +// Value: "12", +// } +// +// templateName := createTemplate(t) +// channelID, _ := createChannel(t) +// newChannelID, _ := createChannel(t) +// t.Cleanup(func() { +// deleteTemplate(t, alertingClient.Default.Alerting, templateName) +// deleteChannel(t, channelsClient, channelID) +// deleteChannel(t, channelsClient, newChannelID) +// }) +// +// t.Run("add", func(t *testing.T) { +// t.Parallel() +// +// t.Run("normal from template", func(t *testing.T) { +// t.Parallel() +// +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(params) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// assert.NotEmpty(t, rule.Payload.RuleID) +// }) +// +// t.Run("without channels and filters", func(t *testing.T) { +// t.Parallel() +// +// params := createAlertRuleParams(templateName, "", "", nil) +// rule, err := rulesClient.CreateAlertRule(params) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// assert.NotEmpty(t, rule.Payload.RuleID) +// }) +// +// t.Run("builtin_template", func(t *testing.T) { +// t.Parallel() +// +// params := createAlertRuleParams("pmm_mongodb_restarted", "", channelID, dummyFilter) +// params.Body.Params = []*rules.CreateAlertRuleParamsBodyParamsItems0{{ +// Name: "threshold", +// Type: pointer.ToString("FLOAT"), +// Float: 3.14, +// }} +// rule, err := rulesClient.CreateAlertRule(params) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// assert.NotEmpty(t, rule.Payload.RuleID) +// }) +// +// t.Run("use default value for parameter", func(t *testing.T) { +// t.Parallel() +// +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(params) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// assert.NotEmpty(t, rule.Payload.RuleID) +// }) +// +// t.Run("normal from other rule", func(t *testing.T) { +// t.Parallel() +// +// sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) +// +// copyRuleParams := createAlertRuleParams("", sourceRule.Payload.RuleID, channelID, dummyFilter) +// copyRule, err := rulesClient.CreateAlertRule(copyRuleParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, copyRule.Payload.RuleID) +// +// assert.NotEmpty(t, copyRule.Payload.RuleID) +// }) +// +// t.Run("normal from other rule with deleted template", func(t *testing.T) { +// t.Parallel() +// +// sourceTemplateName := createTemplate(t) +// sourceRuleParams := createAlertRuleParams(sourceTemplateName, "", channelID, dummyFilter) +// sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) +// +// deleteTemplate(t, templatesClient, sourceTemplateName) +// +// copyRuleParams := createAlertRuleParams("", sourceRule.Payload.RuleID, channelID, dummyFilter) +// copyRule, err := rulesClient.CreateAlertRule(copyRuleParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, copyRule.Payload.RuleID) +// +// assert.NotEmpty(t, copyRule.Payload.RuleID) +// }) +// +// t.Run("both template name and source rule id specified", func(t *testing.T) { +// t.Parallel() +// +// sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) +// +// copyRuleParams := createAlertRuleParams(templateName, sourceRule.Payload.RuleID, channelID, dummyFilter) +// _, err = rulesClient.CreateAlertRule(copyRuleParams) +// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Both template name and source rule id are specified.") +// }) +// +// t.Run("both template name and source rule id are empty", func(t *testing.T) { +// t.Parallel() +// +// sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) +// +// copyRuleParams := createAlertRuleParams("", "", channelID, dummyFilter) +// _, err = rulesClient.CreateAlertRule(copyRuleParams) +// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Template name or source rule id should be specified.") +// }) +// +// t.Run("unknown template", func(t *testing.T) { +// t.Parallel() +// +// templateName := uuid.New().String() +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// _, err := rulesClient.CreateAlertRule(params) +// pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Unknown template %s.", templateName) +// }) +// +// t.Run("unknown channel", func(t *testing.T) { +// t.Parallel() +// +// channelID := uuid.New().String() +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// _, err := rulesClient.CreateAlertRule(params) +// pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Failed to find all required channels: [%s].", channelID) +// }) +// +// t.Run("wrong parameter", func(t *testing.T) { +// t.Parallel() +// +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// params.Body.Params = append( +// params.Body.Params, +// &rules.CreateAlertRuleParamsBodyParamsItems0{ +// Name: "unknown parameter", +// Type: pointer.ToString("FLOAT"), +// Float: 12, +// }) +// _, err := rulesClient.CreateAlertRule(params) +// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 3.") +// }) +// +// t.Run("wrong parameter type", func(t *testing.T) { +// t.Parallel() +// +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// params.Body.Params = []*rules.CreateAlertRuleParamsBodyParamsItems0{ +// { +// Name: "param1", +// Type: pointer.ToString("BOOL"), +// Bool: true, +// }, { +// Name: "param2", +// Type: pointer.ToString("FLOAT"), +// Float: 12, +// }, +// } +// _, err := rulesClient.CreateAlertRule(params) +// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") +// }) +// }) +// +// t.Run("update", func(t *testing.T) { +// t.Parallel() +// +// t.Run("normal", func(t *testing.T) { +// t.Parallel() +// +// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(cParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// params := &rules.UpdateAlertRuleParams{ +// Body: rules.UpdateAlertRuleBody{ +// RuleID: rule.Payload.RuleID, +// Disabled: false, +// Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ +// { +// Name: "param1", +// Type: pointer.ToString("FLOAT"), +// Float: 3.14, +// }, +// { +// Name: "param2", +// Type: pointer.ToString("FLOAT"), +// Float: 21, +// }, +// }, +// For: "10s", +// Severity: pointer.ToString("SEVERITY_ERROR"), +// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, +// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ +// Type: pointer.ToString("EQUAL"), +// Key: "param1", +// Value: "21", +// }}, +// ChannelIds: []string{channelID, newChannelID}, +// }, +// Context: pmmapitests.Context, +// } +// _, err = rulesClient.UpdateAlertRule(params) +// require.NoError(t, err) +// +// list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) +// require.NoError(t, err) +// +// var found bool +// for _, r := range list.Payload.Rules { +// if r.RuleID == rule.Payload.RuleID { +// assert.Equal(t, params.Body.Name, r.Name) +// assert.Equal(t, "Test summary", r.Summary) +// assert.Equal(t, templateName, r.TemplateName) +// assert.False(t, r.Disabled) +// assert.Equal(t, "300s", r.DefaultFor) +// assert.Equal(t, "10s", r.For) +// assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.DefaultSeverity)) +// assert.Equal(t, params.Body.Severity, r.Severity) +// assert.Equal(t, params.Body.CustomLabels, r.CustomLabels) +// assert.Equal(t, map[string]string{"foo": "bar"}, r.Labels) +// assert.Equal(t, map[string]string{"description": "test description", "summary": "test summary"}, r.Annotations) +// assert.Len(t, r.ParamsValues, 2) +// assert.Equal(t, params.Body.Params[0].Type, r.ParamsValues[0].Type) +// assert.Equal(t, params.Body.Params[0].Name, r.ParamsValues[0].Name) +// assert.Equal(t, params.Body.Params[0].Float, r.ParamsValues[0].Float) +// assert.Equal(t, params.Body.Params[0].Bool, r.ParamsValues[0].Bool) +// assert.Equal(t, params.Body.Params[0].String, r.ParamsValues[0].String) +// assert.Equal(t, params.Body.Params[1].Type, r.ParamsValues[1].Type) +// assert.Equal(t, params.Body.Params[1].Name, r.ParamsValues[1].Name) +// assert.Equal(t, params.Body.Params[1].Float, r.ParamsValues[1].Float) +// assert.Equal(t, params.Body.Params[1].Bool, r.ParamsValues[1].Bool) +// assert.Equal(t, params.Body.Params[1].String, r.ParamsValues[1].String) +// assert.Equal(t, "[[ .param1 ]] > 2 and 2 < [[ .param2 ]]", r.ExprTemplate) +// assert.Equal(t, "3.14 > 2 and 2 < 21", r.Expr) +// found = true +// } +// } +// assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) +// }) +// +// t.Run("unknown channel", func(t *testing.T) { +// t.Parallel() +// +// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(cParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// unknownChannelID := uuid.New().String() +// params := &rules.UpdateAlertRuleParams{ +// Body: rules.UpdateAlertRuleBody{ +// RuleID: rule.Payload.RuleID, +// Disabled: false, +// Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ +// { +// Name: "param1", +// Type: pointer.ToString("FLOAT"), +// Float: 3.14, +// }, { +// Name: "param2", +// Type: pointer.ToString("FLOAT"), +// Float: 21, +// }, +// }, +// For: "10s", +// Severity: pointer.ToString("SEVERITY_ERROR"), +// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, +// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ +// Type: pointer.ToString("EQUAL"), +// Key: "param1", +// Value: "21", +// }}, +// ChannelIds: []string{channelID, unknownChannelID}, +// }, +// Context: pmmapitests.Context, +// } +// _, err = rulesClient.UpdateAlertRule(params) +// pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Failed to find all required channels: [%s].", unknownChannelID) +// }) +// +// t.Run("wrong parameter", func(t *testing.T) { +// t.Parallel() +// +// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(cParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// params := &rules.UpdateAlertRuleParams{ +// Body: rules.UpdateAlertRuleBody{ +// RuleID: rule.Payload.RuleID, +// Disabled: false, +// Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{{ +// Name: "param2", +// Type: pointer.ToString("FLOAT"), +// Float: 12, +// }, { +// Name: "unknown parameter", +// Type: pointer.ToString("FLOAT"), +// Float: 21, +// }}, +// For: "10s", +// Severity: pointer.ToString("SEVERITY_ERROR"), +// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, +// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ +// Type: pointer.ToString("EQUAL"), +// Key: "param1", +// Value: "21", +// }}, +// ChannelIds: []string{channelID, newChannelID}, +// }, +// Context: pmmapitests.Context, +// } +// _, err = rulesClient.UpdateAlertRule(params) +// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 is missing.") +// }) +// +// t.Run("missing parameters", func(t *testing.T) { +// t.Parallel() +// +// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(cParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// params := &rules.UpdateAlertRuleParams{ +// Body: rules.UpdateAlertRuleBody{ +// RuleID: rule.Payload.RuleID, +// Disabled: false, +// Params: nil, +// For: "10s", +// Severity: pointer.ToString("SEVERITY_ERROR"), +// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, +// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ +// Type: pointer.ToString("EQUAL"), +// Key: "param1", +// Value: "21", +// }}, +// ChannelIds: []string{channelID, newChannelID}, +// }, +// Context: pmmapitests.Context, +// } +// _, err = rulesClient.UpdateAlertRule(params) +// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 0.") +// }) +// +// t.Run("wrong parameter type", func(t *testing.T) { +// t.Parallel() +// +// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(cParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// params := &rules.UpdateAlertRuleParams{ +// Body: rules.UpdateAlertRuleBody{ +// RuleID: rule.Payload.RuleID, +// Disabled: false, +// Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ +// { +// Name: "param1", +// Type: pointer.ToString("BOOL"), +// Bool: true, +// }, { +// Name: "param2", +// Type: pointer.ToString("FLOAT"), +// Float: 3.14, +// }, +// }, +// For: "10s", +// Severity: pointer.ToString("SEVERITY_ERROR"), +// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, +// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ +// Type: pointer.ToString("EQUAL"), +// Key: "param1", +// Value: "21", +// }}, +// ChannelIds: []string{channelID, newChannelID}, +// }, +// Context: pmmapitests.Context, +// } +// _, err = rulesClient.UpdateAlertRule(params) +// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") +// }) +// }) +// +// t.Run("toggle", func(t *testing.T) { +// t.Parallel() +// +// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(cParams) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) +// require.NoError(t, err) +// +// var found bool +// for _, r := range list.Payload.Rules { +// if r.RuleID == rule.Payload.RuleID { +// assert.True(t, r.Disabled) +// assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.Severity)) +// found = true +// } +// } +// assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) +// +// _, err = rulesClient.ToggleAlertRule(&rules.ToggleAlertRuleParams{ +// Body: rules.ToggleAlertRuleBody{ +// RuleID: rule.Payload.RuleID, +// Disabled: pointer.ToString(rules.ToggleAlertRuleBodyDisabledFALSE), +// }, +// Context: pmmapitests.Context, +// }) +// require.NoError(t, err) +// +// list, err = rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) +// require.NoError(t, err) +// +// found = false +// for _, r := range list.Payload.Rules { +// if r.RuleID == rule.Payload.RuleID { +// assert.False(t, r.Disabled) +// assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.Severity)) +// found = true +// } +// } +// assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) +// }) +// +// t.Run("delete", func(t *testing.T) { +// t.Parallel() +// +// t.Run("normal", func(t *testing.T) { +// t.Parallel() +// +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(params) +// require.NoError(t, err) +// +// _, err = rulesClient.DeleteAlertRule(&rules.DeleteAlertRuleParams{ +// Body: rules.DeleteAlertRuleBody{RuleID: rule.Payload.RuleID}, +// Context: pmmapitests.Context, +// }) +// require.NoError(t, err) +// +// list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) +// require.NoError(t, err) +// +// for _, r := range list.Payload.Rules { +// assert.NotEqual(t, rule.Payload.RuleID, r.RuleID) +// } +// }) +// +// t.Run("missing rule", func(t *testing.T) { +// t.Parallel() +// ruleID := uuid.New().String() +// _, err := rulesClient.DeleteAlertRule(&rules.DeleteAlertRuleParams{ +// Body: rules.DeleteAlertRuleBody{RuleID: ruleID}, +// Context: pmmapitests.Context, +// }) +// pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Rule with ID %q not found.", ruleID) +// }) +// }) +// +// t.Run("list without pagination", func(t *testing.T) { +// t.Run("without pagination", func(t *testing.T) { +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(params) +// require.NoError(t, err) +// defer deleteRule(t, rulesClient, rule.Payload.RuleID) +// +// list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) +// require.NoError(t, err) +// +// var found bool +// for _, r := range list.Payload.Rules { +// if r.RuleID == rule.Payload.RuleID { +// assert.Equal(t, params.Body.TemplateName, r.TemplateName) +// assert.Equal(t, "Test summary", r.Summary) +// assert.True(t, r.Disabled) +// assert.Equal(t, params.Body.Name, r.Name) +// assert.Len(t, r.ParamsValues, 2) +// assert.Equal(t, params.Body.Params[0].Type, r.ParamsValues[0].Type) +// assert.Equal(t, params.Body.Params[0].Name, r.ParamsValues[0].Name) +// assert.Equal(t, params.Body.Params[0].Float, r.ParamsValues[0].Float) +// assert.Equal(t, params.Body.Params[0].Bool, r.ParamsValues[0].Bool) +// assert.Equal(t, params.Body.Params[0].String, r.ParamsValues[0].String) +// assert.Equal(t, params.Body.Params[1].Type, r.ParamsValues[1].Type) +// assert.Equal(t, params.Body.Params[1].Name, r.ParamsValues[1].Name) +// assert.Equal(t, params.Body.Params[1].Float, r.ParamsValues[1].Float) +// assert.Equal(t, params.Body.Params[1].Bool, r.ParamsValues[1].Bool) +// assert.Equal(t, params.Body.Params[1].String, r.ParamsValues[1].String) +// assert.Equal(t, "300s", r.DefaultFor) +// assert.Equal(t, params.Body.For, r.For) +// assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.DefaultSeverity)) +// assert.Equal(t, params.Body.Severity, r.Severity) +// assert.Equal(t, params.Body.CustomLabels, r.CustomLabels) +// assert.Equal(t, map[string]string{"foo": "bar"}, r.Labels) +// assert.Equal(t, map[string]string{"description": "test description", "summary": "test summary"}, r.Annotations) +// assert.Len(t, params.Body.Filters, 1) +// assert.Equal(t, params.Body.Filters[0].Type, r.Filters[0].Type) +// assert.Equal(t, params.Body.Filters[0].Key, r.Filters[0].Key) +// assert.Equal(t, params.Body.Filters[0].Value, r.Filters[0].Value) +// assert.Len(t, r.Channels, 1) +// assert.Equal(t, r.Channels[0].ChannelID, channelID) +// assert.Equal(t, "[[ .param1 ]] > 2 and 2 < [[ .param2 ]]", r.ExprTemplate) +// assert.Equal(t, "4 > 2 and 2 < 12", r.Expr) +// found = true +// } +// } +// assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) +// }) +// +// t.Run("with pagination", func(t *testing.T) { +// const rulesCount = 5 +// +// ruleIDs := make(map[string]struct{}) +// +// for i := 0; i < rulesCount; i++ { +// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) +// rule, err := rulesClient.CreateAlertRule(params) +// require.NoError(t, err) +// +// ruleIDs[rule.Payload.RuleID] = struct{}{} +// } +// defer func() { +// for id := range ruleIDs { +// deleteRule(t, rulesClient, id) +// } +// }() +// +// // list rules, so they are all on the first page +// body := rules.ListAlertRulesBody{ +// PageParams: &rules.ListAlertRulesParamsBodyPageParams{ +// PageSize: 20, +// Index: 0, +// }, +// } +// list1, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Body: body, Context: pmmapitests.Context}) +// require.NoError(t, err) +// +// lp1 := list1.Payload +// // some tests didn't remove rules, so expect more elements than created in current test +// assert.GreaterOrEqual(t, len(lp1.Rules), rulesCount) +// assert.Equal(t, int32(len(lp1.Rules)), lp1.Totals.TotalItems) +// assert.Equal(t, int32(1), lp1.Totals.TotalPages) +// for id := range ruleIDs { +// var found bool +// for _, r := range list1.Payload.Rules { +// if r.RuleID == id { +// found = true +// +// break +// } +// } +// +// assert.Truef(t, found, "rule (%s) not found", id) +// } +// +// // paginate page over page with page size 1 and check the order - it should be the same as in list1. +// // last iteration checks that there is no elements for not existing page. +// for pageIndex := 0; pageIndex <= len(lp1.Rules); pageIndex++ { +// body := rules.ListAlertRulesBody{ +// PageParams: &rules.ListAlertRulesParamsBodyPageParams{ +// PageSize: 1, +// Index: int32(pageIndex), +// }, +// } +// list2, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Body: body, Context: pmmapitests.Context}) +// require.NoError(t, err) +// +// lp2 := list2.Payload +// assert.Equal(t, lp1.Totals.TotalItems, lp2.Totals.TotalItems) +// assert.GreaterOrEqual(t, lp2.Totals.TotalPages, int32(rulesCount)) +// +// if pageIndex != len(lp1.Rules) { +// require.Len(t, lp2.Rules, 1) +// assert.Equal(t, lp1.Rules[pageIndex].RuleID, lp2.Rules[0].RuleID) +// } else { +// assert.Len(t, lp2.Rules, 0) +// } +// } +// }) +// }) +// } +// +// func deleteRule(t *testing.T, client rules.ClientService, id string) { +// t.Helper() +// +// _, err := client.DeleteAlertRule(&rules.DeleteAlertRuleParams{ +// Body: rules.DeleteAlertRuleBody{RuleID: id}, +// Context: pmmapitests.Context, +// }) +// require.NoError(t, err) +// } +// +// func createAlertRuleParams(templateName, sourceRuleID, channelID string, filter *rules.CreateAlertRuleParamsBodyFiltersItems0) *rules.CreateAlertRuleParams { +// rule := &rules.CreateAlertRuleParams{ +// Body: rules.CreateAlertRuleBody{ +// TemplateName: templateName, +// SourceRuleID: sourceRuleID, +// Disabled: true, +// Name: "example rule", +// Params: []*rules.CreateAlertRuleParamsBodyParamsItems0{ +// { +// Name: "param1", +// Type: pointer.ToString("FLOAT"), +// Float: 4, +// }, +// { +// Name: "param2", +// Type: pointer.ToString("FLOAT"), +// Float: 12, +// }, +// }, +// For: "5s", +// Severity: pointer.ToString("SEVERITY_WARNING"), +// CustomLabels: map[string]string{"foo": "bar"}, +// }, +// Context: pmmapitests.Context, +// } +// +// if channelID != "" { +// rule.Body.ChannelIds = []string{channelID} +// } +// +// if filter != nil { +// rule.Body.Filters = []*rules.CreateAlertRuleParamsBodyFiltersItems0{filter} +// } +// +// return rule +// } +// +// func createTemplate(t *testing.T) string { +// t.Helper() +// +// b, err := os.ReadFile("../../testdata/ia/template.yaml") +// require.NoError(t, err) +// +// templateName := uuid.New().String() +// expression := "'[[ .param1 ]] > 2 and 2 < [[ .param2 ]]'" +// _, err = alertingClient.Default.Alerting.CreateTemplate(&alerting.CreateTemplateParams{ +// Body: alerting.CreateTemplateBody{ +// Yaml: fmt.Sprintf(string(b), templateName, expression, "%", "s"), +// }, +// Context: pmmapitests.Context, +// }) +// require.NoError(t, err) +// +// return templateName +// } +// +// func createChannel(t *testing.T) (string, channels.AddChannelBody) { +// t.Helper() +// +// body := channels.AddChannelBody{ +// Summary: gofakeit.Quote(), +// Disabled: gofakeit.Bool(), +// EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ +// SendResolved: false, +// To: []string{gofakeit.Email()}, +// }, +// } +// resp, err := client.Default.Channels.AddChannel(&channels.AddChannelParams{ +// Body: body, +// Context: pmmapitests.Context, +// }) +// require.NoError(t, err) +// return resp.Payload.ChannelID, body +// } +// +// func deleteTemplate(t *testing.T, client alerting.ClientService, name string) { +// t.Helper() +// +// _, err := client.DeleteTemplate(&alerting.DeleteTemplateParams{ +// Body: alerting.DeleteTemplateBody{ +// Name: name, +// }, +// Context: pmmapitests.Context, +// }) +// assert.NoError(t, err) +// } diff --git a/api-tests/management/ia/alerts_test.go b/api-tests/management/ia/alerts_test.go deleted file mode 100644 index ecdbfc5c85..0000000000 --- a/api-tests/management/ia/alerts_test.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "testing" - - "github.com/stretchr/testify/require" - - pmmapitests "github.com/percona/pmm/api-tests" - channelsClient "github.com/percona/pmm/api/managementpb/ia/json/client" - "github.com/percona/pmm/api/managementpb/ia/json/client/alerts" -) - -func TestAlertsAPI(t *testing.T) { - client := channelsClient.Default.Alerts - - t.Run("list", func(t *testing.T) { - _, err := client.ListAlerts(&alerts.ListAlertsParams{ - Body: alerts.ListAlertsBody{}, - Context: pmmapitests.Context, - }) - - require.NoError(t, err) - }) -} diff --git a/api-tests/management/ia/channels_test.go b/api-tests/management/ia/channels_test.go deleted file mode 100644 index fa29d7bbde..0000000000 --- a/api-tests/management/ia/channels_test.go +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "testing" - - "github.com/brianvoe/gofakeit/v6" - "github.com/google/uuid" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - - pmmapitests "github.com/percona/pmm/api-tests" - alertingClient "github.com/percona/pmm/api/managementpb/alerting/json/client" - channelsClient "github.com/percona/pmm/api/managementpb/ia/json/client" - "github.com/percona/pmm/api/managementpb/ia/json/client/channels" -) - -// Note: Even though the IA services check for alerting enabled or disabled before returning results -// we don't enable or disable IA explicit in our tests since it is enabled by default through -// ENABLE_ALERTING env var. - -func TestChannelsAPI(t *testing.T) { //nolint:tparallel - // TODO Fix this test to run in parallel. - // t.Parallel() - client := channelsClient.Default.Channels - - t.Run("add", func(t *testing.T) { - t.Parallel() - - t.Run("normal", func(t *testing.T) { - t.Parallel() - - resp, err := client.AddChannel(&channels.AddChannelParams{ - Body: channels.AddChannelBody{ - Summary: gofakeit.Quote(), - Disabled: gofakeit.Bool(), - EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ - SendResolved: false, - To: []string{gofakeit.Email()}, - }, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteChannel(t, client, resp.Payload.ChannelID) - - assert.NotEmpty(t, resp.Payload.ChannelID) - }) - - t.Run("invalid request", func(t *testing.T) { - t.Parallel() - - resp, err := client.AddChannel(&channels.AddChannelParams{ - Body: channels.AddChannelBody{ - Summary: gofakeit.Quote(), - Disabled: gofakeit.Bool(), - EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ - SendResolved: false, - }, - }, - Context: pmmapitests.Context, - }) - - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddChannelRequest.EmailConfig: embedded message failed validation | caused by: invalid EmailConfig.To: value must contain at least 1 item(s)") - assert.Nil(t, resp) - }) - - t.Run("missing config", func(t *testing.T) { - t.Parallel() - - resp, err := client.AddChannel(&channels.AddChannelParams{ - Body: channels.AddChannelBody{ - Summary: gofakeit.Quote(), - Disabled: gofakeit.Bool(), - }, - Context: pmmapitests.Context, - }) - - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Missing channel configuration.") - assert.Nil(t, resp) - }) - }) - - t.Run("change", func(t *testing.T) { - t.Parallel() - - t.Run("normal", func(t *testing.T) { - t.Parallel() - - resp1, err := client.AddChannel(&channels.AddChannelParams{ - Body: channels.AddChannelBody{ - Summary: gofakeit.Quote(), - Disabled: false, - EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ - SendResolved: false, - To: []string{gofakeit.Email()}, - }, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteChannel(t, client, resp1.Payload.ChannelID) - - slackChannel := uuid.New().String() - newSummary := uuid.New().String() - _, err = client.ChangeChannel(&channels.ChangeChannelParams{ - Body: channels.ChangeChannelBody{ - ChannelID: resp1.Payload.ChannelID, - Summary: newSummary, - Disabled: true, - SlackConfig: &channels.ChangeChannelParamsBodySlackConfig{ - SendResolved: true, - Channel: slackChannel, - }, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - resp2, err := client.ListChannels(&channels.ListChannelsParams{Context: pmmapitests.Context}) - require.NoError(t, err) - - assert.NotEmpty(t, resp2.Payload.Channels) - var found bool - for _, channel := range resp2.Payload.Channels { - if channel.ChannelID == resp1.Payload.ChannelID { - assert.Equal(t, newSummary, channel.Summary) - assert.True(t, channel.Disabled) - assert.Nil(t, channel.EmailConfig) - assert.Equal(t, slackChannel, channel.SlackConfig.Channel) - assert.True(t, channel.SlackConfig.SendResolved) - found = true - } - } - - assert.True(t, found, "Expected channel not found") - }) - }) - - t.Run("remove", func(t *testing.T) { - t.Parallel() - - t.Run("normal", func(t *testing.T) { - t.Parallel() - - summary := uuid.New().String() - resp1, err := client.AddChannel(&channels.AddChannelParams{ - Body: channels.AddChannelBody{ - Summary: summary, - Disabled: gofakeit.Bool(), - EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ - SendResolved: false, - To: []string{gofakeit.Email()}, - }, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - _, err = client.RemoveChannel(&channels.RemoveChannelParams{ - Body: channels.RemoveChannelBody{ - ChannelID: resp1.Payload.ChannelID, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - resp2, err := client.ListChannels(&channels.ListChannelsParams{Context: pmmapitests.Context}) - require.NoError(t, err) - - for _, channel := range resp2.Payload.Channels { - assert.NotEqual(t, resp1, channel.ChannelID) - } - }) - - t.Run("unknown id", func(t *testing.T) { - t.Parallel() - - resp, err := client.AddChannel(&channels.AddChannelParams{ - Body: channels.AddChannelBody{ - Summary: gofakeit.Quote(), - Disabled: gofakeit.Bool(), - EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ - SendResolved: false, - To: []string{gofakeit.Email()}, - }, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteChannel(t, client, resp.Payload.ChannelID) - - _, err = client.RemoveChannel(&channels.RemoveChannelParams{ - Body: channels.RemoveChannelBody{ - ChannelID: uuid.New().String(), - }, - Context: pmmapitests.Context, - }) - require.Error(t, err) - }) - - t.Run("channel in use", func(t *testing.T) { - t.Parallel() - - templateName := createTemplate(t) - defer deleteTemplate(t, alertingClient.Default.Alerting, templateName) - - channelID, body := createChannel(t) - defer deleteChannel(t, channelsClient.Default.Channels, channelID) - - params := createAlertRuleParams(templateName, "", channelID, nil) - rule, err := channelsClient.Default.Rules.CreateAlertRule(params) - require.NoError(t, err) - defer deleteRule(t, channelsClient.Default.Rules, rule.Payload.RuleID) - - _, err = client.RemoveChannel(&channels.RemoveChannelParams{ - Body: channels.RemoveChannelBody{ - ChannelID: channelID, - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `You can't delete the "%s" channel when it's being used by a rule.`, body.Summary) - - resp, err := client.ListChannels(&channels.ListChannelsParams{ - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - var found bool - for _, channel := range resp.Payload.Channels { - if channelID == channel.ChannelID { - found = true - } - } - assert.Truef(t, found, "Channel with id %s not found", channelID) - }) - }) - - t.Run("list", func(t *testing.T) { - client := channelsClient.Default.Channels - - summary := uuid.New().String() - email := gofakeit.Email() - disabled := gofakeit.Bool() - resp1, err := client.AddChannel(&channels.AddChannelParams{ - Body: channels.AddChannelBody{ - Summary: summary, - Disabled: disabled, - EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ - SendResolved: true, - To: []string{email}, - }, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteChannel(t, client, resp1.Payload.ChannelID) - - t.Run("without pagination", func(t *testing.T) { - resp, err := client.ListChannels(&channels.ListChannelsParams{Context: pmmapitests.Context}) - require.NoError(t, err) - - assert.NotEmpty(t, resp.Payload.Channels) - var found bool - for _, channel := range resp.Payload.Channels { - if channel.ChannelID == resp1.Payload.ChannelID { - assert.Equal(t, summary, channel.Summary) - assert.Equal(t, disabled, channel.Disabled) - assert.Equal(t, []string{email}, channel.EmailConfig.To) - assert.True(t, channel.EmailConfig.SendResolved) - found = true - } - } - assert.True(t, found, "Expected channel not found") - }) - - t.Run("pagination", func(t *testing.T) { - const channelsCount = 5 - - channelIds := make(map[string]struct{}) - - for i := 0; i < channelsCount; i++ { - resp, err := client.AddChannel(&channels.AddChannelParams{ - Body: channels.AddChannelBody{ - Summary: gofakeit.Name(), - EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ - SendResolved: true, - To: []string{email}, - }, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - channelIds[resp.Payload.ChannelID] = struct{}{} - } - defer func() { - for id := range channelIds { - deleteChannel(t, client, id) - } - }() - - // list channels, so they are all on the first page - body := channels.ListChannelsBody{ - PageParams: &channels.ListChannelsParamsBodyPageParams{ - PageSize: 20, - Index: 0, - }, - } - listAllChannels, err := client.ListChannels(&channels.ListChannelsParams{ - Body: body, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - assert.GreaterOrEqual(t, len(listAllChannels.Payload.Channels), channelsCount) - assert.Equal(t, int32(len(listAllChannels.Payload.Channels)), listAllChannels.Payload.Totals.TotalItems) - assert.Equal(t, int32(1), listAllChannels.Payload.Totals.TotalPages) - - assertFindChannel := func(list []*channels.ListChannelsOKBodyChannelsItems0, id string) func() bool { - return func() bool { - for _, channel := range list { - if channel.ChannelID == id { - return true - } - } - return false - } - } - - for name := range channelIds { - assert.Conditionf(t, assertFindChannel(listAllChannels.Payload.Channels, name), "channel %s not found", name) - } - - // paginate page over page with page size 1 and check the order - it should be the same as in listAllTemplates. - // last iteration checks that there is no elements for not existing page. - for pageIndex := 0; pageIndex <= len(listAllChannels.Payload.Channels); pageIndex++ { - body := channels.ListChannelsBody{ - PageParams: &channels.ListChannelsParamsBodyPageParams{ - PageSize: 1, - Index: int32(pageIndex), - }, - } - listOneTemplate, err := client.ListChannels(&channels.ListChannelsParams{ - Body: body, Context: pmmapitests.Context, - }) - require.NoError(t, err) - - assert.Equal(t, listAllChannels.Payload.Totals.TotalItems, listOneTemplate.Payload.Totals.TotalItems) - assert.GreaterOrEqual(t, listOneTemplate.Payload.Totals.TotalPages, int32(channelsCount)) - - if pageIndex != len(listAllChannels.Payload.Channels) { - require.Len(t, listOneTemplate.Payload.Channels, 1) - assert.Equal(t, listAllChannels.Payload.Channels[pageIndex].ChannelID, listOneTemplate.Payload.Channels[0].ChannelID) - } else { - assert.Len(t, listOneTemplate.Payload.Channels, 0) - } - } - }) - }) -} - -func deleteChannel(t *testing.T, client channels.ClientService, id string) { - t.Helper() - _, err := client.RemoveChannel(&channels.RemoveChannelParams{ - Body: channels.RemoveChannelBody{ - ChannelID: id, - }, - Context: pmmapitests.Context, - }) - assert.NoError(t, err) -} diff --git a/api-tests/management/ia/rules_test.go b/api-tests/management/ia/rules_test.go deleted file mode 100644 index 7015c1228e..0000000000 --- a/api-tests/management/ia/rules_test.go +++ /dev/null @@ -1,748 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "fmt" - "os" - "testing" - - "github.com/AlekSi/pointer" - "github.com/brianvoe/gofakeit/v6" - "github.com/google/uuid" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - - pmmapitests "github.com/percona/pmm/api-tests" - alertingClient "github.com/percona/pmm/api/managementpb/alerting/json/client" - "github.com/percona/pmm/api/managementpb/alerting/json/client/alerting" - "github.com/percona/pmm/api/managementpb/ia/json/client" - "github.com/percona/pmm/api/managementpb/ia/json/client/channels" - "github.com/percona/pmm/api/managementpb/ia/json/client/rules" -) - -// Note: Even though the IA services check for alerting enabled or disabled before returning results -// we don't enable or disable IA explicit in our tests since it is enabled by default through -// ENABLE_ALERTING env var. -func TestRulesAPI(t *testing.T) { - t.Parallel() - rulesClient := client.Default.Rules - templatesClient := alertingClient.Default.Alerting - channelsClient := client.Default.Channels - - dummyFilter := &rules.CreateAlertRuleParamsBodyFiltersItems0{ - Type: pointer.ToString("EQUAL"), - Key: "threshold", - Value: "12", - } - - templateName := createTemplate(t) - channelID, _ := createChannel(t) - newChannelID, _ := createChannel(t) - t.Cleanup(func() { - deleteTemplate(t, alertingClient.Default.Alerting, templateName) - deleteChannel(t, channelsClient, channelID) - deleteChannel(t, channelsClient, newChannelID) - }) - - t.Run("add", func(t *testing.T) { - t.Parallel() - - t.Run("normal from template", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(params) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - assert.NotEmpty(t, rule.Payload.RuleID) - }) - - t.Run("without channels and filters", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, "", "", nil) - rule, err := rulesClient.CreateAlertRule(params) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - assert.NotEmpty(t, rule.Payload.RuleID) - }) - - t.Run("builtin_template", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams("pmm_mongodb_restarted", "", channelID, dummyFilter) - params.Body.Params = []*rules.CreateAlertRuleParamsBodyParamsItems0{{ - Name: "threshold", - Type: pointer.ToString("FLOAT"), - Float: 3.14, - }} - rule, err := rulesClient.CreateAlertRule(params) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - assert.NotEmpty(t, rule.Payload.RuleID) - }) - - t.Run("use default value for parameter", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(params) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - assert.NotEmpty(t, rule.Payload.RuleID) - }) - - t.Run("normal from other rule", func(t *testing.T) { - t.Parallel() - - sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) - - copyRuleParams := createAlertRuleParams("", sourceRule.Payload.RuleID, channelID, dummyFilter) - copyRule, err := rulesClient.CreateAlertRule(copyRuleParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, copyRule.Payload.RuleID) - - assert.NotEmpty(t, copyRule.Payload.RuleID) - }) - - t.Run("normal from other rule with deleted template", func(t *testing.T) { - t.Parallel() - - sourceTemplateName := createTemplate(t) - sourceRuleParams := createAlertRuleParams(sourceTemplateName, "", channelID, dummyFilter) - sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) - - deleteTemplate(t, templatesClient, sourceTemplateName) - - copyRuleParams := createAlertRuleParams("", sourceRule.Payload.RuleID, channelID, dummyFilter) - copyRule, err := rulesClient.CreateAlertRule(copyRuleParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, copyRule.Payload.RuleID) - - assert.NotEmpty(t, copyRule.Payload.RuleID) - }) - - t.Run("both template name and source rule id specified", func(t *testing.T) { - t.Parallel() - - sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) - - copyRuleParams := createAlertRuleParams(templateName, sourceRule.Payload.RuleID, channelID, dummyFilter) - _, err = rulesClient.CreateAlertRule(copyRuleParams) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Both template name and source rule id are specified.") - }) - - t.Run("both template name and source rule id are empty", func(t *testing.T) { - t.Parallel() - - sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) - - copyRuleParams := createAlertRuleParams("", "", channelID, dummyFilter) - _, err = rulesClient.CreateAlertRule(copyRuleParams) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Template name or source rule id should be specified.") - }) - - t.Run("unknown template", func(t *testing.T) { - t.Parallel() - - templateName := uuid.New().String() - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - _, err := rulesClient.CreateAlertRule(params) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Unknown template %s.", templateName) - }) - - t.Run("unknown channel", func(t *testing.T) { - t.Parallel() - - channelID := uuid.New().String() - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - _, err := rulesClient.CreateAlertRule(params) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Failed to find all required channels: [%s].", channelID) - }) - - t.Run("wrong parameter", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - params.Body.Params = append( - params.Body.Params, - &rules.CreateAlertRuleParamsBodyParamsItems0{ - Name: "unknown parameter", - Type: pointer.ToString("FLOAT"), - Float: 12, - }) - _, err := rulesClient.CreateAlertRule(params) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 3.") - }) - - t.Run("wrong parameter type", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - params.Body.Params = []*rules.CreateAlertRuleParamsBodyParamsItems0{ - { - Name: "param1", - Type: pointer.ToString("BOOL"), - Bool: true, - }, { - Name: "param2", - Type: pointer.ToString("FLOAT"), - Float: 12, - }, - } - _, err := rulesClient.CreateAlertRule(params) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") - }) - }) - - t.Run("update", func(t *testing.T) { - t.Parallel() - - t.Run("normal", func(t *testing.T) { - t.Parallel() - - cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(cParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - params := &rules.UpdateAlertRuleParams{ - Body: rules.UpdateAlertRuleBody{ - RuleID: rule.Payload.RuleID, - Disabled: false, - Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ - { - Name: "param1", - Type: pointer.ToString("FLOAT"), - Float: 3.14, - }, - { - Name: "param2", - Type: pointer.ToString("FLOAT"), - Float: 21, - }, - }, - For: "10s", - Severity: pointer.ToString("SEVERITY_ERROR"), - CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, - Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ - Type: pointer.ToString("EQUAL"), - Key: "param1", - Value: "21", - }}, - ChannelIds: []string{channelID, newChannelID}, - }, - Context: pmmapitests.Context, - } - _, err = rulesClient.UpdateAlertRule(params) - require.NoError(t, err) - - list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) - require.NoError(t, err) - - var found bool - for _, r := range list.Payload.Rules { - if r.RuleID == rule.Payload.RuleID { - assert.Equal(t, params.Body.Name, r.Name) - assert.Equal(t, "Test summary", r.Summary) - assert.Equal(t, templateName, r.TemplateName) - assert.False(t, r.Disabled) - assert.Equal(t, "300s", r.DefaultFor) - assert.Equal(t, "10s", r.For) - assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.DefaultSeverity)) - assert.Equal(t, params.Body.Severity, r.Severity) - assert.Equal(t, params.Body.CustomLabels, r.CustomLabels) - assert.Equal(t, map[string]string{"foo": "bar"}, r.Labels) - assert.Equal(t, map[string]string{"description": "test description", "summary": "test summary"}, r.Annotations) - assert.Len(t, r.ParamsValues, 2) - assert.Equal(t, params.Body.Params[0].Type, r.ParamsValues[0].Type) - assert.Equal(t, params.Body.Params[0].Name, r.ParamsValues[0].Name) - assert.Equal(t, params.Body.Params[0].Float, r.ParamsValues[0].Float) - assert.Equal(t, params.Body.Params[0].Bool, r.ParamsValues[0].Bool) - assert.Equal(t, params.Body.Params[0].String, r.ParamsValues[0].String) - assert.Equal(t, params.Body.Params[1].Type, r.ParamsValues[1].Type) - assert.Equal(t, params.Body.Params[1].Name, r.ParamsValues[1].Name) - assert.Equal(t, params.Body.Params[1].Float, r.ParamsValues[1].Float) - assert.Equal(t, params.Body.Params[1].Bool, r.ParamsValues[1].Bool) - assert.Equal(t, params.Body.Params[1].String, r.ParamsValues[1].String) - assert.Equal(t, "[[ .param1 ]] > 2 and 2 < [[ .param2 ]]", r.ExprTemplate) - assert.Equal(t, "3.14 > 2 and 2 < 21", r.Expr) - found = true - } - } - assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) - }) - - t.Run("unknown channel", func(t *testing.T) { - t.Parallel() - - cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(cParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - unknownChannelID := uuid.New().String() - params := &rules.UpdateAlertRuleParams{ - Body: rules.UpdateAlertRuleBody{ - RuleID: rule.Payload.RuleID, - Disabled: false, - Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ - { - Name: "param1", - Type: pointer.ToString("FLOAT"), - Float: 3.14, - }, { - Name: "param2", - Type: pointer.ToString("FLOAT"), - Float: 21, - }, - }, - For: "10s", - Severity: pointer.ToString("SEVERITY_ERROR"), - CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, - Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ - Type: pointer.ToString("EQUAL"), - Key: "param1", - Value: "21", - }}, - ChannelIds: []string{channelID, unknownChannelID}, - }, - Context: pmmapitests.Context, - } - _, err = rulesClient.UpdateAlertRule(params) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Failed to find all required channels: [%s].", unknownChannelID) - }) - - t.Run("wrong parameter", func(t *testing.T) { - t.Parallel() - - cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(cParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - params := &rules.UpdateAlertRuleParams{ - Body: rules.UpdateAlertRuleBody{ - RuleID: rule.Payload.RuleID, - Disabled: false, - Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{{ - Name: "param2", - Type: pointer.ToString("FLOAT"), - Float: 12, - }, { - Name: "unknown parameter", - Type: pointer.ToString("FLOAT"), - Float: 21, - }}, - For: "10s", - Severity: pointer.ToString("SEVERITY_ERROR"), - CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, - Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ - Type: pointer.ToString("EQUAL"), - Key: "param1", - Value: "21", - }}, - ChannelIds: []string{channelID, newChannelID}, - }, - Context: pmmapitests.Context, - } - _, err = rulesClient.UpdateAlertRule(params) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 is missing.") - }) - - t.Run("missing parameters", func(t *testing.T) { - t.Parallel() - - cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(cParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - params := &rules.UpdateAlertRuleParams{ - Body: rules.UpdateAlertRuleBody{ - RuleID: rule.Payload.RuleID, - Disabled: false, - Params: nil, - For: "10s", - Severity: pointer.ToString("SEVERITY_ERROR"), - CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, - Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ - Type: pointer.ToString("EQUAL"), - Key: "param1", - Value: "21", - }}, - ChannelIds: []string{channelID, newChannelID}, - }, - Context: pmmapitests.Context, - } - _, err = rulesClient.UpdateAlertRule(params) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 0.") - }) - - t.Run("wrong parameter type", func(t *testing.T) { - t.Parallel() - - cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(cParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - params := &rules.UpdateAlertRuleParams{ - Body: rules.UpdateAlertRuleBody{ - RuleID: rule.Payload.RuleID, - Disabled: false, - Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ - { - Name: "param1", - Type: pointer.ToString("BOOL"), - Bool: true, - }, { - Name: "param2", - Type: pointer.ToString("FLOAT"), - Float: 3.14, - }, - }, - For: "10s", - Severity: pointer.ToString("SEVERITY_ERROR"), - CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, - Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ - Type: pointer.ToString("EQUAL"), - Key: "param1", - Value: "21", - }}, - ChannelIds: []string{channelID, newChannelID}, - }, - Context: pmmapitests.Context, - } - _, err = rulesClient.UpdateAlertRule(params) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") - }) - }) - - t.Run("toggle", func(t *testing.T) { - t.Parallel() - - cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(cParams) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) - require.NoError(t, err) - - var found bool - for _, r := range list.Payload.Rules { - if r.RuleID == rule.Payload.RuleID { - assert.True(t, r.Disabled) - assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.Severity)) - found = true - } - } - assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) - - _, err = rulesClient.ToggleAlertRule(&rules.ToggleAlertRuleParams{ - Body: rules.ToggleAlertRuleBody{ - RuleID: rule.Payload.RuleID, - Disabled: pointer.ToString(rules.ToggleAlertRuleBodyDisabledFALSE), - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - list, err = rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) - require.NoError(t, err) - - found = false - for _, r := range list.Payload.Rules { - if r.RuleID == rule.Payload.RuleID { - assert.False(t, r.Disabled) - assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.Severity)) - found = true - } - } - assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) - }) - - t.Run("delete", func(t *testing.T) { - t.Parallel() - - t.Run("normal", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(params) - require.NoError(t, err) - - _, err = rulesClient.DeleteAlertRule(&rules.DeleteAlertRuleParams{ - Body: rules.DeleteAlertRuleBody{RuleID: rule.Payload.RuleID}, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) - require.NoError(t, err) - - for _, r := range list.Payload.Rules { - assert.NotEqual(t, rule.Payload.RuleID, r.RuleID) - } - }) - - t.Run("missing rule", func(t *testing.T) { - t.Parallel() - ruleID := uuid.New().String() - _, err := rulesClient.DeleteAlertRule(&rules.DeleteAlertRuleParams{ - Body: rules.DeleteAlertRuleBody{RuleID: ruleID}, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Rule with ID %q not found.", ruleID) - }) - }) - - t.Run("list without pagination", func(t *testing.T) { - t.Run("without pagination", func(t *testing.T) { - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(params) - require.NoError(t, err) - defer deleteRule(t, rulesClient, rule.Payload.RuleID) - - list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) - require.NoError(t, err) - - var found bool - for _, r := range list.Payload.Rules { - if r.RuleID == rule.Payload.RuleID { - assert.Equal(t, params.Body.TemplateName, r.TemplateName) - assert.Equal(t, "Test summary", r.Summary) - assert.True(t, r.Disabled) - assert.Equal(t, params.Body.Name, r.Name) - assert.Len(t, r.ParamsValues, 2) - assert.Equal(t, params.Body.Params[0].Type, r.ParamsValues[0].Type) - assert.Equal(t, params.Body.Params[0].Name, r.ParamsValues[0].Name) - assert.Equal(t, params.Body.Params[0].Float, r.ParamsValues[0].Float) - assert.Equal(t, params.Body.Params[0].Bool, r.ParamsValues[0].Bool) - assert.Equal(t, params.Body.Params[0].String, r.ParamsValues[0].String) - assert.Equal(t, params.Body.Params[1].Type, r.ParamsValues[1].Type) - assert.Equal(t, params.Body.Params[1].Name, r.ParamsValues[1].Name) - assert.Equal(t, params.Body.Params[1].Float, r.ParamsValues[1].Float) - assert.Equal(t, params.Body.Params[1].Bool, r.ParamsValues[1].Bool) - assert.Equal(t, params.Body.Params[1].String, r.ParamsValues[1].String) - assert.Equal(t, "300s", r.DefaultFor) - assert.Equal(t, params.Body.For, r.For) - assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.DefaultSeverity)) - assert.Equal(t, params.Body.Severity, r.Severity) - assert.Equal(t, params.Body.CustomLabels, r.CustomLabels) - assert.Equal(t, map[string]string{"foo": "bar"}, r.Labels) - assert.Equal(t, map[string]string{"description": "test description", "summary": "test summary"}, r.Annotations) - assert.Len(t, params.Body.Filters, 1) - assert.Equal(t, params.Body.Filters[0].Type, r.Filters[0].Type) - assert.Equal(t, params.Body.Filters[0].Key, r.Filters[0].Key) - assert.Equal(t, params.Body.Filters[0].Value, r.Filters[0].Value) - assert.Len(t, r.Channels, 1) - assert.Equal(t, r.Channels[0].ChannelID, channelID) - assert.Equal(t, "[[ .param1 ]] > 2 and 2 < [[ .param2 ]]", r.ExprTemplate) - assert.Equal(t, "4 > 2 and 2 < 12", r.Expr) - found = true - } - } - assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) - }) - - t.Run("with pagination", func(t *testing.T) { - const rulesCount = 5 - - ruleIDs := make(map[string]struct{}) - - for i := 0; i < rulesCount; i++ { - params := createAlertRuleParams(templateName, "", channelID, dummyFilter) - rule, err := rulesClient.CreateAlertRule(params) - require.NoError(t, err) - - ruleIDs[rule.Payload.RuleID] = struct{}{} - } - defer func() { - for id := range ruleIDs { - deleteRule(t, rulesClient, id) - } - }() - - // list rules, so they are all on the first page - body := rules.ListAlertRulesBody{ - PageParams: &rules.ListAlertRulesParamsBodyPageParams{ - PageSize: 20, - Index: 0, - }, - } - list1, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Body: body, Context: pmmapitests.Context}) - require.NoError(t, err) - - lp1 := list1.Payload - // some tests didn't remove rules, so expect more elements than created in current test - assert.GreaterOrEqual(t, len(lp1.Rules), rulesCount) - assert.Equal(t, int32(len(lp1.Rules)), lp1.Totals.TotalItems) - assert.Equal(t, int32(1), lp1.Totals.TotalPages) - for id := range ruleIDs { - var found bool - for _, r := range list1.Payload.Rules { - if r.RuleID == id { - found = true - - break - } - } - - assert.Truef(t, found, "rule (%s) not found", id) - } - - // paginate page over page with page size 1 and check the order - it should be the same as in list1. - // last iteration checks that there is no elements for not existing page. - for pageIndex := 0; pageIndex <= len(lp1.Rules); pageIndex++ { - body := rules.ListAlertRulesBody{ - PageParams: &rules.ListAlertRulesParamsBodyPageParams{ - PageSize: 1, - Index: int32(pageIndex), - }, - } - list2, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Body: body, Context: pmmapitests.Context}) - require.NoError(t, err) - - lp2 := list2.Payload - assert.Equal(t, lp1.Totals.TotalItems, lp2.Totals.TotalItems) - assert.GreaterOrEqual(t, lp2.Totals.TotalPages, int32(rulesCount)) - - if pageIndex != len(lp1.Rules) { - require.Len(t, lp2.Rules, 1) - assert.Equal(t, lp1.Rules[pageIndex].RuleID, lp2.Rules[0].RuleID) - } else { - assert.Len(t, lp2.Rules, 0) - } - } - }) - }) -} - -func deleteRule(t *testing.T, client rules.ClientService, id string) { - t.Helper() - - _, err := client.DeleteAlertRule(&rules.DeleteAlertRuleParams{ - Body: rules.DeleteAlertRuleBody{RuleID: id}, - Context: pmmapitests.Context, - }) - require.NoError(t, err) -} - -func createAlertRuleParams(templateName, sourceRuleID, channelID string, filter *rules.CreateAlertRuleParamsBodyFiltersItems0) *rules.CreateAlertRuleParams { - rule := &rules.CreateAlertRuleParams{ - Body: rules.CreateAlertRuleBody{ - TemplateName: templateName, - SourceRuleID: sourceRuleID, - Disabled: true, - Name: "example rule", - Params: []*rules.CreateAlertRuleParamsBodyParamsItems0{ - { - Name: "param1", - Type: pointer.ToString("FLOAT"), - Float: 4, - }, - { - Name: "param2", - Type: pointer.ToString("FLOAT"), - Float: 12, - }, - }, - For: "5s", - Severity: pointer.ToString("SEVERITY_WARNING"), - CustomLabels: map[string]string{"foo": "bar"}, - }, - Context: pmmapitests.Context, - } - - if channelID != "" { - rule.Body.ChannelIds = []string{channelID} - } - - if filter != nil { - rule.Body.Filters = []*rules.CreateAlertRuleParamsBodyFiltersItems0{filter} - } - - return rule -} - -func createTemplate(t *testing.T) string { - t.Helper() - - b, err := os.ReadFile("../../testdata/ia/template.yaml") - require.NoError(t, err) - - templateName := uuid.New().String() - expression := "'[[ .param1 ]] > 2 and 2 < [[ .param2 ]]'" - _, err = alertingClient.Default.Alerting.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(b), templateName, expression, "%", "s"), - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - return templateName -} - -func createChannel(t *testing.T) (string, channels.AddChannelBody) { - t.Helper() - - body := channels.AddChannelBody{ - Summary: gofakeit.Quote(), - Disabled: gofakeit.Bool(), - EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ - SendResolved: false, - To: []string{gofakeit.Email()}, - }, - } - resp, err := client.Default.Channels.AddChannel(&channels.AddChannelParams{ - Body: body, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - return resp.Payload.ChannelID, body -} - -func deleteTemplate(t *testing.T, client alerting.ClientService, name string) { - t.Helper() - - _, err := client.DeleteTemplate(&alerting.DeleteTemplateParams{ - Body: alerting.DeleteTemplateBody{ - Name: name, - }, - Context: pmmapitests.Context, - }) - assert.NoError(t, err) -} diff --git a/api/managementpb/ia/alerts.pb.go b/api/managementpb/ia/alerts.pb.go deleted file mode 100644 index cf7470df9d..0000000000 --- a/api/managementpb/ia/alerts.pb.go +++ /dev/null @@ -1,591 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc (unknown) -// source: managementpb/ia/alerts.proto - -package iav1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - managementpb "github.com/percona/pmm/api/managementpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Alert represents Alert. -// -// Deprecated: Marked as deprecated in managementpb/ia/alerts.proto. -type Alert struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID. - AlertId string `protobuf:"bytes,1,opt,name=alert_id,json=alertId,proto3" json:"alert_id,omitempty"` - // Human-readable summary. - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - // Severity. - Severity managementpb.Severity `protobuf:"varint,3,opt,name=severity,proto3,enum=management.Severity" json:"severity,omitempty"` - // Status. - Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=ia.v1beta1.Status" json:"status,omitempty"` - // Combined labels. - Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // The current Alert Rule. - Rule *Rule `protobuf:"bytes,6,opt,name=rule,proto3" json:"rule,omitempty"` - // Alert creation time. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // Alert last update time. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` -} - -func (x *Alert) Reset() { - *x = Alert{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_alerts_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Alert) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Alert) ProtoMessage() {} - -func (x *Alert) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_alerts_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Alert.ProtoReflect.Descriptor instead. -func (*Alert) Descriptor() ([]byte, []int) { - return file_managementpb_ia_alerts_proto_rawDescGZIP(), []int{0} -} - -func (x *Alert) GetAlertId() string { - if x != nil { - return x.AlertId - } - return "" -} - -func (x *Alert) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *Alert) GetSeverity() managementpb.Severity { - if x != nil { - return x.Severity - } - return managementpb.Severity(0) -} - -func (x *Alert) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_INVALID -} - -func (x *Alert) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *Alert) GetRule() *Rule { - if x != nil { - return x.Rule - } - return nil -} - -func (x *Alert) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Alert) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/alerts.proto. -type ListAlertsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Page request. - PageParams *managementpb.PageParams `protobuf:"bytes,1,opt,name=page_params,json=pageParams,proto3" json:"page_params,omitempty"` -} - -func (x *ListAlertsRequest) Reset() { - *x = ListAlertsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_alerts_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAlertsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAlertsRequest) ProtoMessage() {} - -func (x *ListAlertsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_alerts_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAlertsRequest.ProtoReflect.Descriptor instead. -func (*ListAlertsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_alerts_proto_rawDescGZIP(), []int{1} -} - -func (x *ListAlertsRequest) GetPageParams() *managementpb.PageParams { - if x != nil { - return x.PageParams - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/alerts.proto. -type ListAlertsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Alerts []*Alert `protobuf:"bytes,1,rep,name=alerts,proto3" json:"alerts,omitempty"` - // Total items and pages. - Totals *managementpb.PageTotals `protobuf:"bytes,2,opt,name=totals,proto3" json:"totals,omitempty"` -} - -func (x *ListAlertsResponse) Reset() { - *x = ListAlertsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_alerts_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAlertsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAlertsResponse) ProtoMessage() {} - -func (x *ListAlertsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_alerts_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAlertsResponse.ProtoReflect.Descriptor instead. -func (*ListAlertsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_alerts_proto_rawDescGZIP(), []int{2} -} - -func (x *ListAlertsResponse) GetAlerts() []*Alert { - if x != nil { - return x.Alerts - } - return nil -} - -func (x *ListAlertsResponse) GetTotals() *managementpb.PageTotals { - if x != nil { - return x.Totals - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/alerts.proto. -type ToggleAlertsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of alerts that silence state should be switched. If provided array is empty than all - // existing alerts are switched. - AlertIds []string `protobuf:"bytes,1,rep,name=alert_ids,json=alertIds,proto3" json:"alert_ids,omitempty"` - // Silences or unsilences alert if set. - Silenced managementpb.BooleanFlag `protobuf:"varint,2,opt,name=silenced,proto3,enum=managementpb.BooleanFlag" json:"silenced,omitempty"` -} - -func (x *ToggleAlertsRequest) Reset() { - *x = ToggleAlertsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_alerts_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ToggleAlertsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ToggleAlertsRequest) ProtoMessage() {} - -func (x *ToggleAlertsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_alerts_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ToggleAlertsRequest.ProtoReflect.Descriptor instead. -func (*ToggleAlertsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_alerts_proto_rawDescGZIP(), []int{3} -} - -func (x *ToggleAlertsRequest) GetAlertIds() []string { - if x != nil { - return x.AlertIds - } - return nil -} - -func (x *ToggleAlertsRequest) GetSilenced() managementpb.BooleanFlag { - if x != nil { - return x.Silenced - } - return managementpb.BooleanFlag(0) -} - -// Deprecated: Marked as deprecated in managementpb/ia/alerts.proto. -type ToggleAlertsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ToggleAlertsResponse) Reset() { - *x = ToggleAlertsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_alerts_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ToggleAlertsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ToggleAlertsResponse) ProtoMessage() {} - -func (x *ToggleAlertsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_alerts_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ToggleAlertsResponse.ProtoReflect.Descriptor instead. -func (*ToggleAlertsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_alerts_proto_rawDescGZIP(), []int{4} -} - -var File_managementpb_ia_alerts_proto protoreflect.FileDescriptor - -var file_managementpb_ia_alerts_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, - 0x61, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, - 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, - 0x66, 0x6c, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, 0x61, 0x2f, 0x72, 0x75, 0x6c, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, 0x61, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x70, 0x62, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x70, 0x62, 0x2f, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xac, 0x03, 0x0a, 0x05, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, - 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x6c, 0x65, 0x72, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x12, 0x30, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, - 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, - 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, - 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x02, 0x18, 0x01, - 0x22, 0x50, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x02, - 0x18, 0x01, 0x22, 0x73, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x06, 0x61, 0x6c, 0x65, - 0x72, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x06, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x52, 0x06, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x6d, 0x0a, 0x13, 0x54, 0x6f, 0x67, 0x67, 0x6c, - 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, - 0x0a, 0x09, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x08, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x49, 0x64, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x73, - 0x69, 0x6c, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f, - 0x6c, 0x65, 0x61, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x08, 0x73, 0x69, 0x6c, 0x65, 0x6e, 0x63, - 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x1a, 0x0a, 0x14, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, 0x02, - 0x18, 0x01, 0x32, 0xce, 0x02, 0x0a, 0x06, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x12, 0x7d, 0x0a, - 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x69, 0x61, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x69, 0x61, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x92, 0x41, 0x02, 0x58, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x69, 0x61, 0x2f, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x88, 0x02, 0x01, 0x12, 0xc4, 0x01, 0x0a, - 0x0c, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x12, 0x1f, 0x2e, - 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, - 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, - 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x67, 0x67, - 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x71, 0x92, 0x41, 0x41, 0x1a, 0x3d, 0x50, 0x61, 0x73, 0x73, 0x20, 0x65, 0x6d, 0x70, 0x74, - 0x79, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, - 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, - 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6c, - 0x65, 0x72, 0x74, 0x73, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, - 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x69, 0x61, 0x2f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x2f, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, - 0x88, 0x02, 0x01, 0x42, 0x9c, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x61, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, - 0x61, 0x3b, 0x69, 0x61, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, - 0x58, 0xaa, 0x02, 0x0a, 0x49, 0x61, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, - 0x0a, 0x49, 0x61, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x16, 0x49, 0x61, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x49, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_ia_alerts_proto_rawDescOnce sync.Once - file_managementpb_ia_alerts_proto_rawDescData = file_managementpb_ia_alerts_proto_rawDesc -) - -func file_managementpb_ia_alerts_proto_rawDescGZIP() []byte { - file_managementpb_ia_alerts_proto_rawDescOnce.Do(func() { - file_managementpb_ia_alerts_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_ia_alerts_proto_rawDescData) - }) - return file_managementpb_ia_alerts_proto_rawDescData -} - -var ( - file_managementpb_ia_alerts_proto_msgTypes = make([]protoimpl.MessageInfo, 6) - file_managementpb_ia_alerts_proto_goTypes = []interface{}{ - (*Alert)(nil), // 0: ia.v1beta1.Alert - (*ListAlertsRequest)(nil), // 1: ia.v1beta1.ListAlertsRequest - (*ListAlertsResponse)(nil), // 2: ia.v1beta1.ListAlertsResponse - (*ToggleAlertsRequest)(nil), // 3: ia.v1beta1.ToggleAlertsRequest - (*ToggleAlertsResponse)(nil), // 4: ia.v1beta1.ToggleAlertsResponse - nil, // 5: ia.v1beta1.Alert.LabelsEntry - (managementpb.Severity)(0), // 6: management.Severity - (Status)(0), // 7: ia.v1beta1.Status - (*Rule)(nil), // 8: ia.v1beta1.Rule - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp - (*managementpb.PageParams)(nil), // 10: management.PageParams - (*managementpb.PageTotals)(nil), // 11: management.PageTotals - (managementpb.BooleanFlag)(0), // 12: managementpb.BooleanFlag - } -) - -var file_managementpb_ia_alerts_proto_depIdxs = []int32{ - 6, // 0: ia.v1beta1.Alert.severity:type_name -> management.Severity - 7, // 1: ia.v1beta1.Alert.status:type_name -> ia.v1beta1.Status - 5, // 2: ia.v1beta1.Alert.labels:type_name -> ia.v1beta1.Alert.LabelsEntry - 8, // 3: ia.v1beta1.Alert.rule:type_name -> ia.v1beta1.Rule - 9, // 4: ia.v1beta1.Alert.created_at:type_name -> google.protobuf.Timestamp - 9, // 5: ia.v1beta1.Alert.updated_at:type_name -> google.protobuf.Timestamp - 10, // 6: ia.v1beta1.ListAlertsRequest.page_params:type_name -> management.PageParams - 0, // 7: ia.v1beta1.ListAlertsResponse.alerts:type_name -> ia.v1beta1.Alert - 11, // 8: ia.v1beta1.ListAlertsResponse.totals:type_name -> management.PageTotals - 12, // 9: ia.v1beta1.ToggleAlertsRequest.silenced:type_name -> managementpb.BooleanFlag - 1, // 10: ia.v1beta1.Alerts.ListAlerts:input_type -> ia.v1beta1.ListAlertsRequest - 3, // 11: ia.v1beta1.Alerts.ToggleAlerts:input_type -> ia.v1beta1.ToggleAlertsRequest - 2, // 12: ia.v1beta1.Alerts.ListAlerts:output_type -> ia.v1beta1.ListAlertsResponse - 4, // 13: ia.v1beta1.Alerts.ToggleAlerts:output_type -> ia.v1beta1.ToggleAlertsResponse - 12, // [12:14] is the sub-list for method output_type - 10, // [10:12] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name -} - -func init() { file_managementpb_ia_alerts_proto_init() } -func file_managementpb_ia_alerts_proto_init() { - if File_managementpb_ia_alerts_proto != nil { - return - } - file_managementpb_ia_rules_proto_init() - file_managementpb_ia_status_proto_init() - if !protoimpl.UnsafeEnabled { - file_managementpb_ia_alerts_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Alert); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_alerts_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAlertsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_alerts_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAlertsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_alerts_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ToggleAlertsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_alerts_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ToggleAlertsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_ia_alerts_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_ia_alerts_proto_goTypes, - DependencyIndexes: file_managementpb_ia_alerts_proto_depIdxs, - MessageInfos: file_managementpb_ia_alerts_proto_msgTypes, - }.Build() - File_managementpb_ia_alerts_proto = out.File - file_managementpb_ia_alerts_proto_rawDesc = nil - file_managementpb_ia_alerts_proto_goTypes = nil - file_managementpb_ia_alerts_proto_depIdxs = nil -} diff --git a/api/managementpb/ia/alerts.pb.gw.go b/api/managementpb/ia/alerts.pb.gw.go deleted file mode 100644 index 00ed66298e..0000000000 --- a/api/managementpb/ia/alerts.pb.gw.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/ia/alerts.proto - -/* -Package iav1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package iav1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_Alerts_ListAlerts_0(ctx context.Context, marshaler runtime.Marshaler, client AlertsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAlertsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListAlerts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Alerts_ListAlerts_0(ctx context.Context, marshaler runtime.Marshaler, server AlertsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAlertsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListAlerts(ctx, &protoReq) - return msg, metadata, err -} - -func request_Alerts_ToggleAlerts_0(ctx context.Context, marshaler runtime.Marshaler, client AlertsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ToggleAlertsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ToggleAlerts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Alerts_ToggleAlerts_0(ctx context.Context, marshaler runtime.Marshaler, server AlertsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ToggleAlertsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ToggleAlerts(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterAlertsHandlerServer registers the http handlers for service Alerts to "mux". -// UnaryRPC :call AlertsServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAlertsHandlerFromEndpoint instead. -func RegisterAlertsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AlertsServer) error { - mux.Handle("POST", pattern_Alerts_ListAlerts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Alerts/ListAlerts", runtime.WithHTTPPathPattern("/v1/management/ia/Alerts/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Alerts_ListAlerts_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Alerts_ListAlerts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Alerts_ToggleAlerts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Alerts/ToggleAlerts", runtime.WithHTTPPathPattern("/v1/management/ia/Alerts/Toggle")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Alerts_ToggleAlerts_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Alerts_ToggleAlerts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterAlertsHandlerFromEndpoint is same as RegisterAlertsHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAlertsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterAlertsHandler(ctx, mux, conn) -} - -// RegisterAlertsHandler registers the http handlers for service Alerts to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAlertsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAlertsHandlerClient(ctx, mux, NewAlertsClient(conn)) -} - -// RegisterAlertsHandlerClient registers the http handlers for service Alerts -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AlertsClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AlertsClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AlertsClient" to call the correct interceptors. -func RegisterAlertsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AlertsClient) error { - mux.Handle("POST", pattern_Alerts_ListAlerts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Alerts/ListAlerts", runtime.WithHTTPPathPattern("/v1/management/ia/Alerts/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Alerts_ListAlerts_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Alerts_ListAlerts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Alerts_ToggleAlerts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Alerts/ToggleAlerts", runtime.WithHTTPPathPattern("/v1/management/ia/Alerts/Toggle")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Alerts_ToggleAlerts_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Alerts_ToggleAlerts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var ( - pattern_Alerts_ListAlerts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Alerts", "List"}, "")) - - pattern_Alerts_ToggleAlerts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Alerts", "Toggle"}, "")) -) - -var ( - forward_Alerts_ListAlerts_0 = runtime.ForwardResponseMessage - - forward_Alerts_ToggleAlerts_0 = runtime.ForwardResponseMessage -) diff --git a/api/managementpb/ia/alerts.pb.validate.go b/api/managementpb/ia/alerts.pb.validate.go deleted file mode 100644 index 82f050f980..0000000000 --- a/api/managementpb/ia/alerts.pb.validate.go +++ /dev/null @@ -1,737 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/ia/alerts.proto - -package iav1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - managementpb "github.com/percona/pmm/api/managementpb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = managementpb.Severity(0) -) - -// Validate checks the field values on Alert with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Alert) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Alert with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in AlertMultiError, or nil if none found. -func (m *Alert) ValidateAll() error { - return m.validate(true) -} - -func (m *Alert) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AlertId - - // no validation rules for Summary - - // no validation rules for Severity - - // no validation rules for Status - - // no validation rules for Labels - - if all { - switch v := interface{}(m.GetRule()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AlertValidationError{ - field: "Rule", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AlertValidationError{ - field: "Rule", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRule()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AlertValidationError{ - field: "Rule", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AlertValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AlertValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AlertValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetUpdatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AlertValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AlertValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AlertValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return AlertMultiError(errors) - } - - return nil -} - -// AlertMultiError is an error wrapping multiple validation errors returned by -// Alert.ValidateAll() if the designated constraints aren't met. -type AlertMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AlertMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m AlertMultiError) AllErrors() []error { return m } - -// AlertValidationError is the validation error returned by Alert.Validate if -// the designated constraints aren't met. -type AlertValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AlertValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AlertValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AlertValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AlertValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AlertValidationError) ErrorName() string { return "AlertValidationError" } - -// Error satisfies the builtin error interface -func (e AlertValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sAlert.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AlertValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AlertValidationError{} - -// Validate checks the field values on ListAlertsRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *ListAlertsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAlertsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListAlertsRequestMultiError, or nil if none found. -func (m *ListAlertsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAlertsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPageParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAlertsRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAlertsRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPageParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAlertsRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ListAlertsRequestMultiError(errors) - } - - return nil -} - -// ListAlertsRequestMultiError is an error wrapping multiple validation errors -// returned by ListAlertsRequest.ValidateAll() if the designated constraints -// aren't met. -type ListAlertsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAlertsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListAlertsRequestMultiError) AllErrors() []error { return m } - -// ListAlertsRequestValidationError is the validation error returned by -// ListAlertsRequest.Validate if the designated constraints aren't met. -type ListAlertsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAlertsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAlertsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAlertsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAlertsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAlertsRequestValidationError) ErrorName() string { - return "ListAlertsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAlertsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListAlertsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAlertsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAlertsRequestValidationError{} - -// Validate checks the field values on ListAlertsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListAlertsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAlertsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListAlertsResponseMultiError, or nil if none found. -func (m *ListAlertsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAlertsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetAlerts() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAlertsResponseValidationError{ - field: fmt.Sprintf("Alerts[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAlertsResponseValidationError{ - field: fmt.Sprintf("Alerts[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAlertsResponseValidationError{ - field: fmt.Sprintf("Alerts[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetTotals()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAlertsResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAlertsResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTotals()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAlertsResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ListAlertsResponseMultiError(errors) - } - - return nil -} - -// ListAlertsResponseMultiError is an error wrapping multiple validation errors -// returned by ListAlertsResponse.ValidateAll() if the designated constraints -// aren't met. -type ListAlertsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAlertsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListAlertsResponseMultiError) AllErrors() []error { return m } - -// ListAlertsResponseValidationError is the validation error returned by -// ListAlertsResponse.Validate if the designated constraints aren't met. -type ListAlertsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAlertsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAlertsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAlertsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAlertsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAlertsResponseValidationError) ErrorName() string { - return "ListAlertsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAlertsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListAlertsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAlertsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAlertsResponseValidationError{} - -// Validate checks the field values on ToggleAlertsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ToggleAlertsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ToggleAlertsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ToggleAlertsRequestMultiError, or nil if none found. -func (m *ToggleAlertsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ToggleAlertsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Silenced - - if len(errors) > 0 { - return ToggleAlertsRequestMultiError(errors) - } - - return nil -} - -// ToggleAlertsRequestMultiError is an error wrapping multiple validation -// errors returned by ToggleAlertsRequest.ValidateAll() if the designated -// constraints aren't met. -type ToggleAlertsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ToggleAlertsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ToggleAlertsRequestMultiError) AllErrors() []error { return m } - -// ToggleAlertsRequestValidationError is the validation error returned by -// ToggleAlertsRequest.Validate if the designated constraints aren't met. -type ToggleAlertsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ToggleAlertsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ToggleAlertsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ToggleAlertsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ToggleAlertsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ToggleAlertsRequestValidationError) ErrorName() string { - return "ToggleAlertsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ToggleAlertsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sToggleAlertsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ToggleAlertsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ToggleAlertsRequestValidationError{} - -// Validate checks the field values on ToggleAlertsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ToggleAlertsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ToggleAlertsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ToggleAlertsResponseMultiError, or nil if none found. -func (m *ToggleAlertsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ToggleAlertsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ToggleAlertsResponseMultiError(errors) - } - - return nil -} - -// ToggleAlertsResponseMultiError is an error wrapping multiple validation -// errors returned by ToggleAlertsResponse.ValidateAll() if the designated -// constraints aren't met. -type ToggleAlertsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ToggleAlertsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ToggleAlertsResponseMultiError) AllErrors() []error { return m } - -// ToggleAlertsResponseValidationError is the validation error returned by -// ToggleAlertsResponse.Validate if the designated constraints aren't met. -type ToggleAlertsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ToggleAlertsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ToggleAlertsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ToggleAlertsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ToggleAlertsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ToggleAlertsResponseValidationError) ErrorName() string { - return "ToggleAlertsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ToggleAlertsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sToggleAlertsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ToggleAlertsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ToggleAlertsResponseValidationError{} diff --git a/api/managementpb/ia/alerts.proto b/api/managementpb/ia/alerts.proto deleted file mode 100644 index f3383125e8..0000000000 --- a/api/managementpb/ia/alerts.proto +++ /dev/null @@ -1,86 +0,0 @@ -syntax = "proto3"; - -package ia.v1beta1; - -import "google/api/annotations.proto"; -import "google/protobuf/timestamp.proto"; -import "managementpb/boolean_flag.proto"; -import "managementpb/ia/rules.proto"; -import "managementpb/ia/status.proto"; -import "managementpb/pagination.proto"; -import "managementpb/severity.proto"; -import "protoc-gen-openapiv2/options/annotations.proto"; - -option go_package = "api/managementpb/ia;iav1beta1"; - -// Alert represents Alert. -message Alert { - option deprecated = true; - // ID. - string alert_id = 1; - // Human-readable summary. - string summary = 2; - // Severity. - management.Severity severity = 3; - // Status. - Status status = 4; - // Combined labels. - map labels = 5; - // The current Alert Rule. - Rule rule = 6; - // Alert creation time. - google.protobuf.Timestamp created_at = 7; - // Alert last update time. - google.protobuf.Timestamp updated_at = 8; -} - -message ListAlertsRequest { - option deprecated = true; - // Page request. - management.PageParams page_params = 1; -} - -message ListAlertsResponse { - option deprecated = true; - repeated Alert alerts = 1; - // Total items and pages. - management.PageTotals totals = 2; -} - -message ToggleAlertsRequest { - option deprecated = true; - // List of alerts that silence state should be switched. If provided array is empty than all - // existing alerts are switched. - repeated string alert_ids = 1; - // Silences or unsilences alert if set. - managementpb.BooleanFlag silenced = 2; -} - -message ToggleAlertsResponse { - option deprecated = true; -} - -// Alerts service provides public methods for managing Alerting Alerts. -service Alerts { - // ListAlerts returns a list of all Alerts. - rpc ListAlerts(ListAlertsRequest) returns (ListAlertsResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Alerts/List" - body: "*" - }; - } - // ToggleAlerts allows to switch alerts state between silenced and unsilenced. - rpc ToggleAlerts(ToggleAlertsRequest) returns (ToggleAlertsResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - deprecated: true - description: "Pass empty list to apply toggle action to all existing alerts" - }; - option (google.api.http) = { - post: "/v1/management/ia/Alerts/Toggle" - body: "*" - }; - } -} diff --git a/api/managementpb/ia/alerts_grpc.pb.go b/api/managementpb/ia/alerts_grpc.pb.go deleted file mode 100644 index 33c9513f7a..0000000000 --- a/api/managementpb/ia/alerts_grpc.pb.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/ia/alerts.proto - -package iav1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Alerts_ListAlerts_FullMethodName = "/ia.v1beta1.Alerts/ListAlerts" - Alerts_ToggleAlerts_FullMethodName = "/ia.v1beta1.Alerts/ToggleAlerts" -) - -// AlertsClient is the client API for Alerts service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AlertsClient interface { - // Deprecated: Do not use. - // ListAlerts returns a list of all Alerts. - ListAlerts(ctx context.Context, in *ListAlertsRequest, opts ...grpc.CallOption) (*ListAlertsResponse, error) - // Deprecated: Do not use. - // ToggleAlerts allows to switch alerts state between silenced and unsilenced. - ToggleAlerts(ctx context.Context, in *ToggleAlertsRequest, opts ...grpc.CallOption) (*ToggleAlertsResponse, error) -} - -type alertsClient struct { - cc grpc.ClientConnInterface -} - -func NewAlertsClient(cc grpc.ClientConnInterface) AlertsClient { - return &alertsClient{cc} -} - -// Deprecated: Do not use. -func (c *alertsClient) ListAlerts(ctx context.Context, in *ListAlertsRequest, opts ...grpc.CallOption) (*ListAlertsResponse, error) { - out := new(ListAlertsResponse) - err := c.cc.Invoke(ctx, Alerts_ListAlerts_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *alertsClient) ToggleAlerts(ctx context.Context, in *ToggleAlertsRequest, opts ...grpc.CallOption) (*ToggleAlertsResponse, error) { - out := new(ToggleAlertsResponse) - err := c.cc.Invoke(ctx, Alerts_ToggleAlerts_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AlertsServer is the server API for Alerts service. -// All implementations must embed UnimplementedAlertsServer -// for forward compatibility -type AlertsServer interface { - // Deprecated: Do not use. - // ListAlerts returns a list of all Alerts. - ListAlerts(context.Context, *ListAlertsRequest) (*ListAlertsResponse, error) - // Deprecated: Do not use. - // ToggleAlerts allows to switch alerts state between silenced and unsilenced. - ToggleAlerts(context.Context, *ToggleAlertsRequest) (*ToggleAlertsResponse, error) - mustEmbedUnimplementedAlertsServer() -} - -// UnimplementedAlertsServer must be embedded to have forward compatible implementations. -type UnimplementedAlertsServer struct{} - -func (UnimplementedAlertsServer) ListAlerts(context.Context, *ListAlertsRequest) (*ListAlertsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListAlerts not implemented") -} - -func (UnimplementedAlertsServer) ToggleAlerts(context.Context, *ToggleAlertsRequest) (*ToggleAlertsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ToggleAlerts not implemented") -} -func (UnimplementedAlertsServer) mustEmbedUnimplementedAlertsServer() {} - -// UnsafeAlertsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AlertsServer will -// result in compilation errors. -type UnsafeAlertsServer interface { - mustEmbedUnimplementedAlertsServer() -} - -func RegisterAlertsServer(s grpc.ServiceRegistrar, srv AlertsServer) { - s.RegisterService(&Alerts_ServiceDesc, srv) -} - -func _Alerts_ListAlerts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAlertsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertsServer).ListAlerts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Alerts_ListAlerts_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertsServer).ListAlerts(ctx, req.(*ListAlertsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Alerts_ToggleAlerts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ToggleAlertsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertsServer).ToggleAlerts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Alerts_ToggleAlerts_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertsServer).ToggleAlerts(ctx, req.(*ToggleAlertsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Alerts_ServiceDesc is the grpc.ServiceDesc for Alerts service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Alerts_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ia.v1beta1.Alerts", - HandlerType: (*AlertsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListAlerts", - Handler: _Alerts_ListAlerts_Handler, - }, - { - MethodName: "ToggleAlerts", - Handler: _Alerts_ToggleAlerts_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/ia/alerts.proto", -} diff --git a/api/managementpb/ia/channels.pb.go b/api/managementpb/ia/channels.pb.go deleted file mode 100644 index 6f76b7c5ba..0000000000 --- a/api/managementpb/ia/channels.pb.go +++ /dev/null @@ -1,1694 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc (unknown) -// source: managementpb/ia/channels.proto - -package iav1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - managementpb "github.com/percona/pmm/api/managementpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// BasicAuth represents basic HTTP auth configuration. -// -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type BasicAuth struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - PasswordFile string `protobuf:"bytes,3,opt,name=password_file,json=passwordFile,proto3" json:"password_file,omitempty"` -} - -func (x *BasicAuth) Reset() { - *x = BasicAuth{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BasicAuth) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BasicAuth) ProtoMessage() {} - -func (x *BasicAuth) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BasicAuth.ProtoReflect.Descriptor instead. -func (*BasicAuth) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{0} -} - -func (x *BasicAuth) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *BasicAuth) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *BasicAuth) GetPasswordFile() string { - if x != nil { - return x.PasswordFile - } - return "" -} - -// TLSConfig represents TLS configuration for alertmanager -// https://prometheus.io/docs/alerting/latest/configuration/#tls_config -// -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type TLSConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A path to the CA certificate file to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFile string `protobuf:"bytes,1,opt,name=ca_file,json=caFile,proto3" json:"ca_file,omitempty"` - // A path to the certificate file for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFile string `protobuf:"bytes,2,opt,name=cert_file,json=certFile,proto3" json:"cert_file,omitempty"` - // A path to the key file for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFile string `protobuf:"bytes,3,opt,name=key_file,json=keyFile,proto3" json:"key_file,omitempty"` - // Name of the server. - ServerName string `protobuf:"bytes,4,opt,name=server_name,json=serverName,proto3" json:"server_name,omitempty"` - // Disable validation of the server certificate. - InsecureSkipVerify bool `protobuf:"varint,5,opt,name=insecure_skip_verify,json=insecureSkipVerify,proto3" json:"insecure_skip_verify,omitempty"` - // CA certificate to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFileContent string `protobuf:"bytes,6,opt,name=ca_file_content,json=caFileContent,proto3" json:"ca_file_content,omitempty"` - // A certificate for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFileContent string `protobuf:"bytes,7,opt,name=cert_file_content,json=certFileContent,proto3" json:"cert_file_content,omitempty"` - // A key for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFileContent string `protobuf:"bytes,8,opt,name=key_file_content,json=keyFileContent,proto3" json:"key_file_content,omitempty"` -} - -func (x *TLSConfig) Reset() { - *x = TLSConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TLSConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TLSConfig) ProtoMessage() {} - -func (x *TLSConfig) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TLSConfig.ProtoReflect.Descriptor instead. -func (*TLSConfig) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{1} -} - -func (x *TLSConfig) GetCaFile() string { - if x != nil { - return x.CaFile - } - return "" -} - -func (x *TLSConfig) GetCertFile() string { - if x != nil { - return x.CertFile - } - return "" -} - -func (x *TLSConfig) GetKeyFile() string { - if x != nil { - return x.KeyFile - } - return "" -} - -func (x *TLSConfig) GetServerName() string { - if x != nil { - return x.ServerName - } - return "" -} - -func (x *TLSConfig) GetInsecureSkipVerify() bool { - if x != nil { - return x.InsecureSkipVerify - } - return false -} - -func (x *TLSConfig) GetCaFileContent() string { - if x != nil { - return x.CaFileContent - } - return "" -} - -func (x *TLSConfig) GetCertFileContent() string { - if x != nil { - return x.CertFileContent - } - return "" -} - -func (x *TLSConfig) GetKeyFileContent() string { - if x != nil { - return x.KeyFileContent - } - return "" -} - -// HTTPConfig represents HTTP client configuration. -// -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type HTTPConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Basic HTTP auth configuration. Zero value will remove it. - BasicAuth *BasicAuth `protobuf:"bytes,1,opt,name=basic_auth,json=basicAuth,proto3" json:"basic_auth,omitempty"` - BearerToken string `protobuf:"bytes,2,opt,name=bearer_token,json=bearerToken,proto3" json:"bearer_token,omitempty"` - BearerTokenFile string `protobuf:"bytes,3,opt,name=bearer_token_file,json=bearerTokenFile,proto3" json:"bearer_token_file,omitempty"` - // TLS configuration. Zero value will remove it. - TlsConfig *TLSConfig `protobuf:"bytes,4,opt,name=tls_config,json=tlsConfig,proto3" json:"tls_config,omitempty"` - ProxyUrl string `protobuf:"bytes,5,opt,name=proxy_url,json=proxyUrl,proto3" json:"proxy_url,omitempty"` -} - -func (x *HTTPConfig) Reset() { - *x = HTTPConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HTTPConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HTTPConfig) ProtoMessage() {} - -func (x *HTTPConfig) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HTTPConfig.ProtoReflect.Descriptor instead. -func (*HTTPConfig) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{2} -} - -func (x *HTTPConfig) GetBasicAuth() *BasicAuth { - if x != nil { - return x.BasicAuth - } - return nil -} - -func (x *HTTPConfig) GetBearerToken() string { - if x != nil { - return x.BearerToken - } - return "" -} - -func (x *HTTPConfig) GetBearerTokenFile() string { - if x != nil { - return x.BearerTokenFile - } - return "" -} - -func (x *HTTPConfig) GetTlsConfig() *TLSConfig { - if x != nil { - return x.TlsConfig - } - return nil -} - -func (x *HTTPConfig) GetProxyUrl() string { - if x != nil { - return x.ProxyUrl - } - return "" -} - -// EmailConfig represents email configuration. -// -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type EmailConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SendResolved bool `protobuf:"varint,1,opt,name=send_resolved,json=sendResolved,proto3" json:"send_resolved,omitempty"` - To []string `protobuf:"bytes,2,rep,name=to,proto3" json:"to,omitempty"` -} - -func (x *EmailConfig) Reset() { - *x = EmailConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EmailConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EmailConfig) ProtoMessage() {} - -func (x *EmailConfig) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EmailConfig.ProtoReflect.Descriptor instead. -func (*EmailConfig) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{3} -} - -func (x *EmailConfig) GetSendResolved() bool { - if x != nil { - return x.SendResolved - } - return false -} - -func (x *EmailConfig) GetTo() []string { - if x != nil { - return x.To - } - return nil -} - -// PagerDutyConfig represents PagerDuty configuration. -// -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type PagerDutyConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SendResolved bool `protobuf:"varint,1,opt,name=send_resolved,json=sendResolved,proto3" json:"send_resolved,omitempty"` - // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. - RoutingKey string `protobuf:"bytes,2,opt,name=routing_key,json=routingKey,proto3" json:"routing_key,omitempty"` - // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. - ServiceKey string `protobuf:"bytes,3,opt,name=service_key,json=serviceKey,proto3" json:"service_key,omitempty"` -} - -func (x *PagerDutyConfig) Reset() { - *x = PagerDutyConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PagerDutyConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PagerDutyConfig) ProtoMessage() {} - -func (x *PagerDutyConfig) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PagerDutyConfig.ProtoReflect.Descriptor instead. -func (*PagerDutyConfig) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{4} -} - -func (x *PagerDutyConfig) GetSendResolved() bool { - if x != nil { - return x.SendResolved - } - return false -} - -func (x *PagerDutyConfig) GetRoutingKey() string { - if x != nil { - return x.RoutingKey - } - return "" -} - -func (x *PagerDutyConfig) GetServiceKey() string { - if x != nil { - return x.ServiceKey - } - return "" -} - -// SlackConfig represents Slack configuration. -// -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type SlackConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SendResolved bool `protobuf:"varint,1,opt,name=send_resolved,json=sendResolved,proto3" json:"send_resolved,omitempty"` - Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` -} - -func (x *SlackConfig) Reset() { - *x = SlackConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SlackConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SlackConfig) ProtoMessage() {} - -func (x *SlackConfig) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SlackConfig.ProtoReflect.Descriptor instead. -func (*SlackConfig) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{5} -} - -func (x *SlackConfig) GetSendResolved() bool { - if x != nil { - return x.SendResolved - } - return false -} - -func (x *SlackConfig) GetChannel() string { - if x != nil { - return x.Channel - } - return "" -} - -// WebhookConfig represents webhook configuration. -// -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type WebhookConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SendResolved bool `protobuf:"varint,1,opt,name=send_resolved,json=sendResolved,proto3" json:"send_resolved,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - HttpConfig *HTTPConfig `protobuf:"bytes,3,opt,name=http_config,json=httpConfig,proto3" json:"http_config,omitempty"` - MaxAlerts int32 `protobuf:"varint,4,opt,name=max_alerts,json=maxAlerts,proto3" json:"max_alerts,omitempty"` -} - -func (x *WebhookConfig) Reset() { - *x = WebhookConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WebhookConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WebhookConfig) ProtoMessage() {} - -func (x *WebhookConfig) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WebhookConfig.ProtoReflect.Descriptor instead. -func (*WebhookConfig) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{6} -} - -func (x *WebhookConfig) GetSendResolved() bool { - if x != nil { - return x.SendResolved - } - return false -} - -func (x *WebhookConfig) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *WebhookConfig) GetHttpConfig() *HTTPConfig { - if x != nil { - return x.HttpConfig - } - return nil -} - -func (x *WebhookConfig) GetMaxAlerts() int32 { - if x != nil { - return x.MaxAlerts - } - return 0 -} - -// Channel represents a single Notification Channel. -// -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type Channel struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Machine-readable ID. - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // Short human-readable summary. - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - // Types that are assignable to Channel: - // - // *Channel_EmailConfig - // *Channel_PagerdutyConfig - // *Channel_SlackConfig - // *Channel_WebhookConfig - Channel isChannel_Channel `protobuf_oneof:"channel"` - // True if that channel is disabled. - Disabled bool `protobuf:"varint,11,opt,name=disabled,proto3" json:"disabled,omitempty"` -} - -func (x *Channel) Reset() { - *x = Channel{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Channel) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Channel) ProtoMessage() {} - -func (x *Channel) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Channel.ProtoReflect.Descriptor instead. -func (*Channel) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{7} -} - -func (x *Channel) GetChannelId() string { - if x != nil { - return x.ChannelId - } - return "" -} - -func (x *Channel) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (m *Channel) GetChannel() isChannel_Channel { - if m != nil { - return m.Channel - } - return nil -} - -func (x *Channel) GetEmailConfig() *EmailConfig { - if x, ok := x.GetChannel().(*Channel_EmailConfig); ok { - return x.EmailConfig - } - return nil -} - -func (x *Channel) GetPagerdutyConfig() *PagerDutyConfig { - if x, ok := x.GetChannel().(*Channel_PagerdutyConfig); ok { - return x.PagerdutyConfig - } - return nil -} - -func (x *Channel) GetSlackConfig() *SlackConfig { - if x, ok := x.GetChannel().(*Channel_SlackConfig); ok { - return x.SlackConfig - } - return nil -} - -func (x *Channel) GetWebhookConfig() *WebhookConfig { - if x, ok := x.GetChannel().(*Channel_WebhookConfig); ok { - return x.WebhookConfig - } - return nil -} - -func (x *Channel) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -type isChannel_Channel interface { - isChannel_Channel() -} - -type Channel_EmailConfig struct { - EmailConfig *EmailConfig `protobuf:"bytes,3,opt,name=email_config,json=emailConfig,proto3,oneof"` -} - -type Channel_PagerdutyConfig struct { - PagerdutyConfig *PagerDutyConfig `protobuf:"bytes,4,opt,name=pagerduty_config,json=pagerdutyConfig,proto3,oneof"` -} - -type Channel_SlackConfig struct { - SlackConfig *SlackConfig `protobuf:"bytes,6,opt,name=slack_config,json=slackConfig,proto3,oneof"` -} - -type Channel_WebhookConfig struct { - WebhookConfig *WebhookConfig `protobuf:"bytes,8,opt,name=webhook_config,json=webhookConfig,proto3,oneof"` -} - -func (*Channel_EmailConfig) isChannel_Channel() {} - -func (*Channel_PagerdutyConfig) isChannel_Channel() {} - -func (*Channel_SlackConfig) isChannel_Channel() {} - -func (*Channel_WebhookConfig) isChannel_Channel() {} - -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type ListChannelsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Page request. - PageParams *managementpb.PageParams `protobuf:"bytes,1,opt,name=page_params,json=pageParams,proto3" json:"page_params,omitempty"` -} - -func (x *ListChannelsRequest) Reset() { - *x = ListChannelsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListChannelsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListChannelsRequest) ProtoMessage() {} - -func (x *ListChannelsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListChannelsRequest.ProtoReflect.Descriptor instead. -func (*ListChannelsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{8} -} - -func (x *ListChannelsRequest) GetPageParams() *managementpb.PageParams { - if x != nil { - return x.PageParams - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type ListChannelsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Channels []*Channel `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"` - // Total items and pages. - Totals *managementpb.PageTotals `protobuf:"bytes,2,opt,name=totals,proto3" json:"totals,omitempty"` -} - -func (x *ListChannelsResponse) Reset() { - *x = ListChannelsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListChannelsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListChannelsResponse) ProtoMessage() {} - -func (x *ListChannelsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListChannelsResponse.ProtoReflect.Descriptor instead. -func (*ListChannelsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{9} -} - -func (x *ListChannelsResponse) GetChannels() []*Channel { - if x != nil { - return x.Channels - } - return nil -} - -func (x *ListChannelsResponse) GetTotals() *managementpb.PageTotals { - if x != nil { - return x.Totals - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type AddChannelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Short human-readable summary. - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - // Email configuration. Exactly one config should be set. - EmailConfig *EmailConfig `protobuf:"bytes,3,opt,name=email_config,json=emailConfig,proto3" json:"email_config,omitempty"` - // PagerDuty configuration. Exactly one config should be set. - PagerdutyConfig *PagerDutyConfig `protobuf:"bytes,4,opt,name=pagerduty_config,json=pagerdutyConfig,proto3" json:"pagerduty_config,omitempty"` - // Slack configuration. Exactly one config should be set. - SlackConfig *SlackConfig `protobuf:"bytes,6,opt,name=slack_config,json=slackConfig,proto3" json:"slack_config,omitempty"` - // Webhook configuration. Exactly one config should be set. - WebhookConfig *WebhookConfig `protobuf:"bytes,8,opt,name=webhook_config,json=webhookConfig,proto3" json:"webhook_config,omitempty"` - // New channel status. - Disabled bool `protobuf:"varint,11,opt,name=disabled,proto3" json:"disabled,omitempty"` -} - -func (x *AddChannelRequest) Reset() { - *x = AddChannelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddChannelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddChannelRequest) ProtoMessage() {} - -func (x *AddChannelRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddChannelRequest.ProtoReflect.Descriptor instead. -func (*AddChannelRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{10} -} - -func (x *AddChannelRequest) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *AddChannelRequest) GetEmailConfig() *EmailConfig { - if x != nil { - return x.EmailConfig - } - return nil -} - -func (x *AddChannelRequest) GetPagerdutyConfig() *PagerDutyConfig { - if x != nil { - return x.PagerdutyConfig - } - return nil -} - -func (x *AddChannelRequest) GetSlackConfig() *SlackConfig { - if x != nil { - return x.SlackConfig - } - return nil -} - -func (x *AddChannelRequest) GetWebhookConfig() *WebhookConfig { - if x != nil { - return x.WebhookConfig - } - return nil -} - -func (x *AddChannelRequest) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type AddChannelResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Machine-readable ID. - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` -} - -func (x *AddChannelResponse) Reset() { - *x = AddChannelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddChannelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddChannelResponse) ProtoMessage() {} - -func (x *AddChannelResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddChannelResponse.ProtoReflect.Descriptor instead. -func (*AddChannelResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{11} -} - -func (x *AddChannelResponse) GetChannelId() string { - if x != nil { - return x.ChannelId - } - return "" -} - -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type ChangeChannelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Machine-readable ID. - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // Short human-readable summary. Empty value will not change it. - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - // Email configuration. Exactly one config should be set. - EmailConfig *EmailConfig `protobuf:"bytes,3,opt,name=email_config,json=emailConfig,proto3" json:"email_config,omitempty"` - // PagerDuty configuration. Exactly one config should be set. - PagerdutyConfig *PagerDutyConfig `protobuf:"bytes,4,opt,name=pagerduty_config,json=pagerdutyConfig,proto3" json:"pagerduty_config,omitempty"` - // Slack configuration. Exactly one config should be set. - SlackConfig *SlackConfig `protobuf:"bytes,6,opt,name=slack_config,json=slackConfig,proto3" json:"slack_config,omitempty"` - // Webhook configuration. Exactly one config should be set. - WebhookConfig *WebhookConfig `protobuf:"bytes,8,opt,name=webhook_config,json=webhookConfig,proto3" json:"webhook_config,omitempty"` - // Enables or disables that channel. Should be set. - Disabled bool `protobuf:"varint,11,opt,name=disabled,proto3" json:"disabled,omitempty"` -} - -func (x *ChangeChannelRequest) Reset() { - *x = ChangeChannelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangeChannelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeChannelRequest) ProtoMessage() {} - -func (x *ChangeChannelRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangeChannelRequest.ProtoReflect.Descriptor instead. -func (*ChangeChannelRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{12} -} - -func (x *ChangeChannelRequest) GetChannelId() string { - if x != nil { - return x.ChannelId - } - return "" -} - -func (x *ChangeChannelRequest) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *ChangeChannelRequest) GetEmailConfig() *EmailConfig { - if x != nil { - return x.EmailConfig - } - return nil -} - -func (x *ChangeChannelRequest) GetPagerdutyConfig() *PagerDutyConfig { - if x != nil { - return x.PagerdutyConfig - } - return nil -} - -func (x *ChangeChannelRequest) GetSlackConfig() *SlackConfig { - if x != nil { - return x.SlackConfig - } - return nil -} - -func (x *ChangeChannelRequest) GetWebhookConfig() *WebhookConfig { - if x != nil { - return x.WebhookConfig - } - return nil -} - -func (x *ChangeChannelRequest) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type ChangeChannelResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ChangeChannelResponse) Reset() { - *x = ChangeChannelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangeChannelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeChannelResponse) ProtoMessage() {} - -func (x *ChangeChannelResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangeChannelResponse.ProtoReflect.Descriptor instead. -func (*ChangeChannelResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{13} -} - -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type RemoveChannelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` -} - -func (x *RemoveChannelRequest) Reset() { - *x = RemoveChannelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveChannelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveChannelRequest) ProtoMessage() {} - -func (x *RemoveChannelRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveChannelRequest.ProtoReflect.Descriptor instead. -func (*RemoveChannelRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{14} -} - -func (x *RemoveChannelRequest) GetChannelId() string { - if x != nil { - return x.ChannelId - } - return "" -} - -// Deprecated: Marked as deprecated in managementpb/ia/channels.proto. -type RemoveChannelResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveChannelResponse) Reset() { - *x = RemoveChannelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_channels_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveChannelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveChannelResponse) ProtoMessage() {} - -func (x *RemoveChannelResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_channels_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveChannelResponse.ProtoReflect.Descriptor instead. -func (*RemoveChannelResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_channels_proto_rawDescGZIP(), []int{15} -} - -var File_managementpb_ia_channels_proto protoreflect.FileDescriptor - -var file_managementpb_ia_channels_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, - 0x61, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0a, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x6c, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, - 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x3a, 0x02, 0x18, 0x01, - 0x22, 0xb1, 0x02, 0x0a, 0x09, 0x54, 0x4c, 0x53, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x17, - 0x0a, 0x07, 0x63, 0x61, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x63, 0x61, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x65, 0x72, 0x74, 0x5f, - 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x65, 0x72, 0x74, - 0x46, 0x69, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x30, 0x0a, 0x14, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6b, 0x69, - 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, - 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x61, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x46, - 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x65, - 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x65, 0x72, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x69, - 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x6b, 0x65, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x3a, 0x02, 0x18, 0x01, 0x22, 0xe8, 0x01, 0x0a, 0x0a, 0x48, 0x54, 0x54, 0x50, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x61, 0x75, 0x74, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x52, 0x09, - 0x62, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x0a, 0x11, - 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x66, 0x69, 0x6c, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x74, 0x6c, 0x73, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, - 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x4c, 0x53, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x09, 0x74, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, - 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x72, 0x6c, 0x3a, 0x02, 0x18, 0x01, 0x22, - 0x50, 0x0a, 0x0b, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, - 0x0a, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, - 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x02, 0x74, 0x6f, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0x7c, 0x0a, 0x0f, 0x50, 0x61, 0x67, 0x65, 0x72, 0x44, 0x75, 0x74, 0x79, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x73, - 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x65, 0x6e, - 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x3a, 0x02, 0x18, 0x01, 0x22, - 0x59, 0x0a, 0x0b, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, - 0x0a, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xab, 0x01, 0x0a, 0x0d, 0x57, - 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, - 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x64, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x37, 0x0a, 0x0b, - 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, - 0x54, 0x54, 0x50, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x6c, 0x65, - 0x72, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xf7, 0x02, 0x0a, 0x07, 0x43, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x3c, 0x0a, - 0x0c, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x0b, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x48, 0x0a, 0x10, 0x70, - 0x61, 0x67, 0x65, 0x72, 0x64, 0x75, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x72, 0x44, 0x75, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x61, 0x67, 0x65, 0x72, 0x64, 0x75, 0x74, 0x79, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x61, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x0e, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x61, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, - 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, - 0x65, 0x6c, 0x22, 0x52, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x0b, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x7b, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, - 0x0a, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, - 0x2e, 0x0a, 0x06, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x52, 0x06, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x3a, - 0x02, 0x18, 0x01, 0x22, 0xd8, 0x02, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x6e, - 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x73, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0c, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x46, 0x0a, 0x10, 0x70, 0x61, 0x67, 0x65, - 0x72, 0x64, 0x75, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x72, 0x44, 0x75, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x0f, 0x70, 0x61, 0x67, 0x65, 0x72, 0x64, 0x75, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x0b, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x40, 0x0a, 0x0e, - 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x0d, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, - 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x37, - 0x0a, 0x12, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x49, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xfa, 0x02, 0x0a, 0x14, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x26, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0c, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x0b, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x46, - 0x0a, 0x10, 0x70, 0x61, 0x67, 0x65, 0x72, 0x64, 0x75, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x72, 0x44, 0x75, 0x74, 0x79, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0f, 0x70, 0x61, 0x67, 0x65, 0x72, 0x64, 0x75, 0x74, 0x79, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, - 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x40, 0x0a, 0x0e, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x61, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x3a, 0x02, 0x18, 0x01, 0x22, 0x1b, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0x42, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, - 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x63, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, - 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x1b, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, 0x02, - 0x18, 0x01, 0x32, 0xac, 0x04, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, - 0x85, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, - 0x12, 0x1f, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x32, 0x92, 0x41, 0x02, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, - 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x2f, 0x69, 0x61, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2f, - 0x4c, 0x69, 0x73, 0x74, 0x88, 0x02, 0x01, 0x12, 0x7e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x92, 0x41, 0x02, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x69, 0x61, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, - 0x2f, 0x41, 0x64, 0x64, 0x88, 0x02, 0x01, 0x12, 0x8a, 0x01, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x20, 0x2e, 0x69, 0x61, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x69, 0x61, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, - 0x92, 0x41, 0x02, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x69, - 0x61, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x88, 0x02, 0x01, 0x12, 0x8a, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x20, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, - 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x92, 0x41, 0x02, - 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x69, 0x61, 0x2f, 0x43, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x88, 0x02, - 0x01, 0x42, 0x9e, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x42, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, - 0x61, 0x3b, 0x69, 0x61, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, - 0x58, 0xaa, 0x02, 0x0a, 0x49, 0x61, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, - 0x0a, 0x49, 0x61, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x16, 0x49, 0x61, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x49, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_ia_channels_proto_rawDescOnce sync.Once - file_managementpb_ia_channels_proto_rawDescData = file_managementpb_ia_channels_proto_rawDesc -) - -func file_managementpb_ia_channels_proto_rawDescGZIP() []byte { - file_managementpb_ia_channels_proto_rawDescOnce.Do(func() { - file_managementpb_ia_channels_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_ia_channels_proto_rawDescData) - }) - return file_managementpb_ia_channels_proto_rawDescData -} - -var ( - file_managementpb_ia_channels_proto_msgTypes = make([]protoimpl.MessageInfo, 16) - file_managementpb_ia_channels_proto_goTypes = []interface{}{ - (*BasicAuth)(nil), // 0: ia.v1beta1.BasicAuth - (*TLSConfig)(nil), // 1: ia.v1beta1.TLSConfig - (*HTTPConfig)(nil), // 2: ia.v1beta1.HTTPConfig - (*EmailConfig)(nil), // 3: ia.v1beta1.EmailConfig - (*PagerDutyConfig)(nil), // 4: ia.v1beta1.PagerDutyConfig - (*SlackConfig)(nil), // 5: ia.v1beta1.SlackConfig - (*WebhookConfig)(nil), // 6: ia.v1beta1.WebhookConfig - (*Channel)(nil), // 7: ia.v1beta1.Channel - (*ListChannelsRequest)(nil), // 8: ia.v1beta1.ListChannelsRequest - (*ListChannelsResponse)(nil), // 9: ia.v1beta1.ListChannelsResponse - (*AddChannelRequest)(nil), // 10: ia.v1beta1.AddChannelRequest - (*AddChannelResponse)(nil), // 11: ia.v1beta1.AddChannelResponse - (*ChangeChannelRequest)(nil), // 12: ia.v1beta1.ChangeChannelRequest - (*ChangeChannelResponse)(nil), // 13: ia.v1beta1.ChangeChannelResponse - (*RemoveChannelRequest)(nil), // 14: ia.v1beta1.RemoveChannelRequest - (*RemoveChannelResponse)(nil), // 15: ia.v1beta1.RemoveChannelResponse - (*managementpb.PageParams)(nil), // 16: management.PageParams - (*managementpb.PageTotals)(nil), // 17: management.PageTotals - } -) - -var file_managementpb_ia_channels_proto_depIdxs = []int32{ - 0, // 0: ia.v1beta1.HTTPConfig.basic_auth:type_name -> ia.v1beta1.BasicAuth - 1, // 1: ia.v1beta1.HTTPConfig.tls_config:type_name -> ia.v1beta1.TLSConfig - 2, // 2: ia.v1beta1.WebhookConfig.http_config:type_name -> ia.v1beta1.HTTPConfig - 3, // 3: ia.v1beta1.Channel.email_config:type_name -> ia.v1beta1.EmailConfig - 4, // 4: ia.v1beta1.Channel.pagerduty_config:type_name -> ia.v1beta1.PagerDutyConfig - 5, // 5: ia.v1beta1.Channel.slack_config:type_name -> ia.v1beta1.SlackConfig - 6, // 6: ia.v1beta1.Channel.webhook_config:type_name -> ia.v1beta1.WebhookConfig - 16, // 7: ia.v1beta1.ListChannelsRequest.page_params:type_name -> management.PageParams - 7, // 8: ia.v1beta1.ListChannelsResponse.channels:type_name -> ia.v1beta1.Channel - 17, // 9: ia.v1beta1.ListChannelsResponse.totals:type_name -> management.PageTotals - 3, // 10: ia.v1beta1.AddChannelRequest.email_config:type_name -> ia.v1beta1.EmailConfig - 4, // 11: ia.v1beta1.AddChannelRequest.pagerduty_config:type_name -> ia.v1beta1.PagerDutyConfig - 5, // 12: ia.v1beta1.AddChannelRequest.slack_config:type_name -> ia.v1beta1.SlackConfig - 6, // 13: ia.v1beta1.AddChannelRequest.webhook_config:type_name -> ia.v1beta1.WebhookConfig - 3, // 14: ia.v1beta1.ChangeChannelRequest.email_config:type_name -> ia.v1beta1.EmailConfig - 4, // 15: ia.v1beta1.ChangeChannelRequest.pagerduty_config:type_name -> ia.v1beta1.PagerDutyConfig - 5, // 16: ia.v1beta1.ChangeChannelRequest.slack_config:type_name -> ia.v1beta1.SlackConfig - 6, // 17: ia.v1beta1.ChangeChannelRequest.webhook_config:type_name -> ia.v1beta1.WebhookConfig - 8, // 18: ia.v1beta1.Channels.ListChannels:input_type -> ia.v1beta1.ListChannelsRequest - 10, // 19: ia.v1beta1.Channels.AddChannel:input_type -> ia.v1beta1.AddChannelRequest - 12, // 20: ia.v1beta1.Channels.ChangeChannel:input_type -> ia.v1beta1.ChangeChannelRequest - 14, // 21: ia.v1beta1.Channels.RemoveChannel:input_type -> ia.v1beta1.RemoveChannelRequest - 9, // 22: ia.v1beta1.Channels.ListChannels:output_type -> ia.v1beta1.ListChannelsResponse - 11, // 23: ia.v1beta1.Channels.AddChannel:output_type -> ia.v1beta1.AddChannelResponse - 13, // 24: ia.v1beta1.Channels.ChangeChannel:output_type -> ia.v1beta1.ChangeChannelResponse - 15, // 25: ia.v1beta1.Channels.RemoveChannel:output_type -> ia.v1beta1.RemoveChannelResponse - 22, // [22:26] is the sub-list for method output_type - 18, // [18:22] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name -} - -func init() { file_managementpb_ia_channels_proto_init() } -func file_managementpb_ia_channels_proto_init() { - if File_managementpb_ia_channels_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_managementpb_ia_channels_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BasicAuth); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TLSConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HTTPConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmailConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PagerDutyConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SlackConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WebhookConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Channel); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListChannelsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListChannelsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddChannelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddChannelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeChannelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeChannelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveChannelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_channels_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveChannelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_managementpb_ia_channels_proto_msgTypes[7].OneofWrappers = []interface{}{ - (*Channel_EmailConfig)(nil), - (*Channel_PagerdutyConfig)(nil), - (*Channel_SlackConfig)(nil), - (*Channel_WebhookConfig)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_ia_channels_proto_rawDesc, - NumEnums: 0, - NumMessages: 16, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_ia_channels_proto_goTypes, - DependencyIndexes: file_managementpb_ia_channels_proto_depIdxs, - MessageInfos: file_managementpb_ia_channels_proto_msgTypes, - }.Build() - File_managementpb_ia_channels_proto = out.File - file_managementpb_ia_channels_proto_rawDesc = nil - file_managementpb_ia_channels_proto_goTypes = nil - file_managementpb_ia_channels_proto_depIdxs = nil -} diff --git a/api/managementpb/ia/channels.pb.gw.go b/api/managementpb/ia/channels.pb.gw.go deleted file mode 100644 index f47eb473a1..0000000000 --- a/api/managementpb/ia/channels.pb.gw.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/ia/channels.proto - -/* -Package iav1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package iav1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_Channels_ListChannels_0(ctx context.Context, marshaler runtime.Marshaler, client ChannelsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListChannelsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListChannels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Channels_ListChannels_0(ctx context.Context, marshaler runtime.Marshaler, server ChannelsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListChannelsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListChannels(ctx, &protoReq) - return msg, metadata, err -} - -func request_Channels_AddChannel_0(ctx context.Context, marshaler runtime.Marshaler, client ChannelsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddChannelRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AddChannel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Channels_AddChannel_0(ctx context.Context, marshaler runtime.Marshaler, server ChannelsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddChannelRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AddChannel(ctx, &protoReq) - return msg, metadata, err -} - -func request_Channels_ChangeChannel_0(ctx context.Context, marshaler runtime.Marshaler, client ChannelsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangeChannelRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ChangeChannel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Channels_ChangeChannel_0(ctx context.Context, marshaler runtime.Marshaler, server ChannelsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangeChannelRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ChangeChannel(ctx, &protoReq) - return msg, metadata, err -} - -func request_Channels_RemoveChannel_0(ctx context.Context, marshaler runtime.Marshaler, client ChannelsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RemoveChannelRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RemoveChannel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Channels_RemoveChannel_0(ctx context.Context, marshaler runtime.Marshaler, server ChannelsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RemoveChannelRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RemoveChannel(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterChannelsHandlerServer registers the http handlers for service Channels to "mux". -// UnaryRPC :call ChannelsServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChannelsHandlerFromEndpoint instead. -func RegisterChannelsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChannelsServer) error { - mux.Handle("POST", pattern_Channels_ListChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Channels/ListChannels", runtime.WithHTTPPathPattern("/v1/management/ia/Channels/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Channels_ListChannels_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Channels_ListChannels_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Channels_AddChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Channels/AddChannel", runtime.WithHTTPPathPattern("/v1/management/ia/Channels/Add")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Channels_AddChannel_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Channels_AddChannel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Channels_ChangeChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Channels/ChangeChannel", runtime.WithHTTPPathPattern("/v1/management/ia/Channels/Change")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Channels_ChangeChannel_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Channels_ChangeChannel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Channels_RemoveChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Channels/RemoveChannel", runtime.WithHTTPPathPattern("/v1/management/ia/Channels/Remove")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Channels_RemoveChannel_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Channels_RemoveChannel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterChannelsHandlerFromEndpoint is same as RegisterChannelsHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterChannelsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterChannelsHandler(ctx, mux, conn) -} - -// RegisterChannelsHandler registers the http handlers for service Channels to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterChannelsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterChannelsHandlerClient(ctx, mux, NewChannelsClient(conn)) -} - -// RegisterChannelsHandlerClient registers the http handlers for service Channels -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChannelsClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChannelsClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ChannelsClient" to call the correct interceptors. -func RegisterChannelsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChannelsClient) error { - mux.Handle("POST", pattern_Channels_ListChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Channels/ListChannels", runtime.WithHTTPPathPattern("/v1/management/ia/Channels/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Channels_ListChannels_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Channels_ListChannels_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Channels_AddChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Channels/AddChannel", runtime.WithHTTPPathPattern("/v1/management/ia/Channels/Add")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Channels_AddChannel_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Channels_AddChannel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Channels_ChangeChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Channels/ChangeChannel", runtime.WithHTTPPathPattern("/v1/management/ia/Channels/Change")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Channels_ChangeChannel_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Channels_ChangeChannel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Channels_RemoveChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Channels/RemoveChannel", runtime.WithHTTPPathPattern("/v1/management/ia/Channels/Remove")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Channels_RemoveChannel_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Channels_RemoveChannel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var ( - pattern_Channels_ListChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Channels", "List"}, "")) - - pattern_Channels_AddChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Channels", "Add"}, "")) - - pattern_Channels_ChangeChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Channels", "Change"}, "")) - - pattern_Channels_RemoveChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Channels", "Remove"}, "")) -) - -var ( - forward_Channels_ListChannels_0 = runtime.ForwardResponseMessage - - forward_Channels_AddChannel_0 = runtime.ForwardResponseMessage - - forward_Channels_ChangeChannel_0 = runtime.ForwardResponseMessage - - forward_Channels_RemoveChannel_0 = runtime.ForwardResponseMessage -) diff --git a/api/managementpb/ia/channels.pb.validate.go b/api/managementpb/ia/channels.pb.validate.go deleted file mode 100644 index cb0ec7d9d1..0000000000 --- a/api/managementpb/ia/channels.pb.validate.go +++ /dev/null @@ -1,2347 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/ia/channels.proto - -package iav1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on BasicAuth with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *BasicAuth) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on BasicAuth with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in BasicAuthMultiError, or nil -// if none found. -func (m *BasicAuth) ValidateAll() error { - return m.validate(true) -} - -func (m *BasicAuth) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for PasswordFile - - if len(errors) > 0 { - return BasicAuthMultiError(errors) - } - - return nil -} - -// BasicAuthMultiError is an error wrapping multiple validation errors returned -// by BasicAuth.ValidateAll() if the designated constraints aren't met. -type BasicAuthMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m BasicAuthMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m BasicAuthMultiError) AllErrors() []error { return m } - -// BasicAuthValidationError is the validation error returned by -// BasicAuth.Validate if the designated constraints aren't met. -type BasicAuthValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e BasicAuthValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e BasicAuthValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e BasicAuthValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e BasicAuthValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e BasicAuthValidationError) ErrorName() string { return "BasicAuthValidationError" } - -// Error satisfies the builtin error interface -func (e BasicAuthValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sBasicAuth.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = BasicAuthValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = BasicAuthValidationError{} - -// Validate checks the field values on TLSConfig with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *TLSConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on TLSConfig with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in TLSConfigMultiError, or nil -// if none found. -func (m *TLSConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *TLSConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for CaFile - - // no validation rules for CertFile - - // no validation rules for KeyFile - - // no validation rules for ServerName - - // no validation rules for InsecureSkipVerify - - // no validation rules for CaFileContent - - // no validation rules for CertFileContent - - // no validation rules for KeyFileContent - - if len(errors) > 0 { - return TLSConfigMultiError(errors) - } - - return nil -} - -// TLSConfigMultiError is an error wrapping multiple validation errors returned -// by TLSConfig.ValidateAll() if the designated constraints aren't met. -type TLSConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m TLSConfigMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m TLSConfigMultiError) AllErrors() []error { return m } - -// TLSConfigValidationError is the validation error returned by -// TLSConfig.Validate if the designated constraints aren't met. -type TLSConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e TLSConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e TLSConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e TLSConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e TLSConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e TLSConfigValidationError) ErrorName() string { return "TLSConfigValidationError" } - -// Error satisfies the builtin error interface -func (e TLSConfigValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sTLSConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = TLSConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = TLSConfigValidationError{} - -// Validate checks the field values on HTTPConfig with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *HTTPConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on HTTPConfig with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in HTTPConfigMultiError, or -// nil if none found. -func (m *HTTPConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *HTTPConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetBasicAuth()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, HTTPConfigValidationError{ - field: "BasicAuth", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, HTTPConfigValidationError{ - field: "BasicAuth", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetBasicAuth()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return HTTPConfigValidationError{ - field: "BasicAuth", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for BearerToken - - // no validation rules for BearerTokenFile - - if all { - switch v := interface{}(m.GetTlsConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, HTTPConfigValidationError{ - field: "TlsConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, HTTPConfigValidationError{ - field: "TlsConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTlsConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return HTTPConfigValidationError{ - field: "TlsConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for ProxyUrl - - if len(errors) > 0 { - return HTTPConfigMultiError(errors) - } - - return nil -} - -// HTTPConfigMultiError is an error wrapping multiple validation errors -// returned by HTTPConfig.ValidateAll() if the designated constraints aren't met. -type HTTPConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m HTTPConfigMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m HTTPConfigMultiError) AllErrors() []error { return m } - -// HTTPConfigValidationError is the validation error returned by -// HTTPConfig.Validate if the designated constraints aren't met. -type HTTPConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e HTTPConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e HTTPConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e HTTPConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e HTTPConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e HTTPConfigValidationError) ErrorName() string { return "HTTPConfigValidationError" } - -// Error satisfies the builtin error interface -func (e HTTPConfigValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sHTTPConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = HTTPConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = HTTPConfigValidationError{} - -// Validate checks the field values on EmailConfig with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *EmailConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on EmailConfig with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in EmailConfigMultiError, or -// nil if none found. -func (m *EmailConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *EmailConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for SendResolved - - if len(m.GetTo()) < 1 { - err := EmailConfigValidationError{ - field: "To", - reason: "value must contain at least 1 item(s)", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return EmailConfigMultiError(errors) - } - - return nil -} - -// EmailConfigMultiError is an error wrapping multiple validation errors -// returned by EmailConfig.ValidateAll() if the designated constraints aren't met. -type EmailConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m EmailConfigMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m EmailConfigMultiError) AllErrors() []error { return m } - -// EmailConfigValidationError is the validation error returned by -// EmailConfig.Validate if the designated constraints aren't met. -type EmailConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e EmailConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e EmailConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e EmailConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e EmailConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e EmailConfigValidationError) ErrorName() string { return "EmailConfigValidationError" } - -// Error satisfies the builtin error interface -func (e EmailConfigValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sEmailConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = EmailConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = EmailConfigValidationError{} - -// Validate checks the field values on PagerDutyConfig with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *PagerDutyConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PagerDutyConfig with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// PagerDutyConfigMultiError, or nil if none found. -func (m *PagerDutyConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *PagerDutyConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for SendResolved - - // no validation rules for RoutingKey - - // no validation rules for ServiceKey - - if len(errors) > 0 { - return PagerDutyConfigMultiError(errors) - } - - return nil -} - -// PagerDutyConfigMultiError is an error wrapping multiple validation errors -// returned by PagerDutyConfig.ValidateAll() if the designated constraints -// aren't met. -type PagerDutyConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PagerDutyConfigMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PagerDutyConfigMultiError) AllErrors() []error { return m } - -// PagerDutyConfigValidationError is the validation error returned by -// PagerDutyConfig.Validate if the designated constraints aren't met. -type PagerDutyConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PagerDutyConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PagerDutyConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PagerDutyConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PagerDutyConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PagerDutyConfigValidationError) ErrorName() string { return "PagerDutyConfigValidationError" } - -// Error satisfies the builtin error interface -func (e PagerDutyConfigValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPagerDutyConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PagerDutyConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PagerDutyConfigValidationError{} - -// Validate checks the field values on SlackConfig with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *SlackConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SlackConfig with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in SlackConfigMultiError, or -// nil if none found. -func (m *SlackConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *SlackConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for SendResolved - - if utf8.RuneCountInString(m.GetChannel()) < 1 { - err := SlackConfigValidationError{ - field: "Channel", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return SlackConfigMultiError(errors) - } - - return nil -} - -// SlackConfigMultiError is an error wrapping multiple validation errors -// returned by SlackConfig.ValidateAll() if the designated constraints aren't met. -type SlackConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SlackConfigMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m SlackConfigMultiError) AllErrors() []error { return m } - -// SlackConfigValidationError is the validation error returned by -// SlackConfig.Validate if the designated constraints aren't met. -type SlackConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SlackConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SlackConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SlackConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SlackConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SlackConfigValidationError) ErrorName() string { return "SlackConfigValidationError" } - -// Error satisfies the builtin error interface -func (e SlackConfigValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sSlackConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SlackConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SlackConfigValidationError{} - -// Validate checks the field values on WebhookConfig with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *WebhookConfig) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on WebhookConfig with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in WebhookConfigMultiError, or -// nil if none found. -func (m *WebhookConfig) ValidateAll() error { - return m.validate(true) -} - -func (m *WebhookConfig) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for SendResolved - - if utf8.RuneCountInString(m.GetUrl()) < 1 { - err := WebhookConfigValidationError{ - field: "Url", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetHttpConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, WebhookConfigValidationError{ - field: "HttpConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, WebhookConfigValidationError{ - field: "HttpConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHttpConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return WebhookConfigValidationError{ - field: "HttpConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for MaxAlerts - - if len(errors) > 0 { - return WebhookConfigMultiError(errors) - } - - return nil -} - -// WebhookConfigMultiError is an error wrapping multiple validation errors -// returned by WebhookConfig.ValidateAll() if the designated constraints -// aren't met. -type WebhookConfigMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m WebhookConfigMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m WebhookConfigMultiError) AllErrors() []error { return m } - -// WebhookConfigValidationError is the validation error returned by -// WebhookConfig.Validate if the designated constraints aren't met. -type WebhookConfigValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e WebhookConfigValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e WebhookConfigValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e WebhookConfigValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e WebhookConfigValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e WebhookConfigValidationError) ErrorName() string { return "WebhookConfigValidationError" } - -// Error satisfies the builtin error interface -func (e WebhookConfigValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sWebhookConfig.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = WebhookConfigValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = WebhookConfigValidationError{} - -// Validate checks the field values on Channel with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Channel) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Channel with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in ChannelMultiError, or nil if none found. -func (m *Channel) ValidateAll() error { - return m.validate(true) -} - -func (m *Channel) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ChannelId - - // no validation rules for Summary - - // no validation rules for Disabled - - switch v := m.Channel.(type) { - case *Channel_EmailConfig: - if v == nil { - err := ChannelValidationError{ - field: "Channel", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetEmailConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChannelValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChannelValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEmailConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChannelValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *Channel_PagerdutyConfig: - if v == nil { - err := ChannelValidationError{ - field: "Channel", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPagerdutyConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChannelValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChannelValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPagerdutyConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChannelValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *Channel_SlackConfig: - if v == nil { - err := ChannelValidationError{ - field: "Channel", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetSlackConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChannelValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChannelValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSlackConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChannelValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *Channel_WebhookConfig: - if v == nil { - err := ChannelValidationError{ - field: "Channel", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetWebhookConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChannelValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChannelValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetWebhookConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChannelValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return ChannelMultiError(errors) - } - - return nil -} - -// ChannelMultiError is an error wrapping multiple validation errors returned -// by Channel.ValidateAll() if the designated constraints aren't met. -type ChannelMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChannelMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChannelMultiError) AllErrors() []error { return m } - -// ChannelValidationError is the validation error returned by Channel.Validate -// if the designated constraints aren't met. -type ChannelValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChannelValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChannelValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChannelValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChannelValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChannelValidationError) ErrorName() string { return "ChannelValidationError" } - -// Error satisfies the builtin error interface -func (e ChannelValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChannel.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChannelValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChannelValidationError{} - -// Validate checks the field values on ListChannelsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListChannelsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListChannelsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListChannelsRequestMultiError, or nil if none found. -func (m *ListChannelsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListChannelsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPageParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListChannelsRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListChannelsRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPageParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListChannelsRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ListChannelsRequestMultiError(errors) - } - - return nil -} - -// ListChannelsRequestMultiError is an error wrapping multiple validation -// errors returned by ListChannelsRequest.ValidateAll() if the designated -// constraints aren't met. -type ListChannelsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListChannelsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListChannelsRequestMultiError) AllErrors() []error { return m } - -// ListChannelsRequestValidationError is the validation error returned by -// ListChannelsRequest.Validate if the designated constraints aren't met. -type ListChannelsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListChannelsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListChannelsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListChannelsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListChannelsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListChannelsRequestValidationError) ErrorName() string { - return "ListChannelsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListChannelsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListChannelsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListChannelsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListChannelsRequestValidationError{} - -// Validate checks the field values on ListChannelsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListChannelsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListChannelsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListChannelsResponseMultiError, or nil if none found. -func (m *ListChannelsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListChannelsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetChannels() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListChannelsResponseValidationError{ - field: fmt.Sprintf("Channels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListChannelsResponseValidationError{ - field: fmt.Sprintf("Channels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListChannelsResponseValidationError{ - field: fmt.Sprintf("Channels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetTotals()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListChannelsResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListChannelsResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTotals()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListChannelsResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ListChannelsResponseMultiError(errors) - } - - return nil -} - -// ListChannelsResponseMultiError is an error wrapping multiple validation -// errors returned by ListChannelsResponse.ValidateAll() if the designated -// constraints aren't met. -type ListChannelsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListChannelsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListChannelsResponseMultiError) AllErrors() []error { return m } - -// ListChannelsResponseValidationError is the validation error returned by -// ListChannelsResponse.Validate if the designated constraints aren't met. -type ListChannelsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListChannelsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListChannelsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListChannelsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListChannelsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListChannelsResponseValidationError) ErrorName() string { - return "ListChannelsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListChannelsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListChannelsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListChannelsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListChannelsResponseValidationError{} - -// Validate checks the field values on AddChannelRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *AddChannelRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddChannelRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// AddChannelRequestMultiError, or nil if none found. -func (m *AddChannelRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddChannelRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetSummary()) < 1 { - err := AddChannelRequestValidationError{ - field: "Summary", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetEmailConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddChannelRequestValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddChannelRequestValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEmailConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddChannelRequestValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPagerdutyConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddChannelRequestValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddChannelRequestValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPagerdutyConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddChannelRequestValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetSlackConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddChannelRequestValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddChannelRequestValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSlackConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddChannelRequestValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetWebhookConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddChannelRequestValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddChannelRequestValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetWebhookConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddChannelRequestValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Disabled - - if len(errors) > 0 { - return AddChannelRequestMultiError(errors) - } - - return nil -} - -// AddChannelRequestMultiError is an error wrapping multiple validation errors -// returned by AddChannelRequest.ValidateAll() if the designated constraints -// aren't met. -type AddChannelRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddChannelRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m AddChannelRequestMultiError) AllErrors() []error { return m } - -// AddChannelRequestValidationError is the validation error returned by -// AddChannelRequest.Validate if the designated constraints aren't met. -type AddChannelRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddChannelRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddChannelRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddChannelRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddChannelRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddChannelRequestValidationError) ErrorName() string { - return "AddChannelRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e AddChannelRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sAddChannelRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddChannelRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddChannelRequestValidationError{} - -// Validate checks the field values on AddChannelResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *AddChannelResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddChannelResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// AddChannelResponseMultiError, or nil if none found. -func (m *AddChannelResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddChannelResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ChannelId - - if len(errors) > 0 { - return AddChannelResponseMultiError(errors) - } - - return nil -} - -// AddChannelResponseMultiError is an error wrapping multiple validation errors -// returned by AddChannelResponse.ValidateAll() if the designated constraints -// aren't met. -type AddChannelResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddChannelResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m AddChannelResponseMultiError) AllErrors() []error { return m } - -// AddChannelResponseValidationError is the validation error returned by -// AddChannelResponse.Validate if the designated constraints aren't met. -type AddChannelResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddChannelResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddChannelResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddChannelResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddChannelResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddChannelResponseValidationError) ErrorName() string { - return "AddChannelResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AddChannelResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sAddChannelResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddChannelResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddChannelResponseValidationError{} - -// Validate checks the field values on ChangeChannelRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangeChannelRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeChannelRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangeChannelRequestMultiError, or nil if none found. -func (m *ChangeChannelRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeChannelRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetChannelId()) < 1 { - err := ChangeChannelRequestValidationError{ - field: "ChannelId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Summary - - if all { - switch v := interface{}(m.GetEmailConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeChannelRequestValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeChannelRequestValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEmailConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeChannelRequestValidationError{ - field: "EmailConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPagerdutyConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeChannelRequestValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeChannelRequestValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPagerdutyConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeChannelRequestValidationError{ - field: "PagerdutyConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetSlackConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeChannelRequestValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeChannelRequestValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSlackConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeChannelRequestValidationError{ - field: "SlackConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetWebhookConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeChannelRequestValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeChannelRequestValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetWebhookConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeChannelRequestValidationError{ - field: "WebhookConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Disabled - - if len(errors) > 0 { - return ChangeChannelRequestMultiError(errors) - } - - return nil -} - -// ChangeChannelRequestMultiError is an error wrapping multiple validation -// errors returned by ChangeChannelRequest.ValidateAll() if the designated -// constraints aren't met. -type ChangeChannelRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeChannelRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangeChannelRequestMultiError) AllErrors() []error { return m } - -// ChangeChannelRequestValidationError is the validation error returned by -// ChangeChannelRequest.Validate if the designated constraints aren't met. -type ChangeChannelRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeChannelRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeChannelRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeChannelRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeChannelRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeChannelRequestValidationError) ErrorName() string { - return "ChangeChannelRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeChannelRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangeChannelRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeChannelRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeChannelRequestValidationError{} - -// Validate checks the field values on ChangeChannelResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangeChannelResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeChannelResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangeChannelResponseMultiError, or nil if none found. -func (m *ChangeChannelResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeChannelResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ChangeChannelResponseMultiError(errors) - } - - return nil -} - -// ChangeChannelResponseMultiError is an error wrapping multiple validation -// errors returned by ChangeChannelResponse.ValidateAll() if the designated -// constraints aren't met. -type ChangeChannelResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeChannelResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangeChannelResponseMultiError) AllErrors() []error { return m } - -// ChangeChannelResponseValidationError is the validation error returned by -// ChangeChannelResponse.Validate if the designated constraints aren't met. -type ChangeChannelResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeChannelResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeChannelResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeChannelResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeChannelResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeChannelResponseValidationError) ErrorName() string { - return "ChangeChannelResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeChannelResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangeChannelResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeChannelResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeChannelResponseValidationError{} - -// Validate checks the field values on RemoveChannelRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *RemoveChannelRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveChannelRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// RemoveChannelRequestMultiError, or nil if none found. -func (m *RemoveChannelRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveChannelRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetChannelId()) < 1 { - err := RemoveChannelRequestValidationError{ - field: "ChannelId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return RemoveChannelRequestMultiError(errors) - } - - return nil -} - -// RemoveChannelRequestMultiError is an error wrapping multiple validation -// errors returned by RemoveChannelRequest.ValidateAll() if the designated -// constraints aren't met. -type RemoveChannelRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveChannelRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RemoveChannelRequestMultiError) AllErrors() []error { return m } - -// RemoveChannelRequestValidationError is the validation error returned by -// RemoveChannelRequest.Validate if the designated constraints aren't met. -type RemoveChannelRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveChannelRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveChannelRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveChannelRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveChannelRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveChannelRequestValidationError) ErrorName() string { - return "RemoveChannelRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveChannelRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRemoveChannelRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveChannelRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveChannelRequestValidationError{} - -// Validate checks the field values on RemoveChannelResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *RemoveChannelResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveChannelResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// RemoveChannelResponseMultiError, or nil if none found. -func (m *RemoveChannelResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RemoveChannelResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RemoveChannelResponseMultiError(errors) - } - - return nil -} - -// RemoveChannelResponseMultiError is an error wrapping multiple validation -// errors returned by RemoveChannelResponse.ValidateAll() if the designated -// constraints aren't met. -type RemoveChannelResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RemoveChannelResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RemoveChannelResponseMultiError) AllErrors() []error { return m } - -// RemoveChannelResponseValidationError is the validation error returned by -// RemoveChannelResponse.Validate if the designated constraints aren't met. -type RemoveChannelResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RemoveChannelResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RemoveChannelResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RemoveChannelResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RemoveChannelResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RemoveChannelResponseValidationError) ErrorName() string { - return "RemoveChannelResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RemoveChannelResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRemoveChannelResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RemoveChannelResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RemoveChannelResponseValidationError{} diff --git a/api/managementpb/ia/channels.proto b/api/managementpb/ia/channels.proto deleted file mode 100644 index 8caa5fc0e6..0000000000 --- a/api/managementpb/ia/channels.proto +++ /dev/null @@ -1,233 +0,0 @@ -syntax = "proto3"; - -package ia.v1beta1; - -import "google/api/annotations.proto"; -import "managementpb/pagination.proto"; -import "protoc-gen-openapiv2/options/annotations.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/ia;iav1beta1"; - -// BasicAuth represents basic HTTP auth configuration. -message BasicAuth { - option deprecated = true; - - string username = 1; - string password = 2; - string password_file = 3; -} - -// TLSConfig represents TLS configuration for alertmanager -// https://prometheus.io/docs/alerting/latest/configuration/#tls_config -message TLSConfig { - option deprecated = true; - - // A path to the CA certificate file to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - string ca_file = 1; - // A path to the certificate file for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - string cert_file = 2; - // A path to the key file for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - string key_file = 3; - // Name of the server. - string server_name = 4; - // Disable validation of the server certificate. - bool insecure_skip_verify = 5; - // CA certificate to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - string ca_file_content = 6; - // A certificate for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - string cert_file_content = 7; - // A key for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - string key_file_content = 8; -} - -// HTTPConfig represents HTTP client configuration. -message HTTPConfig { - option deprecated = true; - - // Basic HTTP auth configuration. Zero value will remove it. - BasicAuth basic_auth = 1; - string bearer_token = 2; - string bearer_token_file = 3; - // TLS configuration. Zero value will remove it. - TLSConfig tls_config = 4; - string proxy_url = 5; -} - -// EmailConfig represents email configuration. -message EmailConfig { - option deprecated = true; - - bool send_resolved = 1; - repeated string to = 2 [(validate.rules).repeated.min_items = 1]; -} - -// PagerDutyConfig represents PagerDuty configuration. -message PagerDutyConfig { - option deprecated = true; - - bool send_resolved = 1; - // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. - string routing_key = 2; - // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. - string service_key = 3; -} - -// SlackConfig represents Slack configuration. -message SlackConfig { - option deprecated = true; - - bool send_resolved = 1; - string channel = 2 [(validate.rules).string.min_len = 1]; -} - -// WebhookConfig represents webhook configuration. -message WebhookConfig { - option deprecated = true; - - bool send_resolved = 1; - string url = 2 [(validate.rules).string.min_len = 1]; - HTTPConfig http_config = 3; - int32 max_alerts = 4; -} - -// Channel represents a single Notification Channel. -message Channel { - option deprecated = true; - - // reserved channels - // pushover_config = 5; - // opsgenie_config = 7; - // victorops_config = 9; - // wechat_config = 10; - - // Machine-readable ID. - string channel_id = 1; - // Short human-readable summary. - string summary = 2; - oneof channel { - EmailConfig email_config = 3; - PagerDutyConfig pagerduty_config = 4; - SlackConfig slack_config = 6; - WebhookConfig webhook_config = 8; - } - // True if that channel is disabled. - bool disabled = 11; -} - -message ListChannelsRequest { - option deprecated = true; - - // Page request. - management.PageParams page_params = 1; -} - -message ListChannelsResponse { - option deprecated = true; - - repeated Channel channels = 1; - // Total items and pages. - management.PageTotals totals = 2; -} - -message AddChannelRequest { - option deprecated = true; - - // Short human-readable summary. - string summary = 2 [(validate.rules).string.min_len = 1]; - // Email configuration. Exactly one config should be set. - EmailConfig email_config = 3; - // PagerDuty configuration. Exactly one config should be set. - PagerDutyConfig pagerduty_config = 4; - // Slack configuration. Exactly one config should be set. - SlackConfig slack_config = 6; - // Webhook configuration. Exactly one config should be set. - WebhookConfig webhook_config = 8; - // New channel status. - bool disabled = 11; -} - -message AddChannelResponse { - option deprecated = true; - - // Machine-readable ID. - string channel_id = 1; -} - -message ChangeChannelRequest { - option deprecated = true; - - // Machine-readable ID. - string channel_id = 1 [(validate.rules).string.min_len = 1]; - // Short human-readable summary. Empty value will not change it. - string summary = 2; - // Email configuration. Exactly one config should be set. - EmailConfig email_config = 3; - // PagerDuty configuration. Exactly one config should be set. - PagerDutyConfig pagerduty_config = 4; - // Slack configuration. Exactly one config should be set. - SlackConfig slack_config = 6; - // Webhook configuration. Exactly one config should be set. - WebhookConfig webhook_config = 8; - // Enables or disables that channel. Should be set. - bool disabled = 11; -} - -message ChangeChannelResponse { - option deprecated = true; -} - -message RemoveChannelRequest { - option deprecated = true; - string channel_id = 1 [(validate.rules).string.min_len = 1]; -} - -message RemoveChannelResponse { - option deprecated = true; -} - -// Channels service provides access to Notification Channels. -service Channels { - // ListChannels returns a list of all notifation channels. - rpc ListChannels(ListChannelsRequest) returns (ListChannelsResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Channels/List" - body: "*" - }; - } - // AddChannel adds notification channel. - rpc AddChannel(AddChannelRequest) returns (AddChannelResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Channels/Add" - body: "*" - }; - } - // ChangeChannel changes notification channel. - rpc ChangeChannel(ChangeChannelRequest) returns (ChangeChannelResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Channels/Change" - body: "*" - }; - } - // RemoveChannel removes notification channel. - rpc RemoveChannel(RemoveChannelRequest) returns (RemoveChannelResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Channels/Remove" - body: "*" - }; - } -} diff --git a/api/managementpb/ia/channels_grpc.pb.go b/api/managementpb/ia/channels_grpc.pb.go deleted file mode 100644 index 48806962f5..0000000000 --- a/api/managementpb/ia/channels_grpc.pb.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/ia/channels.proto - -package iav1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Channels_ListChannels_FullMethodName = "/ia.v1beta1.Channels/ListChannels" - Channels_AddChannel_FullMethodName = "/ia.v1beta1.Channels/AddChannel" - Channels_ChangeChannel_FullMethodName = "/ia.v1beta1.Channels/ChangeChannel" - Channels_RemoveChannel_FullMethodName = "/ia.v1beta1.Channels/RemoveChannel" -) - -// ChannelsClient is the client API for Channels service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ChannelsClient interface { - // Deprecated: Do not use. - // ListChannels returns a list of all notifation channels. - ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error) - // Deprecated: Do not use. - // AddChannel adds notification channel. - AddChannel(ctx context.Context, in *AddChannelRequest, opts ...grpc.CallOption) (*AddChannelResponse, error) - // Deprecated: Do not use. - // ChangeChannel changes notification channel. - ChangeChannel(ctx context.Context, in *ChangeChannelRequest, opts ...grpc.CallOption) (*ChangeChannelResponse, error) - // Deprecated: Do not use. - // RemoveChannel removes notification channel. - RemoveChannel(ctx context.Context, in *RemoveChannelRequest, opts ...grpc.CallOption) (*RemoveChannelResponse, error) -} - -type channelsClient struct { - cc grpc.ClientConnInterface -} - -func NewChannelsClient(cc grpc.ClientConnInterface) ChannelsClient { - return &channelsClient{cc} -} - -// Deprecated: Do not use. -func (c *channelsClient) ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error) { - out := new(ListChannelsResponse) - err := c.cc.Invoke(ctx, Channels_ListChannels_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *channelsClient) AddChannel(ctx context.Context, in *AddChannelRequest, opts ...grpc.CallOption) (*AddChannelResponse, error) { - out := new(AddChannelResponse) - err := c.cc.Invoke(ctx, Channels_AddChannel_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *channelsClient) ChangeChannel(ctx context.Context, in *ChangeChannelRequest, opts ...grpc.CallOption) (*ChangeChannelResponse, error) { - out := new(ChangeChannelResponse) - err := c.cc.Invoke(ctx, Channels_ChangeChannel_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *channelsClient) RemoveChannel(ctx context.Context, in *RemoveChannelRequest, opts ...grpc.CallOption) (*RemoveChannelResponse, error) { - out := new(RemoveChannelResponse) - err := c.cc.Invoke(ctx, Channels_RemoveChannel_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ChannelsServer is the server API for Channels service. -// All implementations must embed UnimplementedChannelsServer -// for forward compatibility -type ChannelsServer interface { - // Deprecated: Do not use. - // ListChannels returns a list of all notifation channels. - ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error) - // Deprecated: Do not use. - // AddChannel adds notification channel. - AddChannel(context.Context, *AddChannelRequest) (*AddChannelResponse, error) - // Deprecated: Do not use. - // ChangeChannel changes notification channel. - ChangeChannel(context.Context, *ChangeChannelRequest) (*ChangeChannelResponse, error) - // Deprecated: Do not use. - // RemoveChannel removes notification channel. - RemoveChannel(context.Context, *RemoveChannelRequest) (*RemoveChannelResponse, error) - mustEmbedUnimplementedChannelsServer() -} - -// UnimplementedChannelsServer must be embedded to have forward compatible implementations. -type UnimplementedChannelsServer struct{} - -func (UnimplementedChannelsServer) ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListChannels not implemented") -} - -func (UnimplementedChannelsServer) AddChannel(context.Context, *AddChannelRequest) (*AddChannelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddChannel not implemented") -} - -func (UnimplementedChannelsServer) ChangeChannel(context.Context, *ChangeChannelRequest) (*ChangeChannelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangeChannel not implemented") -} - -func (UnimplementedChannelsServer) RemoveChannel(context.Context, *RemoveChannelRequest) (*RemoveChannelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveChannel not implemented") -} -func (UnimplementedChannelsServer) mustEmbedUnimplementedChannelsServer() {} - -// UnsafeChannelsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ChannelsServer will -// result in compilation errors. -type UnsafeChannelsServer interface { - mustEmbedUnimplementedChannelsServer() -} - -func RegisterChannelsServer(s grpc.ServiceRegistrar, srv ChannelsServer) { - s.RegisterService(&Channels_ServiceDesc, srv) -} - -func _Channels_ListChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListChannelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChannelsServer).ListChannels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Channels_ListChannels_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChannelsServer).ListChannels(ctx, req.(*ListChannelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Channels_AddChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChannelsServer).AddChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Channels_AddChannel_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChannelsServer).AddChannel(ctx, req.(*AddChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Channels_ChangeChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChannelsServer).ChangeChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Channels_ChangeChannel_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChannelsServer).ChangeChannel(ctx, req.(*ChangeChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Channels_RemoveChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChannelsServer).RemoveChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Channels_RemoveChannel_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChannelsServer).RemoveChannel(ctx, req.(*RemoveChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Channels_ServiceDesc is the grpc.ServiceDesc for Channels service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Channels_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ia.v1beta1.Channels", - HandlerType: (*ChannelsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListChannels", - Handler: _Channels_ListChannels_Handler, - }, - { - MethodName: "AddChannel", - Handler: _Channels_AddChannel_Handler, - }, - { - MethodName: "ChangeChannel", - Handler: _Channels_ChangeChannel_Handler, - }, - { - MethodName: "RemoveChannel", - Handler: _Channels_RemoveChannel_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/ia/channels.proto", -} diff --git a/api/managementpb/ia/json/client/alerts/alerts_client.go b/api/managementpb/ia/json/client/alerts/alerts_client.go deleted file mode 100644 index ddd570bb7a..0000000000 --- a/api/managementpb/ia/json/client/alerts/alerts_client.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerts - -// 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 alerts API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for alerts API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ListAlerts(params *ListAlertsParams, opts ...ClientOption) (*ListAlertsOK, error) - - ToggleAlerts(params *ToggleAlertsParams, opts ...ClientOption) (*ToggleAlertsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ListAlerts lists alerts returns a list of all alerts -*/ -func (a *Client) ListAlerts(params *ListAlertsParams, opts ...ClientOption) (*ListAlertsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListAlertsParams() - } - op := &runtime.ClientOperation{ - ID: "ListAlerts", - Method: "POST", - PathPattern: "/v1/management/ia/Alerts/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListAlertsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListAlertsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListAlertsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ToggleAlerts toggles alerts allows to switch alerts state between silenced and unsilenced - -Pass empty list to apply toggle action to all existing alerts -*/ -func (a *Client) ToggleAlerts(params *ToggleAlertsParams, opts ...ClientOption) (*ToggleAlertsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewToggleAlertsParams() - } - op := &runtime.ClientOperation{ - ID: "ToggleAlerts", - Method: "POST", - PathPattern: "/v1/management/ia/Alerts/Toggle", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ToggleAlertsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ToggleAlertsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ToggleAlertsDefault) - 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/api/managementpb/ia/json/client/alerts/list_alerts_parameters.go b/api/managementpb/ia/json/client/alerts/list_alerts_parameters.go deleted file mode 100644 index b2937ec92e..0000000000 --- a/api/managementpb/ia/json/client/alerts/list_alerts_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerts - -// 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" -) - -// NewListAlertsParams creates a new ListAlertsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListAlertsParams() *ListAlertsParams { - return &ListAlertsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAlertsParamsWithTimeout creates a new ListAlertsParams object -// with the ability to set a timeout on a request. -func NewListAlertsParamsWithTimeout(timeout time.Duration) *ListAlertsParams { - return &ListAlertsParams{ - timeout: timeout, - } -} - -// NewListAlertsParamsWithContext creates a new ListAlertsParams object -// with the ability to set a context for a request. -func NewListAlertsParamsWithContext(ctx context.Context) *ListAlertsParams { - return &ListAlertsParams{ - Context: ctx, - } -} - -// NewListAlertsParamsWithHTTPClient creates a new ListAlertsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAlertsParamsWithHTTPClient(client *http.Client) *ListAlertsParams { - return &ListAlertsParams{ - HTTPClient: client, - } -} - -/* -ListAlertsParams contains all the parameters to send to the API endpoint - - for the list alerts operation. - - Typically these are written to a http.Request. -*/ -type ListAlertsParams struct { - // Body. - Body ListAlertsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list alerts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAlertsParams) WithDefaults() *ListAlertsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list alerts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAlertsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list alerts params -func (o *ListAlertsParams) WithTimeout(timeout time.Duration) *ListAlertsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list alerts params -func (o *ListAlertsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list alerts params -func (o *ListAlertsParams) WithContext(ctx context.Context) *ListAlertsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list alerts params -func (o *ListAlertsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list alerts params -func (o *ListAlertsParams) WithHTTPClient(client *http.Client) *ListAlertsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list alerts params -func (o *ListAlertsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list alerts params -func (o *ListAlertsParams) WithBody(body ListAlertsBody) *ListAlertsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list alerts params -func (o *ListAlertsParams) SetBody(body ListAlertsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListAlertsParams) 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/api/managementpb/ia/json/client/alerts/list_alerts_responses.go b/api/managementpb/ia/json/client/alerts/list_alerts_responses.go deleted file mode 100644 index e1728b1587..0000000000 --- a/api/managementpb/ia/json/client/alerts/list_alerts_responses.go +++ /dev/null @@ -1,2711 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "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" -) - -// ListAlertsReader is a Reader for the ListAlerts structure. -type ListAlertsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAlertsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListAlertsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListAlertsDefault(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 - } -} - -// NewListAlertsOK creates a ListAlertsOK with default headers values -func NewListAlertsOK() *ListAlertsOK { - return &ListAlertsOK{} -} - -/* -ListAlertsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListAlertsOK struct { - Payload *ListAlertsOKBody -} - -func (o *ListAlertsOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Alerts/List][%d] listAlertsOk %+v", 200, o.Payload) -} - -func (o *ListAlertsOK) GetPayload() *ListAlertsOKBody { - return o.Payload -} - -func (o *ListAlertsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAlertsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListAlertsDefault creates a ListAlertsDefault with default headers values -func NewListAlertsDefault(code int) *ListAlertsDefault { - return &ListAlertsDefault{ - _statusCode: code, - } -} - -/* -ListAlertsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListAlertsDefault struct { - _statusCode int - - Payload *ListAlertsDefaultBody -} - -// Code gets the status code for the list alerts default response -func (o *ListAlertsDefault) Code() int { - return o._statusCode -} - -func (o *ListAlertsDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Alerts/List][%d] ListAlerts default %+v", o._statusCode, o.Payload) -} - -func (o *ListAlertsDefault) GetPayload() *ListAlertsDefaultBody { - return o.Payload -} - -func (o *ListAlertsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAlertsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListAlertsBody list alerts body -swagger:model ListAlertsBody -*/ -type ListAlertsBody struct { - // page params - PageParams *ListAlertsParamsBodyPageParams `json:"page_params,omitempty"` -} - -// Validate validates this list alerts body -func (o *ListAlertsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePageParams(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsBody) validatePageParams(formats strfmt.Registry) error { - if swag.IsZero(o.PageParams) { // not required - return nil - } - - if o.PageParams != nil { - if err := o.PageParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "page_params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "page_params") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alerts body based on the context it is used -func (o *ListAlertsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidatePageParams(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsBody) contextValidatePageParams(ctx context.Context, formats strfmt.Registry) error { - if o.PageParams != nil { - if err := o.PageParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "page_params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "page_params") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsBody) UnmarshalBinary(b []byte) error { - var res ListAlertsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsDefaultBody list alerts default body -swagger:model ListAlertsDefaultBody -*/ -type ListAlertsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListAlertsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list alerts default body -func (o *ListAlertsDefaultBody) 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 *ListAlertsDefaultBody) 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("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list alerts default body based on the context it is used -func (o *ListAlertsDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListAlertsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsDefaultBodyDetailsItems0 list alerts default body details items0 -swagger:model ListAlertsDefaultBodyDetailsItems0 -*/ -type ListAlertsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this list alerts default body details items0 -func (o *ListAlertsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts default body details items0 based on context it is used -func (o *ListAlertsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListAlertsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBody list alerts OK body -swagger:model ListAlertsOKBody -*/ -type ListAlertsOKBody struct { - // alerts - Alerts []*ListAlertsOKBodyAlertsItems0 `json:"alerts"` - - // totals - Totals *ListAlertsOKBodyTotals `json:"totals,omitempty"` -} - -// Validate validates this list alerts OK body -func (o *ListAlertsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAlerts(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTotals(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBody) validateAlerts(formats strfmt.Registry) error { - if swag.IsZero(o.Alerts) { // not required - return nil - } - - for i := 0; i < len(o.Alerts); i++ { - if swag.IsZero(o.Alerts[i]) { // not required - continue - } - - if o.Alerts[i] != nil { - if err := o.Alerts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListAlertsOKBody) validateTotals(formats strfmt.Registry) error { - if swag.IsZero(o.Totals) { // not required - return nil - } - - if o.Totals != nil { - if err := o.Totals.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertsOk" + "." + "totals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listAlertsOk" + "." + "totals") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alerts OK body based on the context it is used -func (o *ListAlertsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAlerts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTotals(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBody) contextValidateAlerts(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Alerts); i++ { - if o.Alerts[i] != nil { - if err := o.Alerts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListAlertsOKBody) contextValidateTotals(ctx context.Context, formats strfmt.Registry) error { - if o.Totals != nil { - if err := o.Totals.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertsOk" + "." + "totals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listAlertsOk" + "." + "totals") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBody) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0 Alert represents Alert. -swagger:model ListAlertsOKBodyAlertsItems0 -*/ -type ListAlertsOKBodyAlertsItems0 struct { - // ID. - AlertID string `json:"alert_id,omitempty"` - - // Human-readable summary. - Summary string `json:"summary,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - Severity *string `json:"severity,omitempty"` - - // Status represents Alert Rule's and Alert's combined status. - // - // - CLEAR: No alert. - // - PENDING: Pending, but not triggering alert. - // - TRIGGERING: Triggering (firing) alert. - // - SILENCED: Silenced alert. - // Enum: [STATUS_INVALID CLEAR PENDING TRIGGERING SILENCED] - Status *string `json:"status,omitempty"` - - // Combined labels. - Labels map[string]string `json:"labels,omitempty"` - - // Alert creation time. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // Alert last update time. - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` - - // rule - Rule *ListAlertsOKBodyAlertsItems0Rule `json:"rule,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 -func (o *ListAlertsOKBodyAlertsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRule(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertsOkBodyAlertsItems0TypeSeverityPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_INVALID","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0TypeSeverityPropEnum = append(listAlertsOkBodyAlertsItems0TypeSeverityPropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" - - // ListAlertsOKBodyAlertsItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - ListAlertsOKBodyAlertsItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0TypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -var listAlertsOkBodyAlertsItems0TypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["STATUS_INVALID","CLEAR","PENDING","TRIGGERING","SILENCED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0TypeStatusPropEnum = append(listAlertsOkBodyAlertsItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0StatusSTATUSINVALID captures enum value "STATUS_INVALID" - ListAlertsOKBodyAlertsItems0StatusSTATUSINVALID string = "STATUS_INVALID" - - // ListAlertsOKBodyAlertsItems0StatusCLEAR captures enum value "CLEAR" - ListAlertsOKBodyAlertsItems0StatusCLEAR string = "CLEAR" - - // ListAlertsOKBodyAlertsItems0StatusPENDING captures enum value "PENDING" - ListAlertsOKBodyAlertsItems0StatusPENDING string = "PENDING" - - // ListAlertsOKBodyAlertsItems0StatusTRIGGERING captures enum value "TRIGGERING" - ListAlertsOKBodyAlertsItems0StatusTRIGGERING string = "TRIGGERING" - - // ListAlertsOKBodyAlertsItems0StatusSILENCED captures enum value "SILENCED" - ListAlertsOKBodyAlertsItems0StatusSILENCED string = "SILENCED" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0) validateRule(formats strfmt.Registry) error { - if swag.IsZero(o.Rule) { // not required - return nil - } - - if o.Rule != nil { - if err := o.Rule.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alerts OK body alerts items0 based on the context it is used -func (o *ListAlertsOKBodyAlertsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRule(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0) contextValidateRule(ctx context.Context, formats strfmt.Registry) error { - if o.Rule != nil { - if err := o.Rule.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0Rule Rule represents Alert Rule. -swagger:model ListAlertsOKBodyAlertsItems0Rule -*/ -type ListAlertsOKBodyAlertsItems0Rule struct { - // Rule ID. - RuleID string `json:"rule_id,omitempty"` - - // Rule name. - Name string `json:"name,omitempty"` - - // Rule human-readable summary. - Summary string `json:"summary,omitempty"` - - // Template used for this rule. - TemplateName string `json:"template_name,omitempty"` - - // True if that rule is disabled. - Disabled bool `json:"disabled,omitempty"` - - // Expression template. - ExprTemplate string `json:"expr_template,omitempty"` - - // Expression filled with parameters. - Expr string `json:"expr,omitempty"` - - // Expression parameters definitions. - ParamsDefinitions []*ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 `json:"params_definitions"` - - // Expression parameters values. - ParamsValues []*ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 `json:"params_values"` - - // Default for duration. - DefaultFor string `json:"default_for,omitempty"` - - // For duration. - For string `json:"for,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - DefaultSeverity *string `json:"default_severity,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - Severity *string `json:"severity,omitempty"` - - // Custom labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Labels. - Labels map[string]string `json:"labels,omitempty"` - - // Annotations. - Annotations map[string]string `json:"annotations,omitempty"` - - // Filters. - Filters []*ListAlertsOKBodyAlertsItems0RuleFiltersItems0 `json:"filters"` - - // Channels. - Channels []*ListAlertsOKBodyAlertsItems0RuleChannelsItems0 `json:"channels"` - - // Rule creation time. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule -func (o *ListAlertsOKBodyAlertsItems0Rule) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParamsDefinitions(formats); err != nil { - res = append(res, err) - } - - if err := o.validateParamsValues(formats); err != nil { - res = append(res, err) - } - - if err := o.validateDefaultSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFilters(formats); err != nil { - res = append(res, err) - } - - if err := o.validateChannels(formats); err != nil { - res = append(res, err) - } - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) validateParamsDefinitions(formats strfmt.Registry) error { - if swag.IsZero(o.ParamsDefinitions) { // not required - return nil - } - - for i := 0; i < len(o.ParamsDefinitions); i++ { - if swag.IsZero(o.ParamsDefinitions[i]) { // not required - continue - } - - if o.ParamsDefinitions[i] != nil { - if err := o.ParamsDefinitions[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) validateParamsValues(formats strfmt.Registry) error { - if swag.IsZero(o.ParamsValues) { // not required - return nil - } - - for i := 0; i < len(o.ParamsValues); i++ { - if swag.IsZero(o.ParamsValues[i]) { // not required - continue - } - - if o.ParamsValues[i] != nil { - if err := o.ParamsValues[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var listAlertsOkBodyAlertsItems0RuleTypeDefaultSeverityPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_INVALID","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0RuleTypeDefaultSeverityPropEnum = append(listAlertsOkBodyAlertsItems0RuleTypeDefaultSeverityPropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYINVALID string = "SEVERITY_INVALID" - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYINFO string = "SEVERITY_INFO" - - // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0Rule) validateDefaultSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleTypeDefaultSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) validateDefaultSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.DefaultSeverity) { // not required - return nil - } - - // value enum - if err := o.validateDefaultSeverityEnum("rule"+"."+"default_severity", "body", *o.DefaultSeverity); err != nil { - return err - } - - return nil -} - -var listAlertsOkBodyAlertsItems0RuleTypeSeverityPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_INVALID","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0RuleTypeSeverityPropEnum = append(listAlertsOkBodyAlertsItems0RuleTypeSeverityPropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYINVALID string = "SEVERITY_INVALID" - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYINFO string = "SEVERITY_INFO" - - // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0Rule) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleTypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("rule"+"."+"severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) validateFilters(formats strfmt.Registry) error { - if swag.IsZero(o.Filters) { // not required - return nil - } - - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue - } - - if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) validateChannels(formats strfmt.Registry) error { - if swag.IsZero(o.Channels) { // not required - return nil - } - - for i := 0; i < len(o.Channels); i++ { - if swag.IsZero(o.Channels[i]) { // not required - continue - } - - if o.Channels[i] != nil { - if err := o.Channels[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("rule"+"."+"created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this list alerts OK body alerts items0 rule based on the context it is used -func (o *ListAlertsOKBodyAlertsItems0Rule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateParamsDefinitions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateParamsValues(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateFilters(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateChannels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) contextValidateParamsDefinitions(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.ParamsDefinitions); i++ { - if o.ParamsDefinitions[i] != nil { - if err := o.ParamsDefinitions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) contextValidateParamsValues(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.ParamsValues); i++ { - if o.ParamsValues[i] != nil { - if err := o.ParamsValues[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Filters); i++ { - if o.Filters[i] != nil { - if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0Rule) contextValidateChannels(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Channels); i++ { - if o.Channels[i] != nil { - if err := o.Channels[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0Rule) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0Rule) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0Rule - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleChannelsItems0 Channel represents a single Notification Channel. -swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0 -*/ -type ListAlertsOKBodyAlertsItems0RuleChannelsItems0 struct { - // Machine-readable ID. - ChannelID string `json:"channel_id,omitempty"` - - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // True if that channel is disabled. - Disabled bool `json:"disabled,omitempty"` - - // email config - EmailConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig `json:"email_config,omitempty"` - - // pagerduty config - PagerdutyConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` - - // slack config - SlackConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig `json:"slack_config,omitempty"` - - // webhook config - WebhookConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule channels items0 -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEmailConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePagerdutyConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSlackConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateWebhookConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { - if swag.IsZero(o.EmailConfig) { // not required - return nil - } - - if o.EmailConfig != nil { - if err := o.EmailConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("email_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PagerdutyConfig) { // not required - return nil - } - - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { - if swag.IsZero(o.SlackConfig) { // not required - return nil - } - - if o.SlackConfig != nil { - if err := o.SlackConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("slack_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { - if swag.IsZero(o.WebhookConfig) { // not required - return nil - } - - if o.WebhookConfig != nil { - if err := o.WebhookConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alerts OK body alerts items0 rule channels items0 based on the context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateEmailConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateSlackConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { - if o.EmailConfig != nil { - if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("email_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { - if o.SlackConfig != nil { - if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("slack_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { - if o.WebhookConfig != nil { - if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig EmailConfig represents email configuration. -swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig -*/ -type ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // to - To []string `json:"to"` -} - -// Validate validates this list alerts OK body alerts items0 rule channels items0 email config -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 email config based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. -swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig -*/ -type ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. - RoutingKey string `json:"routing_key,omitempty"` - - // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. - ServiceKey string `json:"service_key,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule channels items0 pagerduty config -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 pagerduty config based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig SlackConfig represents Slack configuration. -swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig -*/ -type ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // channel - Channel string `json:"channel,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule channels items0 slack config -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 slack config based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. -swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig -*/ -type ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // url - URL string `json:"url,omitempty"` - - // max alerts - MaxAlerts int32 `json:"max_alerts,omitempty"` - - // http config - HTTPConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule channels items0 webhook config -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHTTPConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - if swag.IsZero(o.HTTPConfig) { // not required - return nil - } - - if o.HTTPConfig != nil { - if err := o.HTTPConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alerts OK body alerts items0 rule channels items0 webhook config based on the context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { - if o.HTTPConfig != nil { - if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. -swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig -*/ -type ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig struct { - // bearer token - BearerToken string `json:"bearer_token,omitempty"` - - // bearer token file - BearerTokenFile string `json:"bearer_token_file,omitempty"` - - // proxy url - ProxyURL string `json:"proxy_url,omitempty"` - - // basic auth - BasicAuth *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` - - // tls config - TLSConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBasicAuth(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTLSConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - if swag.IsZero(o.BasicAuth) { // not required - return nil - } - - if o.BasicAuth != nil { - if err := o.BasicAuth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - if swag.IsZero(o.TLSConfig) { // not required - return nil - } - - if o.TLSConfig != nil { - if err := o.TLSConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config based on the context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBasicAuth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTLSConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { - if o.BasicAuth != nil { - if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { - if o.TLSConfig != nil { - if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. -swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth -*/ -type ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { - // username - Username string `json:"username,omitempty"` - - // password - Password string `json:"password,omitempty"` - - // password file - PasswordFile string `json:"password_file,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config basic auth -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config basic auth based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager -// https://prometheus.io/docs/alerting/latest/configuration/#tls_config -swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig -*/ -type ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { - // A path to the CA certificate file to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFile string `json:"ca_file,omitempty"` - - // A path to the certificate file for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFile string `json:"cert_file,omitempty"` - - // A path to the key file for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFile string `json:"key_file,omitempty"` - - // Name of the server. - ServerName string `json:"server_name,omitempty"` - - // Disable validation of the server certificate. - InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` - - // CA certificate to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFileContent string `json:"ca_file_content,omitempty"` - - // A certificate for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFileContent string `json:"cert_file_content,omitempty"` - - // A key for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFileContent string `json:"key_file_content,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config TLS config -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config TLS config based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleFiltersItems0 Filter repsents a single filter condition. -swagger:model ListAlertsOKBodyAlertsItems0RuleFiltersItems0 -*/ -type ListAlertsOKBodyAlertsItems0RuleFiltersItems0 struct { - // FilterType represents filter matching type. - // - // - EQUAL: = - // - // != - // NOT_EQUAL = 2; - // - REGEX: =~ - // - // !~ - // NOT_REGEX = 4; - // Enum: [FILTER_TYPE_INVALID EQUAL REGEX] - Type *string `json:"type,omitempty"` - - // key - Key string `json:"key,omitempty"` - - // value - Value string `json:"value,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule filters items0 -func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertsOkBodyAlertsItems0RuleFiltersItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["FILTER_TYPE_INVALID","EQUAL","REGEX"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0RuleFiltersItems0TypeTypePropEnum = append(listAlertsOkBodyAlertsItems0RuleFiltersItems0TypeTypePropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" - ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" - - // ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeEQUAL captures enum value "EQUAL" - ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeEQUAL string = "EQUAL" - - // ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeREGEX captures enum value "REGEX" - ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeREGEX string = "REGEX" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleFiltersItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule filters items0 based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleFiltersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 ParamDefinition represents a single query parameter. -swagger:model ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 -*/ -type ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // Short human-readable parameter summary. - Summary string `json:"summary,omitempty"` - - // ParamUnit represents template parameter unit. - // - // - PARAM_UNIT_INVALID: Invalid, unknown or absent. - // - PERCENTAGE: % - // - SECONDS: s - // Enum: [PARAM_UNIT_INVALID PERCENTAGE SECONDS] - Unit *string `json:"unit,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // bool - Bool *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool `json:"bool,omitempty"` - - // float - Float *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float `json:"float,omitempty"` - - // string - String *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String `json:"string,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule params definitions items0 -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateUnit(formats); err != nil { - res = append(res, err) - } - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if err := o.validateBool(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFloat(formats); err != nil { - res = append(res, err) - } - - if err := o.validateString(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_UNIT_INVALID","PERCENTAGE","SECONDS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum = append(listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitPARAMUNITINVALID captures enum value "PARAM_UNIT_INVALID" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitPARAMUNITINVALID string = "PARAM_UNIT_INVALID" - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitPERCENTAGE captures enum value "PERCENTAGE" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitPERCENTAGE string = "PERCENTAGE" - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitSECONDS captures enum value "SECONDS" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitSECONDS string = "SECONDS" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateUnitEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateUnit(formats strfmt.Registry) error { - if swag.IsZero(o.Unit) { // not required - return nil - } - - // value enum - if err := o.validateUnitEnum("unit", "body", *o.Unit); err != nil { - return err - } - - return nil -} - -var listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum = append(listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeBOOL captures enum value "BOOL" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeBOOL string = "BOOL" - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeFLOAT captures enum value "FLOAT" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeFLOAT string = "FLOAT" - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeSTRING captures enum value "STRING" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeSTRING string = "STRING" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateBool(formats strfmt.Registry) error { - if swag.IsZero(o.Bool) { // not required - return nil - } - - if o.Bool != nil { - if err := o.Bool.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("bool") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("bool") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateFloat(formats strfmt.Registry) error { - if swag.IsZero(o.Float) { // not required - return nil - } - - if o.Float != nil { - if err := o.Float.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("float") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("float") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateString(formats strfmt.Registry) error { - if swag.IsZero(o.String) { // not required - return nil - } - - if o.String != nil { - if err := o.String.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("string") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("string") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alerts OK body alerts items0 rule params definitions items0 based on the context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBool(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateFloat(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateString(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) contextValidateBool(ctx context.Context, formats strfmt.Registry) error { - if o.Bool != nil { - if err := o.Bool.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("bool") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("bool") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) contextValidateFloat(ctx context.Context, formats strfmt.Registry) error { - if o.Float != nil { - if err := o.Float.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("float") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("float") - } - return err - } - } - - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) contextValidateString(ctx context.Context, formats strfmt.Registry) error { - if o.String != nil { - if err := o.String.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("string") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("string") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool BoolParamDefinition represents boolean parameter's default value. -swagger:model ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool -*/ -type ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool struct { - // BooleanFlag represent a command to set some boolean property to true, - // to false, or avoid changing that property. - // - // - DO_NOT_CHANGE: Do not change boolean property. Default value. - // - TRUE: True. - // - FALSE: False. - // Enum: [DO_NOT_CHANGE TRUE FALSE] - Default *string `json:"default,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule params definitions items0 bool -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDefault(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DO_NOT_CHANGE","TRUE","FALSE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum = append(listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultDONOTCHANGE captures enum value "DO_NOT_CHANGE" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultDONOTCHANGE string = "DO_NOT_CHANGE" - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultTRUE captures enum value "TRUE" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultTRUE string = "TRUE" - - // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultFALSE captures enum value "FALSE" - ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultFALSE string = "FALSE" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) validateDefaultEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) validateDefault(formats strfmt.Registry) error { - if swag.IsZero(o.Default) { // not required - return nil - } - - // value enum - if err := o.validateDefaultEnum("bool"+"."+"default", "body", *o.Default); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule params definitions items0 bool based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float FloatParamDefinition represents float parameter's default value and valid range. -swagger:model ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float -*/ -type ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float struct { - // True if default value is set. - HasDefault bool `json:"has_default,omitempty"` - - // Default value if has_default is true. - Default float64 `json:"default,omitempty"` - - // True if minimal valid value is set. - HasMin bool `json:"has_min,omitempty"` - - // Minimal valid value (inclusive) if has_min is true. - Min float64 `json:"min,omitempty"` - - // True if maximal valid value is set. - HasMax bool `json:"has_max,omitempty"` - - // Maximal valid value (inclusive) if has_max is true. - Max float64 `json:"max,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule params definitions items0 float -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule params definitions items0 float based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String StringParamDefinition represents string parameter's default value. -swagger:model ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String -*/ -type ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String struct { - // True if default value is set. - HasDefault bool `json:"has_default,omitempty"` - - // Default value if has_default is true. - Default string `json:"default,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule params definitions items0 string -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule params definitions items0 string based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. -swagger:model ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 -*/ -type ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // Bool value. - Bool bool `json:"bool,omitempty"` - - // Float value. - Float float64 `json:"float,omitempty"` - - // String value. - String string `json:"string,omitempty"` -} - -// Validate validates this list alerts OK body alerts items0 rule params values items0 -func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertsOkBodyAlertsItems0RuleParamsValuesItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertsOkBodyAlertsItems0RuleParamsValuesItems0TypeTypePropEnum = append(listAlertsOkBodyAlertsItems0RuleParamsValuesItems0TypeTypePropEnum, v) - } -} - -const ( - - // ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - - // ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeBOOL captures enum value "BOOL" - ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeBOOL string = "BOOL" - - // ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeFLOAT captures enum value "FLOAT" - ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeFLOAT string = "FLOAT" - - // ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeSTRING captures enum value "STRING" - ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeSTRING string = "STRING" -) - -// prop value enum -func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleParamsValuesItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list alerts OK body alerts items0 rule params values items0 based on context it is used -func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsOKBodyTotals PageTotals represents total values for pagination. -swagger:model ListAlertsOKBodyTotals -*/ -type ListAlertsOKBodyTotals struct { - // Total number of results. - TotalItems int32 `json:"total_items,omitempty"` - - // Total number of pages. - TotalPages int32 `json:"total_pages,omitempty"` -} - -// Validate validates this list alerts OK body totals -func (o *ListAlertsOKBodyTotals) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts OK body totals based on context it is used -func (o *ListAlertsOKBodyTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsOKBodyTotals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsOKBodyTotals) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBodyTotals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertsParamsBodyPageParams PageParams represents page request parameters for pagination. -swagger:model ListAlertsParamsBodyPageParams -*/ -type ListAlertsParamsBodyPageParams struct { - // Maximum number of results per page. - PageSize int32 `json:"page_size,omitempty"` - - // Index of the requested page, starts from 0. - Index int32 `json:"index,omitempty"` -} - -// Validate validates this list alerts params body page params -func (o *ListAlertsParamsBodyPageParams) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alerts params body page params based on context it is used -func (o *ListAlertsParamsBodyPageParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertsParamsBodyPageParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsParamsBodyPageParams) UnmarshalBinary(b []byte) error { - var res ListAlertsParamsBodyPageParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/alerts/toggle_alerts_parameters.go b/api/managementpb/ia/json/client/alerts/toggle_alerts_parameters.go deleted file mode 100644 index 91f845542b..0000000000 --- a/api/managementpb/ia/json/client/alerts/toggle_alerts_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerts - -// 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" -) - -// NewToggleAlertsParams creates a new ToggleAlertsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewToggleAlertsParams() *ToggleAlertsParams { - return &ToggleAlertsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewToggleAlertsParamsWithTimeout creates a new ToggleAlertsParams object -// with the ability to set a timeout on a request. -func NewToggleAlertsParamsWithTimeout(timeout time.Duration) *ToggleAlertsParams { - return &ToggleAlertsParams{ - timeout: timeout, - } -} - -// NewToggleAlertsParamsWithContext creates a new ToggleAlertsParams object -// with the ability to set a context for a request. -func NewToggleAlertsParamsWithContext(ctx context.Context) *ToggleAlertsParams { - return &ToggleAlertsParams{ - Context: ctx, - } -} - -// NewToggleAlertsParamsWithHTTPClient creates a new ToggleAlertsParams object -// with the ability to set a custom HTTPClient for a request. -func NewToggleAlertsParamsWithHTTPClient(client *http.Client) *ToggleAlertsParams { - return &ToggleAlertsParams{ - HTTPClient: client, - } -} - -/* -ToggleAlertsParams contains all the parameters to send to the API endpoint - - for the toggle alerts operation. - - Typically these are written to a http.Request. -*/ -type ToggleAlertsParams struct { - // Body. - Body ToggleAlertsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the toggle alerts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ToggleAlertsParams) WithDefaults() *ToggleAlertsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the toggle alerts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ToggleAlertsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the toggle alerts params -func (o *ToggleAlertsParams) WithTimeout(timeout time.Duration) *ToggleAlertsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the toggle alerts params -func (o *ToggleAlertsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the toggle alerts params -func (o *ToggleAlertsParams) WithContext(ctx context.Context) *ToggleAlertsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the toggle alerts params -func (o *ToggleAlertsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the toggle alerts params -func (o *ToggleAlertsParams) WithHTTPClient(client *http.Client) *ToggleAlertsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the toggle alerts params -func (o *ToggleAlertsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the toggle alerts params -func (o *ToggleAlertsParams) WithBody(body ToggleAlertsBody) *ToggleAlertsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the toggle alerts params -func (o *ToggleAlertsParams) SetBody(body ToggleAlertsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ToggleAlertsParams) 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/api/managementpb/ia/json/client/alerts/toggle_alerts_responses.go b/api/managementpb/ia/json/client/alerts/toggle_alerts_responses.go deleted file mode 100644 index bba76b097d..0000000000 --- a/api/managementpb/ia/json/client/alerts/toggle_alerts_responses.go +++ /dev/null @@ -1,361 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package alerts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "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" -) - -// ToggleAlertsReader is a Reader for the ToggleAlerts structure. -type ToggleAlertsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ToggleAlertsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewToggleAlertsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewToggleAlertsDefault(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 - } -} - -// NewToggleAlertsOK creates a ToggleAlertsOK with default headers values -func NewToggleAlertsOK() *ToggleAlertsOK { - return &ToggleAlertsOK{} -} - -/* -ToggleAlertsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ToggleAlertsOK struct { - Payload interface{} -} - -func (o *ToggleAlertsOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Alerts/Toggle][%d] toggleAlertsOk %+v", 200, o.Payload) -} - -func (o *ToggleAlertsOK) GetPayload() interface{} { - return o.Payload -} - -func (o *ToggleAlertsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewToggleAlertsDefault creates a ToggleAlertsDefault with default headers values -func NewToggleAlertsDefault(code int) *ToggleAlertsDefault { - return &ToggleAlertsDefault{ - _statusCode: code, - } -} - -/* -ToggleAlertsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ToggleAlertsDefault struct { - _statusCode int - - Payload *ToggleAlertsDefaultBody -} - -// Code gets the status code for the toggle alerts default response -func (o *ToggleAlertsDefault) Code() int { - return o._statusCode -} - -func (o *ToggleAlertsDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Alerts/Toggle][%d] ToggleAlerts default %+v", o._statusCode, o.Payload) -} - -func (o *ToggleAlertsDefault) GetPayload() *ToggleAlertsDefaultBody { - return o.Payload -} - -func (o *ToggleAlertsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ToggleAlertsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ToggleAlertsBody toggle alerts body -swagger:model ToggleAlertsBody -*/ -type ToggleAlertsBody struct { - // List of alerts that silence state should be switched. If provided array is empty than all - // existing alerts are switched. - AlertIds []string `json:"alert_ids"` - - // BooleanFlag represent a command to set some boolean property to true, - // to false, or avoid changing that property. - // - // - DO_NOT_CHANGE: Do not change boolean property. Default value. - // - TRUE: True. - // - FALSE: False. - // Enum: [DO_NOT_CHANGE TRUE FALSE] - Silenced *string `json:"silenced,omitempty"` -} - -// Validate validates this toggle alerts body -func (o *ToggleAlertsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSilenced(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var toggleAlertsBodyTypeSilencedPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DO_NOT_CHANGE","TRUE","FALSE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - toggleAlertsBodyTypeSilencedPropEnum = append(toggleAlertsBodyTypeSilencedPropEnum, v) - } -} - -const ( - - // ToggleAlertsBodySilencedDONOTCHANGE captures enum value "DO_NOT_CHANGE" - ToggleAlertsBodySilencedDONOTCHANGE string = "DO_NOT_CHANGE" - - // ToggleAlertsBodySilencedTRUE captures enum value "TRUE" - ToggleAlertsBodySilencedTRUE string = "TRUE" - - // ToggleAlertsBodySilencedFALSE captures enum value "FALSE" - ToggleAlertsBodySilencedFALSE string = "FALSE" -) - -// prop value enum -func (o *ToggleAlertsBody) validateSilencedEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, toggleAlertsBodyTypeSilencedPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ToggleAlertsBody) validateSilenced(formats strfmt.Registry) error { - if swag.IsZero(o.Silenced) { // not required - return nil - } - - // value enum - if err := o.validateSilencedEnum("body"+"."+"silenced", "body", *o.Silenced); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this toggle alerts body based on context it is used -func (o *ToggleAlertsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ToggleAlertsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ToggleAlertsBody) UnmarshalBinary(b []byte) error { - var res ToggleAlertsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ToggleAlertsDefaultBody toggle alerts default body -swagger:model ToggleAlertsDefaultBody -*/ -type ToggleAlertsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ToggleAlertsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this toggle alerts default body -func (o *ToggleAlertsDefaultBody) 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 *ToggleAlertsDefaultBody) 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("ToggleAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ToggleAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this toggle alerts default body based on the context it is used -func (o *ToggleAlertsDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ToggleAlertsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ToggleAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ToggleAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ToggleAlertsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ToggleAlertsDefaultBody) UnmarshalBinary(b []byte) error { - var res ToggleAlertsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ToggleAlertsDefaultBodyDetailsItems0 toggle alerts default body details items0 -swagger:model ToggleAlertsDefaultBodyDetailsItems0 -*/ -type ToggleAlertsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this toggle alerts default body details items0 -func (o *ToggleAlertsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this toggle alerts default body details items0 based on context it is used -func (o *ToggleAlertsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ToggleAlertsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ToggleAlertsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ToggleAlertsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/channels/add_channel_parameters.go b/api/managementpb/ia/json/client/channels/add_channel_parameters.go deleted file mode 100644 index dda611d4a5..0000000000 --- a/api/managementpb/ia/json/client/channels/add_channel_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// 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" -) - -// NewAddChannelParams creates a new AddChannelParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAddChannelParams() *AddChannelParams { - return &AddChannelParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddChannelParamsWithTimeout creates a new AddChannelParams object -// with the ability to set a timeout on a request. -func NewAddChannelParamsWithTimeout(timeout time.Duration) *AddChannelParams { - return &AddChannelParams{ - timeout: timeout, - } -} - -// NewAddChannelParamsWithContext creates a new AddChannelParams object -// with the ability to set a context for a request. -func NewAddChannelParamsWithContext(ctx context.Context) *AddChannelParams { - return &AddChannelParams{ - Context: ctx, - } -} - -// NewAddChannelParamsWithHTTPClient creates a new AddChannelParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddChannelParamsWithHTTPClient(client *http.Client) *AddChannelParams { - return &AddChannelParams{ - HTTPClient: client, - } -} - -/* -AddChannelParams contains all the parameters to send to the API endpoint - - for the add channel operation. - - Typically these are written to a http.Request. -*/ -type AddChannelParams struct { - // Body. - Body AddChannelBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add channel params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddChannelParams) WithDefaults() *AddChannelParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add channel params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddChannelParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add channel params -func (o *AddChannelParams) WithTimeout(timeout time.Duration) *AddChannelParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add channel params -func (o *AddChannelParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add channel params -func (o *AddChannelParams) WithContext(ctx context.Context) *AddChannelParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add channel params -func (o *AddChannelParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add channel params -func (o *AddChannelParams) WithHTTPClient(client *http.Client) *AddChannelParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add channel params -func (o *AddChannelParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the add channel params -func (o *AddChannelParams) WithBody(body AddChannelBody) *AddChannelParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the add channel params -func (o *AddChannelParams) SetBody(body AddChannelBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *AddChannelParams) 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/api/managementpb/ia/json/client/channels/add_channel_responses.go b/api/managementpb/ia/json/client/channels/add_channel_responses.go deleted file mode 100644 index 96a7a1f087..0000000000 --- a/api/managementpb/ia/json/client/channels/add_channel_responses.go +++ /dev/null @@ -1,999 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AddChannelReader is a Reader for the AddChannel structure. -type AddChannelReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddChannelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewAddChannelOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewAddChannelDefault(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 - } -} - -// NewAddChannelOK creates a AddChannelOK with default headers values -func NewAddChannelOK() *AddChannelOK { - return &AddChannelOK{} -} - -/* -AddChannelOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type AddChannelOK struct { - Payload *AddChannelOKBody -} - -func (o *AddChannelOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Channels/Add][%d] addChannelOk %+v", 200, o.Payload) -} - -func (o *AddChannelOK) GetPayload() *AddChannelOKBody { - return o.Payload -} - -func (o *AddChannelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddChannelOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAddChannelDefault creates a AddChannelDefault with default headers values -func NewAddChannelDefault(code int) *AddChannelDefault { - return &AddChannelDefault{ - _statusCode: code, - } -} - -/* -AddChannelDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type AddChannelDefault struct { - _statusCode int - - Payload *AddChannelDefaultBody -} - -// Code gets the status code for the add channel default response -func (o *AddChannelDefault) Code() int { - return o._statusCode -} - -func (o *AddChannelDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Channels/Add][%d] AddChannel default %+v", o._statusCode, o.Payload) -} - -func (o *AddChannelDefault) GetPayload() *AddChannelDefaultBody { - return o.Payload -} - -func (o *AddChannelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(AddChannelDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -AddChannelBody add channel body -swagger:model AddChannelBody -*/ -type AddChannelBody struct { - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // New channel status. - Disabled bool `json:"disabled,omitempty"` - - // email config - EmailConfig *AddChannelParamsBodyEmailConfig `json:"email_config,omitempty"` - - // pagerduty config - PagerdutyConfig *AddChannelParamsBodyPagerdutyConfig `json:"pagerduty_config,omitempty"` - - // slack config - SlackConfig *AddChannelParamsBodySlackConfig `json:"slack_config,omitempty"` - - // webhook config - WebhookConfig *AddChannelParamsBodyWebhookConfig `json:"webhook_config,omitempty"` -} - -// Validate validates this add channel body -func (o *AddChannelBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEmailConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePagerdutyConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSlackConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateWebhookConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddChannelBody) validateEmailConfig(formats strfmt.Registry) error { - if swag.IsZero(o.EmailConfig) { // not required - return nil - } - - if o.EmailConfig != nil { - if err := o.EmailConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "email_config") - } - return err - } - } - - return nil -} - -func (o *AddChannelBody) validatePagerdutyConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PagerdutyConfig) { // not required - return nil - } - - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *AddChannelBody) validateSlackConfig(formats strfmt.Registry) error { - if swag.IsZero(o.SlackConfig) { // not required - return nil - } - - if o.SlackConfig != nil { - if err := o.SlackConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "slack_config") - } - return err - } - } - - return nil -} - -func (o *AddChannelBody) validateWebhookConfig(formats strfmt.Registry) error { - if swag.IsZero(o.WebhookConfig) { // not required - return nil - } - - if o.WebhookConfig != nil { - if err := o.WebhookConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this add channel body based on the context it is used -func (o *AddChannelBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateEmailConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateSlackConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddChannelBody) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { - if o.EmailConfig != nil { - if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "email_config") - } - return err - } - } - - return nil -} - -func (o *AddChannelBody) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *AddChannelBody) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { - if o.SlackConfig != nil { - if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "slack_config") - } - return err - } - } - - return nil -} - -func (o *AddChannelBody) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { - if o.WebhookConfig != nil { - if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelBody) UnmarshalBinary(b []byte) error { - var res AddChannelBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelDefaultBody add channel default body -swagger:model AddChannelDefaultBody -*/ -type AddChannelDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*AddChannelDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this add channel default body -func (o *AddChannelDefaultBody) 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 *AddChannelDefaultBody) 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("AddChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("AddChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this add channel default body based on the context it is used -func (o *AddChannelDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddChannelDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("AddChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("AddChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelDefaultBody) UnmarshalBinary(b []byte) error { - var res AddChannelDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelDefaultBodyDetailsItems0 add channel default body details items0 -swagger:model AddChannelDefaultBodyDetailsItems0 -*/ -type AddChannelDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this add channel default body details items0 -func (o *AddChannelDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add channel default body details items0 based on context it is used -func (o *AddChannelDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res AddChannelDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelOKBody add channel OK body -swagger:model AddChannelOKBody -*/ -type AddChannelOKBody struct { - // Machine-readable ID. - ChannelID string `json:"channel_id,omitempty"` -} - -// Validate validates this add channel OK body -func (o *AddChannelOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add channel OK body based on context it is used -func (o *AddChannelOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelOKBody) UnmarshalBinary(b []byte) error { - var res AddChannelOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelParamsBodyEmailConfig EmailConfig represents email configuration. -swagger:model AddChannelParamsBodyEmailConfig -*/ -type AddChannelParamsBodyEmailConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // to - To []string `json:"to"` -} - -// Validate validates this add channel params body email config -func (o *AddChannelParamsBodyEmailConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add channel params body email config based on context it is used -func (o *AddChannelParamsBodyEmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelParamsBodyEmailConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelParamsBodyEmailConfig) UnmarshalBinary(b []byte) error { - var res AddChannelParamsBodyEmailConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelParamsBodyPagerdutyConfig PagerDutyConfig represents PagerDuty configuration. -swagger:model AddChannelParamsBodyPagerdutyConfig -*/ -type AddChannelParamsBodyPagerdutyConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. - RoutingKey string `json:"routing_key,omitempty"` - - // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. - ServiceKey string `json:"service_key,omitempty"` -} - -// Validate validates this add channel params body pagerduty config -func (o *AddChannelParamsBodyPagerdutyConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add channel params body pagerduty config based on context it is used -func (o *AddChannelParamsBodyPagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelParamsBodyPagerdutyConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelParamsBodyPagerdutyConfig) UnmarshalBinary(b []byte) error { - var res AddChannelParamsBodyPagerdutyConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelParamsBodySlackConfig SlackConfig represents Slack configuration. -swagger:model AddChannelParamsBodySlackConfig -*/ -type AddChannelParamsBodySlackConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // channel - Channel string `json:"channel,omitempty"` -} - -// Validate validates this add channel params body slack config -func (o *AddChannelParamsBodySlackConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add channel params body slack config based on context it is used -func (o *AddChannelParamsBodySlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelParamsBodySlackConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelParamsBodySlackConfig) UnmarshalBinary(b []byte) error { - var res AddChannelParamsBodySlackConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelParamsBodyWebhookConfig WebhookConfig represents webhook configuration. -swagger:model AddChannelParamsBodyWebhookConfig -*/ -type AddChannelParamsBodyWebhookConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // url - URL string `json:"url,omitempty"` - - // max alerts - MaxAlerts int32 `json:"max_alerts,omitempty"` - - // http config - HTTPConfig *AddChannelParamsBodyWebhookConfigHTTPConfig `json:"http_config,omitempty"` -} - -// Validate validates this add channel params body webhook config -func (o *AddChannelParamsBodyWebhookConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHTTPConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddChannelParamsBodyWebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - if swag.IsZero(o.HTTPConfig) { // not required - return nil - } - - if o.HTTPConfig != nil { - if err := o.HTTPConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this add channel params body webhook config based on the context it is used -func (o *AddChannelParamsBodyWebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddChannelParamsBodyWebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { - if o.HTTPConfig != nil { - if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfig) UnmarshalBinary(b []byte) error { - var res AddChannelParamsBodyWebhookConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelParamsBodyWebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. -swagger:model AddChannelParamsBodyWebhookConfigHTTPConfig -*/ -type AddChannelParamsBodyWebhookConfigHTTPConfig struct { - // bearer token - BearerToken string `json:"bearer_token,omitempty"` - - // bearer token file - BearerTokenFile string `json:"bearer_token_file,omitempty"` - - // proxy url - ProxyURL string `json:"proxy_url,omitempty"` - - // basic auth - BasicAuth *AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` - - // tls config - TLSConfig *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` -} - -// Validate validates this add channel params body webhook config HTTP config -func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBasicAuth(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTLSConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - if swag.IsZero(o.BasicAuth) { // not required - return nil - } - - if o.BasicAuth != nil { - if err := o.BasicAuth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - if swag.IsZero(o.TLSConfig) { // not required - return nil - } - - if o.TLSConfig != nil { - if err := o.TLSConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this add channel params body webhook config HTTP config based on the context it is used -func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBasicAuth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTLSConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { - if o.BasicAuth != nil { - if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { - if o.TLSConfig != nil { - if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { - var res AddChannelParamsBodyWebhookConfigHTTPConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. -swagger:model AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth -*/ -type AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth struct { - // username - Username string `json:"username,omitempty"` - - // password - Password string `json:"password,omitempty"` - - // password file - PasswordFile string `json:"password_file,omitempty"` -} - -// Validate validates this add channel params body webhook config HTTP config basic auth -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add channel params body webhook config HTTP config basic auth based on context it is used -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { - var res AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager -// https://prometheus.io/docs/alerting/latest/configuration/#tls_config -swagger:model AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig -*/ -type AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig struct { - // A path to the CA certificate file to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFile string `json:"ca_file,omitempty"` - - // A path to the certificate file for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFile string `json:"cert_file,omitempty"` - - // A path to the key file for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFile string `json:"key_file,omitempty"` - - // Name of the server. - ServerName string `json:"server_name,omitempty"` - - // Disable validation of the server certificate. - InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` - - // CA certificate to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFileContent string `json:"ca_file_content,omitempty"` - - // A certificate for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFileContent string `json:"cert_file_content,omitempty"` - - // A key for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFileContent string `json:"key_file_content,omitempty"` -} - -// Validate validates this add channel params body webhook config HTTP config TLS config -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this add channel params body webhook config HTTP config TLS config based on context it is used -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/channels/change_channel_parameters.go b/api/managementpb/ia/json/client/channels/change_channel_parameters.go deleted file mode 100644 index 569379c6b6..0000000000 --- a/api/managementpb/ia/json/client/channels/change_channel_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// 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" -) - -// NewChangeChannelParams creates a new ChangeChannelParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewChangeChannelParams() *ChangeChannelParams { - return &ChangeChannelParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangeChannelParamsWithTimeout creates a new ChangeChannelParams object -// with the ability to set a timeout on a request. -func NewChangeChannelParamsWithTimeout(timeout time.Duration) *ChangeChannelParams { - return &ChangeChannelParams{ - timeout: timeout, - } -} - -// NewChangeChannelParamsWithContext creates a new ChangeChannelParams object -// with the ability to set a context for a request. -func NewChangeChannelParamsWithContext(ctx context.Context) *ChangeChannelParams { - return &ChangeChannelParams{ - Context: ctx, - } -} - -// NewChangeChannelParamsWithHTTPClient creates a new ChangeChannelParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangeChannelParamsWithHTTPClient(client *http.Client) *ChangeChannelParams { - return &ChangeChannelParams{ - HTTPClient: client, - } -} - -/* -ChangeChannelParams contains all the parameters to send to the API endpoint - - for the change channel operation. - - Typically these are written to a http.Request. -*/ -type ChangeChannelParams struct { - // Body. - Body ChangeChannelBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change channel params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeChannelParams) WithDefaults() *ChangeChannelParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change channel params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeChannelParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the change channel params -func (o *ChangeChannelParams) WithTimeout(timeout time.Duration) *ChangeChannelParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change channel params -func (o *ChangeChannelParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change channel params -func (o *ChangeChannelParams) WithContext(ctx context.Context) *ChangeChannelParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change channel params -func (o *ChangeChannelParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change channel params -func (o *ChangeChannelParams) WithHTTPClient(client *http.Client) *ChangeChannelParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change channel params -func (o *ChangeChannelParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change channel params -func (o *ChangeChannelParams) WithBody(body ChangeChannelBody) *ChangeChannelParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change channel params -func (o *ChangeChannelParams) SetBody(body ChangeChannelBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangeChannelParams) 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/api/managementpb/ia/json/client/channels/change_channel_responses.go b/api/managementpb/ia/json/client/channels/change_channel_responses.go deleted file mode 100644 index d4fb8eea19..0000000000 --- a/api/managementpb/ia/json/client/channels/change_channel_responses.go +++ /dev/null @@ -1,963 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ChangeChannelReader is a Reader for the ChangeChannel structure. -type ChangeChannelReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangeChannelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewChangeChannelOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangeChannelDefault(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 - } -} - -// NewChangeChannelOK creates a ChangeChannelOK with default headers values -func NewChangeChannelOK() *ChangeChannelOK { - return &ChangeChannelOK{} -} - -/* -ChangeChannelOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangeChannelOK struct { - Payload interface{} -} - -func (o *ChangeChannelOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Channels/Change][%d] changeChannelOk %+v", 200, o.Payload) -} - -func (o *ChangeChannelOK) GetPayload() interface{} { - return o.Payload -} - -func (o *ChangeChannelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangeChannelDefault creates a ChangeChannelDefault with default headers values -func NewChangeChannelDefault(code int) *ChangeChannelDefault { - return &ChangeChannelDefault{ - _statusCode: code, - } -} - -/* -ChangeChannelDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangeChannelDefault struct { - _statusCode int - - Payload *ChangeChannelDefaultBody -} - -// Code gets the status code for the change channel default response -func (o *ChangeChannelDefault) Code() int { - return o._statusCode -} - -func (o *ChangeChannelDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Channels/Change][%d] ChangeChannel default %+v", o._statusCode, o.Payload) -} - -func (o *ChangeChannelDefault) GetPayload() *ChangeChannelDefaultBody { - return o.Payload -} - -func (o *ChangeChannelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangeChannelDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ChangeChannelBody change channel body -swagger:model ChangeChannelBody -*/ -type ChangeChannelBody struct { - // Machine-readable ID. - ChannelID string `json:"channel_id,omitempty"` - - // Short human-readable summary. Empty value will not change it. - Summary string `json:"summary,omitempty"` - - // Enables or disables that channel. Should be set. - Disabled bool `json:"disabled,omitempty"` - - // email config - EmailConfig *ChangeChannelParamsBodyEmailConfig `json:"email_config,omitempty"` - - // pagerduty config - PagerdutyConfig *ChangeChannelParamsBodyPagerdutyConfig `json:"pagerduty_config,omitempty"` - - // slack config - SlackConfig *ChangeChannelParamsBodySlackConfig `json:"slack_config,omitempty"` - - // webhook config - WebhookConfig *ChangeChannelParamsBodyWebhookConfig `json:"webhook_config,omitempty"` -} - -// Validate validates this change channel body -func (o *ChangeChannelBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEmailConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePagerdutyConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSlackConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateWebhookConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeChannelBody) validateEmailConfig(formats strfmt.Registry) error { - if swag.IsZero(o.EmailConfig) { // not required - return nil - } - - if o.EmailConfig != nil { - if err := o.EmailConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "email_config") - } - return err - } - } - - return nil -} - -func (o *ChangeChannelBody) validatePagerdutyConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PagerdutyConfig) { // not required - return nil - } - - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *ChangeChannelBody) validateSlackConfig(formats strfmt.Registry) error { - if swag.IsZero(o.SlackConfig) { // not required - return nil - } - - if o.SlackConfig != nil { - if err := o.SlackConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "slack_config") - } - return err - } - } - - return nil -} - -func (o *ChangeChannelBody) validateWebhookConfig(formats strfmt.Registry) error { - if swag.IsZero(o.WebhookConfig) { // not required - return nil - } - - if o.WebhookConfig != nil { - if err := o.WebhookConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this change channel body based on the context it is used -func (o *ChangeChannelBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateEmailConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateSlackConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeChannelBody) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { - if o.EmailConfig != nil { - if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "email_config") - } - return err - } - } - - return nil -} - -func (o *ChangeChannelBody) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *ChangeChannelBody) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { - if o.SlackConfig != nil { - if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "slack_config") - } - return err - } - } - - return nil -} - -func (o *ChangeChannelBody) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { - if o.WebhookConfig != nil { - if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelBody) UnmarshalBinary(b []byte) error { - var res ChangeChannelBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelDefaultBody change channel default body -swagger:model ChangeChannelDefaultBody -*/ -type ChangeChannelDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangeChannelDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change channel default body -func (o *ChangeChannelDefaultBody) 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 *ChangeChannelDefaultBody) 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("ChangeChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ChangeChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this change channel default body based on the context it is used -func (o *ChangeChannelDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeChannelDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ChangeChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ChangeChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangeChannelDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelDefaultBodyDetailsItems0 change channel default body details items0 -swagger:model ChangeChannelDefaultBodyDetailsItems0 -*/ -type ChangeChannelDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this change channel default body details items0 -func (o *ChangeChannelDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change channel default body details items0 based on context it is used -func (o *ChangeChannelDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ChangeChannelDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelParamsBodyEmailConfig EmailConfig represents email configuration. -swagger:model ChangeChannelParamsBodyEmailConfig -*/ -type ChangeChannelParamsBodyEmailConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // to - To []string `json:"to"` -} - -// Validate validates this change channel params body email config -func (o *ChangeChannelParamsBodyEmailConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change channel params body email config based on context it is used -func (o *ChangeChannelParamsBodyEmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelParamsBodyEmailConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelParamsBodyEmailConfig) UnmarshalBinary(b []byte) error { - var res ChangeChannelParamsBodyEmailConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelParamsBodyPagerdutyConfig PagerDutyConfig represents PagerDuty configuration. -swagger:model ChangeChannelParamsBodyPagerdutyConfig -*/ -type ChangeChannelParamsBodyPagerdutyConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. - RoutingKey string `json:"routing_key,omitempty"` - - // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. - ServiceKey string `json:"service_key,omitempty"` -} - -// Validate validates this change channel params body pagerduty config -func (o *ChangeChannelParamsBodyPagerdutyConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change channel params body pagerduty config based on context it is used -func (o *ChangeChannelParamsBodyPagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelParamsBodyPagerdutyConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelParamsBodyPagerdutyConfig) UnmarshalBinary(b []byte) error { - var res ChangeChannelParamsBodyPagerdutyConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelParamsBodySlackConfig SlackConfig represents Slack configuration. -swagger:model ChangeChannelParamsBodySlackConfig -*/ -type ChangeChannelParamsBodySlackConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // channel - Channel string `json:"channel,omitempty"` -} - -// Validate validates this change channel params body slack config -func (o *ChangeChannelParamsBodySlackConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change channel params body slack config based on context it is used -func (o *ChangeChannelParamsBodySlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelParamsBodySlackConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelParamsBodySlackConfig) UnmarshalBinary(b []byte) error { - var res ChangeChannelParamsBodySlackConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelParamsBodyWebhookConfig WebhookConfig represents webhook configuration. -swagger:model ChangeChannelParamsBodyWebhookConfig -*/ -type ChangeChannelParamsBodyWebhookConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // url - URL string `json:"url,omitempty"` - - // max alerts - MaxAlerts int32 `json:"max_alerts,omitempty"` - - // http config - HTTPConfig *ChangeChannelParamsBodyWebhookConfigHTTPConfig `json:"http_config,omitempty"` -} - -// Validate validates this change channel params body webhook config -func (o *ChangeChannelParamsBodyWebhookConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHTTPConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeChannelParamsBodyWebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - if swag.IsZero(o.HTTPConfig) { // not required - return nil - } - - if o.HTTPConfig != nil { - if err := o.HTTPConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this change channel params body webhook config based on the context it is used -func (o *ChangeChannelParamsBodyWebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeChannelParamsBodyWebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { - if o.HTTPConfig != nil { - if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelParamsBodyWebhookConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelParamsBodyWebhookConfig) UnmarshalBinary(b []byte) error { - var res ChangeChannelParamsBodyWebhookConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelParamsBodyWebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. -swagger:model ChangeChannelParamsBodyWebhookConfigHTTPConfig -*/ -type ChangeChannelParamsBodyWebhookConfigHTTPConfig struct { - // bearer token - BearerToken string `json:"bearer_token,omitempty"` - - // bearer token file - BearerTokenFile string `json:"bearer_token_file,omitempty"` - - // proxy url - ProxyURL string `json:"proxy_url,omitempty"` - - // basic auth - BasicAuth *ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` - - // tls config - TLSConfig *ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` -} - -// Validate validates this change channel params body webhook config HTTP config -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBasicAuth(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTLSConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - if swag.IsZero(o.BasicAuth) { // not required - return nil - } - - if o.BasicAuth != nil { - if err := o.BasicAuth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - if swag.IsZero(o.TLSConfig) { // not required - return nil - } - - if o.TLSConfig != nil { - if err := o.TLSConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this change channel params body webhook config HTTP config based on the context it is used -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBasicAuth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTLSConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { - if o.BasicAuth != nil { - if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { - if o.TLSConfig != nil { - if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { - var res ChangeChannelParamsBodyWebhookConfigHTTPConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. -swagger:model ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth -*/ -type ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth struct { - // username - Username string `json:"username,omitempty"` - - // password - Password string `json:"password,omitempty"` - - // password file - PasswordFile string `json:"password_file,omitempty"` -} - -// Validate validates this change channel params body webhook config HTTP config basic auth -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change channel params body webhook config HTTP config basic auth based on context it is used -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { - var res ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager -// https://prometheus.io/docs/alerting/latest/configuration/#tls_config -swagger:model ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig -*/ -type ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig struct { - // A path to the CA certificate file to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFile string `json:"ca_file,omitempty"` - - // A path to the certificate file for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFile string `json:"cert_file,omitempty"` - - // A path to the key file for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFile string `json:"key_file,omitempty"` - - // Name of the server. - ServerName string `json:"server_name,omitempty"` - - // Disable validation of the server certificate. - InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` - - // CA certificate to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFileContent string `json:"ca_file_content,omitempty"` - - // A certificate for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFileContent string `json:"cert_file_content,omitempty"` - - // A key for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFileContent string `json:"key_file_content,omitempty"` -} - -// Validate validates this change channel params body webhook config HTTP config TLS config -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change channel params body webhook config HTTP config TLS config based on context it is used -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/channels/channels_client.go b/api/managementpb/ia/json/client/channels/channels_client.go deleted file mode 100644 index 801236e6ab..0000000000 --- a/api/managementpb/ia/json/client/channels/channels_client.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// 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 channels API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for channels API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AddChannel(params *AddChannelParams, opts ...ClientOption) (*AddChannelOK, error) - - ChangeChannel(params *ChangeChannelParams, opts ...ClientOption) (*ChangeChannelOK, error) - - ListChannels(params *ListChannelsParams, opts ...ClientOption) (*ListChannelsOK, error) - - RemoveChannel(params *RemoveChannelParams, opts ...ClientOption) (*RemoveChannelOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddChannel adds channel adds notification channel -*/ -func (a *Client) AddChannel(params *AddChannelParams, opts ...ClientOption) (*AddChannelOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAddChannelParams() - } - op := &runtime.ClientOperation{ - ID: "AddChannel", - Method: "POST", - PathPattern: "/v1/management/ia/Channels/Add", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddChannelReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*AddChannelOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*AddChannelDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ChangeChannel changes channel changes notification channel -*/ -func (a *Client) ChangeChannel(params *ChangeChannelParams, opts ...ClientOption) (*ChangeChannelOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewChangeChannelParams() - } - op := &runtime.ClientOperation{ - ID: "ChangeChannel", - Method: "POST", - PathPattern: "/v1/management/ia/Channels/Change", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ChangeChannelReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ChangeChannelOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ChangeChannelDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListChannels lists channels returns a list of all notifation channels -*/ -func (a *Client) ListChannels(params *ListChannelsParams, opts ...ClientOption) (*ListChannelsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListChannelsParams() - } - op := &runtime.ClientOperation{ - ID: "ListChannels", - Method: "POST", - PathPattern: "/v1/management/ia/Channels/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListChannelsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListChannelsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListChannelsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -RemoveChannel removes channel removes notification channel -*/ -func (a *Client) RemoveChannel(params *RemoveChannelParams, opts ...ClientOption) (*RemoveChannelOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewRemoveChannelParams() - } - op := &runtime.ClientOperation{ - ID: "RemoveChannel", - Method: "POST", - PathPattern: "/v1/management/ia/Channels/Remove", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RemoveChannelReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*RemoveChannelOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*RemoveChannelDefault) - 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/api/managementpb/ia/json/client/channels/list_channels_parameters.go b/api/managementpb/ia/json/client/channels/list_channels_parameters.go deleted file mode 100644 index 4f6948c977..0000000000 --- a/api/managementpb/ia/json/client/channels/list_channels_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// 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" -) - -// NewListChannelsParams creates a new ListChannelsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListChannelsParams() *ListChannelsParams { - return &ListChannelsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListChannelsParamsWithTimeout creates a new ListChannelsParams object -// with the ability to set a timeout on a request. -func NewListChannelsParamsWithTimeout(timeout time.Duration) *ListChannelsParams { - return &ListChannelsParams{ - timeout: timeout, - } -} - -// NewListChannelsParamsWithContext creates a new ListChannelsParams object -// with the ability to set a context for a request. -func NewListChannelsParamsWithContext(ctx context.Context) *ListChannelsParams { - return &ListChannelsParams{ - Context: ctx, - } -} - -// NewListChannelsParamsWithHTTPClient creates a new ListChannelsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListChannelsParamsWithHTTPClient(client *http.Client) *ListChannelsParams { - return &ListChannelsParams{ - HTTPClient: client, - } -} - -/* -ListChannelsParams contains all the parameters to send to the API endpoint - - for the list channels operation. - - Typically these are written to a http.Request. -*/ -type ListChannelsParams struct { - // Body. - Body ListChannelsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list channels params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListChannelsParams) WithDefaults() *ListChannelsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list channels params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListChannelsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list channels params -func (o *ListChannelsParams) WithTimeout(timeout time.Duration) *ListChannelsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list channels params -func (o *ListChannelsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list channels params -func (o *ListChannelsParams) WithContext(ctx context.Context) *ListChannelsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list channels params -func (o *ListChannelsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list channels params -func (o *ListChannelsParams) WithHTTPClient(client *http.Client) *ListChannelsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list channels params -func (o *ListChannelsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list channels params -func (o *ListChannelsParams) WithBody(body ListChannelsBody) *ListChannelsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list channels params -func (o *ListChannelsParams) SetBody(body ListChannelsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListChannelsParams) 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/api/managementpb/ia/json/client/channels/list_channels_responses.go b/api/managementpb/ia/json/client/channels/list_channels_responses.go deleted file mode 100644 index ec672a76db..0000000000 --- a/api/managementpb/ia/json/client/channels/list_channels_responses.go +++ /dev/null @@ -1,1277 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListChannelsReader is a Reader for the ListChannels structure. -type ListChannelsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListChannelsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListChannelsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListChannelsDefault(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 - } -} - -// NewListChannelsOK creates a ListChannelsOK with default headers values -func NewListChannelsOK() *ListChannelsOK { - return &ListChannelsOK{} -} - -/* -ListChannelsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListChannelsOK struct { - Payload *ListChannelsOKBody -} - -func (o *ListChannelsOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Channels/List][%d] listChannelsOk %+v", 200, o.Payload) -} - -func (o *ListChannelsOK) GetPayload() *ListChannelsOKBody { - return o.Payload -} - -func (o *ListChannelsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListChannelsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListChannelsDefault creates a ListChannelsDefault with default headers values -func NewListChannelsDefault(code int) *ListChannelsDefault { - return &ListChannelsDefault{ - _statusCode: code, - } -} - -/* -ListChannelsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListChannelsDefault struct { - _statusCode int - - Payload *ListChannelsDefaultBody -} - -// Code gets the status code for the list channels default response -func (o *ListChannelsDefault) Code() int { - return o._statusCode -} - -func (o *ListChannelsDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Channels/List][%d] ListChannels default %+v", o._statusCode, o.Payload) -} - -func (o *ListChannelsDefault) GetPayload() *ListChannelsDefaultBody { - return o.Payload -} - -func (o *ListChannelsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListChannelsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListChannelsBody list channels body -swagger:model ListChannelsBody -*/ -type ListChannelsBody struct { - // page params - PageParams *ListChannelsParamsBodyPageParams `json:"page_params,omitempty"` -} - -// Validate validates this list channels body -func (o *ListChannelsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePageParams(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsBody) validatePageParams(formats strfmt.Registry) error { - if swag.IsZero(o.PageParams) { // not required - return nil - } - - if o.PageParams != nil { - if err := o.PageParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "page_params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "page_params") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list channels body based on the context it is used -func (o *ListChannelsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidatePageParams(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsBody) contextValidatePageParams(ctx context.Context, formats strfmt.Registry) error { - if o.PageParams != nil { - if err := o.PageParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "page_params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "page_params") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsBody) UnmarshalBinary(b []byte) error { - var res ListChannelsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsDefaultBody list channels default body -swagger:model ListChannelsDefaultBody -*/ -type ListChannelsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListChannelsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list channels default body -func (o *ListChannelsDefaultBody) 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 *ListChannelsDefaultBody) 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("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list channels default body based on the context it is used -func (o *ListChannelsDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListChannelsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsDefaultBodyDetailsItems0 list channels default body details items0 -swagger:model ListChannelsDefaultBodyDetailsItems0 -*/ -type ListChannelsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this list channels default body details items0 -func (o *ListChannelsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list channels default body details items0 based on context it is used -func (o *ListChannelsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListChannelsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBody list channels OK body -swagger:model ListChannelsOKBody -*/ -type ListChannelsOKBody struct { - // channels - Channels []*ListChannelsOKBodyChannelsItems0 `json:"channels"` - - // totals - Totals *ListChannelsOKBodyTotals `json:"totals,omitempty"` -} - -// Validate validates this list channels OK body -func (o *ListChannelsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateChannels(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTotals(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsOKBody) validateChannels(formats strfmt.Registry) error { - if swag.IsZero(o.Channels) { // not required - return nil - } - - for i := 0; i < len(o.Channels); i++ { - if swag.IsZero(o.Channels[i]) { // not required - continue - } - - if o.Channels[i] != nil { - if err := o.Channels[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListChannelsOKBody) validateTotals(formats strfmt.Registry) error { - if swag.IsZero(o.Totals) { // not required - return nil - } - - if o.Totals != nil { - if err := o.Totals.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listChannelsOk" + "." + "totals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listChannelsOk" + "." + "totals") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list channels OK body based on the context it is used -func (o *ListChannelsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateChannels(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTotals(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsOKBody) contextValidateChannels(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Channels); i++ { - if o.Channels[i] != nil { - if err := o.Channels[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListChannelsOKBody) contextValidateTotals(ctx context.Context, formats strfmt.Registry) error { - if o.Totals != nil { - if err := o.Totals.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listChannelsOk" + "." + "totals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listChannelsOk" + "." + "totals") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBody) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyChannelsItems0 Channel represents a single Notification Channel. -swagger:model ListChannelsOKBodyChannelsItems0 -*/ -type ListChannelsOKBodyChannelsItems0 struct { - // Machine-readable ID. - ChannelID string `json:"channel_id,omitempty"` - - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // True if that channel is disabled. - Disabled bool `json:"disabled,omitempty"` - - // email config - EmailConfig *ListChannelsOKBodyChannelsItems0EmailConfig `json:"email_config,omitempty"` - - // pagerduty config - PagerdutyConfig *ListChannelsOKBodyChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` - - // slack config - SlackConfig *ListChannelsOKBodyChannelsItems0SlackConfig `json:"slack_config,omitempty"` - - // webhook config - WebhookConfig *ListChannelsOKBodyChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` -} - -// Validate validates this list channels OK body channels items0 -func (o *ListChannelsOKBodyChannelsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEmailConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePagerdutyConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSlackConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateWebhookConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { - if swag.IsZero(o.EmailConfig) { // not required - return nil - } - - if o.EmailConfig != nil { - if err := o.EmailConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("email_config") - } - return err - } - } - - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PagerdutyConfig) { // not required - return nil - } - - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { - if swag.IsZero(o.SlackConfig) { // not required - return nil - } - - if o.SlackConfig != nil { - if err := o.SlackConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("slack_config") - } - return err - } - } - - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { - if swag.IsZero(o.WebhookConfig) { // not required - return nil - } - - if o.WebhookConfig != nil { - if err := o.WebhookConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list channels OK body channels items0 based on the context it is used -func (o *ListChannelsOKBodyChannelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateEmailConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateSlackConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { - if o.EmailConfig != nil { - if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("email_config") - } - return err - } - } - - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { - if o.SlackConfig != nil { - if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("slack_config") - } - return err - } - } - - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { - if o.WebhookConfig != nil { - if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyChannelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyChannelsItems0EmailConfig EmailConfig represents email configuration. -swagger:model ListChannelsOKBodyChannelsItems0EmailConfig -*/ -type ListChannelsOKBodyChannelsItems0EmailConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // to - To []string `json:"to"` -} - -// Validate validates this list channels OK body channels items0 email config -func (o *ListChannelsOKBodyChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list channels OK body channels items0 email config based on context it is used -func (o *ListChannelsOKBodyChannelsItems0EmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyChannelsItems0EmailConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. -swagger:model ListChannelsOKBodyChannelsItems0PagerdutyConfig -*/ -type ListChannelsOKBodyChannelsItems0PagerdutyConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. - RoutingKey string `json:"routing_key,omitempty"` - - // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. - ServiceKey string `json:"service_key,omitempty"` -} - -// Validate validates this list channels OK body channels items0 pagerduty config -func (o *ListChannelsOKBodyChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list channels OK body channels items0 pagerduty config based on context it is used -func (o *ListChannelsOKBodyChannelsItems0PagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyChannelsItems0PagerdutyConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyChannelsItems0SlackConfig SlackConfig represents Slack configuration. -swagger:model ListChannelsOKBodyChannelsItems0SlackConfig -*/ -type ListChannelsOKBodyChannelsItems0SlackConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // channel - Channel string `json:"channel,omitempty"` -} - -// Validate validates this list channels OK body channels items0 slack config -func (o *ListChannelsOKBodyChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list channels OK body channels items0 slack config based on context it is used -func (o *ListChannelsOKBodyChannelsItems0SlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyChannelsItems0SlackConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. -swagger:model ListChannelsOKBodyChannelsItems0WebhookConfig -*/ -type ListChannelsOKBodyChannelsItems0WebhookConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // url - URL string `json:"url,omitempty"` - - // max alerts - MaxAlerts int32 `json:"max_alerts,omitempty"` - - // http config - HTTPConfig *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` -} - -// Validate validates this list channels OK body channels items0 webhook config -func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHTTPConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - if swag.IsZero(o.HTTPConfig) { // not required - return nil - } - - if o.HTTPConfig != nil { - if err := o.HTTPConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list channels OK body channels items0 webhook config based on the context it is used -func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { - if o.HTTPConfig != nil { - if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyChannelsItems0WebhookConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. -swagger:model ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig -*/ -type ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig struct { - // bearer token - BearerToken string `json:"bearer_token,omitempty"` - - // bearer token file - BearerTokenFile string `json:"bearer_token_file,omitempty"` - - // proxy url - ProxyURL string `json:"proxy_url,omitempty"` - - // basic auth - BasicAuth *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` - - // tls config - TLSConfig *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` -} - -// Validate validates this list channels OK body channels items0 webhook config HTTP config -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBasicAuth(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTLSConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - if swag.IsZero(o.BasicAuth) { // not required - return nil - } - - if o.BasicAuth != nil { - if err := o.BasicAuth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - if swag.IsZero(o.TLSConfig) { // not required - return nil - } - - if o.TLSConfig != nil { - if err := o.TLSConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list channels OK body channels items0 webhook config HTTP config based on the context it is used -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBasicAuth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTLSConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { - if o.BasicAuth != nil { - if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { - if o.TLSConfig != nil { - if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. -swagger:model ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth -*/ -type ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { - // username - Username string `json:"username,omitempty"` - - // password - Password string `json:"password,omitempty"` - - // password file - PasswordFile string `json:"password_file,omitempty"` -} - -// Validate validates this list channels OK body channels items0 webhook config HTTP config basic auth -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list channels OK body channels items0 webhook config HTTP config basic auth based on context it is used -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager -// https://prometheus.io/docs/alerting/latest/configuration/#tls_config -swagger:model ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig -*/ -type ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { - // A path to the CA certificate file to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFile string `json:"ca_file,omitempty"` - - // A path to the certificate file for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFile string `json:"cert_file,omitempty"` - - // A path to the key file for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFile string `json:"key_file,omitempty"` - - // Name of the server. - ServerName string `json:"server_name,omitempty"` - - // Disable validation of the server certificate. - InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` - - // CA certificate to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFileContent string `json:"ca_file_content,omitempty"` - - // A certificate for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFileContent string `json:"cert_file_content,omitempty"` - - // A key for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFileContent string `json:"key_file_content,omitempty"` -} - -// Validate validates this list channels OK body channels items0 webhook config HTTP config TLS config -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list channels OK body channels items0 webhook config HTTP config TLS config based on context it is used -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsOKBodyTotals PageTotals represents total values for pagination. -swagger:model ListChannelsOKBodyTotals -*/ -type ListChannelsOKBodyTotals struct { - // Total number of results. - TotalItems int32 `json:"total_items,omitempty"` - - // Total number of pages. - TotalPages int32 `json:"total_pages,omitempty"` -} - -// Validate validates this list channels OK body totals -func (o *ListChannelsOKBodyTotals) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list channels OK body totals based on context it is used -func (o *ListChannelsOKBodyTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsOKBodyTotals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsOKBodyTotals) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBodyTotals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListChannelsParamsBodyPageParams PageParams represents page request parameters for pagination. -swagger:model ListChannelsParamsBodyPageParams -*/ -type ListChannelsParamsBodyPageParams struct { - // Maximum number of results per page. - PageSize int32 `json:"page_size,omitempty"` - - // Index of the requested page, starts from 0. - Index int32 `json:"index,omitempty"` -} - -// Validate validates this list channels params body page params -func (o *ListChannelsParamsBodyPageParams) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list channels params body page params based on context it is used -func (o *ListChannelsParamsBodyPageParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListChannelsParamsBodyPageParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListChannelsParamsBodyPageParams) UnmarshalBinary(b []byte) error { - var res ListChannelsParamsBodyPageParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/channels/remove_channel_parameters.go b/api/managementpb/ia/json/client/channels/remove_channel_parameters.go deleted file mode 100644 index bc094beef7..0000000000 --- a/api/managementpb/ia/json/client/channels/remove_channel_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// 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" -) - -// NewRemoveChannelParams creates a new RemoveChannelParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewRemoveChannelParams() *RemoveChannelParams { - return &RemoveChannelParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRemoveChannelParamsWithTimeout creates a new RemoveChannelParams object -// with the ability to set a timeout on a request. -func NewRemoveChannelParamsWithTimeout(timeout time.Duration) *RemoveChannelParams { - return &RemoveChannelParams{ - timeout: timeout, - } -} - -// NewRemoveChannelParamsWithContext creates a new RemoveChannelParams object -// with the ability to set a context for a request. -func NewRemoveChannelParamsWithContext(ctx context.Context) *RemoveChannelParams { - return &RemoveChannelParams{ - Context: ctx, - } -} - -// NewRemoveChannelParamsWithHTTPClient creates a new RemoveChannelParams object -// with the ability to set a custom HTTPClient for a request. -func NewRemoveChannelParamsWithHTTPClient(client *http.Client) *RemoveChannelParams { - return &RemoveChannelParams{ - HTTPClient: client, - } -} - -/* -RemoveChannelParams contains all the parameters to send to the API endpoint - - for the remove channel operation. - - Typically these are written to a http.Request. -*/ -type RemoveChannelParams struct { - // Body. - Body RemoveChannelBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the remove channel params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveChannelParams) WithDefaults() *RemoveChannelParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the remove channel params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveChannelParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the remove channel params -func (o *RemoveChannelParams) WithTimeout(timeout time.Duration) *RemoveChannelParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the remove channel params -func (o *RemoveChannelParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the remove channel params -func (o *RemoveChannelParams) WithContext(ctx context.Context) *RemoveChannelParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the remove channel params -func (o *RemoveChannelParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the remove channel params -func (o *RemoveChannelParams) WithHTTPClient(client *http.Client) *RemoveChannelParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the remove channel params -func (o *RemoveChannelParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the remove channel params -func (o *RemoveChannelParams) WithBody(body RemoveChannelBody) *RemoveChannelParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the remove channel params -func (o *RemoveChannelParams) SetBody(body RemoveChannelBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *RemoveChannelParams) 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/api/managementpb/ia/json/client/channels/remove_channel_responses.go b/api/managementpb/ia/json/client/channels/remove_channel_responses.go deleted file mode 100644 index eb6aa49b30..0000000000 --- a/api/managementpb/ia/json/client/channels/remove_channel_responses.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package channels - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RemoveChannelReader is a Reader for the RemoveChannel structure. -type RemoveChannelReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RemoveChannelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewRemoveChannelOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRemoveChannelDefault(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 - } -} - -// NewRemoveChannelOK creates a RemoveChannelOK with default headers values -func NewRemoveChannelOK() *RemoveChannelOK { - return &RemoveChannelOK{} -} - -/* -RemoveChannelOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RemoveChannelOK struct { - Payload interface{} -} - -func (o *RemoveChannelOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Channels/Remove][%d] removeChannelOk %+v", 200, o.Payload) -} - -func (o *RemoveChannelOK) GetPayload() interface{} { - return o.Payload -} - -func (o *RemoveChannelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRemoveChannelDefault creates a RemoveChannelDefault with default headers values -func NewRemoveChannelDefault(code int) *RemoveChannelDefault { - return &RemoveChannelDefault{ - _statusCode: code, - } -} - -/* -RemoveChannelDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RemoveChannelDefault struct { - _statusCode int - - Payload *RemoveChannelDefaultBody -} - -// Code gets the status code for the remove channel default response -func (o *RemoveChannelDefault) Code() int { - return o._statusCode -} - -func (o *RemoveChannelDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Channels/Remove][%d] RemoveChannel default %+v", o._statusCode, o.Payload) -} - -func (o *RemoveChannelDefault) GetPayload() *RemoveChannelDefaultBody { - return o.Payload -} - -func (o *RemoveChannelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RemoveChannelDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -RemoveChannelBody remove channel body -swagger:model RemoveChannelBody -*/ -type RemoveChannelBody struct { - // channel id - ChannelID string `json:"channel_id,omitempty"` -} - -// Validate validates this remove channel body -func (o *RemoveChannelBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this remove channel body based on context it is used -func (o *RemoveChannelBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveChannelBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveChannelBody) UnmarshalBinary(b []byte) error { - var res RemoveChannelBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RemoveChannelDefaultBody remove channel default body -swagger:model RemoveChannelDefaultBody -*/ -type RemoveChannelDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RemoveChannelDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this remove channel default body -func (o *RemoveChannelDefaultBody) 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 *RemoveChannelDefaultBody) 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("RemoveChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("RemoveChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this remove channel default body based on the context it is used -func (o *RemoveChannelDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *RemoveChannelDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("RemoveChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("RemoveChannel default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveChannelDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveChannelDefaultBody) UnmarshalBinary(b []byte) error { - var res RemoveChannelDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RemoveChannelDefaultBodyDetailsItems0 remove channel default body details items0 -swagger:model RemoveChannelDefaultBodyDetailsItems0 -*/ -type RemoveChannelDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this remove channel default body details items0 -func (o *RemoveChannelDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this remove channel default body details items0 based on context it is used -func (o *RemoveChannelDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RemoveChannelDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RemoveChannelDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res RemoveChannelDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/pmm_integrated_alerting_api_client.go b/api/managementpb/ia/json/client/pmm_integrated_alerting_api_client.go deleted file mode 100644 index f892460af9..0000000000 --- a/api/managementpb/ia/json/client/pmm_integrated_alerting_api_client.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// 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" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/percona/pmm/api/managementpb/ia/json/client/alerts" - "github.com/percona/pmm/api/managementpb/ia/json/client/channels" - "github.com/percona/pmm/api/managementpb/ia/json/client/rules" -) - -// Default PMM integrated alerting API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new PMM integrated alerting API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMIntegratedAlertingAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM integrated alerting API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMIntegratedAlertingAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new PMM integrated alerting API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMIntegratedAlertingAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMIntegratedAlertingAPI) - cli.Transport = transport - cli.Alerts = alerts.New(transport, formats) - cli.Channels = channels.New(transport, formats) - cli.Rules = rules.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PMMIntegratedAlertingAPI is a client for PMM integrated alerting API -type PMMIntegratedAlertingAPI struct { - Alerts alerts.ClientService - - Channels channels.ClientService - - Rules rules.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMIntegratedAlertingAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Alerts.SetTransport(transport) - c.Channels.SetTransport(transport) - c.Rules.SetTransport(transport) -} diff --git a/api/managementpb/ia/json/client/rules/create_alert_rule_parameters.go b/api/managementpb/ia/json/client/rules/create_alert_rule_parameters.go deleted file mode 100644 index c361a3c197..0000000000 --- a/api/managementpb/ia/json/client/rules/create_alert_rule_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// 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" -) - -// NewCreateAlertRuleParams creates a new CreateAlertRuleParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateAlertRuleParams() *CreateAlertRuleParams { - return &CreateAlertRuleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateAlertRuleParamsWithTimeout creates a new CreateAlertRuleParams object -// with the ability to set a timeout on a request. -func NewCreateAlertRuleParamsWithTimeout(timeout time.Duration) *CreateAlertRuleParams { - return &CreateAlertRuleParams{ - timeout: timeout, - } -} - -// NewCreateAlertRuleParamsWithContext creates a new CreateAlertRuleParams object -// with the ability to set a context for a request. -func NewCreateAlertRuleParamsWithContext(ctx context.Context) *CreateAlertRuleParams { - return &CreateAlertRuleParams{ - Context: ctx, - } -} - -// NewCreateAlertRuleParamsWithHTTPClient creates a new CreateAlertRuleParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateAlertRuleParamsWithHTTPClient(client *http.Client) *CreateAlertRuleParams { - return &CreateAlertRuleParams{ - HTTPClient: client, - } -} - -/* -CreateAlertRuleParams contains all the parameters to send to the API endpoint - - for the create alert rule operation. - - Typically these are written to a http.Request. -*/ -type CreateAlertRuleParams struct { - // Body. - Body CreateAlertRuleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create alert rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateAlertRuleParams) WithDefaults() *CreateAlertRuleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create alert rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateAlertRuleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create alert rule params -func (o *CreateAlertRuleParams) WithTimeout(timeout time.Duration) *CreateAlertRuleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create alert rule params -func (o *CreateAlertRuleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create alert rule params -func (o *CreateAlertRuleParams) WithContext(ctx context.Context) *CreateAlertRuleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create alert rule params -func (o *CreateAlertRuleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create alert rule params -func (o *CreateAlertRuleParams) WithHTTPClient(client *http.Client) *CreateAlertRuleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create alert rule params -func (o *CreateAlertRuleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create alert rule params -func (o *CreateAlertRuleParams) WithBody(body CreateAlertRuleBody) *CreateAlertRuleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create alert rule params -func (o *CreateAlertRuleParams) SetBody(body CreateAlertRuleBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateAlertRuleParams) 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/api/managementpb/ia/json/client/rules/create_alert_rule_responses.go b/api/managementpb/ia/json/client/rules/create_alert_rule_responses.go deleted file mode 100644 index d7102f2eb4..0000000000 --- a/api/managementpb/ia/json/client/rules/create_alert_rule_responses.go +++ /dev/null @@ -1,757 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "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" -) - -// CreateAlertRuleReader is a Reader for the CreateAlertRule structure. -type CreateAlertRuleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateAlertRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateAlertRuleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreateAlertRuleDefault(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 - } -} - -// NewCreateAlertRuleOK creates a CreateAlertRuleOK with default headers values -func NewCreateAlertRuleOK() *CreateAlertRuleOK { - return &CreateAlertRuleOK{} -} - -/* -CreateAlertRuleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreateAlertRuleOK struct { - Payload *CreateAlertRuleOKBody -} - -func (o *CreateAlertRuleOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/Create][%d] createAlertRuleOk %+v", 200, o.Payload) -} - -func (o *CreateAlertRuleOK) GetPayload() *CreateAlertRuleOKBody { - return o.Payload -} - -func (o *CreateAlertRuleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateAlertRuleOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateAlertRuleDefault creates a CreateAlertRuleDefault with default headers values -func NewCreateAlertRuleDefault(code int) *CreateAlertRuleDefault { - return &CreateAlertRuleDefault{ - _statusCode: code, - } -} - -/* -CreateAlertRuleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreateAlertRuleDefault struct { - _statusCode int - - Payload *CreateAlertRuleDefaultBody -} - -// Code gets the status code for the create alert rule default response -func (o *CreateAlertRuleDefault) Code() int { - return o._statusCode -} - -func (o *CreateAlertRuleDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/Create][%d] CreateAlertRule default %+v", o._statusCode, o.Payload) -} - -func (o *CreateAlertRuleDefault) GetPayload() *CreateAlertRuleDefaultBody { - return o.Payload -} - -func (o *CreateAlertRuleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreateAlertRuleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -CreateAlertRuleBody create alert rule body -swagger:model CreateAlertRuleBody -*/ -type CreateAlertRuleBody struct { - // Template name. Can't be specified simultaneously with source_rule_id. - TemplateName string `json:"template_name,omitempty"` - - // ID of the rule that will be used as source. Can't be specified simultaneously with template_name. - SourceRuleID string `json:"source_rule_id,omitempty"` - - // Rule name. - Name string `json:"name,omitempty"` - - // New rule status. - Disabled bool `json:"disabled,omitempty"` - - // Rule parameters. All template parameters should be set. - Params []*CreateAlertRuleParamsBodyParamsItems0 `json:"params"` - - // Rule duration. Should be set. - For string `json:"for,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - Severity *string `json:"severity,omitempty"` - - // All custom labels to add or remove (with empty values) to default labels from template. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Filters. Should be set. - Filters []*CreateAlertRuleParamsBodyFiltersItems0 `json:"filters"` - - // Channels. Should be set. - ChannelIds []string `json:"channel_ids"` -} - -// Validate validates this create alert rule body -func (o *CreateAlertRuleBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFilters(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateAlertRuleBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required - return nil - } - - for i := 0; i < len(o.Params); i++ { - if swag.IsZero(o.Params[i]) { // not required - continue - } - - if o.Params[i] != nil { - if err := o.Params[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var createAlertRuleBodyTypeSeverityPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_INVALID","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createAlertRuleBodyTypeSeverityPropEnum = append(createAlertRuleBodyTypeSeverityPropEnum, v) - } -} - -const ( - - // CreateAlertRuleBodySeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - CreateAlertRuleBodySeveritySEVERITYINVALID string = "SEVERITY_INVALID" - - // CreateAlertRuleBodySeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - CreateAlertRuleBodySeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // CreateAlertRuleBodySeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - CreateAlertRuleBodySeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // CreateAlertRuleBodySeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - CreateAlertRuleBodySeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // CreateAlertRuleBodySeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - CreateAlertRuleBodySeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // CreateAlertRuleBodySeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - CreateAlertRuleBodySeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // CreateAlertRuleBodySeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - CreateAlertRuleBodySeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // CreateAlertRuleBodySeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - CreateAlertRuleBodySeveritySEVERITYINFO string = "SEVERITY_INFO" - - // CreateAlertRuleBodySeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - CreateAlertRuleBodySeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *CreateAlertRuleBody) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createAlertRuleBodyTypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *CreateAlertRuleBody) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("body"+"."+"severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -func (o *CreateAlertRuleBody) validateFilters(formats strfmt.Registry) error { - if swag.IsZero(o.Filters) { // not required - return nil - } - - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue - } - - if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this create alert rule body based on the context it is used -func (o *CreateAlertRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateParams(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateFilters(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateAlertRuleBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Params); i++ { - if o.Params[i] != nil { - if err := o.Params[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *CreateAlertRuleBody) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Filters); i++ { - if o.Filters[i] != nil { - if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateAlertRuleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateAlertRuleBody) UnmarshalBinary(b []byte) error { - var res CreateAlertRuleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateAlertRuleDefaultBody create alert rule default body -swagger:model CreateAlertRuleDefaultBody -*/ -type CreateAlertRuleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CreateAlertRuleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this create alert rule default body -func (o *CreateAlertRuleDefaultBody) 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 *CreateAlertRuleDefaultBody) 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("CreateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("CreateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this create alert rule default body based on the context it is used -func (o *CreateAlertRuleDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateAlertRuleDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("CreateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("CreateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateAlertRuleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateAlertRuleDefaultBody) UnmarshalBinary(b []byte) error { - var res CreateAlertRuleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateAlertRuleDefaultBodyDetailsItems0 create alert rule default body details items0 -swagger:model CreateAlertRuleDefaultBodyDetailsItems0 -*/ -type CreateAlertRuleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this create alert rule default body details items0 -func (o *CreateAlertRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create alert rule default body details items0 based on context it is used -func (o *CreateAlertRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateAlertRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateAlertRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res CreateAlertRuleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateAlertRuleOKBody create alert rule OK body -swagger:model CreateAlertRuleOKBody -*/ -type CreateAlertRuleOKBody struct { - // Rule ID. - RuleID string `json:"rule_id,omitempty"` -} - -// Validate validates this create alert rule OK body -func (o *CreateAlertRuleOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create alert rule OK body based on context it is used -func (o *CreateAlertRuleOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateAlertRuleOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateAlertRuleOKBody) UnmarshalBinary(b []byte) error { - var res CreateAlertRuleOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateAlertRuleParamsBodyFiltersItems0 Filter repsents a single filter condition. -swagger:model CreateAlertRuleParamsBodyFiltersItems0 -*/ -type CreateAlertRuleParamsBodyFiltersItems0 struct { - // FilterType represents filter matching type. - // - // - EQUAL: = - // - // != - // NOT_EQUAL = 2; - // - REGEX: =~ - // - // !~ - // NOT_REGEX = 4; - // Enum: [FILTER_TYPE_INVALID EQUAL REGEX] - Type *string `json:"type,omitempty"` - - // key - Key string `json:"key,omitempty"` - - // value - Value string `json:"value,omitempty"` -} - -// Validate validates this create alert rule params body filters items0 -func (o *CreateAlertRuleParamsBodyFiltersItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var createAlertRuleParamsBodyFiltersItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["FILTER_TYPE_INVALID","EQUAL","REGEX"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createAlertRuleParamsBodyFiltersItems0TypeTypePropEnum = append(createAlertRuleParamsBodyFiltersItems0TypeTypePropEnum, v) - } -} - -const ( - - // CreateAlertRuleParamsBodyFiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" - CreateAlertRuleParamsBodyFiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" - - // CreateAlertRuleParamsBodyFiltersItems0TypeEQUAL captures enum value "EQUAL" - CreateAlertRuleParamsBodyFiltersItems0TypeEQUAL string = "EQUAL" - - // CreateAlertRuleParamsBodyFiltersItems0TypeREGEX captures enum value "REGEX" - CreateAlertRuleParamsBodyFiltersItems0TypeREGEX string = "REGEX" -) - -// prop value enum -func (o *CreateAlertRuleParamsBodyFiltersItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createAlertRuleParamsBodyFiltersItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *CreateAlertRuleParamsBodyFiltersItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create alert rule params body filters items0 based on context it is used -func (o *CreateAlertRuleParamsBodyFiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateAlertRuleParamsBodyFiltersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateAlertRuleParamsBodyFiltersItems0) UnmarshalBinary(b []byte) error { - var res CreateAlertRuleParamsBodyFiltersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateAlertRuleParamsBodyParamsItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. -swagger:model CreateAlertRuleParamsBodyParamsItems0 -*/ -type CreateAlertRuleParamsBodyParamsItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // Bool value. - Bool bool `json:"bool,omitempty"` - - // Float value. - Float float64 `json:"float,omitempty"` - - // String value. - String string `json:"string,omitempty"` -} - -// Validate validates this create alert rule params body params items0 -func (o *CreateAlertRuleParamsBodyParamsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var createAlertRuleParamsBodyParamsItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createAlertRuleParamsBodyParamsItems0TypeTypePropEnum = append(createAlertRuleParamsBodyParamsItems0TypeTypePropEnum, v) - } -} - -const ( - - // CreateAlertRuleParamsBodyParamsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - CreateAlertRuleParamsBodyParamsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - - // CreateAlertRuleParamsBodyParamsItems0TypeBOOL captures enum value "BOOL" - CreateAlertRuleParamsBodyParamsItems0TypeBOOL string = "BOOL" - - // CreateAlertRuleParamsBodyParamsItems0TypeFLOAT captures enum value "FLOAT" - CreateAlertRuleParamsBodyParamsItems0TypeFLOAT string = "FLOAT" - - // CreateAlertRuleParamsBodyParamsItems0TypeSTRING captures enum value "STRING" - CreateAlertRuleParamsBodyParamsItems0TypeSTRING string = "STRING" -) - -// prop value enum -func (o *CreateAlertRuleParamsBodyParamsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createAlertRuleParamsBodyParamsItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *CreateAlertRuleParamsBodyParamsItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create alert rule params body params items0 based on context it is used -func (o *CreateAlertRuleParamsBodyParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreateAlertRuleParamsBodyParamsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateAlertRuleParamsBodyParamsItems0) UnmarshalBinary(b []byte) error { - var res CreateAlertRuleParamsBodyParamsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/rules/delete_alert_rule_parameters.go b/api/managementpb/ia/json/client/rules/delete_alert_rule_parameters.go deleted file mode 100644 index 7b24bccb74..0000000000 --- a/api/managementpb/ia/json/client/rules/delete_alert_rule_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// 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" -) - -// NewDeleteAlertRuleParams creates a new DeleteAlertRuleParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteAlertRuleParams() *DeleteAlertRuleParams { - return &DeleteAlertRuleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteAlertRuleParamsWithTimeout creates a new DeleteAlertRuleParams object -// with the ability to set a timeout on a request. -func NewDeleteAlertRuleParamsWithTimeout(timeout time.Duration) *DeleteAlertRuleParams { - return &DeleteAlertRuleParams{ - timeout: timeout, - } -} - -// NewDeleteAlertRuleParamsWithContext creates a new DeleteAlertRuleParams object -// with the ability to set a context for a request. -func NewDeleteAlertRuleParamsWithContext(ctx context.Context) *DeleteAlertRuleParams { - return &DeleteAlertRuleParams{ - Context: ctx, - } -} - -// NewDeleteAlertRuleParamsWithHTTPClient creates a new DeleteAlertRuleParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteAlertRuleParamsWithHTTPClient(client *http.Client) *DeleteAlertRuleParams { - return &DeleteAlertRuleParams{ - HTTPClient: client, - } -} - -/* -DeleteAlertRuleParams contains all the parameters to send to the API endpoint - - for the delete alert rule operation. - - Typically these are written to a http.Request. -*/ -type DeleteAlertRuleParams struct { - // Body. - Body DeleteAlertRuleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete alert rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteAlertRuleParams) WithDefaults() *DeleteAlertRuleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete alert rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteAlertRuleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete alert rule params -func (o *DeleteAlertRuleParams) WithTimeout(timeout time.Duration) *DeleteAlertRuleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete alert rule params -func (o *DeleteAlertRuleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete alert rule params -func (o *DeleteAlertRuleParams) WithContext(ctx context.Context) *DeleteAlertRuleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete alert rule params -func (o *DeleteAlertRuleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete alert rule params -func (o *DeleteAlertRuleParams) WithHTTPClient(client *http.Client) *DeleteAlertRuleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete alert rule params -func (o *DeleteAlertRuleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the delete alert rule params -func (o *DeleteAlertRuleParams) WithBody(body DeleteAlertRuleBody) *DeleteAlertRuleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the delete alert rule params -func (o *DeleteAlertRuleParams) SetBody(body DeleteAlertRuleBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteAlertRuleParams) 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/api/managementpb/ia/json/client/rules/delete_alert_rule_responses.go b/api/managementpb/ia/json/client/rules/delete_alert_rule_responses.go deleted file mode 100644 index accdebbdc8..0000000000 --- a/api/managementpb/ia/json/client/rules/delete_alert_rule_responses.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeleteAlertRuleReader is a Reader for the DeleteAlertRule structure. -type DeleteAlertRuleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteAlertRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteAlertRuleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDeleteAlertRuleDefault(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 - } -} - -// NewDeleteAlertRuleOK creates a DeleteAlertRuleOK with default headers values -func NewDeleteAlertRuleOK() *DeleteAlertRuleOK { - return &DeleteAlertRuleOK{} -} - -/* -DeleteAlertRuleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DeleteAlertRuleOK struct { - Payload interface{} -} - -func (o *DeleteAlertRuleOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/Delete][%d] deleteAlertRuleOk %+v", 200, o.Payload) -} - -func (o *DeleteAlertRuleOK) GetPayload() interface{} { - return o.Payload -} - -func (o *DeleteAlertRuleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteAlertRuleDefault creates a DeleteAlertRuleDefault with default headers values -func NewDeleteAlertRuleDefault(code int) *DeleteAlertRuleDefault { - return &DeleteAlertRuleDefault{ - _statusCode: code, - } -} - -/* -DeleteAlertRuleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DeleteAlertRuleDefault struct { - _statusCode int - - Payload *DeleteAlertRuleDefaultBody -} - -// Code gets the status code for the delete alert rule default response -func (o *DeleteAlertRuleDefault) Code() int { - return o._statusCode -} - -func (o *DeleteAlertRuleDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/Delete][%d] DeleteAlertRule default %+v", o._statusCode, o.Payload) -} - -func (o *DeleteAlertRuleDefault) GetPayload() *DeleteAlertRuleDefaultBody { - return o.Payload -} - -func (o *DeleteAlertRuleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DeleteAlertRuleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -DeleteAlertRuleBody delete alert rule body -swagger:model DeleteAlertRuleBody -*/ -type DeleteAlertRuleBody struct { - // Rule ID. - RuleID string `json:"rule_id,omitempty"` -} - -// Validate validates this delete alert rule body -func (o *DeleteAlertRuleBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this delete alert rule body based on context it is used -func (o *DeleteAlertRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteAlertRuleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteAlertRuleBody) UnmarshalBinary(b []byte) error { - var res DeleteAlertRuleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteAlertRuleDefaultBody delete alert rule default body -swagger:model DeleteAlertRuleDefaultBody -*/ -type DeleteAlertRuleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DeleteAlertRuleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this delete alert rule default body -func (o *DeleteAlertRuleDefaultBody) 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 *DeleteAlertRuleDefaultBody) 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("DeleteAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("DeleteAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this delete alert rule default body based on the context it is used -func (o *DeleteAlertRuleDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *DeleteAlertRuleDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("DeleteAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("DeleteAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteAlertRuleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteAlertRuleDefaultBody) UnmarshalBinary(b []byte) error { - var res DeleteAlertRuleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteAlertRuleDefaultBodyDetailsItems0 delete alert rule default body details items0 -swagger:model DeleteAlertRuleDefaultBodyDetailsItems0 -*/ -type DeleteAlertRuleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this delete alert rule default body details items0 -func (o *DeleteAlertRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this delete alert rule default body details items0 based on context it is used -func (o *DeleteAlertRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteAlertRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteAlertRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DeleteAlertRuleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/rules/list_alert_rules_parameters.go b/api/managementpb/ia/json/client/rules/list_alert_rules_parameters.go deleted file mode 100644 index 324b22bb8c..0000000000 --- a/api/managementpb/ia/json/client/rules/list_alert_rules_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// 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" -) - -// NewListAlertRulesParams creates a new ListAlertRulesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListAlertRulesParams() *ListAlertRulesParams { - return &ListAlertRulesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAlertRulesParamsWithTimeout creates a new ListAlertRulesParams object -// with the ability to set a timeout on a request. -func NewListAlertRulesParamsWithTimeout(timeout time.Duration) *ListAlertRulesParams { - return &ListAlertRulesParams{ - timeout: timeout, - } -} - -// NewListAlertRulesParamsWithContext creates a new ListAlertRulesParams object -// with the ability to set a context for a request. -func NewListAlertRulesParamsWithContext(ctx context.Context) *ListAlertRulesParams { - return &ListAlertRulesParams{ - Context: ctx, - } -} - -// NewListAlertRulesParamsWithHTTPClient creates a new ListAlertRulesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAlertRulesParamsWithHTTPClient(client *http.Client) *ListAlertRulesParams { - return &ListAlertRulesParams{ - HTTPClient: client, - } -} - -/* -ListAlertRulesParams contains all the parameters to send to the API endpoint - - for the list alert rules operation. - - Typically these are written to a http.Request. -*/ -type ListAlertRulesParams struct { - // Body. - Body ListAlertRulesBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list alert rules params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAlertRulesParams) WithDefaults() *ListAlertRulesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list alert rules params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAlertRulesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list alert rules params -func (o *ListAlertRulesParams) WithTimeout(timeout time.Duration) *ListAlertRulesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list alert rules params -func (o *ListAlertRulesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list alert rules params -func (o *ListAlertRulesParams) WithContext(ctx context.Context) *ListAlertRulesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list alert rules params -func (o *ListAlertRulesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list alert rules params -func (o *ListAlertRulesParams) WithHTTPClient(client *http.Client) *ListAlertRulesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list alert rules params -func (o *ListAlertRulesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list alert rules params -func (o *ListAlertRulesParams) WithBody(body ListAlertRulesBody) *ListAlertRulesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list alert rules params -func (o *ListAlertRulesParams) SetBody(body ListAlertRulesBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListAlertRulesParams) 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/api/managementpb/ia/json/client/rules/list_alert_rules_responses.go b/api/managementpb/ia/json/client/rules/list_alert_rules_responses.go deleted file mode 100644 index 2231679875..0000000000 --- a/api/managementpb/ia/json/client/rules/list_alert_rules_responses.go +++ /dev/null @@ -1,2438 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "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" -) - -// ListAlertRulesReader is a Reader for the ListAlertRules structure. -type ListAlertRulesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAlertRulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListAlertRulesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListAlertRulesDefault(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 - } -} - -// NewListAlertRulesOK creates a ListAlertRulesOK with default headers values -func NewListAlertRulesOK() *ListAlertRulesOK { - return &ListAlertRulesOK{} -} - -/* -ListAlertRulesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListAlertRulesOK struct { - Payload *ListAlertRulesOKBody -} - -func (o *ListAlertRulesOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/List][%d] listAlertRulesOk %+v", 200, o.Payload) -} - -func (o *ListAlertRulesOK) GetPayload() *ListAlertRulesOKBody { - return o.Payload -} - -func (o *ListAlertRulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAlertRulesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListAlertRulesDefault creates a ListAlertRulesDefault with default headers values -func NewListAlertRulesDefault(code int) *ListAlertRulesDefault { - return &ListAlertRulesDefault{ - _statusCode: code, - } -} - -/* -ListAlertRulesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListAlertRulesDefault struct { - _statusCode int - - Payload *ListAlertRulesDefaultBody -} - -// Code gets the status code for the list alert rules default response -func (o *ListAlertRulesDefault) Code() int { - return o._statusCode -} - -func (o *ListAlertRulesDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/List][%d] ListAlertRules default %+v", o._statusCode, o.Payload) -} - -func (o *ListAlertRulesDefault) GetPayload() *ListAlertRulesDefaultBody { - return o.Payload -} - -func (o *ListAlertRulesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListAlertRulesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListAlertRulesBody list alert rules body -swagger:model ListAlertRulesBody -*/ -type ListAlertRulesBody struct { - // page params - PageParams *ListAlertRulesParamsBodyPageParams `json:"page_params,omitempty"` -} - -// Validate validates this list alert rules body -func (o *ListAlertRulesBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePageParams(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesBody) validatePageParams(formats strfmt.Registry) error { - if swag.IsZero(o.PageParams) { // not required - return nil - } - - if o.PageParams != nil { - if err := o.PageParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "page_params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "page_params") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alert rules body based on the context it is used -func (o *ListAlertRulesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidatePageParams(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesBody) contextValidatePageParams(ctx context.Context, formats strfmt.Registry) error { - if o.PageParams != nil { - if err := o.PageParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "page_params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "page_params") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesBody) UnmarshalBinary(b []byte) error { - var res ListAlertRulesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesDefaultBody list alert rules default body -swagger:model ListAlertRulesDefaultBody -*/ -type ListAlertRulesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListAlertRulesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list alert rules default body -func (o *ListAlertRulesDefaultBody) 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 *ListAlertRulesDefaultBody) 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("ListAlertRules default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListAlertRules default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list alert rules default body based on the context it is used -func (o *ListAlertRulesDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListAlertRules default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListAlertRules default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListAlertRulesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesDefaultBodyDetailsItems0 list alert rules default body details items0 -swagger:model ListAlertRulesDefaultBodyDetailsItems0 -*/ -type ListAlertRulesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this list alert rules default body details items0 -func (o *ListAlertRulesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules default body details items0 based on context it is used -func (o *ListAlertRulesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListAlertRulesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBody list alert rules OK body -swagger:model ListAlertRulesOKBody -*/ -type ListAlertRulesOKBody struct { - // rules - Rules []*ListAlertRulesOKBodyRulesItems0 `json:"rules"` - - // totals - Totals *ListAlertRulesOKBodyTotals `json:"totals,omitempty"` -} - -// Validate validates this list alert rules OK body -func (o *ListAlertRulesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRules(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTotals(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBody) validateRules(formats strfmt.Registry) error { - if swag.IsZero(o.Rules) { // not required - return nil - } - - for i := 0; i < len(o.Rules); i++ { - if swag.IsZero(o.Rules[i]) { // not required - continue - } - - if o.Rules[i] != nil { - if err := o.Rules[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertRulesOk" + "." + "rules" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listAlertRulesOk" + "." + "rules" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListAlertRulesOKBody) validateTotals(formats strfmt.Registry) error { - if swag.IsZero(o.Totals) { // not required - return nil - } - - if o.Totals != nil { - if err := o.Totals.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertRulesOk" + "." + "totals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listAlertRulesOk" + "." + "totals") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alert rules OK body based on the context it is used -func (o *ListAlertRulesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRules(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTotals(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBody) contextValidateRules(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Rules); i++ { - if o.Rules[i] != nil { - if err := o.Rules[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertRulesOk" + "." + "rules" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listAlertRulesOk" + "." + "rules" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListAlertRulesOKBody) contextValidateTotals(ctx context.Context, formats strfmt.Registry) error { - if o.Totals != nil { - if err := o.Totals.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertRulesOk" + "." + "totals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listAlertRulesOk" + "." + "totals") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBody) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0 Rule represents Alert Rule. -swagger:model ListAlertRulesOKBodyRulesItems0 -*/ -type ListAlertRulesOKBodyRulesItems0 struct { - // Rule ID. - RuleID string `json:"rule_id,omitempty"` - - // Rule name. - Name string `json:"name,omitempty"` - - // Rule human-readable summary. - Summary string `json:"summary,omitempty"` - - // Template used for this rule. - TemplateName string `json:"template_name,omitempty"` - - // True if that rule is disabled. - Disabled bool `json:"disabled,omitempty"` - - // Expression template. - ExprTemplate string `json:"expr_template,omitempty"` - - // Expression filled with parameters. - Expr string `json:"expr,omitempty"` - - // Expression parameters definitions. - ParamsDefinitions []*ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 `json:"params_definitions"` - - // Expression parameters values. - ParamsValues []*ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 `json:"params_values"` - - // Default for duration. - DefaultFor string `json:"default_for,omitempty"` - - // For duration. - For string `json:"for,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - DefaultSeverity *string `json:"default_severity,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - Severity *string `json:"severity,omitempty"` - - // Custom labels. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Labels. - Labels map[string]string `json:"labels,omitempty"` - - // Annotations. - Annotations map[string]string `json:"annotations,omitempty"` - - // Filters. - Filters []*ListAlertRulesOKBodyRulesItems0FiltersItems0 `json:"filters"` - - // Channels. - Channels []*ListAlertRulesOKBodyRulesItems0ChannelsItems0 `json:"channels"` - - // Rule creation time. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 -func (o *ListAlertRulesOKBodyRulesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParamsDefinitions(formats); err != nil { - res = append(res, err) - } - - if err := o.validateParamsValues(formats); err != nil { - res = append(res, err) - } - - if err := o.validateDefaultSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFilters(formats); err != nil { - res = append(res, err) - } - - if err := o.validateChannels(formats); err != nil { - res = append(res, err) - } - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) validateParamsDefinitions(formats strfmt.Registry) error { - if swag.IsZero(o.ParamsDefinitions) { // not required - return nil - } - - for i := 0; i < len(o.ParamsDefinitions); i++ { - if swag.IsZero(o.ParamsDefinitions[i]) { // not required - continue - } - - if o.ParamsDefinitions[i] != nil { - if err := o.ParamsDefinitions[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params_definitions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params_definitions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) validateParamsValues(formats strfmt.Registry) error { - if swag.IsZero(o.ParamsValues) { // not required - return nil - } - - for i := 0; i < len(o.ParamsValues); i++ { - if swag.IsZero(o.ParamsValues[i]) { // not required - continue - } - - if o.ParamsValues[i] != nil { - if err := o.ParamsValues[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params_values" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params_values" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var listAlertRulesOkBodyRulesItems0TypeDefaultSeverityPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_INVALID","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertRulesOkBodyRulesItems0TypeDefaultSeverityPropEnum = append(listAlertRulesOkBodyRulesItems0TypeDefaultSeverityPropEnum, v) - } -} - -const ( - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYINVALID string = "SEVERITY_INVALID" - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYINFO string = "SEVERITY_INFO" - - // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *ListAlertRulesOKBodyRulesItems0) validateDefaultSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0TypeDefaultSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) validateDefaultSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.DefaultSeverity) { // not required - return nil - } - - // value enum - if err := o.validateDefaultSeverityEnum("default_severity", "body", *o.DefaultSeverity); err != nil { - return err - } - - return nil -} - -var listAlertRulesOkBodyRulesItems0TypeSeverityPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_INVALID","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertRulesOkBodyRulesItems0TypeSeverityPropEnum = append(listAlertRulesOkBodyRulesItems0TypeSeverityPropEnum, v) - } -} - -const ( - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" - - // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - ListAlertRulesOKBodyRulesItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *ListAlertRulesOKBodyRulesItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0TypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) validateFilters(formats strfmt.Registry) error { - if swag.IsZero(o.Filters) { // not required - return nil - } - - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue - } - - if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("filters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("filters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) validateChannels(formats strfmt.Registry) error { - if swag.IsZero(o.Channels) { // not required - return nil - } - - for i := 0; i < len(o.Channels); i++ { - if swag.IsZero(o.Channels[i]) { // not required - continue - } - - if o.Channels[i] != nil { - if err := o.Channels[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("channels" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("channels" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this list alert rules OK body rules items0 based on the context it is used -func (o *ListAlertRulesOKBodyRulesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateParamsDefinitions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateParamsValues(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateFilters(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateChannels(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) contextValidateParamsDefinitions(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.ParamsDefinitions); i++ { - if o.ParamsDefinitions[i] != nil { - if err := o.ParamsDefinitions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params_definitions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params_definitions" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) contextValidateParamsValues(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.ParamsValues); i++ { - if o.ParamsValues[i] != nil { - if err := o.ParamsValues[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params_values" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params_values" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Filters); i++ { - if o.Filters[i] != nil { - if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("filters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("filters" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0) contextValidateChannels(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Channels); i++ { - if o.Channels[i] != nil { - if err := o.Channels[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("channels" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("channels" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ChannelsItems0 Channel represents a single Notification Channel. -swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0 -*/ -type ListAlertRulesOKBodyRulesItems0ChannelsItems0 struct { - // Machine-readable ID. - ChannelID string `json:"channel_id,omitempty"` - - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // True if that channel is disabled. - Disabled bool `json:"disabled,omitempty"` - - // email config - EmailConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig `json:"email_config,omitempty"` - - // pagerduty config - PagerdutyConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` - - // slack config - SlackConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig `json:"slack_config,omitempty"` - - // webhook config - WebhookConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 channels items0 -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEmailConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePagerdutyConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSlackConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateWebhookConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { - if swag.IsZero(o.EmailConfig) { // not required - return nil - } - - if o.EmailConfig != nil { - if err := o.EmailConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("email_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PagerdutyConfig) { // not required - return nil - } - - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { - if swag.IsZero(o.SlackConfig) { // not required - return nil - } - - if o.SlackConfig != nil { - if err := o.SlackConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("slack_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { - if swag.IsZero(o.WebhookConfig) { // not required - return nil - } - - if o.WebhookConfig != nil { - if err := o.WebhookConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alert rules OK body rules items0 channels items0 based on the context it is used -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateEmailConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateSlackConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { - if o.EmailConfig != nil { - if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("email_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("email_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagerduty_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagerduty_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { - if o.SlackConfig != nil { - if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("slack_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("slack_config") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { - if o.WebhookConfig != nil { - if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ChannelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig EmailConfig represents email configuration. -swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig -*/ -type ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // to - To []string `json:"to"` -} - -// Validate validates this list alert rules OK body rules items0 channels items0 email config -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 channels items0 email config based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. -swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig -*/ -type ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. - RoutingKey string `json:"routing_key,omitempty"` - - // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. - ServiceKey string `json:"service_key,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 channels items0 pagerduty config -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 channels items0 pagerduty config based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig SlackConfig represents Slack configuration. -swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig -*/ -type ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // channel - Channel string `json:"channel,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 channels items0 slack config -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 channels items0 slack config based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. -swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig -*/ -type ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // url - URL string `json:"url,omitempty"` - - // max alerts - MaxAlerts int32 `json:"max_alerts,omitempty"` - - // http config - HTTPConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 channels items0 webhook config -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHTTPConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - if swag.IsZero(o.HTTPConfig) { // not required - return nil - } - - if o.HTTPConfig != nil { - if err := o.HTTPConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alert rules OK body rules items0 channels items0 webhook config based on the context it is used -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { - if o.HTTPConfig != nil { - if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. -swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig -*/ -type ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig struct { - // bearer token - BearerToken string `json:"bearer_token,omitempty"` - - // bearer token file - BearerTokenFile string `json:"bearer_token_file,omitempty"` - - // proxy url - ProxyURL string `json:"proxy_url,omitempty"` - - // basic auth - BasicAuth *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` - - // tls config - TLSConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBasicAuth(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTLSConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - if swag.IsZero(o.BasicAuth) { // not required - return nil - } - - if o.BasicAuth != nil { - if err := o.BasicAuth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - if swag.IsZero(o.TLSConfig) { // not required - return nil - } - - if o.TLSConfig != nil { - if err := o.TLSConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alert rules OK body rules items0 channels items0 webhook config HTTP config based on the context it is used -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBasicAuth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTLSConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { - if o.BasicAuth != nil { - if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { - if o.TLSConfig != nil { - if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. -swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth -*/ -type ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { - // username - Username string `json:"username,omitempty"` - - // password - Password string `json:"password,omitempty"` - - // password file - PasswordFile string `json:"password_file,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config basic auth -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config basic auth based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager -// https://prometheus.io/docs/alerting/latest/configuration/#tls_config -swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig -*/ -type ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { - // A path to the CA certificate file to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFile string `json:"ca_file,omitempty"` - - // A path to the certificate file for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFile string `json:"cert_file,omitempty"` - - // A path to the key file for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFile string `json:"key_file,omitempty"` - - // Name of the server. - ServerName string `json:"server_name,omitempty"` - - // Disable validation of the server certificate. - InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` - - // CA certificate to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFileContent string `json:"ca_file_content,omitempty"` - - // A certificate for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFileContent string `json:"cert_file_content,omitempty"` - - // A key for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFileContent string `json:"key_file_content,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config TLS config -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config TLS config based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0FiltersItems0 Filter repsents a single filter condition. -swagger:model ListAlertRulesOKBodyRulesItems0FiltersItems0 -*/ -type ListAlertRulesOKBodyRulesItems0FiltersItems0 struct { - // FilterType represents filter matching type. - // - // - EQUAL: = - // - // != - // NOT_EQUAL = 2; - // - REGEX: =~ - // - // !~ - // NOT_REGEX = 4; - // Enum: [FILTER_TYPE_INVALID EQUAL REGEX] - Type *string `json:"type,omitempty"` - - // key - Key string `json:"key,omitempty"` - - // value - Value string `json:"value,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 filters items0 -func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertRulesOkBodyRulesItems0FiltersItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["FILTER_TYPE_INVALID","EQUAL","REGEX"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertRulesOkBodyRulesItems0FiltersItems0TypeTypePropEnum = append(listAlertRulesOkBodyRulesItems0FiltersItems0TypeTypePropEnum, v) - } -} - -const ( - - // ListAlertRulesOKBodyRulesItems0FiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" - ListAlertRulesOKBodyRulesItems0FiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" - - // ListAlertRulesOKBodyRulesItems0FiltersItems0TypeEQUAL captures enum value "EQUAL" - ListAlertRulesOKBodyRulesItems0FiltersItems0TypeEQUAL string = "EQUAL" - - // ListAlertRulesOKBodyRulesItems0FiltersItems0TypeREGEX captures enum value "REGEX" - ListAlertRulesOKBodyRulesItems0FiltersItems0TypeREGEX string = "REGEX" -) - -// prop value enum -func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0FiltersItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 filters items0 based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0FiltersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 ParamDefinition represents a single query parameter. -swagger:model ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 -*/ -type ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // Short human-readable parameter summary. - Summary string `json:"summary,omitempty"` - - // ParamUnit represents template parameter unit. - // - // - PARAM_UNIT_INVALID: Invalid, unknown or absent. - // - PERCENTAGE: % - // - SECONDS: s - // Enum: [PARAM_UNIT_INVALID PERCENTAGE SECONDS] - Unit *string `json:"unit,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // bool - Bool *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool `json:"bool,omitempty"` - - // float - Float *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float `json:"float,omitempty"` - - // string - String *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String `json:"string,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 params definitions items0 -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateUnit(formats); err != nil { - res = append(res, err) - } - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if err := o.validateBool(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFloat(formats); err != nil { - res = append(res, err) - } - - if err := o.validateString(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeUnitPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_UNIT_INVALID","PERCENTAGE","SECONDS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeUnitPropEnum = append(listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeUnitPropEnum, v) - } -} - -const ( - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitPARAMUNITINVALID captures enum value "PARAM_UNIT_INVALID" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitPARAMUNITINVALID string = "PARAM_UNIT_INVALID" - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitPERCENTAGE captures enum value "PERCENTAGE" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitPERCENTAGE string = "PERCENTAGE" - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitSECONDS captures enum value "SECONDS" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitSECONDS string = "SECONDS" -) - -// prop value enum -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateUnitEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeUnitPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateUnit(formats strfmt.Registry) error { - if swag.IsZero(o.Unit) { // not required - return nil - } - - // value enum - if err := o.validateUnitEnum("unit", "body", *o.Unit); err != nil { - return err - } - - return nil -} - -var listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeTypePropEnum = append(listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeTypePropEnum, v) - } -} - -const ( - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeBOOL captures enum value "BOOL" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeBOOL string = "BOOL" - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeFLOAT captures enum value "FLOAT" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeFLOAT string = "FLOAT" - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeSTRING captures enum value "STRING" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeSTRING string = "STRING" -) - -// prop value enum -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateBool(formats strfmt.Registry) error { - if swag.IsZero(o.Bool) { // not required - return nil - } - - if o.Bool != nil { - if err := o.Bool.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("bool") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("bool") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateFloat(formats strfmt.Registry) error { - if swag.IsZero(o.Float) { // not required - return nil - } - - if o.Float != nil { - if err := o.Float.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("float") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("float") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateString(formats strfmt.Registry) error { - if swag.IsZero(o.String) { // not required - return nil - } - - if o.String != nil { - if err := o.String.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("string") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("string") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list alert rules OK body rules items0 params definitions items0 based on the context it is used -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBool(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateFloat(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateString(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) contextValidateBool(ctx context.Context, formats strfmt.Registry) error { - if o.Bool != nil { - if err := o.Bool.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("bool") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("bool") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) contextValidateFloat(ctx context.Context, formats strfmt.Registry) error { - if o.Float != nil { - if err := o.Float.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("float") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("float") - } - return err - } - } - - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) contextValidateString(ctx context.Context, formats strfmt.Registry) error { - if o.String != nil { - if err := o.String.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("string") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("string") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool BoolParamDefinition represents boolean parameter's default value. -swagger:model ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool -*/ -type ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool struct { - // BooleanFlag represent a command to set some boolean property to true, - // to false, or avoid changing that property. - // - // - DO_NOT_CHANGE: Do not change boolean property. Default value. - // - TRUE: True. - // - FALSE: False. - // Enum: [DO_NOT_CHANGE TRUE FALSE] - Default *string `json:"default,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 params definitions items0 bool -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDefault(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DO_NOT_CHANGE","TRUE","FALSE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum = append(listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum, v) - } -} - -const ( - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultDONOTCHANGE captures enum value "DO_NOT_CHANGE" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultDONOTCHANGE string = "DO_NOT_CHANGE" - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultTRUE captures enum value "TRUE" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultTRUE string = "TRUE" - - // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultFALSE captures enum value "FALSE" - ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultFALSE string = "FALSE" -) - -// prop value enum -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) validateDefaultEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) validateDefault(formats strfmt.Registry) error { - if swag.IsZero(o.Default) { // not required - return nil - } - - // value enum - if err := o.validateDefaultEnum("bool"+"."+"default", "body", *o.Default); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 params definitions items0 bool based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float FloatParamDefinition represents float parameter's default value and valid range. -swagger:model ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float -*/ -type ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float struct { - // True if default value is set. - HasDefault bool `json:"has_default,omitempty"` - - // Default value if has_default is true. - Default float64 `json:"default,omitempty"` - - // True if minimal valid value is set. - HasMin bool `json:"has_min,omitempty"` - - // Minimal valid value (inclusive) if has_min is true. - Min float64 `json:"min,omitempty"` - - // True if maximal valid value is set. - HasMax bool `json:"has_max,omitempty"` - - // Maximal valid value (inclusive) if has_max is true. - Max float64 `json:"max,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 params definitions items0 float -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 params definitions items0 float based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String StringParamDefinition represents string parameter's default value. -swagger:model ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String -*/ -type ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String struct { - // True if default value is set. - HasDefault bool `json:"has_default,omitempty"` - - // Default value if has_default is true. - Default string `json:"default,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 params definitions items0 string -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 params definitions items0 string based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. -swagger:model ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 -*/ -type ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // Bool value. - Bool bool `json:"bool,omitempty"` - - // Float value. - Float float64 `json:"float,omitempty"` - - // String value. - String string `json:"string,omitempty"` -} - -// Validate validates this list alert rules OK body rules items0 params values items0 -func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listAlertRulesOkBodyRulesItems0ParamsValuesItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listAlertRulesOkBodyRulesItems0ParamsValuesItems0TypeTypePropEnum = append(listAlertRulesOkBodyRulesItems0ParamsValuesItems0TypeTypePropEnum, v) - } -} - -const ( - - // ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - - // ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeBOOL captures enum value "BOOL" - ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeBOOL string = "BOOL" - - // ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeFLOAT captures enum value "FLOAT" - ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeFLOAT string = "FLOAT" - - // ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeSTRING captures enum value "STRING" - ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeSTRING string = "STRING" -) - -// prop value enum -func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0ParamsValuesItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list alert rules OK body rules items0 params values items0 based on context it is used -func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesOKBodyTotals PageTotals represents total values for pagination. -swagger:model ListAlertRulesOKBodyTotals -*/ -type ListAlertRulesOKBodyTotals struct { - // Total number of results. - TotalItems int32 `json:"total_items,omitempty"` - - // Total number of pages. - TotalPages int32 `json:"total_pages,omitempty"` -} - -// Validate validates this list alert rules OK body totals -func (o *ListAlertRulesOKBodyTotals) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules OK body totals based on context it is used -func (o *ListAlertRulesOKBodyTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyTotals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyTotals) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyTotals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListAlertRulesParamsBodyPageParams PageParams represents page request parameters for pagination. -swagger:model ListAlertRulesParamsBodyPageParams -*/ -type ListAlertRulesParamsBodyPageParams struct { - // Maximum number of results per page. - PageSize int32 `json:"page_size,omitempty"` - - // Index of the requested page, starts from 0. - Index int32 `json:"index,omitempty"` -} - -// Validate validates this list alert rules params body page params -func (o *ListAlertRulesParamsBodyPageParams) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list alert rules params body page params based on context it is used -func (o *ListAlertRulesParamsBodyPageParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListAlertRulesParamsBodyPageParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertRulesParamsBodyPageParams) UnmarshalBinary(b []byte) error { - var res ListAlertRulesParamsBodyPageParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/rules/rules_client.go b/api/managementpb/ia/json/client/rules/rules_client.go deleted file mode 100644 index 5a14a8e792..0000000000 --- a/api/managementpb/ia/json/client/rules/rules_client.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// 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 rules API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for rules API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateAlertRule(params *CreateAlertRuleParams, opts ...ClientOption) (*CreateAlertRuleOK, error) - - DeleteAlertRule(params *DeleteAlertRuleParams, opts ...ClientOption) (*DeleteAlertRuleOK, error) - - ListAlertRules(params *ListAlertRulesParams, opts ...ClientOption) (*ListAlertRulesOK, error) - - ToggleAlertRule(params *ToggleAlertRuleParams, opts ...ClientOption) (*ToggleAlertRuleOK, error) - - UpdateAlertRule(params *UpdateAlertRuleParams, opts ...ClientOption) (*UpdateAlertRuleOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateAlertRule creates alert rule creates alerting rule -*/ -func (a *Client) CreateAlertRule(params *CreateAlertRuleParams, opts ...ClientOption) (*CreateAlertRuleOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateAlertRuleParams() - } - op := &runtime.ClientOperation{ - ID: "CreateAlertRule", - Method: "POST", - PathPattern: "/v1/management/ia/Rules/Create", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CreateAlertRuleReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateAlertRuleOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*CreateAlertRuleDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -DeleteAlertRule deletes alert rule deletes alerting rule -*/ -func (a *Client) DeleteAlertRule(params *DeleteAlertRuleParams, opts ...ClientOption) (*DeleteAlertRuleOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteAlertRuleParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteAlertRule", - Method: "POST", - PathPattern: "/v1/management/ia/Rules/Delete", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DeleteAlertRuleReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteAlertRuleOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*DeleteAlertRuleDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListAlertRules lists alert rules returns a list of all alerting rules -*/ -func (a *Client) ListAlertRules(params *ListAlertRulesParams, opts ...ClientOption) (*ListAlertRulesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListAlertRulesParams() - } - op := &runtime.ClientOperation{ - ID: "ListAlertRules", - Method: "POST", - PathPattern: "/v1/management/ia/Rules/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListAlertRulesReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListAlertRulesOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListAlertRulesDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ToggleAlertRule toggles alert rule allows to switch between disabled and enabled states of an alert rule -*/ -func (a *Client) ToggleAlertRule(params *ToggleAlertRuleParams, opts ...ClientOption) (*ToggleAlertRuleOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewToggleAlertRuleParams() - } - op := &runtime.ClientOperation{ - ID: "ToggleAlertRule", - Method: "POST", - PathPattern: "/v1/management/ia/Rules/Toggle", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ToggleAlertRuleReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ToggleAlertRuleOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ToggleAlertRuleDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UpdateAlertRule updates alert rule updates alerting rule -*/ -func (a *Client) UpdateAlertRule(params *UpdateAlertRuleParams, opts ...ClientOption) (*UpdateAlertRuleOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateAlertRuleParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateAlertRule", - Method: "POST", - PathPattern: "/v1/management/ia/Rules/Update", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UpdateAlertRuleReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateAlertRuleOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*UpdateAlertRuleDefault) - 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/api/managementpb/ia/json/client/rules/toggle_alert_rule_parameters.go b/api/managementpb/ia/json/client/rules/toggle_alert_rule_parameters.go deleted file mode 100644 index 98c9657468..0000000000 --- a/api/managementpb/ia/json/client/rules/toggle_alert_rule_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// 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" -) - -// NewToggleAlertRuleParams creates a new ToggleAlertRuleParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewToggleAlertRuleParams() *ToggleAlertRuleParams { - return &ToggleAlertRuleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewToggleAlertRuleParamsWithTimeout creates a new ToggleAlertRuleParams object -// with the ability to set a timeout on a request. -func NewToggleAlertRuleParamsWithTimeout(timeout time.Duration) *ToggleAlertRuleParams { - return &ToggleAlertRuleParams{ - timeout: timeout, - } -} - -// NewToggleAlertRuleParamsWithContext creates a new ToggleAlertRuleParams object -// with the ability to set a context for a request. -func NewToggleAlertRuleParamsWithContext(ctx context.Context) *ToggleAlertRuleParams { - return &ToggleAlertRuleParams{ - Context: ctx, - } -} - -// NewToggleAlertRuleParamsWithHTTPClient creates a new ToggleAlertRuleParams object -// with the ability to set a custom HTTPClient for a request. -func NewToggleAlertRuleParamsWithHTTPClient(client *http.Client) *ToggleAlertRuleParams { - return &ToggleAlertRuleParams{ - HTTPClient: client, - } -} - -/* -ToggleAlertRuleParams contains all the parameters to send to the API endpoint - - for the toggle alert rule operation. - - Typically these are written to a http.Request. -*/ -type ToggleAlertRuleParams struct { - // Body. - Body ToggleAlertRuleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the toggle alert rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ToggleAlertRuleParams) WithDefaults() *ToggleAlertRuleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the toggle alert rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ToggleAlertRuleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the toggle alert rule params -func (o *ToggleAlertRuleParams) WithTimeout(timeout time.Duration) *ToggleAlertRuleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the toggle alert rule params -func (o *ToggleAlertRuleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the toggle alert rule params -func (o *ToggleAlertRuleParams) WithContext(ctx context.Context) *ToggleAlertRuleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the toggle alert rule params -func (o *ToggleAlertRuleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the toggle alert rule params -func (o *ToggleAlertRuleParams) WithHTTPClient(client *http.Client) *ToggleAlertRuleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the toggle alert rule params -func (o *ToggleAlertRuleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the toggle alert rule params -func (o *ToggleAlertRuleParams) WithBody(body ToggleAlertRuleBody) *ToggleAlertRuleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the toggle alert rule params -func (o *ToggleAlertRuleParams) SetBody(body ToggleAlertRuleBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ToggleAlertRuleParams) 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/api/managementpb/ia/json/client/rules/toggle_alert_rule_responses.go b/api/managementpb/ia/json/client/rules/toggle_alert_rule_responses.go deleted file mode 100644 index afbd371436..0000000000 --- a/api/managementpb/ia/json/client/rules/toggle_alert_rule_responses.go +++ /dev/null @@ -1,360 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "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" -) - -// ToggleAlertRuleReader is a Reader for the ToggleAlertRule structure. -type ToggleAlertRuleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ToggleAlertRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewToggleAlertRuleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewToggleAlertRuleDefault(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 - } -} - -// NewToggleAlertRuleOK creates a ToggleAlertRuleOK with default headers values -func NewToggleAlertRuleOK() *ToggleAlertRuleOK { - return &ToggleAlertRuleOK{} -} - -/* -ToggleAlertRuleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ToggleAlertRuleOK struct { - Payload interface{} -} - -func (o *ToggleAlertRuleOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/Toggle][%d] toggleAlertRuleOk %+v", 200, o.Payload) -} - -func (o *ToggleAlertRuleOK) GetPayload() interface{} { - return o.Payload -} - -func (o *ToggleAlertRuleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewToggleAlertRuleDefault creates a ToggleAlertRuleDefault with default headers values -func NewToggleAlertRuleDefault(code int) *ToggleAlertRuleDefault { - return &ToggleAlertRuleDefault{ - _statusCode: code, - } -} - -/* -ToggleAlertRuleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ToggleAlertRuleDefault struct { - _statusCode int - - Payload *ToggleAlertRuleDefaultBody -} - -// Code gets the status code for the toggle alert rule default response -func (o *ToggleAlertRuleDefault) Code() int { - return o._statusCode -} - -func (o *ToggleAlertRuleDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/Toggle][%d] ToggleAlertRule default %+v", o._statusCode, o.Payload) -} - -func (o *ToggleAlertRuleDefault) GetPayload() *ToggleAlertRuleDefaultBody { - return o.Payload -} - -func (o *ToggleAlertRuleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ToggleAlertRuleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ToggleAlertRuleBody toggle alert rule body -swagger:model ToggleAlertRuleBody -*/ -type ToggleAlertRuleBody struct { - // Rule ID. - RuleID string `json:"rule_id,omitempty"` - - // BooleanFlag represent a command to set some boolean property to true, - // to false, or avoid changing that property. - // - // - DO_NOT_CHANGE: Do not change boolean property. Default value. - // - TRUE: True. - // - FALSE: False. - // Enum: [DO_NOT_CHANGE TRUE FALSE] - Disabled *string `json:"disabled,omitempty"` -} - -// Validate validates this toggle alert rule body -func (o *ToggleAlertRuleBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDisabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var toggleAlertRuleBodyTypeDisabledPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DO_NOT_CHANGE","TRUE","FALSE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - toggleAlertRuleBodyTypeDisabledPropEnum = append(toggleAlertRuleBodyTypeDisabledPropEnum, v) - } -} - -const ( - - // ToggleAlertRuleBodyDisabledDONOTCHANGE captures enum value "DO_NOT_CHANGE" - ToggleAlertRuleBodyDisabledDONOTCHANGE string = "DO_NOT_CHANGE" - - // ToggleAlertRuleBodyDisabledTRUE captures enum value "TRUE" - ToggleAlertRuleBodyDisabledTRUE string = "TRUE" - - // ToggleAlertRuleBodyDisabledFALSE captures enum value "FALSE" - ToggleAlertRuleBodyDisabledFALSE string = "FALSE" -) - -// prop value enum -func (o *ToggleAlertRuleBody) validateDisabledEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, toggleAlertRuleBodyTypeDisabledPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ToggleAlertRuleBody) validateDisabled(formats strfmt.Registry) error { - if swag.IsZero(o.Disabled) { // not required - return nil - } - - // value enum - if err := o.validateDisabledEnum("body"+"."+"disabled", "body", *o.Disabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this toggle alert rule body based on context it is used -func (o *ToggleAlertRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ToggleAlertRuleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ToggleAlertRuleBody) UnmarshalBinary(b []byte) error { - var res ToggleAlertRuleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ToggleAlertRuleDefaultBody toggle alert rule default body -swagger:model ToggleAlertRuleDefaultBody -*/ -type ToggleAlertRuleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ToggleAlertRuleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this toggle alert rule default body -func (o *ToggleAlertRuleDefaultBody) 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 *ToggleAlertRuleDefaultBody) 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("ToggleAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ToggleAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this toggle alert rule default body based on the context it is used -func (o *ToggleAlertRuleDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ToggleAlertRuleDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ToggleAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ToggleAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ToggleAlertRuleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ToggleAlertRuleDefaultBody) UnmarshalBinary(b []byte) error { - var res ToggleAlertRuleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ToggleAlertRuleDefaultBodyDetailsItems0 toggle alert rule default body details items0 -swagger:model ToggleAlertRuleDefaultBodyDetailsItems0 -*/ -type ToggleAlertRuleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this toggle alert rule default body details items0 -func (o *ToggleAlertRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this toggle alert rule default body details items0 based on context it is used -func (o *ToggleAlertRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ToggleAlertRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ToggleAlertRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ToggleAlertRuleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/client/rules/update_alert_rule_parameters.go b/api/managementpb/ia/json/client/rules/update_alert_rule_parameters.go deleted file mode 100644 index 0e0b4d7bc6..0000000000 --- a/api/managementpb/ia/json/client/rules/update_alert_rule_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// 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" -) - -// NewUpdateAlertRuleParams creates a new UpdateAlertRuleParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateAlertRuleParams() *UpdateAlertRuleParams { - return &UpdateAlertRuleParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateAlertRuleParamsWithTimeout creates a new UpdateAlertRuleParams object -// with the ability to set a timeout on a request. -func NewUpdateAlertRuleParamsWithTimeout(timeout time.Duration) *UpdateAlertRuleParams { - return &UpdateAlertRuleParams{ - timeout: timeout, - } -} - -// NewUpdateAlertRuleParamsWithContext creates a new UpdateAlertRuleParams object -// with the ability to set a context for a request. -func NewUpdateAlertRuleParamsWithContext(ctx context.Context) *UpdateAlertRuleParams { - return &UpdateAlertRuleParams{ - Context: ctx, - } -} - -// NewUpdateAlertRuleParamsWithHTTPClient creates a new UpdateAlertRuleParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateAlertRuleParamsWithHTTPClient(client *http.Client) *UpdateAlertRuleParams { - return &UpdateAlertRuleParams{ - HTTPClient: client, - } -} - -/* -UpdateAlertRuleParams contains all the parameters to send to the API endpoint - - for the update alert rule operation. - - Typically these are written to a http.Request. -*/ -type UpdateAlertRuleParams struct { - // Body. - Body UpdateAlertRuleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update alert rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateAlertRuleParams) WithDefaults() *UpdateAlertRuleParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update alert rule params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateAlertRuleParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update alert rule params -func (o *UpdateAlertRuleParams) WithTimeout(timeout time.Duration) *UpdateAlertRuleParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update alert rule params -func (o *UpdateAlertRuleParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update alert rule params -func (o *UpdateAlertRuleParams) WithContext(ctx context.Context) *UpdateAlertRuleParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update alert rule params -func (o *UpdateAlertRuleParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update alert rule params -func (o *UpdateAlertRuleParams) WithHTTPClient(client *http.Client) *UpdateAlertRuleParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update alert rule params -func (o *UpdateAlertRuleParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update alert rule params -func (o *UpdateAlertRuleParams) WithBody(body UpdateAlertRuleBody) *UpdateAlertRuleParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update alert rule params -func (o *UpdateAlertRuleParams) SetBody(body UpdateAlertRuleBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateAlertRuleParams) 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/api/managementpb/ia/json/client/rules/update_alert_rule_responses.go b/api/managementpb/ia/json/client/rules/update_alert_rule_responses.go deleted file mode 100644 index 13854b9415..0000000000 --- a/api/managementpb/ia/json/client/rules/update_alert_rule_responses.go +++ /dev/null @@ -1,715 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "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" -) - -// UpdateAlertRuleReader is a Reader for the UpdateAlertRule structure. -type UpdateAlertRuleReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateAlertRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateAlertRuleOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUpdateAlertRuleDefault(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 - } -} - -// NewUpdateAlertRuleOK creates a UpdateAlertRuleOK with default headers values -func NewUpdateAlertRuleOK() *UpdateAlertRuleOK { - return &UpdateAlertRuleOK{} -} - -/* -UpdateAlertRuleOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UpdateAlertRuleOK struct { - Payload interface{} -} - -func (o *UpdateAlertRuleOK) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/Update][%d] updateAlertRuleOk %+v", 200, o.Payload) -} - -func (o *UpdateAlertRuleOK) GetPayload() interface{} { - return o.Payload -} - -func (o *UpdateAlertRuleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAlertRuleDefault creates a UpdateAlertRuleDefault with default headers values -func NewUpdateAlertRuleDefault(code int) *UpdateAlertRuleDefault { - return &UpdateAlertRuleDefault{ - _statusCode: code, - } -} - -/* -UpdateAlertRuleDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UpdateAlertRuleDefault struct { - _statusCode int - - Payload *UpdateAlertRuleDefaultBody -} - -// Code gets the status code for the update alert rule default response -func (o *UpdateAlertRuleDefault) Code() int { - return o._statusCode -} - -func (o *UpdateAlertRuleDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Rules/Update][%d] UpdateAlertRule default %+v", o._statusCode, o.Payload) -} - -func (o *UpdateAlertRuleDefault) GetPayload() *UpdateAlertRuleDefaultBody { - return o.Payload -} - -func (o *UpdateAlertRuleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdateAlertRuleDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -UpdateAlertRuleBody update alert rule body -swagger:model UpdateAlertRuleBody -*/ -type UpdateAlertRuleBody struct { - // Rule ID. - RuleID string `json:"rule_id,omitempty"` - - // Rule name. Should be set. - Name string `json:"name,omitempty"` - - // New rule status. Should be set. - Disabled bool `json:"disabled,omitempty"` - - // Rule parameters. All template parameters should be set. - Params []*UpdateAlertRuleParamsBodyParamsItems0 `json:"params"` - - // Rule duration. Should be set. - For string `json:"for,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - Severity *string `json:"severity,omitempty"` - - // All custom labels to add or remove (with empty values) to default labels from template. - CustomLabels map[string]string `json:"custom_labels,omitempty"` - - // Filters. Should be set. - Filters []*UpdateAlertRuleParamsBodyFiltersItems0 `json:"filters"` - - // Channels. Should be set. - ChannelIds []string `json:"channel_ids"` -} - -// Validate validates this update alert rule body -func (o *UpdateAlertRuleBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if err := o.validateFilters(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdateAlertRuleBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required - return nil - } - - for i := 0; i < len(o.Params); i++ { - if swag.IsZero(o.Params[i]) { // not required - continue - } - - if o.Params[i] != nil { - if err := o.Params[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var updateAlertRuleBodyTypeSeverityPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SEVERITY_INVALID","SEVERITY_EMERGENCY","SEVERITY_ALERT","SEVERITY_CRITICAL","SEVERITY_ERROR","SEVERITY_WARNING","SEVERITY_NOTICE","SEVERITY_INFO","SEVERITY_DEBUG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateAlertRuleBodyTypeSeverityPropEnum = append(updateAlertRuleBodyTypeSeverityPropEnum, v) - } -} - -const ( - - // UpdateAlertRuleBodySeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - UpdateAlertRuleBodySeveritySEVERITYINVALID string = "SEVERITY_INVALID" - - // UpdateAlertRuleBodySeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - UpdateAlertRuleBodySeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - - // UpdateAlertRuleBodySeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - UpdateAlertRuleBodySeveritySEVERITYALERT string = "SEVERITY_ALERT" - - // UpdateAlertRuleBodySeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - UpdateAlertRuleBodySeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - - // UpdateAlertRuleBodySeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - UpdateAlertRuleBodySeveritySEVERITYERROR string = "SEVERITY_ERROR" - - // UpdateAlertRuleBodySeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - UpdateAlertRuleBodySeveritySEVERITYWARNING string = "SEVERITY_WARNING" - - // UpdateAlertRuleBodySeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - UpdateAlertRuleBodySeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - - // UpdateAlertRuleBodySeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - UpdateAlertRuleBodySeveritySEVERITYINFO string = "SEVERITY_INFO" - - // UpdateAlertRuleBodySeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - UpdateAlertRuleBodySeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" -) - -// prop value enum -func (o *UpdateAlertRuleBody) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateAlertRuleBodyTypeSeverityPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *UpdateAlertRuleBody) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required - return nil - } - - // value enum - if err := o.validateSeverityEnum("body"+"."+"severity", "body", *o.Severity); err != nil { - return err - } - - return nil -} - -func (o *UpdateAlertRuleBody) validateFilters(formats strfmt.Registry) error { - if swag.IsZero(o.Filters) { // not required - return nil - } - - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue - } - - if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this update alert rule body based on the context it is used -func (o *UpdateAlertRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateParams(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateFilters(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdateAlertRuleBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Params); i++ { - if o.Params[i] != nil { - if err := o.Params[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -func (o *UpdateAlertRuleBody) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Filters); i++ { - if o.Filters[i] != nil { - if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAlertRuleBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAlertRuleBody) UnmarshalBinary(b []byte) error { - var res UpdateAlertRuleBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateAlertRuleDefaultBody update alert rule default body -swagger:model UpdateAlertRuleDefaultBody -*/ -type UpdateAlertRuleDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UpdateAlertRuleDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this update alert rule default body -func (o *UpdateAlertRuleDefaultBody) 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 *UpdateAlertRuleDefaultBody) 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("UpdateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("UpdateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this update alert rule default body based on the context it is used -func (o *UpdateAlertRuleDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdateAlertRuleDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("UpdateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("UpdateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAlertRuleDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAlertRuleDefaultBody) UnmarshalBinary(b []byte) error { - var res UpdateAlertRuleDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateAlertRuleDefaultBodyDetailsItems0 update alert rule default body details items0 -swagger:model UpdateAlertRuleDefaultBodyDetailsItems0 -*/ -type UpdateAlertRuleDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this update alert rule default body details items0 -func (o *UpdateAlertRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update alert rule default body details items0 based on context it is used -func (o *UpdateAlertRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAlertRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAlertRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res UpdateAlertRuleDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateAlertRuleParamsBodyFiltersItems0 Filter repsents a single filter condition. -swagger:model UpdateAlertRuleParamsBodyFiltersItems0 -*/ -type UpdateAlertRuleParamsBodyFiltersItems0 struct { - // FilterType represents filter matching type. - // - // - EQUAL: = - // - // != - // NOT_EQUAL = 2; - // - REGEX: =~ - // - // !~ - // NOT_REGEX = 4; - // Enum: [FILTER_TYPE_INVALID EQUAL REGEX] - Type *string `json:"type,omitempty"` - - // key - Key string `json:"key,omitempty"` - - // value - Value string `json:"value,omitempty"` -} - -// Validate validates this update alert rule params body filters items0 -func (o *UpdateAlertRuleParamsBodyFiltersItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var updateAlertRuleParamsBodyFiltersItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["FILTER_TYPE_INVALID","EQUAL","REGEX"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateAlertRuleParamsBodyFiltersItems0TypeTypePropEnum = append(updateAlertRuleParamsBodyFiltersItems0TypeTypePropEnum, v) - } -} - -const ( - - // UpdateAlertRuleParamsBodyFiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" - UpdateAlertRuleParamsBodyFiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" - - // UpdateAlertRuleParamsBodyFiltersItems0TypeEQUAL captures enum value "EQUAL" - UpdateAlertRuleParamsBodyFiltersItems0TypeEQUAL string = "EQUAL" - - // UpdateAlertRuleParamsBodyFiltersItems0TypeREGEX captures enum value "REGEX" - UpdateAlertRuleParamsBodyFiltersItems0TypeREGEX string = "REGEX" -) - -// prop value enum -func (o *UpdateAlertRuleParamsBodyFiltersItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateAlertRuleParamsBodyFiltersItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *UpdateAlertRuleParamsBodyFiltersItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update alert rule params body filters items0 based on context it is used -func (o *UpdateAlertRuleParamsBodyFiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAlertRuleParamsBodyFiltersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAlertRuleParamsBodyFiltersItems0) UnmarshalBinary(b []byte) error { - var res UpdateAlertRuleParamsBodyFiltersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdateAlertRuleParamsBodyParamsItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. -swagger:model UpdateAlertRuleParamsBodyParamsItems0 -*/ -type UpdateAlertRuleParamsBodyParamsItems0 struct { - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // Bool value. - Bool bool `json:"bool,omitempty"` - - // Float value. - Float float64 `json:"float,omitempty"` - - // String value. - String string `json:"string,omitempty"` -} - -// Validate validates this update alert rule params body params items0 -func (o *UpdateAlertRuleParamsBodyParamsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var updateAlertRuleParamsBodyParamsItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateAlertRuleParamsBodyParamsItems0TypeTypePropEnum = append(updateAlertRuleParamsBodyParamsItems0TypeTypePropEnum, v) - } -} - -const ( - - // UpdateAlertRuleParamsBodyParamsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - UpdateAlertRuleParamsBodyParamsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - - // UpdateAlertRuleParamsBodyParamsItems0TypeBOOL captures enum value "BOOL" - UpdateAlertRuleParamsBodyParamsItems0TypeBOOL string = "BOOL" - - // UpdateAlertRuleParamsBodyParamsItems0TypeFLOAT captures enum value "FLOAT" - UpdateAlertRuleParamsBodyParamsItems0TypeFLOAT string = "FLOAT" - - // UpdateAlertRuleParamsBodyParamsItems0TypeSTRING captures enum value "STRING" - UpdateAlertRuleParamsBodyParamsItems0TypeSTRING string = "STRING" -) - -// prop value enum -func (o *UpdateAlertRuleParamsBodyParamsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateAlertRuleParamsBodyParamsItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *UpdateAlertRuleParamsBodyParamsItems0) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required - return nil - } - - // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update alert rule params body params items0 based on context it is used -func (o *UpdateAlertRuleParamsBodyParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAlertRuleParamsBodyParamsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAlertRuleParamsBodyParamsItems0) UnmarshalBinary(b []byte) error { - var res UpdateAlertRuleParamsBodyParamsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/ia/json/header.json b/api/managementpb/ia/json/header.json deleted file mode 100644 index 0ace53f924..0000000000 --- a/api/managementpb/ia/json/header.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PMM Integrated Alerting API", - "version": "v1beta1" - }, - "schemes": [ - "https", - "http" - ] -} diff --git a/api/managementpb/ia/json/ia.json b/api/managementpb/ia/json/ia.json deleted file mode 100644 index 7e941ad93e..0000000000 --- a/api/managementpb/ia/json/ia.json +++ /dev/null @@ -1,2727 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Integrated Alerting API", - "version": "v1beta1" - }, - "paths": { - "/v1/management/ia/Alerts/List": { - "post": { - "tags": [ - "Alerts" - ], - "summary": "ListAlerts returns a list of all Alerts.", - "operationId": "ListAlerts", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "alerts": { - "type": "array", - "items": { - "description": "Alert represents Alert.", - "type": "object", - "properties": { - "alert_id": { - "description": "ID.", - "type": "string", - "x-order": 0 - }, - "created_at": { - "description": "Alert creation time.", - "type": "string", - "format": "date-time", - "x-order": 6 - }, - "labels": { - "description": "Combined labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 4 - }, - "rule": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "channel": { - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - } - }, - "x-order": 4 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - }, - "username": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 5 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 1 - }, - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "params_definitions": { - "description": "Expression parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - } - }, - "x-order": 5 - }, - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - }, - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - } - }, - "x-order": 6 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - } - } - }, - "x-order": 8 - }, - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 5 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 2 - }, - "status": { - "description": "Status represents Alert Rule's and Alert's combined status.\n\n - CLEAR: No alert.\n - PENDING: Pending, but not triggering alert.\n - TRIGGERING: Triggering (firing) alert.\n - SILENCED: Silenced alert.", - "type": "string", - "default": "STATUS_INVALID", - "enum": [ - "STATUS_INVALID", - "CLEAR", - "PENDING", - "TRIGGERING", - "SILENCED" - ], - "x-order": 3 - }, - "summary": { - "description": "Human-readable summary.", - "type": "string", - "x-order": 1 - }, - "updated_at": { - "description": "Alert last update time.", - "type": "string", - "format": "date-time", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Alerts/Toggle": { - "post": { - "description": "Pass empty list to apply toggle action to all existing alerts", - "tags": [ - "Alerts" - ], - "summary": "ToggleAlerts allows to switch alerts state between silenced and unsilenced.", - "operationId": "ToggleAlerts", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "alert_ids": { - "description": "List of alerts that silence state should be switched. If provided array is empty than all\nexisting alerts are switched.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "silenced": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Add": { - "post": { - "tags": [ - "Channels" - ], - "summary": "AddChannel adds notification channel.", - "operationId": "AddChannel", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "disabled": { - "description": "New channel status.", - "type": "boolean", - "x-order": 5 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "channel": { - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - } - }, - "x-order": 3 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 0 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - }, - "username": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Change": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ChangeChannel changes notification channel.", - "operationId": "ChangeChannel", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "Enables or disables that channel. Should be set.", - "type": "boolean", - "x-order": 6 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "channel": { - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - } - }, - "x-order": 4 - }, - "summary": { - "description": "Short human-readable summary. Empty value will not change it.", - "type": "string", - "x-order": 1 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - }, - "username": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/List": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ListChannels returns a list of all notifation channels.", - "operationId": "ListChannels", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "channel": { - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - } - }, - "x-order": 4 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - }, - "username": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 5 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Remove": { - "post": { - "tags": [ - "Channels" - ], - "summary": "RemoveChannel removes notification channel.", - "operationId": "RemoveChannel", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Create": { - "post": { - "tags": [ - "Rules" - ], - "summary": "CreateAlertRule creates Alerting rule.", - "operationId": "CreateAlertRule", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "disabled": { - "description": "New rule status.", - "type": "boolean", - "x-order": 3 - }, - "filters": { - "description": "Filters. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 1 - }, - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 5 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 2 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 6 - }, - "source_rule_id": { - "description": "ID of the rule that will be used as source. Can't be specified simultaneously with template_name.", - "type": "string", - "x-order": 1 - }, - "template_name": { - "description": "Template name. Can't be specified simultaneously with source_rule_id.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Delete": { - "post": { - "tags": [ - "Rules" - ], - "summary": "DeleteAlertRule deletes Alerting rule.", - "operationId": "DeleteAlertRule", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/List": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ListAlertRules returns a list of all Alerting rules.", - "operationId": "ListAlertRules", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rules": { - "type": "array", - "items": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "channel": { - "type": "string", - "x-order": 1 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - } - }, - "x-order": 4 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - }, - "username": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 5 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 1 - }, - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "params_definitions": { - "description": "Expression parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - } - }, - "x-order": 5 - }, - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - }, - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - } - }, - "x-order": 6 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - } - } - }, - "x-order": 8 - }, - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Toggle": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule.", - "operationId": "ToggleAlertRule", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "disabled": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - }, - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Update": { - "post": { - "tags": [ - "Rules" - ], - "summary": "UpdateAlertRule updates Alerting rule.", - "operationId": "UpdateAlertRule", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 8 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "disabled": { - "description": "New rule status. Should be set.", - "type": "boolean", - "x-order": 2 - }, - "filters": { - "description": "Filters. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 1 - }, - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 4 - }, - "name": { - "description": "Rule name. Should be set.", - "type": "string", - "x-order": 1 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "Alerts" - }, - { - "name": "Channels" - }, - { - "name": "Rules" - } - ] -} \ No newline at end of file diff --git a/api/managementpb/ia/rules.pb.go b/api/managementpb/ia/rules.pb.go deleted file mode 100644 index 4b3020312d..0000000000 --- a/api/managementpb/ia/rules.pb.go +++ /dev/null @@ -1,1671 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc (unknown) -// source: managementpb/ia/rules.proto - -package iav1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - managementpb "github.com/percona/pmm/api/managementpb" - alerting "github.com/percona/pmm/api/managementpb/alerting" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// FilterType represents filter matching type. -// -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type FilterType int32 - -const ( - FilterType_FILTER_TYPE_INVALID FilterType = 0 - // = - FilterType_EQUAL FilterType = 1 - // =~ - FilterType_REGEX FilterType = 3 -) - -// Enum value maps for FilterType. -var ( - FilterType_name = map[int32]string{ - 0: "FILTER_TYPE_INVALID", - 1: "EQUAL", - 3: "REGEX", - } - FilterType_value = map[string]int32{ - "FILTER_TYPE_INVALID": 0, - "EQUAL": 1, - "REGEX": 3, - } -) - -func (x FilterType) Enum() *FilterType { - p := new(FilterType) - *p = x - return p -} - -func (x FilterType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FilterType) Descriptor() protoreflect.EnumDescriptor { - return file_managementpb_ia_rules_proto_enumTypes[0].Descriptor() -} - -func (FilterType) Type() protoreflect.EnumType { - return &file_managementpb_ia_rules_proto_enumTypes[0] -} - -func (x FilterType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FilterType.Descriptor instead. -func (FilterType) EnumDescriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{0} -} - -// Filter repsents a single filter condition. -// -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type Filter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type FilterType `protobuf:"varint,1,opt,name=type,proto3,enum=ia.v1beta1.FilterType" json:"type,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Filter) Reset() { - *x = Filter{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Filter) ProtoMessage() {} - -func (x *Filter) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Filter.ProtoReflect.Descriptor instead. -func (*Filter) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{0} -} - -func (x *Filter) GetType() FilterType { - if x != nil { - return x.Type - } - return FilterType_FILTER_TYPE_INVALID -} - -func (x *Filter) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Filter) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// ParamValue represents a single rule parameter value for List, Change and Update APIs. -// -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type ParamValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Machine-readable name (ID) that is used in expression. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Parameter type. - Type alerting.ParamType `protobuf:"varint,2,opt,name=type,proto3,enum=alerting.v1.ParamType" json:"type,omitempty"` - // Parameter value. - // - // Types that are assignable to Value: - // - // *ParamValue_Bool - // *ParamValue_Float - // *ParamValue_String_ - Value isParamValue_Value `protobuf_oneof:"value"` -} - -func (x *ParamValue) Reset() { - *x = ParamValue{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParamValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParamValue) ProtoMessage() {} - -func (x *ParamValue) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParamValue.ProtoReflect.Descriptor instead. -func (*ParamValue) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{1} -} - -func (x *ParamValue) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ParamValue) GetType() alerting.ParamType { - if x != nil { - return x.Type - } - return alerting.ParamType(0) -} - -func (m *ParamValue) GetValue() isParamValue_Value { - if m != nil { - return m.Value - } - return nil -} - -func (x *ParamValue) GetBool() bool { - if x, ok := x.GetValue().(*ParamValue_Bool); ok { - return x.Bool - } - return false -} - -func (x *ParamValue) GetFloat() float64 { - if x, ok := x.GetValue().(*ParamValue_Float); ok { - return x.Float - } - return 0 -} - -func (x *ParamValue) GetString_() string { - if x, ok := x.GetValue().(*ParamValue_String_); ok { - return x.String_ - } - return "" -} - -type isParamValue_Value interface { - isParamValue_Value() -} - -type ParamValue_Bool struct { - // Bool value. - Bool bool `protobuf:"varint,3,opt,name=bool,proto3,oneof"` -} - -type ParamValue_Float struct { - // Float value. - Float float64 `protobuf:"fixed64,4,opt,name=float,proto3,oneof"` -} - -type ParamValue_String_ struct { - // String value. - String_ string `protobuf:"bytes,5,opt,name=string,proto3,oneof"` -} - -func (*ParamValue_Bool) isParamValue_Value() {} - -func (*ParamValue_Float) isParamValue_Value() {} - -func (*ParamValue_String_) isParamValue_Value() {} - -// Rule represents Alert Rule. -// -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type Rule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Rule ID. - RuleId string `protobuf:"bytes,1,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` - // Rule name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Rule human-readable summary. - Summary string `protobuf:"bytes,3,opt,name=summary,proto3" json:"summary,omitempty"` - // Template used for this rule. - TemplateName string `protobuf:"bytes,4,opt,name=template_name,json=templateName,proto3" json:"template_name,omitempty"` - // True if that rule is disabled. - Disabled bool `protobuf:"varint,5,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Expression template. - ExprTemplate string `protobuf:"bytes,6,opt,name=expr_template,json=exprTemplate,proto3" json:"expr_template,omitempty"` - // Expression filled with parameters. - Expr string `protobuf:"bytes,7,opt,name=expr,proto3" json:"expr,omitempty"` - // Expression parameters definitions. - ParamsDefinitions []*alerting.ParamDefinition `protobuf:"bytes,8,rep,name=params_definitions,json=paramsDefinitions,proto3" json:"params_definitions,omitempty"` - // Expression parameters values. - ParamsValues []*ParamValue `protobuf:"bytes,9,rep,name=params_values,json=paramsValues,proto3" json:"params_values,omitempty"` - // Default for duration. - DefaultFor *durationpb.Duration `protobuf:"bytes,10,opt,name=default_for,json=defaultFor,proto3" json:"default_for,omitempty"` - // For duration. - For *durationpb.Duration `protobuf:"bytes,11,opt,name=for,proto3" json:"for,omitempty"` - // Default severity. - DefaultSeverity managementpb.Severity `protobuf:"varint,12,opt,name=default_severity,json=defaultSeverity,proto3,enum=management.Severity" json:"default_severity,omitempty"` - // Severity. - Severity managementpb.Severity `protobuf:"varint,13,opt,name=severity,proto3,enum=management.Severity" json:"severity,omitempty"` - // Custom labels. - CustomLabels map[string]string `protobuf:"bytes,14,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Labels. - Labels map[string]string `protobuf:"bytes,15,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Annotations. - Annotations map[string]string `protobuf:"bytes,16,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Filters. - Filters []*Filter `protobuf:"bytes,17,rep,name=filters,proto3" json:"filters,omitempty"` - // Channels. - Channels []*Channel `protobuf:"bytes,18,rep,name=channels,proto3" json:"channels,omitempty"` - // Rule creation time. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,19,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` -} - -func (x *Rule) Reset() { - *x = Rule{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rule) ProtoMessage() {} - -func (x *Rule) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rule.ProtoReflect.Descriptor instead. -func (*Rule) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{2} -} - -func (x *Rule) GetRuleId() string { - if x != nil { - return x.RuleId - } - return "" -} - -func (x *Rule) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Rule) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *Rule) GetTemplateName() string { - if x != nil { - return x.TemplateName - } - return "" -} - -func (x *Rule) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *Rule) GetExprTemplate() string { - if x != nil { - return x.ExprTemplate - } - return "" -} - -func (x *Rule) GetExpr() string { - if x != nil { - return x.Expr - } - return "" -} - -func (x *Rule) GetParamsDefinitions() []*alerting.ParamDefinition { - if x != nil { - return x.ParamsDefinitions - } - return nil -} - -func (x *Rule) GetParamsValues() []*ParamValue { - if x != nil { - return x.ParamsValues - } - return nil -} - -func (x *Rule) GetDefaultFor() *durationpb.Duration { - if x != nil { - return x.DefaultFor - } - return nil -} - -func (x *Rule) GetFor() *durationpb.Duration { - if x != nil { - return x.For - } - return nil -} - -func (x *Rule) GetDefaultSeverity() managementpb.Severity { - if x != nil { - return x.DefaultSeverity - } - return managementpb.Severity(0) -} - -func (x *Rule) GetSeverity() managementpb.Severity { - if x != nil { - return x.Severity - } - return managementpb.Severity(0) -} - -func (x *Rule) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *Rule) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *Rule) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -func (x *Rule) GetFilters() []*Filter { - if x != nil { - return x.Filters - } - return nil -} - -func (x *Rule) GetChannels() []*Channel { - if x != nil { - return x.Channels - } - return nil -} - -func (x *Rule) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type ListAlertRulesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Page request. - PageParams *managementpb.PageParams `protobuf:"bytes,1,opt,name=page_params,json=pageParams,proto3" json:"page_params,omitempty"` -} - -func (x *ListAlertRulesRequest) Reset() { - *x = ListAlertRulesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAlertRulesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAlertRulesRequest) ProtoMessage() {} - -func (x *ListAlertRulesRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAlertRulesRequest.ProtoReflect.Descriptor instead. -func (*ListAlertRulesRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{3} -} - -func (x *ListAlertRulesRequest) GetPageParams() *managementpb.PageParams { - if x != nil { - return x.PageParams - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type ListAlertRulesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Rules []*Rule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` - // Total items and pages. - Totals *managementpb.PageTotals `protobuf:"bytes,2,opt,name=totals,proto3" json:"totals,omitempty"` -} - -func (x *ListAlertRulesResponse) Reset() { - *x = ListAlertRulesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAlertRulesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAlertRulesResponse) ProtoMessage() {} - -func (x *ListAlertRulesResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAlertRulesResponse.ProtoReflect.Descriptor instead. -func (*ListAlertRulesResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{4} -} - -func (x *ListAlertRulesResponse) GetRules() []*Rule { - if x != nil { - return x.Rules - } - return nil -} - -func (x *ListAlertRulesResponse) GetTotals() *managementpb.PageTotals { - if x != nil { - return x.Totals - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type CreateAlertRuleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Template name. Can't be specified simultaneously with source_rule_id. - TemplateName string `protobuf:"bytes,1,opt,name=template_name,json=templateName,proto3" json:"template_name,omitempty"` - // ID of the rule that will be used as source. Can't be specified simultaneously with template_name. - SourceRuleId string `protobuf:"bytes,2,opt,name=source_rule_id,json=sourceRuleId,proto3" json:"source_rule_id,omitempty"` - // Rule name. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // New rule status. - Disabled bool `protobuf:"varint,4,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Rule parameters. All template parameters should be set. - Params []*ParamValue `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty"` - // Rule duration. Should be set. - For *durationpb.Duration `protobuf:"bytes,6,opt,name=for,proto3" json:"for,omitempty"` - // Rule severity. Should be set. - Severity managementpb.Severity `protobuf:"varint,7,opt,name=severity,proto3,enum=management.Severity" json:"severity,omitempty"` - // All custom labels to add or remove (with empty values) to default labels from template. - CustomLabels map[string]string `protobuf:"bytes,8,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Filters. Should be set. - Filters []*Filter `protobuf:"bytes,9,rep,name=filters,proto3" json:"filters,omitempty"` - // Channels. Should be set. - ChannelIds []string `protobuf:"bytes,10,rep,name=channel_ids,json=channelIds,proto3" json:"channel_ids,omitempty"` -} - -func (x *CreateAlertRuleRequest) Reset() { - *x = CreateAlertRuleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAlertRuleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAlertRuleRequest) ProtoMessage() {} - -func (x *CreateAlertRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateAlertRuleRequest.ProtoReflect.Descriptor instead. -func (*CreateAlertRuleRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateAlertRuleRequest) GetTemplateName() string { - if x != nil { - return x.TemplateName - } - return "" -} - -func (x *CreateAlertRuleRequest) GetSourceRuleId() string { - if x != nil { - return x.SourceRuleId - } - return "" -} - -func (x *CreateAlertRuleRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateAlertRuleRequest) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *CreateAlertRuleRequest) GetParams() []*ParamValue { - if x != nil { - return x.Params - } - return nil -} - -func (x *CreateAlertRuleRequest) GetFor() *durationpb.Duration { - if x != nil { - return x.For - } - return nil -} - -func (x *CreateAlertRuleRequest) GetSeverity() managementpb.Severity { - if x != nil { - return x.Severity - } - return managementpb.Severity(0) -} - -func (x *CreateAlertRuleRequest) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *CreateAlertRuleRequest) GetFilters() []*Filter { - if x != nil { - return x.Filters - } - return nil -} - -func (x *CreateAlertRuleRequest) GetChannelIds() []string { - if x != nil { - return x.ChannelIds - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type CreateAlertRuleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Rule ID. - RuleId string `protobuf:"bytes,1,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` -} - -func (x *CreateAlertRuleResponse) Reset() { - *x = CreateAlertRuleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAlertRuleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAlertRuleResponse) ProtoMessage() {} - -func (x *CreateAlertRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateAlertRuleResponse.ProtoReflect.Descriptor instead. -func (*CreateAlertRuleResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{6} -} - -func (x *CreateAlertRuleResponse) GetRuleId() string { - if x != nil { - return x.RuleId - } - return "" -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type UpdateAlertRuleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Rule ID. - RuleId string `protobuf:"bytes,1,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` - // Rule name. Should be set. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // New rule status. Should be set. - Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"` - // Rule parameters. All template parameters should be set. - Params []*ParamValue `protobuf:"bytes,4,rep,name=params,proto3" json:"params,omitempty"` - // Rule duration. Should be set. - For *durationpb.Duration `protobuf:"bytes,5,opt,name=for,proto3" json:"for,omitempty"` - // Rule severity. Should be set. - Severity managementpb.Severity `protobuf:"varint,6,opt,name=severity,proto3,enum=management.Severity" json:"severity,omitempty"` - // All custom labels to add or remove (with empty values) to default labels from template. - CustomLabels map[string]string `protobuf:"bytes,7,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Filters. Should be set. - Filters []*Filter `protobuf:"bytes,8,rep,name=filters,proto3" json:"filters,omitempty"` - // Channels. Should be set. - ChannelIds []string `protobuf:"bytes,9,rep,name=channel_ids,json=channelIds,proto3" json:"channel_ids,omitempty"` -} - -func (x *UpdateAlertRuleRequest) Reset() { - *x = UpdateAlertRuleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateAlertRuleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAlertRuleRequest) ProtoMessage() {} - -func (x *UpdateAlertRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateAlertRuleRequest.ProtoReflect.Descriptor instead. -func (*UpdateAlertRuleRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{7} -} - -func (x *UpdateAlertRuleRequest) GetRuleId() string { - if x != nil { - return x.RuleId - } - return "" -} - -func (x *UpdateAlertRuleRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateAlertRuleRequest) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -func (x *UpdateAlertRuleRequest) GetParams() []*ParamValue { - if x != nil { - return x.Params - } - return nil -} - -func (x *UpdateAlertRuleRequest) GetFor() *durationpb.Duration { - if x != nil { - return x.For - } - return nil -} - -func (x *UpdateAlertRuleRequest) GetSeverity() managementpb.Severity { - if x != nil { - return x.Severity - } - return managementpb.Severity(0) -} - -func (x *UpdateAlertRuleRequest) GetCustomLabels() map[string]string { - if x != nil { - return x.CustomLabels - } - return nil -} - -func (x *UpdateAlertRuleRequest) GetFilters() []*Filter { - if x != nil { - return x.Filters - } - return nil -} - -func (x *UpdateAlertRuleRequest) GetChannelIds() []string { - if x != nil { - return x.ChannelIds - } - return nil -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type UpdateAlertRuleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateAlertRuleResponse) Reset() { - *x = UpdateAlertRuleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateAlertRuleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAlertRuleResponse) ProtoMessage() {} - -func (x *UpdateAlertRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateAlertRuleResponse.ProtoReflect.Descriptor instead. -func (*UpdateAlertRuleResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{8} -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type ToggleAlertRuleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Rule ID. - RuleId string `protobuf:"bytes,1,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` - // New rule status, if set. - Disabled managementpb.BooleanFlag `protobuf:"varint,2,opt,name=disabled,proto3,enum=managementpb.BooleanFlag" json:"disabled,omitempty"` -} - -func (x *ToggleAlertRuleRequest) Reset() { - *x = ToggleAlertRuleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ToggleAlertRuleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ToggleAlertRuleRequest) ProtoMessage() {} - -func (x *ToggleAlertRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ToggleAlertRuleRequest.ProtoReflect.Descriptor instead. -func (*ToggleAlertRuleRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{9} -} - -func (x *ToggleAlertRuleRequest) GetRuleId() string { - if x != nil { - return x.RuleId - } - return "" -} - -func (x *ToggleAlertRuleRequest) GetDisabled() managementpb.BooleanFlag { - if x != nil { - return x.Disabled - } - return managementpb.BooleanFlag(0) -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type ToggleAlertRuleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ToggleAlertRuleResponse) Reset() { - *x = ToggleAlertRuleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ToggleAlertRuleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ToggleAlertRuleResponse) ProtoMessage() {} - -func (x *ToggleAlertRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ToggleAlertRuleResponse.ProtoReflect.Descriptor instead. -func (*ToggleAlertRuleResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{10} -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type DeleteAlertRuleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Rule ID. - RuleId string `protobuf:"bytes,1,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` -} - -func (x *DeleteAlertRuleRequest) Reset() { - *x = DeleteAlertRuleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteAlertRuleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAlertRuleRequest) ProtoMessage() {} - -func (x *DeleteAlertRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteAlertRuleRequest.ProtoReflect.Descriptor instead. -func (*DeleteAlertRuleRequest) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{11} -} - -func (x *DeleteAlertRuleRequest) GetRuleId() string { - if x != nil { - return x.RuleId - } - return "" -} - -// Deprecated: Marked as deprecated in managementpb/ia/rules.proto. -type DeleteAlertRuleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteAlertRuleResponse) Reset() { - *x = DeleteAlertRuleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_ia_rules_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteAlertRuleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAlertRuleResponse) ProtoMessage() {} - -func (x *DeleteAlertRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_ia_rules_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteAlertRuleResponse.ProtoReflect.Descriptor instead. -func (*DeleteAlertRuleResponse) Descriptor() ([]byte, []int) { - return file_managementpb_ia_rules_proto_rawDescGZIP(), []int{12} -} - -var File_managementpb_ia_rules_proto protoreflect.FileDescriptor - -var file_managementpb_ia_rules_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, - 0x61, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x69, - 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2f, - 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x61, 0x6c, 0x65, - 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, - 0x2f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, - 0x62, 0x2f, 0x69, 0x61, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, - 0x62, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, - 0x2f, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x16, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xaa, 0x01, 0x0a, 0x0a, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x14, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x16, 0x0a, 0x05, 0x66, 0x6c, 0x6f, 0x61, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, - 0x12, 0x18, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x07, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xcb, 0x08, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, - 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x72, - 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x65, 0x78, 0x70, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x78, 0x70, - 0x72, 0x12, 0x4b, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, - 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0b, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x46, 0x6f, 0x72, 0x12, 0x2b, 0x0a, 0x03, 0x66, 0x6f, 0x72, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x03, 0x66, 0x6f, 0x72, 0x12, 0x3f, 0x0a, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, - 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x76, 0x65, - 0x72, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x76, - 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x30, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, - 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, 0x73, - 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, - 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x12, 0x34, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, - 0x6c, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x69, 0x61, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x41, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x07, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x69, - 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x63, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x69, 0x61, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x54, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, - 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x50, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x67, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x74, 0x0a, 0x16, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2e, 0x0a, - 0x06, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x52, 0x06, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0x91, 0x04, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x75, 0x6c, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x66, 0x6f, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x03, 0x66, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, 0x73, 0x65, - 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, - 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x12, 0x2c, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, - 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0a, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x73, - 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x36, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, - 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xe8, 0x03, - 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, 0x61, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x66, 0x6f, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x03, 0x66, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, - 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, - 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x34, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, - 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x49, 0x64, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x1d, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x75, 0x0a, 0x16, 0x54, 0x6f, 0x67, 0x67, 0x6c, - 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x20, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x75, 0x6c, - 0x65, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x46, 0x6c, 0x61, 0x67, - 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x1d, - 0x0a, 0x17, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x3e, 0x0a, - 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x1d, 0x0a, - 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x2a, 0x3f, 0x0a, 0x0a, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x46, 0x49, - 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, - 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x09, - 0x0a, 0x05, 0x52, 0x45, 0x47, 0x45, 0x58, 0x10, 0x03, 0x1a, 0x02, 0x18, 0x01, 0x32, 0xd2, 0x05, - 0x0a, 0x05, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x88, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x69, 0x61, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2f, 0x92, 0x41, 0x02, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, - 0x2a, 0x22, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x2f, 0x69, 0x61, 0x2f, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x88, - 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x61, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x31, 0x92, 0x41, 0x02, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, - 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x69, 0x61, 0x2f, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x88, - 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x61, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x31, 0x92, 0x41, 0x02, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, - 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x69, 0x61, 0x2f, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x88, - 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x0f, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x61, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x31, 0x92, 0x41, 0x02, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, - 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x69, 0x61, 0x2f, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x88, - 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x61, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x31, 0x92, 0x41, 0x02, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, - 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x69, 0x61, 0x2f, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x88, - 0x02, 0x01, 0x42, 0x9b, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, 0x61, 0x3b, - 0x69, 0x61, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, - 0x02, 0x0a, 0x49, 0x61, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0a, 0x49, - 0x61, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x16, 0x49, 0x61, 0x5c, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0b, 0x49, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_ia_rules_proto_rawDescOnce sync.Once - file_managementpb_ia_rules_proto_rawDescData = file_managementpb_ia_rules_proto_rawDesc -) - -func file_managementpb_ia_rules_proto_rawDescGZIP() []byte { - file_managementpb_ia_rules_proto_rawDescOnce.Do(func() { - file_managementpb_ia_rules_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_ia_rules_proto_rawDescData) - }) - return file_managementpb_ia_rules_proto_rawDescData -} - -var ( - file_managementpb_ia_rules_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_managementpb_ia_rules_proto_msgTypes = make([]protoimpl.MessageInfo, 18) - file_managementpb_ia_rules_proto_goTypes = []interface{}{ - (FilterType)(0), // 0: ia.v1beta1.FilterType - (*Filter)(nil), // 1: ia.v1beta1.Filter - (*ParamValue)(nil), // 2: ia.v1beta1.ParamValue - (*Rule)(nil), // 3: ia.v1beta1.Rule - (*ListAlertRulesRequest)(nil), // 4: ia.v1beta1.ListAlertRulesRequest - (*ListAlertRulesResponse)(nil), // 5: ia.v1beta1.ListAlertRulesResponse - (*CreateAlertRuleRequest)(nil), // 6: ia.v1beta1.CreateAlertRuleRequest - (*CreateAlertRuleResponse)(nil), // 7: ia.v1beta1.CreateAlertRuleResponse - (*UpdateAlertRuleRequest)(nil), // 8: ia.v1beta1.UpdateAlertRuleRequest - (*UpdateAlertRuleResponse)(nil), // 9: ia.v1beta1.UpdateAlertRuleResponse - (*ToggleAlertRuleRequest)(nil), // 10: ia.v1beta1.ToggleAlertRuleRequest - (*ToggleAlertRuleResponse)(nil), // 11: ia.v1beta1.ToggleAlertRuleResponse - (*DeleteAlertRuleRequest)(nil), // 12: ia.v1beta1.DeleteAlertRuleRequest - (*DeleteAlertRuleResponse)(nil), // 13: ia.v1beta1.DeleteAlertRuleResponse - nil, // 14: ia.v1beta1.Rule.CustomLabelsEntry - nil, // 15: ia.v1beta1.Rule.LabelsEntry - nil, // 16: ia.v1beta1.Rule.AnnotationsEntry - nil, // 17: ia.v1beta1.CreateAlertRuleRequest.CustomLabelsEntry - nil, // 18: ia.v1beta1.UpdateAlertRuleRequest.CustomLabelsEntry - (alerting.ParamType)(0), // 19: alerting.v1.ParamType - (*alerting.ParamDefinition)(nil), // 20: alerting.v1.ParamDefinition - (*durationpb.Duration)(nil), // 21: google.protobuf.Duration - (managementpb.Severity)(0), // 22: management.Severity - (*Channel)(nil), // 23: ia.v1beta1.Channel - (*timestamppb.Timestamp)(nil), // 24: google.protobuf.Timestamp - (*managementpb.PageParams)(nil), // 25: management.PageParams - (*managementpb.PageTotals)(nil), // 26: management.PageTotals - (managementpb.BooleanFlag)(0), // 27: managementpb.BooleanFlag - } -) - -var file_managementpb_ia_rules_proto_depIdxs = []int32{ - 0, // 0: ia.v1beta1.Filter.type:type_name -> ia.v1beta1.FilterType - 19, // 1: ia.v1beta1.ParamValue.type:type_name -> alerting.v1.ParamType - 20, // 2: ia.v1beta1.Rule.params_definitions:type_name -> alerting.v1.ParamDefinition - 2, // 3: ia.v1beta1.Rule.params_values:type_name -> ia.v1beta1.ParamValue - 21, // 4: ia.v1beta1.Rule.default_for:type_name -> google.protobuf.Duration - 21, // 5: ia.v1beta1.Rule.for:type_name -> google.protobuf.Duration - 22, // 6: ia.v1beta1.Rule.default_severity:type_name -> management.Severity - 22, // 7: ia.v1beta1.Rule.severity:type_name -> management.Severity - 14, // 8: ia.v1beta1.Rule.custom_labels:type_name -> ia.v1beta1.Rule.CustomLabelsEntry - 15, // 9: ia.v1beta1.Rule.labels:type_name -> ia.v1beta1.Rule.LabelsEntry - 16, // 10: ia.v1beta1.Rule.annotations:type_name -> ia.v1beta1.Rule.AnnotationsEntry - 1, // 11: ia.v1beta1.Rule.filters:type_name -> ia.v1beta1.Filter - 23, // 12: ia.v1beta1.Rule.channels:type_name -> ia.v1beta1.Channel - 24, // 13: ia.v1beta1.Rule.created_at:type_name -> google.protobuf.Timestamp - 25, // 14: ia.v1beta1.ListAlertRulesRequest.page_params:type_name -> management.PageParams - 3, // 15: ia.v1beta1.ListAlertRulesResponse.rules:type_name -> ia.v1beta1.Rule - 26, // 16: ia.v1beta1.ListAlertRulesResponse.totals:type_name -> management.PageTotals - 2, // 17: ia.v1beta1.CreateAlertRuleRequest.params:type_name -> ia.v1beta1.ParamValue - 21, // 18: ia.v1beta1.CreateAlertRuleRequest.for:type_name -> google.protobuf.Duration - 22, // 19: ia.v1beta1.CreateAlertRuleRequest.severity:type_name -> management.Severity - 17, // 20: ia.v1beta1.CreateAlertRuleRequest.custom_labels:type_name -> ia.v1beta1.CreateAlertRuleRequest.CustomLabelsEntry - 1, // 21: ia.v1beta1.CreateAlertRuleRequest.filters:type_name -> ia.v1beta1.Filter - 2, // 22: ia.v1beta1.UpdateAlertRuleRequest.params:type_name -> ia.v1beta1.ParamValue - 21, // 23: ia.v1beta1.UpdateAlertRuleRequest.for:type_name -> google.protobuf.Duration - 22, // 24: ia.v1beta1.UpdateAlertRuleRequest.severity:type_name -> management.Severity - 18, // 25: ia.v1beta1.UpdateAlertRuleRequest.custom_labels:type_name -> ia.v1beta1.UpdateAlertRuleRequest.CustomLabelsEntry - 1, // 26: ia.v1beta1.UpdateAlertRuleRequest.filters:type_name -> ia.v1beta1.Filter - 27, // 27: ia.v1beta1.ToggleAlertRuleRequest.disabled:type_name -> managementpb.BooleanFlag - 4, // 28: ia.v1beta1.Rules.ListAlertRules:input_type -> ia.v1beta1.ListAlertRulesRequest - 6, // 29: ia.v1beta1.Rules.CreateAlertRule:input_type -> ia.v1beta1.CreateAlertRuleRequest - 8, // 30: ia.v1beta1.Rules.UpdateAlertRule:input_type -> ia.v1beta1.UpdateAlertRuleRequest - 10, // 31: ia.v1beta1.Rules.ToggleAlertRule:input_type -> ia.v1beta1.ToggleAlertRuleRequest - 12, // 32: ia.v1beta1.Rules.DeleteAlertRule:input_type -> ia.v1beta1.DeleteAlertRuleRequest - 5, // 33: ia.v1beta1.Rules.ListAlertRules:output_type -> ia.v1beta1.ListAlertRulesResponse - 7, // 34: ia.v1beta1.Rules.CreateAlertRule:output_type -> ia.v1beta1.CreateAlertRuleResponse - 9, // 35: ia.v1beta1.Rules.UpdateAlertRule:output_type -> ia.v1beta1.UpdateAlertRuleResponse - 11, // 36: ia.v1beta1.Rules.ToggleAlertRule:output_type -> ia.v1beta1.ToggleAlertRuleResponse - 13, // 37: ia.v1beta1.Rules.DeleteAlertRule:output_type -> ia.v1beta1.DeleteAlertRuleResponse - 33, // [33:38] is the sub-list for method output_type - 28, // [28:33] is the sub-list for method input_type - 28, // [28:28] is the sub-list for extension type_name - 28, // [28:28] is the sub-list for extension extendee - 0, // [0:28] is the sub-list for field type_name -} - -func init() { file_managementpb_ia_rules_proto_init() } -func file_managementpb_ia_rules_proto_init() { - if File_managementpb_ia_rules_proto != nil { - return - } - file_managementpb_ia_channels_proto_init() - if !protoimpl.UnsafeEnabled { - file_managementpb_ia_rules_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParamValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAlertRulesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAlertRulesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAlertRuleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAlertRuleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAlertRuleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAlertRuleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ToggleAlertRuleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ToggleAlertRuleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAlertRuleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_ia_rules_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAlertRuleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_managementpb_ia_rules_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*ParamValue_Bool)(nil), - (*ParamValue_Float)(nil), - (*ParamValue_String_)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_ia_rules_proto_rawDesc, - NumEnums: 1, - NumMessages: 18, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_ia_rules_proto_goTypes, - DependencyIndexes: file_managementpb_ia_rules_proto_depIdxs, - EnumInfos: file_managementpb_ia_rules_proto_enumTypes, - MessageInfos: file_managementpb_ia_rules_proto_msgTypes, - }.Build() - File_managementpb_ia_rules_proto = out.File - file_managementpb_ia_rules_proto_rawDesc = nil - file_managementpb_ia_rules_proto_goTypes = nil - file_managementpb_ia_rules_proto_depIdxs = nil -} diff --git a/api/managementpb/ia/rules.pb.gw.go b/api/managementpb/ia/rules.pb.gw.go deleted file mode 100644 index 8458714bcb..0000000000 --- a/api/managementpb/ia/rules.pb.gw.go +++ /dev/null @@ -1,491 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/ia/rules.proto - -/* -Package iav1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package iav1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_Rules_ListAlertRules_0(ctx context.Context, marshaler runtime.Marshaler, client RulesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAlertRulesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListAlertRules(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Rules_ListAlertRules_0(ctx context.Context, marshaler runtime.Marshaler, server RulesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAlertRulesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListAlertRules(ctx, &protoReq) - return msg, metadata, err -} - -func request_Rules_CreateAlertRule_0(ctx context.Context, marshaler runtime.Marshaler, client RulesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateAlertRuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateAlertRule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Rules_CreateAlertRule_0(ctx context.Context, marshaler runtime.Marshaler, server RulesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateAlertRuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateAlertRule(ctx, &protoReq) - return msg, metadata, err -} - -func request_Rules_UpdateAlertRule_0(ctx context.Context, marshaler runtime.Marshaler, client RulesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateAlertRuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpdateAlertRule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Rules_UpdateAlertRule_0(ctx context.Context, marshaler runtime.Marshaler, server RulesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateAlertRuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpdateAlertRule(ctx, &protoReq) - return msg, metadata, err -} - -func request_Rules_ToggleAlertRule_0(ctx context.Context, marshaler runtime.Marshaler, client RulesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ToggleAlertRuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ToggleAlertRule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Rules_ToggleAlertRule_0(ctx context.Context, marshaler runtime.Marshaler, server RulesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ToggleAlertRuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ToggleAlertRule(ctx, &protoReq) - return msg, metadata, err -} - -func request_Rules_DeleteAlertRule_0(ctx context.Context, marshaler runtime.Marshaler, client RulesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteAlertRuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteAlertRule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Rules_DeleteAlertRule_0(ctx context.Context, marshaler runtime.Marshaler, server RulesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteAlertRuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteAlertRule(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterRulesHandlerServer registers the http handlers for service Rules to "mux". -// UnaryRPC :call RulesServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRulesHandlerFromEndpoint instead. -func RegisterRulesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RulesServer) error { - mux.Handle("POST", pattern_Rules_ListAlertRules_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Rules/ListAlertRules", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rules_ListAlertRules_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_ListAlertRules_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Rules_CreateAlertRule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Rules/CreateAlertRule", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/Create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rules_CreateAlertRule_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_CreateAlertRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Rules_UpdateAlertRule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Rules/UpdateAlertRule", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/Update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rules_UpdateAlertRule_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_UpdateAlertRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Rules_ToggleAlertRule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Rules/ToggleAlertRule", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/Toggle")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rules_ToggleAlertRule_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_ToggleAlertRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Rules_DeleteAlertRule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/ia.v1beta1.Rules/DeleteAlertRule", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/Delete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Rules_DeleteAlertRule_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_DeleteAlertRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterRulesHandlerFromEndpoint is same as RegisterRulesHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterRulesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterRulesHandler(ctx, mux, conn) -} - -// RegisterRulesHandler registers the http handlers for service Rules to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterRulesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterRulesHandlerClient(ctx, mux, NewRulesClient(conn)) -} - -// RegisterRulesHandlerClient registers the http handlers for service Rules -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RulesClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RulesClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "RulesClient" to call the correct interceptors. -func RegisterRulesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RulesClient) error { - mux.Handle("POST", pattern_Rules_ListAlertRules_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Rules/ListAlertRules", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rules_ListAlertRules_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_ListAlertRules_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Rules_CreateAlertRule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Rules/CreateAlertRule", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/Create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rules_CreateAlertRule_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_CreateAlertRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Rules_UpdateAlertRule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Rules/UpdateAlertRule", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/Update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rules_UpdateAlertRule_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_UpdateAlertRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Rules_ToggleAlertRule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Rules/ToggleAlertRule", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/Toggle")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rules_ToggleAlertRule_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_ToggleAlertRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Rules_DeleteAlertRule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/ia.v1beta1.Rules/DeleteAlertRule", runtime.WithHTTPPathPattern("/v1/management/ia/Rules/Delete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Rules_DeleteAlertRule_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Rules_DeleteAlertRule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var ( - pattern_Rules_ListAlertRules_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Rules", "List"}, "")) - - pattern_Rules_CreateAlertRule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Rules", "Create"}, "")) - - pattern_Rules_UpdateAlertRule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Rules", "Update"}, "")) - - pattern_Rules_ToggleAlertRule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Rules", "Toggle"}, "")) - - pattern_Rules_DeleteAlertRule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "ia", "Rules", "Delete"}, "")) -) - -var ( - forward_Rules_ListAlertRules_0 = runtime.ForwardResponseMessage - - forward_Rules_CreateAlertRule_0 = runtime.ForwardResponseMessage - - forward_Rules_UpdateAlertRule_0 = runtime.ForwardResponseMessage - - forward_Rules_ToggleAlertRule_0 = runtime.ForwardResponseMessage - - forward_Rules_DeleteAlertRule_0 = runtime.ForwardResponseMessage -) diff --git a/api/managementpb/ia/rules.pb.validate.go b/api/managementpb/ia/rules.pb.validate.go deleted file mode 100644 index 03d92e46f4..0000000000 --- a/api/managementpb/ia/rules.pb.validate.go +++ /dev/null @@ -1,2008 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/ia/rules.proto - -package iav1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - managementpb "github.com/percona/pmm/api/managementpb" - alertingv1 "github.com/percona/pmm/api/managementpb/alerting" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = alertingv1.ParamType(0) - - _ = managementpb.Severity(0) -) - -// Validate checks the field values on Filter with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Filter) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Filter with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in FilterMultiError, or nil if none found. -func (m *Filter) ValidateAll() error { - return m.validate(true) -} - -func (m *Filter) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Type - - // no validation rules for Key - - // no validation rules for Value - - if len(errors) > 0 { - return FilterMultiError(errors) - } - - return nil -} - -// FilterMultiError is an error wrapping multiple validation errors returned by -// Filter.ValidateAll() if the designated constraints aren't met. -type FilterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FilterMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m FilterMultiError) AllErrors() []error { return m } - -// FilterValidationError is the validation error returned by Filter.Validate if -// the designated constraints aren't met. -type FilterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FilterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FilterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FilterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FilterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FilterValidationError) ErrorName() string { return "FilterValidationError" } - -// Error satisfies the builtin error interface -func (e FilterValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sFilter.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FilterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FilterValidationError{} - -// Validate checks the field values on ParamValue with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *ParamValue) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ParamValue with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in ParamValueMultiError, or -// nil if none found. -func (m *ParamValue) ValidateAll() error { - return m.validate(true) -} - -func (m *ParamValue) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := ParamValueValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Type - - switch v := m.Value.(type) { - case *ParamValue_Bool: - if v == nil { - err := ParamValueValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Bool - case *ParamValue_Float: - if v == nil { - err := ParamValueValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for Float - case *ParamValue_String_: - if v == nil { - err := ParamValueValidationError{ - field: "Value", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - // no validation rules for String_ - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return ParamValueMultiError(errors) - } - - return nil -} - -// ParamValueMultiError is an error wrapping multiple validation errors -// returned by ParamValue.ValidateAll() if the designated constraints aren't met. -type ParamValueMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ParamValueMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ParamValueMultiError) AllErrors() []error { return m } - -// ParamValueValidationError is the validation error returned by -// ParamValue.Validate if the designated constraints aren't met. -type ParamValueValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ParamValueValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ParamValueValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ParamValueValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ParamValueValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ParamValueValidationError) ErrorName() string { return "ParamValueValidationError" } - -// Error satisfies the builtin error interface -func (e ParamValueValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sParamValue.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ParamValueValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ParamValueValidationError{} - -// Validate checks the field values on Rule with the rules defined in the proto -// definition for this message. If any rules are violated, the first error -// encountered is returned, or nil if there are no violations. -func (m *Rule) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Rule with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in RuleMultiError, or nil if none found. -func (m *Rule) ValidateAll() error { - return m.validate(true) -} - -func (m *Rule) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for RuleId - - // no validation rules for Name - - // no validation rules for Summary - - // no validation rules for TemplateName - - // no validation rules for Disabled - - // no validation rules for ExprTemplate - - // no validation rules for Expr - - for idx, item := range m.GetParamsDefinitions() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RuleValidationError{ - field: fmt.Sprintf("ParamsDefinitions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RuleValidationError{ - field: fmt.Sprintf("ParamsDefinitions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RuleValidationError{ - field: fmt.Sprintf("ParamsDefinitions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetParamsValues() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RuleValidationError{ - field: fmt.Sprintf("ParamsValues[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RuleValidationError{ - field: fmt.Sprintf("ParamsValues[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RuleValidationError{ - field: fmt.Sprintf("ParamsValues[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetDefaultFor()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RuleValidationError{ - field: "DefaultFor", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RuleValidationError{ - field: "DefaultFor", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetDefaultFor()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RuleValidationError{ - field: "DefaultFor", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetFor()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RuleValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RuleValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFor()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RuleValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for DefaultSeverity - - // no validation rules for Severity - - // no validation rules for CustomLabels - - // no validation rules for Labels - - // no validation rules for Annotations - - for idx, item := range m.GetFilters() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RuleValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RuleValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RuleValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetChannels() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RuleValidationError{ - field: fmt.Sprintf("Channels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RuleValidationError{ - field: fmt.Sprintf("Channels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RuleValidationError{ - field: fmt.Sprintf("Channels[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RuleValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RuleValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RuleValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return RuleMultiError(errors) - } - - return nil -} - -// RuleMultiError is an error wrapping multiple validation errors returned by -// Rule.ValidateAll() if the designated constraints aren't met. -type RuleMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RuleMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RuleMultiError) AllErrors() []error { return m } - -// RuleValidationError is the validation error returned by Rule.Validate if the -// designated constraints aren't met. -type RuleValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RuleValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RuleValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RuleValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RuleValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RuleValidationError) ErrorName() string { return "RuleValidationError" } - -// Error satisfies the builtin error interface -func (e RuleValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRule.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RuleValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RuleValidationError{} - -// Validate checks the field values on ListAlertRulesRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListAlertRulesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAlertRulesRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListAlertRulesRequestMultiError, or nil if none found. -func (m *ListAlertRulesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAlertRulesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPageParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAlertRulesRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAlertRulesRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPageParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAlertRulesRequestValidationError{ - field: "PageParams", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ListAlertRulesRequestMultiError(errors) - } - - return nil -} - -// ListAlertRulesRequestMultiError is an error wrapping multiple validation -// errors returned by ListAlertRulesRequest.ValidateAll() if the designated -// constraints aren't met. -type ListAlertRulesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAlertRulesRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListAlertRulesRequestMultiError) AllErrors() []error { return m } - -// ListAlertRulesRequestValidationError is the validation error returned by -// ListAlertRulesRequest.Validate if the designated constraints aren't met. -type ListAlertRulesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAlertRulesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAlertRulesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAlertRulesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAlertRulesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAlertRulesRequestValidationError) ErrorName() string { - return "ListAlertRulesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAlertRulesRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListAlertRulesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAlertRulesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAlertRulesRequestValidationError{} - -// Validate checks the field values on ListAlertRulesResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListAlertRulesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListAlertRulesResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListAlertRulesResponseMultiError, or nil if none found. -func (m *ListAlertRulesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListAlertRulesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetRules() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAlertRulesResponseValidationError{ - field: fmt.Sprintf("Rules[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAlertRulesResponseValidationError{ - field: fmt.Sprintf("Rules[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAlertRulesResponseValidationError{ - field: fmt.Sprintf("Rules[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetTotals()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListAlertRulesResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListAlertRulesResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTotals()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListAlertRulesResponseValidationError{ - field: "Totals", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ListAlertRulesResponseMultiError(errors) - } - - return nil -} - -// ListAlertRulesResponseMultiError is an error wrapping multiple validation -// errors returned by ListAlertRulesResponse.ValidateAll() if the designated -// constraints aren't met. -type ListAlertRulesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListAlertRulesResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListAlertRulesResponseMultiError) AllErrors() []error { return m } - -// ListAlertRulesResponseValidationError is the validation error returned by -// ListAlertRulesResponse.Validate if the designated constraints aren't met. -type ListAlertRulesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListAlertRulesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListAlertRulesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListAlertRulesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListAlertRulesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListAlertRulesResponseValidationError) ErrorName() string { - return "ListAlertRulesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListAlertRulesResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListAlertRulesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListAlertRulesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListAlertRulesResponseValidationError{} - -// Validate checks the field values on CreateAlertRuleRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *CreateAlertRuleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateAlertRuleRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// CreateAlertRuleRequestMultiError, or nil if none found. -func (m *CreateAlertRuleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateAlertRuleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for TemplateName - - // no validation rules for SourceRuleId - - // no validation rules for Name - - // no validation rules for Disabled - - for idx, item := range m.GetParams() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetFor()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAlertRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateAlertRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFor()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateAlertRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Severity - - // no validation rules for CustomLabels - - for idx, item := range m.GetFilters() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return CreateAlertRuleRequestMultiError(errors) - } - - return nil -} - -// CreateAlertRuleRequestMultiError is an error wrapping multiple validation -// errors returned by CreateAlertRuleRequest.ValidateAll() if the designated -// constraints aren't met. -type CreateAlertRuleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateAlertRuleRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreateAlertRuleRequestMultiError) AllErrors() []error { return m } - -// CreateAlertRuleRequestValidationError is the validation error returned by -// CreateAlertRuleRequest.Validate if the designated constraints aren't met. -type CreateAlertRuleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateAlertRuleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateAlertRuleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateAlertRuleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateAlertRuleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateAlertRuleRequestValidationError) ErrorName() string { - return "CreateAlertRuleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateAlertRuleRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCreateAlertRuleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateAlertRuleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateAlertRuleRequestValidationError{} - -// Validate checks the field values on CreateAlertRuleResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *CreateAlertRuleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateAlertRuleResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// CreateAlertRuleResponseMultiError, or nil if none found. -func (m *CreateAlertRuleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateAlertRuleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for RuleId - - if len(errors) > 0 { - return CreateAlertRuleResponseMultiError(errors) - } - - return nil -} - -// CreateAlertRuleResponseMultiError is an error wrapping multiple validation -// errors returned by CreateAlertRuleResponse.ValidateAll() if the designated -// constraints aren't met. -type CreateAlertRuleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateAlertRuleResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreateAlertRuleResponseMultiError) AllErrors() []error { return m } - -// CreateAlertRuleResponseValidationError is the validation error returned by -// CreateAlertRuleResponse.Validate if the designated constraints aren't met. -type CreateAlertRuleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateAlertRuleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateAlertRuleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateAlertRuleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateAlertRuleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateAlertRuleResponseValidationError) ErrorName() string { - return "CreateAlertRuleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateAlertRuleResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCreateAlertRuleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateAlertRuleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateAlertRuleResponseValidationError{} - -// Validate checks the field values on UpdateAlertRuleRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdateAlertRuleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateAlertRuleRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdateAlertRuleRequestMultiError, or nil if none found. -func (m *UpdateAlertRuleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateAlertRuleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRuleId()) < 1 { - err := UpdateAlertRuleRequestValidationError{ - field: "RuleId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Name - - // no validation rules for Disabled - - for idx, item := range m.GetParams() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Params[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetFor()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdateAlertRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdateAlertRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFor()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdateAlertRuleRequestValidationError{ - field: "For", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Severity - - // no validation rules for CustomLabels - - for idx, item := range m.GetFilters() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdateAlertRuleRequestValidationError{ - field: fmt.Sprintf("Filters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return UpdateAlertRuleRequestMultiError(errors) - } - - return nil -} - -// UpdateAlertRuleRequestMultiError is an error wrapping multiple validation -// errors returned by UpdateAlertRuleRequest.ValidateAll() if the designated -// constraints aren't met. -type UpdateAlertRuleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateAlertRuleRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdateAlertRuleRequestMultiError) AllErrors() []error { return m } - -// UpdateAlertRuleRequestValidationError is the validation error returned by -// UpdateAlertRuleRequest.Validate if the designated constraints aren't met. -type UpdateAlertRuleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateAlertRuleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateAlertRuleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateAlertRuleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateAlertRuleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateAlertRuleRequestValidationError) ErrorName() string { - return "UpdateAlertRuleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateAlertRuleRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdateAlertRuleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateAlertRuleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateAlertRuleRequestValidationError{} - -// Validate checks the field values on UpdateAlertRuleResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdateAlertRuleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateAlertRuleResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdateAlertRuleResponseMultiError, or nil if none found. -func (m *UpdateAlertRuleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateAlertRuleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UpdateAlertRuleResponseMultiError(errors) - } - - return nil -} - -// UpdateAlertRuleResponseMultiError is an error wrapping multiple validation -// errors returned by UpdateAlertRuleResponse.ValidateAll() if the designated -// constraints aren't met. -type UpdateAlertRuleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateAlertRuleResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdateAlertRuleResponseMultiError) AllErrors() []error { return m } - -// UpdateAlertRuleResponseValidationError is the validation error returned by -// UpdateAlertRuleResponse.Validate if the designated constraints aren't met. -type UpdateAlertRuleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateAlertRuleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateAlertRuleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateAlertRuleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateAlertRuleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateAlertRuleResponseValidationError) ErrorName() string { - return "UpdateAlertRuleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateAlertRuleResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdateAlertRuleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateAlertRuleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateAlertRuleResponseValidationError{} - -// Validate checks the field values on ToggleAlertRuleRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ToggleAlertRuleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ToggleAlertRuleRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ToggleAlertRuleRequestMultiError, or nil if none found. -func (m *ToggleAlertRuleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ToggleAlertRuleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRuleId()) < 1 { - err := ToggleAlertRuleRequestValidationError{ - field: "RuleId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Disabled - - if len(errors) > 0 { - return ToggleAlertRuleRequestMultiError(errors) - } - - return nil -} - -// ToggleAlertRuleRequestMultiError is an error wrapping multiple validation -// errors returned by ToggleAlertRuleRequest.ValidateAll() if the designated -// constraints aren't met. -type ToggleAlertRuleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ToggleAlertRuleRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ToggleAlertRuleRequestMultiError) AllErrors() []error { return m } - -// ToggleAlertRuleRequestValidationError is the validation error returned by -// ToggleAlertRuleRequest.Validate if the designated constraints aren't met. -type ToggleAlertRuleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ToggleAlertRuleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ToggleAlertRuleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ToggleAlertRuleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ToggleAlertRuleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ToggleAlertRuleRequestValidationError) ErrorName() string { - return "ToggleAlertRuleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ToggleAlertRuleRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sToggleAlertRuleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ToggleAlertRuleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ToggleAlertRuleRequestValidationError{} - -// Validate checks the field values on ToggleAlertRuleResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ToggleAlertRuleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ToggleAlertRuleResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ToggleAlertRuleResponseMultiError, or nil if none found. -func (m *ToggleAlertRuleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ToggleAlertRuleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ToggleAlertRuleResponseMultiError(errors) - } - - return nil -} - -// ToggleAlertRuleResponseMultiError is an error wrapping multiple validation -// errors returned by ToggleAlertRuleResponse.ValidateAll() if the designated -// constraints aren't met. -type ToggleAlertRuleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ToggleAlertRuleResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ToggleAlertRuleResponseMultiError) AllErrors() []error { return m } - -// ToggleAlertRuleResponseValidationError is the validation error returned by -// ToggleAlertRuleResponse.Validate if the designated constraints aren't met. -type ToggleAlertRuleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ToggleAlertRuleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ToggleAlertRuleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ToggleAlertRuleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ToggleAlertRuleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ToggleAlertRuleResponseValidationError) ErrorName() string { - return "ToggleAlertRuleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ToggleAlertRuleResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sToggleAlertRuleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ToggleAlertRuleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ToggleAlertRuleResponseValidationError{} - -// Validate checks the field values on DeleteAlertRuleRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *DeleteAlertRuleRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteAlertRuleRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// DeleteAlertRuleRequestMultiError, or nil if none found. -func (m *DeleteAlertRuleRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteAlertRuleRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRuleId()) < 1 { - err := DeleteAlertRuleRequestValidationError{ - field: "RuleId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return DeleteAlertRuleRequestMultiError(errors) - } - - return nil -} - -// DeleteAlertRuleRequestMultiError is an error wrapping multiple validation -// errors returned by DeleteAlertRuleRequest.ValidateAll() if the designated -// constraints aren't met. -type DeleteAlertRuleRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteAlertRuleRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m DeleteAlertRuleRequestMultiError) AllErrors() []error { return m } - -// DeleteAlertRuleRequestValidationError is the validation error returned by -// DeleteAlertRuleRequest.Validate if the designated constraints aren't met. -type DeleteAlertRuleRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteAlertRuleRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteAlertRuleRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteAlertRuleRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteAlertRuleRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteAlertRuleRequestValidationError) ErrorName() string { - return "DeleteAlertRuleRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteAlertRuleRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sDeleteAlertRuleRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteAlertRuleRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteAlertRuleRequestValidationError{} - -// Validate checks the field values on DeleteAlertRuleResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *DeleteAlertRuleResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteAlertRuleResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// DeleteAlertRuleResponseMultiError, or nil if none found. -func (m *DeleteAlertRuleResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteAlertRuleResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return DeleteAlertRuleResponseMultiError(errors) - } - - return nil -} - -// DeleteAlertRuleResponseMultiError is an error wrapping multiple validation -// errors returned by DeleteAlertRuleResponse.ValidateAll() if the designated -// constraints aren't met. -type DeleteAlertRuleResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteAlertRuleResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m DeleteAlertRuleResponseMultiError) AllErrors() []error { return m } - -// DeleteAlertRuleResponseValidationError is the validation error returned by -// DeleteAlertRuleResponse.Validate if the designated constraints aren't met. -type DeleteAlertRuleResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteAlertRuleResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteAlertRuleResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteAlertRuleResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteAlertRuleResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteAlertRuleResponseValidationError) ErrorName() string { - return "DeleteAlertRuleResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteAlertRuleResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sDeleteAlertRuleResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteAlertRuleResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteAlertRuleResponseValidationError{} diff --git a/api/managementpb/ia/rules.proto b/api/managementpb/ia/rules.proto deleted file mode 100644 index a0f18dafbd..0000000000 --- a/api/managementpb/ia/rules.proto +++ /dev/null @@ -1,243 +0,0 @@ -syntax = "proto3"; - -package ia.v1beta1; - -import "google/api/annotations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "managementpb/alerting/alerting.proto"; -import "managementpb/alerting/params.proto"; -import "managementpb/boolean_flag.proto"; -import "managementpb/ia/channels.proto"; -import "managementpb/pagination.proto"; -import "managementpb/severity.proto"; -import "protoc-gen-openapiv2/options/annotations.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/ia;iav1beta1"; - -// FilterType represents filter matching type. -enum FilterType { - option deprecated = true; - FILTER_TYPE_INVALID = 0; - // = - EQUAL = 1; - // != - // NOT_EQUAL = 2; - - // =~ - REGEX = 3; - // !~ - // NOT_REGEX = 4; -} - -// Filter repsents a single filter condition. -message Filter { - option deprecated = true; - FilterType type = 1; - string key = 2; - string value = 3; -} - -// ParamValue represents a single rule parameter value for List, Change and Update APIs. -message ParamValue { - option deprecated = true; - // Machine-readable name (ID) that is used in expression. - string name = 1 [(validate.rules).string.min_len = 1]; - // Parameter type. - alerting.v1.ParamType type = 2; - // Parameter value. - oneof value { - // Bool value. - bool bool = 3; - // Float value. - double float = 4; - // String value. - string string = 5; - } -} - -// Rule represents Alert Rule. -message Rule { - option deprecated = true; - // Rule ID. - string rule_id = 1; - // Rule name. - string name = 2; - // Rule human-readable summary. - string summary = 3; - // Template used for this rule. - string template_name = 4; - // True if that rule is disabled. - bool disabled = 5; - // Expression template. - string expr_template = 6; - // Expression filled with parameters. - string expr = 7; - // Expression parameters definitions. - repeated alerting.v1.ParamDefinition params_definitions = 8; - // Expression parameters values. - repeated ParamValue params_values = 9; - // Default for duration. - google.protobuf.Duration default_for = 10; - // For duration. - google.protobuf.Duration for = 11; - // Default severity. - management.Severity default_severity = 12; - // Severity. - management.Severity severity = 13; - // Custom labels. - map custom_labels = 14; - // Labels. - map labels = 15; - // Annotations. - map annotations = 16; - // Filters. - repeated Filter filters = 17; - // Channels. - repeated Channel channels = 18; - // Rule creation time. - google.protobuf.Timestamp created_at = 19; -} - -message ListAlertRulesRequest { - option deprecated = true; - // Page request. - management.PageParams page_params = 1; -} - -message ListAlertRulesResponse { - option deprecated = true; - repeated Rule rules = 1; - // Total items and pages. - management.PageTotals totals = 2; -} - -message CreateAlertRuleRequest { - option deprecated = true; - // Template name. Can't be specified simultaneously with source_rule_id. - string template_name = 1; - // ID of the rule that will be used as source. Can't be specified simultaneously with template_name. - string source_rule_id = 2; - // Rule name. - string name = 3; - // New rule status. - bool disabled = 4; - // Rule parameters. All template parameters should be set. - repeated ParamValue params = 5; - // Rule duration. Should be set. - google.protobuf.Duration for = 6; - // Rule severity. Should be set. - management.Severity severity = 7; - // All custom labels to add or remove (with empty values) to default labels from template. - map custom_labels = 8; - // Filters. Should be set. - repeated Filter filters = 9; - // Channels. Should be set. - repeated string channel_ids = 10; -} - -message CreateAlertRuleResponse { - option deprecated = true; - // Rule ID. - string rule_id = 1; -} - -message UpdateAlertRuleRequest { - option deprecated = true; - // Rule ID. - string rule_id = 1 [(validate.rules).string.min_len = 1]; - // Rule name. Should be set. - string name = 2; - // New rule status. Should be set. - bool disabled = 3; - // Rule parameters. All template parameters should be set. - repeated ParamValue params = 4; - // Rule duration. Should be set. - google.protobuf.Duration for = 5; - // Rule severity. Should be set. - management.Severity severity = 6; - // All custom labels to add or remove (with empty values) to default labels from template. - map custom_labels = 7; - // Filters. Should be set. - repeated Filter filters = 8; - // Channels. Should be set. - repeated string channel_ids = 9; -} - -message UpdateAlertRuleResponse { - option deprecated = true; -} - -message ToggleAlertRuleRequest { - option deprecated = true; - - // Rule ID. - string rule_id = 1 [(validate.rules).string.min_len = 1]; - // New rule status, if set. - managementpb.BooleanFlag disabled = 2; -} - -message ToggleAlertRuleResponse { - option deprecated = true; -} - -message DeleteAlertRuleRequest { - option deprecated = true; - - // Rule ID. - string rule_id = 1 [(validate.rules).string.min_len = 1]; -} - -message DeleteAlertRuleResponse { - option deprecated = true; -} - -// Rules service provides public methods for managing Alerting rules. -service Rules { - // ListAlertRules returns a list of all Alerting rules. - rpc ListAlertRules(ListAlertRulesRequest) returns (ListAlertRulesResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Rules/List" - body: "*" - }; - } - // CreateAlertRule creates Alerting rule. - rpc CreateAlertRule(CreateAlertRuleRequest) returns (CreateAlertRuleResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Rules/Create" - body: "*" - }; - } - // UpdateAlertRule updates Alerting rule. - rpc UpdateAlertRule(UpdateAlertRuleRequest) returns (UpdateAlertRuleResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Rules/Update" - body: "*" - }; - } - // ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule. - rpc ToggleAlertRule(ToggleAlertRuleRequest) returns (ToggleAlertRuleResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Rules/Toggle" - body: "*" - }; - } - // DeleteAlertRule deletes Alerting rule. - rpc DeleteAlertRule(DeleteAlertRuleRequest) returns (DeleteAlertRuleResponse) { - option deprecated = true; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {deprecated: true}; - option (google.api.http) = { - post: "/v1/management/ia/Rules/Delete" - body: "*" - }; - } -} diff --git a/api/managementpb/ia/rules_grpc.pb.go b/api/managementpb/ia/rules_grpc.pb.go deleted file mode 100644 index 786492a856..0000000000 --- a/api/managementpb/ia/rules_grpc.pb.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/ia/rules.proto - -package iav1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Rules_ListAlertRules_FullMethodName = "/ia.v1beta1.Rules/ListAlertRules" - Rules_CreateAlertRule_FullMethodName = "/ia.v1beta1.Rules/CreateAlertRule" - Rules_UpdateAlertRule_FullMethodName = "/ia.v1beta1.Rules/UpdateAlertRule" - Rules_ToggleAlertRule_FullMethodName = "/ia.v1beta1.Rules/ToggleAlertRule" - Rules_DeleteAlertRule_FullMethodName = "/ia.v1beta1.Rules/DeleteAlertRule" -) - -// RulesClient is the client API for Rules service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type RulesClient interface { - // Deprecated: Do not use. - // ListAlertRules returns a list of all Alerting rules. - ListAlertRules(ctx context.Context, in *ListAlertRulesRequest, opts ...grpc.CallOption) (*ListAlertRulesResponse, error) - // Deprecated: Do not use. - // CreateAlertRule creates Alerting rule. - CreateAlertRule(ctx context.Context, in *CreateAlertRuleRequest, opts ...grpc.CallOption) (*CreateAlertRuleResponse, error) - // Deprecated: Do not use. - // UpdateAlertRule updates Alerting rule. - UpdateAlertRule(ctx context.Context, in *UpdateAlertRuleRequest, opts ...grpc.CallOption) (*UpdateAlertRuleResponse, error) - // Deprecated: Do not use. - // ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule. - ToggleAlertRule(ctx context.Context, in *ToggleAlertRuleRequest, opts ...grpc.CallOption) (*ToggleAlertRuleResponse, error) - // Deprecated: Do not use. - // DeleteAlertRule deletes Alerting rule. - DeleteAlertRule(ctx context.Context, in *DeleteAlertRuleRequest, opts ...grpc.CallOption) (*DeleteAlertRuleResponse, error) -} - -type rulesClient struct { - cc grpc.ClientConnInterface -} - -func NewRulesClient(cc grpc.ClientConnInterface) RulesClient { - return &rulesClient{cc} -} - -// Deprecated: Do not use. -func (c *rulesClient) ListAlertRules(ctx context.Context, in *ListAlertRulesRequest, opts ...grpc.CallOption) (*ListAlertRulesResponse, error) { - out := new(ListAlertRulesResponse) - err := c.cc.Invoke(ctx, Rules_ListAlertRules_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *rulesClient) CreateAlertRule(ctx context.Context, in *CreateAlertRuleRequest, opts ...grpc.CallOption) (*CreateAlertRuleResponse, error) { - out := new(CreateAlertRuleResponse) - err := c.cc.Invoke(ctx, Rules_CreateAlertRule_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *rulesClient) UpdateAlertRule(ctx context.Context, in *UpdateAlertRuleRequest, opts ...grpc.CallOption) (*UpdateAlertRuleResponse, error) { - out := new(UpdateAlertRuleResponse) - err := c.cc.Invoke(ctx, Rules_UpdateAlertRule_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *rulesClient) ToggleAlertRule(ctx context.Context, in *ToggleAlertRuleRequest, opts ...grpc.CallOption) (*ToggleAlertRuleResponse, error) { - out := new(ToggleAlertRuleResponse) - err := c.cc.Invoke(ctx, Rules_ToggleAlertRule_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *rulesClient) DeleteAlertRule(ctx context.Context, in *DeleteAlertRuleRequest, opts ...grpc.CallOption) (*DeleteAlertRuleResponse, error) { - out := new(DeleteAlertRuleResponse) - err := c.cc.Invoke(ctx, Rules_DeleteAlertRule_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RulesServer is the server API for Rules service. -// All implementations must embed UnimplementedRulesServer -// for forward compatibility -type RulesServer interface { - // Deprecated: Do not use. - // ListAlertRules returns a list of all Alerting rules. - ListAlertRules(context.Context, *ListAlertRulesRequest) (*ListAlertRulesResponse, error) - // Deprecated: Do not use. - // CreateAlertRule creates Alerting rule. - CreateAlertRule(context.Context, *CreateAlertRuleRequest) (*CreateAlertRuleResponse, error) - // Deprecated: Do not use. - // UpdateAlertRule updates Alerting rule. - UpdateAlertRule(context.Context, *UpdateAlertRuleRequest) (*UpdateAlertRuleResponse, error) - // Deprecated: Do not use. - // ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule. - ToggleAlertRule(context.Context, *ToggleAlertRuleRequest) (*ToggleAlertRuleResponse, error) - // Deprecated: Do not use. - // DeleteAlertRule deletes Alerting rule. - DeleteAlertRule(context.Context, *DeleteAlertRuleRequest) (*DeleteAlertRuleResponse, error) - mustEmbedUnimplementedRulesServer() -} - -// UnimplementedRulesServer must be embedded to have forward compatible implementations. -type UnimplementedRulesServer struct{} - -func (UnimplementedRulesServer) ListAlertRules(context.Context, *ListAlertRulesRequest) (*ListAlertRulesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListAlertRules not implemented") -} - -func (UnimplementedRulesServer) CreateAlertRule(context.Context, *CreateAlertRuleRequest) (*CreateAlertRuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateAlertRule not implemented") -} - -func (UnimplementedRulesServer) UpdateAlertRule(context.Context, *UpdateAlertRuleRequest) (*UpdateAlertRuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAlertRule not implemented") -} - -func (UnimplementedRulesServer) ToggleAlertRule(context.Context, *ToggleAlertRuleRequest) (*ToggleAlertRuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ToggleAlertRule not implemented") -} - -func (UnimplementedRulesServer) DeleteAlertRule(context.Context, *DeleteAlertRuleRequest) (*DeleteAlertRuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteAlertRule not implemented") -} -func (UnimplementedRulesServer) mustEmbedUnimplementedRulesServer() {} - -// UnsafeRulesServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to RulesServer will -// result in compilation errors. -type UnsafeRulesServer interface { - mustEmbedUnimplementedRulesServer() -} - -func RegisterRulesServer(s grpc.ServiceRegistrar, srv RulesServer) { - s.RegisterService(&Rules_ServiceDesc, srv) -} - -func _Rules_ListAlertRules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAlertRulesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RulesServer).ListAlertRules(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Rules_ListAlertRules_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RulesServer).ListAlertRules(ctx, req.(*ListAlertRulesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Rules_CreateAlertRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAlertRuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RulesServer).CreateAlertRule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Rules_CreateAlertRule_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RulesServer).CreateAlertRule(ctx, req.(*CreateAlertRuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Rules_UpdateAlertRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateAlertRuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RulesServer).UpdateAlertRule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Rules_UpdateAlertRule_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RulesServer).UpdateAlertRule(ctx, req.(*UpdateAlertRuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Rules_ToggleAlertRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ToggleAlertRuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RulesServer).ToggleAlertRule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Rules_ToggleAlertRule_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RulesServer).ToggleAlertRule(ctx, req.(*ToggleAlertRuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Rules_DeleteAlertRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAlertRuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RulesServer).DeleteAlertRule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Rules_DeleteAlertRule_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RulesServer).DeleteAlertRule(ctx, req.(*DeleteAlertRuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Rules_ServiceDesc is the grpc.ServiceDesc for Rules service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Rules_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ia.v1beta1.Rules", - HandlerType: (*RulesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListAlertRules", - Handler: _Rules_ListAlertRules_Handler, - }, - { - MethodName: "CreateAlertRule", - Handler: _Rules_CreateAlertRule_Handler, - }, - { - MethodName: "UpdateAlertRule", - Handler: _Rules_UpdateAlertRule_Handler, - }, - { - MethodName: "ToggleAlertRule", - Handler: _Rules_ToggleAlertRule_Handler, - }, - { - MethodName: "DeleteAlertRule", - Handler: _Rules_DeleteAlertRule_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/ia/rules.proto", -} diff --git a/api/managementpb/ia/status.dot b/api/managementpb/ia/status.dot deleted file mode 100644 index 158875869e..0000000000 --- a/api/managementpb/ia/status.dot +++ /dev/null @@ -1,20 +0,0 @@ -digraph { - node [style=filled]; - - CLEAR [fillcolor=green]; - PENDING; - TRIGGERING; - SILENCED; - - CLEAR -> PENDING; - PENDING -> TRIGGERING; - TRIGGERING -> SILENCED; - - # not typical and not exposed in the UI, but still possible - CLEAR -> SILENCED [style=dashed]; - PENDING -> SILENCED [style=dashed]; - - PENDING -> CLEAR [style=dotted]; - TRIGGERING -> CLEAR [style=dotted]; - SILENCED -> CLEAR [style=dotted]; -} diff --git a/api/managementpb/ia/status.pb.go b/api/managementpb/ia/status.pb.go deleted file mode 100644 index e9ddc8ffca..0000000000 --- a/api/managementpb/ia/status.pb.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc (unknown) -// source: managementpb/ia/status.proto - -package iav1beta1 - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Status represents Alert Rule's and Alert's combined status. -// -// Deprecated: Marked as deprecated in managementpb/ia/status.proto. -type Status int32 - -const ( - Status_STATUS_INVALID Status = 0 - // No alert. - Status_CLEAR Status = 1 - // Pending, but not triggering alert. - Status_PENDING Status = 2 - // Triggering (firing) alert. - Status_TRIGGERING Status = 3 - // Silenced alert. - Status_SILENCED Status = 4 -) - -// Enum value maps for Status. -var ( - Status_name = map[int32]string{ - 0: "STATUS_INVALID", - 1: "CLEAR", - 2: "PENDING", - 3: "TRIGGERING", - 4: "SILENCED", - } - Status_value = map[string]int32{ - "STATUS_INVALID": 0, - "CLEAR": 1, - "PENDING": 2, - "TRIGGERING": 3, - "SILENCED": 4, - } -) - -func (x Status) Enum() *Status { - p := new(Status) - *p = x - return p -} - -func (x Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Status) Descriptor() protoreflect.EnumDescriptor { - return file_managementpb_ia_status_proto_enumTypes[0].Descriptor() -} - -func (Status) Type() protoreflect.EnumType { - return &file_managementpb_ia_status_proto_enumTypes[0] -} - -func (x Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Status.Descriptor instead. -func (Status) EnumDescriptor() ([]byte, []int) { - return file_managementpb_ia_status_proto_rawDescGZIP(), []int{0} -} - -var File_managementpb_ia_status_proto protoreflect.FileDescriptor - -var file_managementpb_ia_status_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, - 0x61, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, - 0x69, 0x61, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2a, 0x56, 0x0a, 0x06, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, - 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4c, 0x45, 0x41, - 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, - 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x03, - 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x49, 0x4c, 0x45, 0x4e, 0x43, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x02, - 0x18, 0x01, 0x42, 0x9c, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x61, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x69, 0x61, - 0x3b, 0x69, 0x61, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, - 0xaa, 0x02, 0x0a, 0x49, 0x61, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0a, - 0x49, 0x61, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x16, 0x49, 0x61, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x49, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_ia_status_proto_rawDescOnce sync.Once - file_managementpb_ia_status_proto_rawDescData = file_managementpb_ia_status_proto_rawDesc -) - -func file_managementpb_ia_status_proto_rawDescGZIP() []byte { - file_managementpb_ia_status_proto_rawDescOnce.Do(func() { - file_managementpb_ia_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_ia_status_proto_rawDescData) - }) - return file_managementpb_ia_status_proto_rawDescData -} - -var ( - file_managementpb_ia_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_managementpb_ia_status_proto_goTypes = []interface{}{ - (Status)(0), // 0: ia.v1beta1.Status - } -) - -var file_managementpb_ia_status_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_managementpb_ia_status_proto_init() } -func file_managementpb_ia_status_proto_init() { - if File_managementpb_ia_status_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_ia_status_proto_rawDesc, - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_managementpb_ia_status_proto_goTypes, - DependencyIndexes: file_managementpb_ia_status_proto_depIdxs, - EnumInfos: file_managementpb_ia_status_proto_enumTypes, - }.Build() - File_managementpb_ia_status_proto = out.File - file_managementpb_ia_status_proto_rawDesc = nil - file_managementpb_ia_status_proto_goTypes = nil - file_managementpb_ia_status_proto_depIdxs = nil -} diff --git a/api/managementpb/ia/status.pb.validate.go b/api/managementpb/ia/status.pb.validate.go deleted file mode 100644 index 88d02ccf6b..0000000000 --- a/api/managementpb/ia/status.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/ia/status.proto - -package iav1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/api/managementpb/ia/status.proto b/api/managementpb/ia/status.proto deleted file mode 100644 index 9592c9c541..0000000000 --- a/api/managementpb/ia/status.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -package ia.v1beta1; - -option go_package = "api/managementpb/ia;iav1beta1"; - -// Status represents Alert Rule's and Alert's combined status. -enum Status { - option deprecated = true; - STATUS_INVALID = 0; - // No alert. - CLEAR = 1; - // Pending, but not triggering alert. - PENDING = 2; - // Triggering (firing) alert. - TRIGGERING = 3; - // Silenced alert. - SILENCED = 4; -} diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index 926ca7fa3f..5b8c74a455 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -18378,7 +18378,7 @@ "Agent" ], "summary": "List Agents", - "operationId": "ListAgentsMixin10", + "operationId": "ListAgentsMixin9", "parameters": [ { "description": "Only one of the parameters below must be set.", @@ -26000,7 +26000,7 @@ "MgmtNode" ], "summary": "Get Node", - "operationId": "GetNodeMixin11", + "operationId": "GetNodeMixin10", "parameters": [ { "name": "body", @@ -26217,7 +26217,7 @@ "MgmtNode" ], "summary": "List Nodes", - "operationId": "ListNodesMixin11", + "operationId": "ListNodesMixin10", "parameters": [ { "name": "body", @@ -30210,7 +30210,7 @@ "MgmtService" ], "summary": "List Services", - "operationId": "ListServicesMixin12", + "operationId": "ListServicesMixin11", "parameters": [ { "name": "body", @@ -31125,7 +31125,7 @@ "Alerting" ], "summary": "ListTemplates returns a list of all collected alert rule templates.", - "operationId": "ListTemplatesMixin6", + "operationId": "ListTemplatesMixin5", "parameters": [ { "name": "body", @@ -32341,7 +32341,7 @@ "Backups" ], "summary": "GetLogs returns logs from the underlying tools for a backup/restore job.", - "operationId": "GetLogsMixin7", + "operationId": "GetLogsMixin6", "parameters": [ { "name": "body", @@ -33878,2703 +33878,6 @@ } } }, - "/v1/management/ia/Alerts/List": { - "post": { - "tags": [ - "Alerts" - ], - "summary": "ListAlerts returns a list of all Alerts.", - "operationId": "ListAlerts", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "alerts": { - "type": "array", - "items": { - "description": "Alert represents Alert.", - "type": "object", - "properties": { - "alert_id": { - "description": "ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Human-readable summary.", - "type": "string", - "x-order": 1 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 2 - }, - "status": { - "description": "Status represents Alert Rule's and Alert's combined status.\n\n - CLEAR: No alert.\n - PENDING: Pending, but not triggering alert.\n - TRIGGERING: Triggering (firing) alert.\n - SILENCED: Silenced alert.", - "type": "string", - "default": "STATUS_INVALID", - "enum": [ - "STATUS_INVALID", - "CLEAR", - "PENDING", - "TRIGGERING", - "SILENCED" - ], - "x-order": 3 - }, - "labels": { - "description": "Combined labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 4 - }, - "rule": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "params_definitions": { - "description": "Expression parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 8 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - } - }, - "x-order": 5 - }, - "created_at": { - "description": "Alert creation time.", - "type": "string", - "format": "date-time", - "x-order": 6 - }, - "updated_at": { - "description": "Alert last update time.", - "type": "string", - "format": "date-time", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Alerts/Toggle": { - "post": { - "description": "Pass empty list to apply toggle action to all existing alerts", - "tags": [ - "Alerts" - ], - "summary": "ToggleAlerts allows to switch alerts state between silenced and unsilenced.", - "operationId": "ToggleAlerts", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "alert_ids": { - "description": "List of alerts that silence state should be switched. If provided array is empty than all\nexisting alerts are switched.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "silenced": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Add": { - "post": { - "tags": [ - "Channels" - ], - "summary": "AddChannel adds notification channel.", - "operationId": "AddChannel", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 0 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 3 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 4 - }, - "disabled": { - "description": "New channel status.", - "type": "boolean", - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Change": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ChangeChannel changes notification channel.", - "operationId": "ChangeChannel", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary. Empty value will not change it.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "Enables or disables that channel. Should be set.", - "type": "boolean", - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/List": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ListChannels returns a list of all notifation channels.", - "operationId": "ListChannels", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Remove": { - "post": { - "tags": [ - "Channels" - ], - "summary": "RemoveChannel removes notification channel.", - "operationId": "RemoveChannel", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Create": { - "post": { - "tags": [ - "Rules" - ], - "summary": "CreateAlertRule creates Alerting rule.", - "operationId": "CreateAlertRule", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "template_name": { - "description": "Template name. Can't be specified simultaneously with source_rule_id.", - "type": "string", - "x-order": 0 - }, - "source_rule_id": { - "description": "ID of the rule that will be used as source. Can't be specified simultaneously with template_name.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 2 - }, - "disabled": { - "description": "New rule status.", - "type": "boolean", - "x-order": 3 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 4 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 5 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 6 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "filters": { - "description": "Filters. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - }, - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Delete": { - "post": { - "tags": [ - "Rules" - ], - "summary": "DeleteAlertRule deletes Alerting rule.", - "operationId": "DeleteAlertRule", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/List": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ListAlertRules returns a list of all Alerting rules.", - "operationId": "ListAlertRules", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rules": { - "type": "array", - "items": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "params_definitions": { - "description": "Expression parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 8 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Toggle": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule.", - "operationId": "ToggleAlertRule", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Update": { - "post": { - "tags": [ - "Rules" - ], - "summary": "UpdateAlertRule updates Alerting rule.", - "operationId": "UpdateAlertRule", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name. Should be set.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "New rule status. Should be set.", - "type": "boolean", - "x-order": 2 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 3 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "filters": { - "description": "Filters. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, "/v1/readyz": { "get": { "description": "Returns an error when Server components being restarted are not ready yet. Use this API for checking the health of Docker containers and for probing Kubernetes readiness.", @@ -37065,15 +34368,6 @@ { "name": "Templates" }, - { - "name": "Alerts" - }, - { - "name": "Channels" - }, - { - "name": "Rules" - }, { "name": "Alerting" }, diff --git a/descriptor.bin b/descriptor.bin index c3bddb1e35a91817f0e0ae20ef7eb8df260e660a..970fb942da29196cf8c633d12392225208495b07 100644 GIT binary patch delta 109046 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 diff --git a/managed/cmd/pmm-managed/main.go b/managed/cmd/pmm-managed/main.go index 962cd55166..b17fcecdd2 100644 --- a/managed/cmd/pmm-managed/main.go +++ b/managed/cmd/pmm-managed/main.go @@ -66,7 +66,6 @@ import ( azurev1beta1 "github.com/percona/pmm/api/managementpb/azure" backuppb "github.com/percona/pmm/api/managementpb/backup" dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - iav1beta1 "github.com/percona/pmm/api/managementpb/ia" nodev1beta1 "github.com/percona/pmm/api/managementpb/node" rolev1beta1 "github.com/percona/pmm/api/managementpb/role" servicev1beta1 "github.com/percona/pmm/api/managementpb/service" @@ -90,7 +89,6 @@ import ( managementbackup "github.com/percona/pmm/managed/services/management/backup" managementdbaas "github.com/percona/pmm/managed/services/management/dbaas" managementgrpc "github.com/percona/pmm/managed/services/management/grpc" - "github.com/percona/pmm/managed/services/management/ia" "github.com/percona/pmm/managed/services/minio" "github.com/percona/pmm/managed/services/platform" "github.com/percona/pmm/managed/services/qan" @@ -197,9 +195,7 @@ type gRPCServerDeps struct { alertmanager *alertmanager.Service vmalert *vmalert.Service settings *models.Settings - alertsService *ia.AlertsService templatesService *alerting.Service - rulesService *ia.RulesService jobsService *agents.JobsService versionServiceClient *managementdbaas.VersionServiceClient schedulerService *scheduler.Service @@ -290,9 +286,6 @@ func runGRPCServer(ctx context.Context, deps *gRPCServerDeps) { rolev1beta1.RegisterRoleServer(gRPCServer, management.NewRoleService(deps.db)) - iav1beta1.RegisterChannelsServer(gRPCServer, ia.NewChannelsService(deps.db, deps.alertmanager)) - iav1beta1.RegisterRulesServer(gRPCServer, deps.rulesService) - iav1beta1.RegisterAlertsServer(gRPCServer, deps.alertsService) alertingpb.RegisterAlertingServer(gRPCServer, deps.templatesService) backuppb.RegisterBackupsServer(gRPCServer, managementbackup.NewBackupsService(deps.db, deps.backupService, deps.compatibilityService, deps.schedulerService)) @@ -411,9 +404,6 @@ func runHTTP1Server(ctx context.Context, deps *http1ServerDeps) { managementpb.RegisterSecurityChecksHandlerFromEndpoint, rolev1beta1.RegisterRoleHandlerFromEndpoint, - iav1beta1.RegisterAlertsHandlerFromEndpoint, - iav1beta1.RegisterChannelsHandlerFromEndpoint, - iav1beta1.RegisterRulesHandlerFromEndpoint, alertingpb.RegisterAlertingHandlerFromEndpoint, backuppb.RegisterBackupsHandlerFromEndpoint, @@ -911,8 +901,6 @@ func main() { //nolint:cyclop,maintidx } // We should collect templates before rules service created, because it will regenerate rule files on startup. templatesService.CollectTemplates(ctx) - rulesService := ia.NewRulesService(db, templatesService, vmalert, alertManager) - alertsService := ia.NewAlertsService(db, alertManager, templatesService) agentService := agents.NewAgentService(agentsRegistry) versionService := managementdbaas.NewVersionServiceClient(*versionServiceAPIURLF) @@ -923,7 +911,6 @@ func main() { //nolint:cyclop,maintidx backupService := backup.NewService(db, jobsService, agentService, compatibilityService, pbmPITRService) schedulerService := scheduler.New(db, backupService) versionCache := versioncache.New(db, versioner) - emailer := alertmanager.NewEmailer(logrus.WithField("component", "alertmanager-emailer").Logger) kubeStorage := managementdbaas.NewKubeStorage(db) @@ -944,9 +931,7 @@ func main() { //nolint:cyclop,maintidx AwsInstanceChecker: awsInstanceChecker, GrafanaClient: grafanaClient, VMAlertExternalRules: externalRules, - RulesService: rulesService, DBaaSInitializer: dbaasInitializer, - Emailer: emailer, } server, err := server.NewServer(serverParams) @@ -1099,9 +1084,7 @@ func main() { //nolint:cyclop,maintidx alertmanager: alertManager, vmalert: vmalert, settings: settings, - alertsService: alertsService, templatesService: templatesService, - rulesService: rulesService, jobsService: jobsService, versionServiceClient: versionService, schedulerService: schedulerService, diff --git a/managed/models/channel.go b/managed/models/channel.go deleted file mode 100644 index 2d13e040a6..0000000000 --- a/managed/models/channel.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models - -import ( - "database/sql/driver" - "time" - - "gopkg.in/reform.v1" -) - -//go:generate ../../bin/reform - -// ChannelType represents notificaion channel type. -type ChannelType string - -// Available notification channel types. -const ( - Email = ChannelType("email") - PagerDuty = ChannelType("pagerduty") - Slack = ChannelType("slack") - WebHook = ChannelType("webhook") -) - -// Channel represents Integrated Alerting Notification Channel configuration. -// -//reform:ia_channels -type Channel struct { - ID string `reform:"id,pk"` - Summary string `reform:"summary"` - Type ChannelType `reform:"type"` - - EmailConfig *EmailConfig `reform:"email_config"` - PagerDutyConfig *PagerDutyConfig `reform:"pagerduty_config"` - SlackConfig *SlackConfig `reform:"slack_config"` - WebHookConfig *WebHookConfig `reform:"webhook_config"` - - Disabled bool `reform:"disabled"` - - CreatedAt time.Time `reform:"created_at"` - UpdatedAt time.Time `reform:"updated_at"` -} - -// BeforeInsert implements reform.BeforeInserter interface. -func (c *Channel) BeforeInsert() error { - now := Now() - c.CreatedAt = now - c.UpdatedAt = now - - return nil -} - -// BeforeUpdate implements reform.BeforeUpdater interface. -func (c *Channel) BeforeUpdate() error { - c.UpdatedAt = Now() - - return nil -} - -// AfterFind implements reform.AfterFinder interface. -func (c *Channel) AfterFind() error { - c.CreatedAt = c.CreatedAt.UTC() - c.UpdatedAt = c.UpdatedAt.UTC() - - return nil -} - -// EmailConfig is email notification channel configuration. -type EmailConfig struct { - SendResolved bool `json:"send_resolved"` - To []string `json:"to"` -} - -// Value implements database/sql/driver.Valuer interface. Should be defined on the value. -func (c EmailConfig) Value() (driver.Value, error) { return jsonValue(c) } - -// Scan implements database/sql.Scanner interface. Should be defined on the pointer. -func (c *EmailConfig) Scan(src interface{}) error { return jsonScan(c, src) } - -// PagerDutyConfig represents PagerDuty channel configuration. -type PagerDutyConfig struct { - SendResolved bool `json:"send_resolved"` - RoutingKey string `json:"routing_key,omitempty"` - ServiceKey string `json:"service_key,omitempty"` -} - -// Value implements database/sql/driver.Valuer interface. Should be defined on the value. -func (c PagerDutyConfig) Value() (driver.Value, error) { return jsonValue(c) } - -// Scan implements database/sql.Scanner interface. Should be defined on the pointer. -func (c *PagerDutyConfig) Scan(src interface{}) error { return jsonScan(c, src) } - -// SlackConfig is slack notification channel configuration. -type SlackConfig struct { - SendResolved bool `json:"send_resolved"` - Channel string `json:"channel"` -} - -// Value implements database/sql/driver.Valuer interface. Should be defined on the value. -func (c SlackConfig) Value() (driver.Value, error) { return jsonValue(c) } - -// Scan implements database/sql.Scanner interface. Should be defined on the pointer. -func (c *SlackConfig) Scan(src interface{}) error { return jsonScan(c, src) } - -// WebHookConfig is webhook notification channel configuration. -type WebHookConfig struct { - SendResolved bool ` json:"send_resolved"` - URL string ` json:"url"` - HTTPConfig *HTTPConfig ` json:"http_config,omitempty"` - MaxAlerts int32 ` json:"max_alerts"` -} - -// Value implements database/sql/driver.Valuer interface. Should be defined on the value. -func (c WebHookConfig) Value() (driver.Value, error) { return jsonValue(c) } - -// Scan implements database/sql.Scanner interface. Should be defined on the pointer. -func (c *WebHookConfig) Scan(src interface{}) error { return jsonScan(c, src) } - -// HTTPConfig is HTTP connection configuration. -type HTTPConfig struct { - BasicAuth *HTTPBasicAuth `json:"basic_auth,omitempty"` - BearerToken string `json:"bearer_token,omitempty"` - BearerTokenFile string `json:"bearer_token_file,omitempty"` - TLSConfig *TLSConfig `json:"tls_config,omitempty"` - ProxyURL string `json:"proxy_url,omitempty"` -} - -// HTTPBasicAuth is HTTP basic authentication configuration. -type HTTPBasicAuth struct { - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - PasswordFile string `json:"password_file,omitempty"` -} - -// TLSConfig is TLS configuration. -type TLSConfig struct { - CAFile string `json:"ca_file,omitempty"` - CertFile string `json:"cert_file,omitempty"` - KeyFile string `json:"key_file,omitempty"` - ServerName string `json:"server_name,omitempty"` - InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` - CAFileContent string `json:"ca_file_content,omitempty"` - CertFileContent string `json:"cert_file_content,omitempty"` - KeyFileContent string `json:"key_file_content,omitempty"` -} - -// check interfaces. -var ( - _ reform.BeforeInserter = (*Channel)(nil) - _ reform.BeforeUpdater = (*Channel)(nil) - _ reform.AfterFinder = (*Channel)(nil) -) diff --git a/managed/models/channel_helpers.go b/managed/models/channel_helpers.go deleted file mode 100644 index c39f9a24e4..0000000000 --- a/managed/models/channel_helpers.go +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models - -import ( - "fmt" - "strings" - - "github.com/google/uuid" - "github.com/pkg/errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" -) - -var invalidConfigurationError = status.Error(codes.InvalidArgument, "Channel should contain only one type of channel configuration.") - -func checkUniqueChannelID(q *reform.Querier, id string) error { - if id == "" { - panic("empty Channel ID") - } - - agent := &Channel{ID: id} - err := q.Reload(agent) - if err != nil { - if errors.Is(err, reform.ErrNoRows) { - return nil - } - return errors.WithStack(err) - } - - return status.Errorf(codes.AlreadyExists, "Channel with ID %q already exists.", id) -} - -func checkEmailConfig(c *EmailConfig) error { - if c == nil { - return status.Error(codes.InvalidArgument, "Email config is empty.") - } - - if len(c.To) == 0 { - return status.Error(codes.InvalidArgument, "Email to field is empty.") - } - - return nil -} - -func checkPagerDutyConfig(c *PagerDutyConfig) error { - if c == nil { - return status.Error(codes.InvalidArgument, "Pager duty config is empty.") - } - - if (c.RoutingKey == "" && c.ServiceKey == "") || (c.RoutingKey != "" && c.ServiceKey != "") { - return status.Error(codes.InvalidArgument, "Exactly one key should be present in pager duty configuration.") - } - - return nil -} - -func checkSlackConfig(c *SlackConfig) error { - if c == nil { - return status.Error(codes.InvalidArgument, "Slack config is empty.") - } - - if c.Channel == "" { - return status.Error(codes.InvalidArgument, "Slack channel field is empty.") - } - - return nil -} - -func checkWebHookConfig(c *WebHookConfig) error { - if c == nil { - return status.Error(codes.InvalidArgument, "Webhook config is empty.") - } - - if c.URL == "" { - return status.Error(codes.InvalidArgument, "Webhook url field is empty.") - } - - if c.HTTPConfig != nil && c.HTTPConfig.TLSConfig != nil { - tlsConfig := c.HTTPConfig.TLSConfig - if tlsConfig.CAFile != "" && tlsConfig.CAFileContent != "" { - return status.Error(codes.InvalidArgument, - "Fields CAFile and CAFileContent shouldn't be set at the same time.") - } - if tlsConfig.CertFile != "" && tlsConfig.CertFileContent != "" { - return status.Error(codes.InvalidArgument, - "Fields CertFile and CertFileContent shouldn't be set at the same time.") - } - if tlsConfig.KeyFile != "" && tlsConfig.KeyFileContent != "" { - return status.Error(codes.InvalidArgument, - "Fields KeyFile and KeyFileContent shouldn't be set at the same time.") - } - } - - return nil -} - -// FindChannels returns saved notification channels configuration. -func FindChannels(q *reform.Querier) ([]*Channel, error) { - rows, err := q.SelectAllFrom(ChannelTable, "") - if err != nil { - return nil, errors.Wrap(err, "failed to select notification channels") - } - - channels := make([]*Channel, len(rows)) - for i, s := range rows { - channels[i] = s.(*Channel) //nolint:forcetypeassert - } - - return channels, nil -} - -// FindChannelsOnPage returns a page with saved notification channels. -func FindChannelsOnPage(q *reform.Querier, pageIndex, pageSize int) ([]*Channel, error) { - rows, err := q.SelectAllFrom(ChannelTable, "ORDER BY id LIMIT $1 OFFSET $2", pageSize, pageIndex*pageSize) - if err != nil { - return nil, errors.Wrap(err, "failed to select notification channels") - } - - channels := make([]*Channel, len(rows)) - for i, s := range rows { - channels[i] = s.(*Channel) //nolint:forcetypeassert - } - - return channels, nil -} - -// CountChannels returns number of notification channels. -func CountChannels(q *reform.Querier) (int, error) { - count, err := q.Count(ChannelTable, "") - if err != nil { - return 0, errors.Wrap(err, "failed to count notification channels") - } - - return count, nil -} - -// FindChannelByID finds Channel by ID. -func FindChannelByID(q *reform.Querier, id string) (*Channel, error) { - if id == "" { - return nil, status.Error(codes.InvalidArgument, "Empty Channel ID.") - } - - channel := &Channel{ID: id} - err := q.Reload(channel) - if err != nil { - if errors.Is(err, reform.ErrNoRows) { - return nil, status.Errorf(codes.NotFound, "Channel with ID %q not found.", id) - } - return nil, errors.WithStack(err) - } - - return channel, nil -} - -// FindChannelsByIDs finds channels by IDs. -func FindChannelsByIDs(q *reform.Querier, ids []string) ([]*Channel, error) { - if len(ids) == 0 { - return []*Channel{}, nil - } - - p := strings.Join(q.Placeholders(1, len(ids)), ", ") - tail := fmt.Sprintf("WHERE id IN (%s) ORDER BY id", p) - args := make([]interface{}, len(ids)) - for i, id := range ids { - args[i] = id - } - - structs, err := q.SelectAllFrom(ChannelTable, tail, args...) - if err != nil { - return nil, errors.WithStack(err) - } - - res := make([]*Channel, len(structs)) - for i, s := range structs { - res[i] = s.(*Channel) //nolint:forcetypeassert - } - return res, nil -} - -// CreateChannelParams are params for creating new channel. -type CreateChannelParams struct { - Summary string - - EmailConfig *EmailConfig - PagerDutyConfig *PagerDutyConfig - SlackConfig *SlackConfig - WebHookConfig *WebHookConfig - - Disabled bool -} - -// CreateChannel persists notification channel. -func CreateChannel(q *reform.Querier, params *CreateChannelParams) (*Channel, error) { - id := "/channel_id/" + uuid.New().String() - - if err := checkUniqueChannelID(q, id); err != nil { - return nil, err - } - - if params.Summary == "" { - return nil, status.Error(codes.InvalidArgument, "Channel summary can't be empty.") - } - - row := &Channel{ - ID: id, - Summary: params.Summary, - Disabled: params.Disabled, - } - - if params.EmailConfig != nil { - if err := checkEmailConfig(params.EmailConfig); err != nil { - return nil, err - } - row.Type = Email - row.EmailConfig = params.EmailConfig - } - - if params.PagerDutyConfig != nil { - if row.Type != "" { - return nil, invalidConfigurationError - } - - if err := checkPagerDutyConfig(params.PagerDutyConfig); err != nil { - return nil, err - } - row.Type = PagerDuty - row.PagerDutyConfig = params.PagerDutyConfig - } - - if params.SlackConfig != nil { - if row.Type != "" { - return nil, invalidConfigurationError - } - if err := checkSlackConfig(params.SlackConfig); err != nil { - return nil, err - } - row.Type = Slack - row.SlackConfig = params.SlackConfig - } - - if params.WebHookConfig != nil { - if row.Type != "" { - return nil, invalidConfigurationError - } - if err := checkWebHookConfig(params.WebHookConfig); err != nil { - return nil, err - } - row.Type = WebHook - row.WebHookConfig = params.WebHookConfig - } - - if row.Type == "" { - return nil, status.Error(codes.InvalidArgument, "Missing channel configuration.") - } - - if err := q.Insert(row); err != nil { - return nil, errors.Wrap(err, "failed to create notifications channel") - } - - return row, nil -} - -// ChangeChannelParams is params for changing existing channel. -type ChangeChannelParams struct { - Summary string - - EmailConfig *EmailConfig - PagerDutyConfig *PagerDutyConfig - SlackConfig *SlackConfig - WebHookConfig *WebHookConfig - - Disabled bool -} - -// ChangeChannel updates existing notifications channel. -func ChangeChannel(q *reform.Querier, channelID string, params *ChangeChannelParams) (*Channel, error) { - row, err := FindChannelByID(q, channelID) - if err != nil { - return nil, err - } - - // remove previous configuration - row.Type = "" - row.EmailConfig = nil - row.PagerDutyConfig = nil - row.SlackConfig = nil - row.WebHookConfig = nil - - if params.Summary != "" { - row.Summary = params.Summary - } - - if params.EmailConfig != nil { - if err := checkEmailConfig(params.EmailConfig); err != nil { - return nil, err - } - row.Type = Email - row.EmailConfig = params.EmailConfig - } - - if params.PagerDutyConfig != nil { - if row.Type != "" { - return nil, invalidConfigurationError - } - - if err := checkPagerDutyConfig(params.PagerDutyConfig); err != nil { - return nil, err - } - row.Type = PagerDuty - row.PagerDutyConfig = params.PagerDutyConfig - } - - if params.SlackConfig != nil { - if row.Type != "" { - return nil, invalidConfigurationError - } - if err := checkSlackConfig(params.SlackConfig); err != nil { - return nil, err - } - row.Type = Slack - row.SlackConfig = params.SlackConfig - } - - if params.WebHookConfig != nil { - if row.Type != "" { - return nil, invalidConfigurationError - } - if err := checkWebHookConfig(params.WebHookConfig); err != nil { - return nil, err - } - row.Type = WebHook - row.WebHookConfig = params.WebHookConfig - } - - row.Disabled = params.Disabled - - if err = q.Update(row); err != nil { - return nil, errors.Wrap(err, "failed to update notifications channel") - } - - return row, nil -} - -// RemoveChannel removes notification channel with specified id. -func RemoveChannel(q *reform.Querier, id string) error { - channel, err := FindChannelByID(q, id) - if err != nil { - return err - } - - inUse, err := channelInUse(q, id) - if err != nil { - return err - } - - if inUse { - return status.Errorf(codes.FailedPrecondition, `You can't delete the "%s" channel when it's being used by a rule.`, channel.Summary) - } - - if err = q.Delete(&Channel{ID: id}); err != nil { - return errors.Wrap(err, "failed to delete notification channel") - } - - return nil -} - -func channelInUse(q *reform.Querier, id string) (bool, error) { - _, err := q.SelectOneFrom(RuleTable, "WHERE channel_ids ? $1", id) - if err != nil { - if errors.Is(err, reform.ErrNoRows) { - return false, nil - } - return false, errors.WithStack(err) - } - return true, nil -} diff --git a/managed/models/channel_helpers_test.go b/managed/models/channel_helpers_test.go deleted file mode 100644 index e6531021e7..0000000000 --- a/managed/models/channel_helpers_test.go +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models_test - -import ( - "testing" - - "github.com/google/uuid" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" -) - -func TestNotificationChannels(t *testing.T) { - sqlDB := testdb.Open(t, models.SkipFixtures, nil) - defer func() { - require.NoError(t, sqlDB.Close()) - }() - db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - - t.Run("create", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - params := models.CreateChannelParams{ - Summary: "some summary", - EmailConfig: &models.EmailConfig{ - To: []string{"test@test.test"}, - }, - Disabled: false, - } - - expected, err := models.CreateChannel(q, ¶ms) - require.NoError(t, err) - assert.Equal(t, models.Email, expected.Type) - assert.Equal(t, params.Summary, expected.Summary) - assert.Equal(t, params.Disabled, expected.Disabled) - assert.Equal(t, params.EmailConfig.SendResolved, expected.EmailConfig.SendResolved) - assert.EqualValues(t, params.EmailConfig.SendResolved, expected.EmailConfig.SendResolved) - - actual, err := models.FindChannelByID(q, expected.ID) - require.NoError(t, err) - assert.Equal(t, expected, actual) - }) - t.Run("create with textual tls config", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - tlsConfig := &models.TLSConfig{ - CAFileContent: "cafilecontent", - CertFileContent: "certfilecontent", - KeyFileContent: "keyfilecontent", - } - params := models.CreateChannelParams{ - Summary: "some summary", - WebHookConfig: &models.WebHookConfig{ - URL: "example.com", - HTTPConfig: &models.HTTPConfig{ - TLSConfig: tlsConfig, - }, - }, - Disabled: false, - } - - expected, err := models.CreateChannel(q, ¶ms) - require.NoError(t, err) - assert.Equal(t, models.WebHook, expected.Type) - assert.Equal(t, params.Summary, expected.Summary) - assert.Equal(t, params.Disabled, expected.Disabled) - - actual, err := models.FindChannelByID(q, expected.ID) - require.NoError(t, err) - assert.Equal(t, expected, actual) - require.NotNil(t, actual.WebHookConfig) - require.NotNil(t, actual.WebHookConfig.HTTPConfig) - require.NotNil(t, actual.WebHookConfig.HTTPConfig.TLSConfig) - assert.Equal(t, tlsConfig.CAFileContent, actual.WebHookConfig.HTTPConfig.TLSConfig.CAFileContent) - assert.Equal(t, tlsConfig.CertFileContent, actual.WebHookConfig.HTTPConfig.TLSConfig.CertFileContent) - assert.Equal(t, tlsConfig.KeyFileContent, actual.WebHookConfig.HTTPConfig.TLSConfig.KeyFileContent) - }) - - t.Run("change", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - createParams := &models.CreateChannelParams{ - Summary: "some summary", - EmailConfig: &models.EmailConfig{ - To: []string{"test@test.test"}, - SendResolved: false, - }, - Disabled: false, - } - - created, err := models.CreateChannel(q, createParams) - require.NoError(t, err) - - updateParams := &models.ChangeChannelParams{ - Summary: "completely new summary", - SlackConfig: &models.SlackConfig{ - SendResolved: true, - Channel: "general", - }, - Disabled: true, - } - - updated, err := models.ChangeChannel(q, created.ID, updateParams) - require.NoError(t, err) - assert.Equal(t, models.Slack, updated.Type) - assert.Equal(t, updateParams.Summary, updated.Summary) - assert.Equal(t, updateParams.Disabled, updated.Disabled) - assert.Nil(t, updated.EmailConfig) - assert.Equal(t, updateParams.SlackConfig.Channel, updated.SlackConfig.Channel) - assert.EqualValues(t, updateParams.SlackConfig.SendResolved, updated.SlackConfig.SendResolved) - - actual, err := models.FindChannelByID(q, created.ID) - require.NoError(t, err) - assert.Equal(t, updated, actual) - }) - - t.Run("remove", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - channel := createChannel(t, q) - - err = models.RemoveChannel(q, channel.ID) - require.NoError(t, err) - - cs, err := models.FindChannels(q) - require.NoError(t, err) - assert.Len(t, cs, 0) - }) - - t.Run("remove channel in use", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template, err := models.CreateTemplate(q, createTemplateParams(uuid.New().String())) - require.NoError(t, err) - - channel := createChannel(t, q) - - _ = createRule(t, q, channel.ID, template) - - err = models.RemoveChannel(q, channel.ID) - tests.AssertGRPCError(t, status.Newf(codes.FailedPrecondition, `You can't delete the "%s" channel when it's being used by a rule.`, channel.Summary), err) - - cs, err := models.FindChannels(q) - require.NoError(t, err) - assert.NotEmpty(t, cs) - }) - - t.Run("find", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - params1 := models.CreateChannelParams{ - Summary: "some summary", - EmailConfig: &models.EmailConfig{ - To: []string{"test@test.test"}, - }, - Disabled: false, - } - expected1, err := models.CreateChannel(q, ¶ms1) - require.NoError(t, err) - - params2 := models.CreateChannelParams{ - Summary: "another summary", - EmailConfig: &models.EmailConfig{ - To: []string{"test2@test.test"}, - }, - Disabled: true, - } - expected2, err := models.CreateChannel(q, ¶ms2) - require.NoError(t, err) - - actual, err := models.FindChannels(q) - require.NoError(t, err) - var found1, found2 bool - for _, channel := range actual { - if channel.ID == expected1.ID { - found1 = true - } - if channel.ID == expected2.ID { - found2 = true - } - } - - assert.True(t, found1, "Fist channel not found") - assert.True(t, found2, "Second channel not found") - }) -} - -func TestChannelValidation(t *testing.T) { - sqlDB := testdb.Open(t, models.SkipFixtures, nil) - defer func() { - require.NoError(t, sqlDB.Close()) - }() - db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - - cases := []struct { - name string - channel models.CreateChannelParams - errorMsg string - }{ - { - name: "normal email config", - channel: models.CreateChannelParams{ - Summary: "some summary", - EmailConfig: &models.EmailConfig{ - To: []string{"test@test.test"}, - }, - Disabled: false, - }, - errorMsg: "", - }, - { - name: "normal pager duty config", - channel: models.CreateChannelParams{ - Summary: "some summary", - PagerDutyConfig: &models.PagerDutyConfig{ - SendResolved: false, - RoutingKey: "some key", - }, - Disabled: false, - }, - errorMsg: "", - }, - { - name: "normal slack config", - channel: models.CreateChannelParams{ - Summary: "some summary", - SlackConfig: &models.SlackConfig{ - Channel: "channel", - }, - Disabled: false, - }, - errorMsg: "", - }, - { - name: "normal webhook config", - channel: models.CreateChannelParams{ - Summary: "some summary", - WebHookConfig: &models.WebHookConfig{ - URL: "test.test", - }, - Disabled: false, - }, - errorMsg: "", - }, - { - name: "missing summary", - channel: models.CreateChannelParams{ - Summary: "", - EmailConfig: &models.EmailConfig{ - To: []string{"test@test.test"}, - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Channel summary can't be empty.", - }, - { - name: "missing email config", - channel: models.CreateChannelParams{ - Summary: "some summary", - EmailConfig: nil, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Missing channel configuration.", - }, - { - name: "missing pager duty config", - channel: models.CreateChannelParams{ - Summary: "some summary", - PagerDutyConfig: nil, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Missing channel configuration.", - }, - { - name: "missing slack config", - channel: models.CreateChannelParams{ - Summary: "some summary", - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Missing channel configuration.", - }, - { - name: "missing webhook config", - channel: models.CreateChannelParams{ - Summary: "some summary", - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Missing channel configuration.", - }, - { - name: "missing to field in email configuration", - channel: models.CreateChannelParams{ - Summary: "some summary", - EmailConfig: &models.EmailConfig{ - To: nil, - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Email to field is empty.", - }, - { - name: "no keys set in pager duty config", - channel: models.CreateChannelParams{ - Summary: "some summary", - PagerDutyConfig: &models.PagerDutyConfig{ - SendResolved: false, - RoutingKey: "", - ServiceKey: "", - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Exactly one key should be present in pager duty configuration.", - }, - { - name: "both keys set in pager duty config", - channel: models.CreateChannelParams{ - Summary: "some summary", - PagerDutyConfig: &models.PagerDutyConfig{ - SendResolved: false, - RoutingKey: "some key", - ServiceKey: "some key", - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Exactly one key should be present in pager duty configuration.", - }, - { - name: "missing channel in slack configuration", - channel: models.CreateChannelParams{ - Summary: "some summary", - SlackConfig: &models.SlackConfig{ - Channel: "", - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Slack channel field is empty.", - }, - { - name: "missing url in webhook configuration", - channel: models.CreateChannelParams{ - Summary: "some summary", - WebHookConfig: &models.WebHookConfig{ - URL: "", - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Webhook url field is empty.", - }, - { - name: "multiple configurations", - channel: models.CreateChannelParams{ - Summary: "some summary", - EmailConfig: &models.EmailConfig{ - To: []string{"test@test.test"}, - }, - WebHookConfig: &models.WebHookConfig{ - URL: "example.com", - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Channel should contain only one type of channel configuration.", - }, - { - name: "both CAFile and CAFileContent are set", - channel: models.CreateChannelParams{ - Summary: "some summary", - WebHookConfig: &models.WebHookConfig{ - URL: "example.com", - HTTPConfig: &models.HTTPConfig{ - TLSConfig: &models.TLSConfig{ - CAFile: "cafile", - CAFileContent: "cafile content", - }, - }, - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Fields CAFile and CAFileContent shouldn't be set at the same time.", - }, - { - name: "both CertFile and CertFileContent are set", - channel: models.CreateChannelParams{ - Summary: "some summary", - WebHookConfig: &models.WebHookConfig{ - URL: "example.com", - HTTPConfig: &models.HTTPConfig{ - TLSConfig: &models.TLSConfig{ - CertFile: "certfile", - CertFileContent: "certfile content", - }, - }, - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Fields CertFile and CertFileContent shouldn't be set at the same time.", - }, - { - name: "both KeyFile and KeyFileContent are set", - channel: models.CreateChannelParams{ - Summary: "some summary", - WebHookConfig: &models.WebHookConfig{ - URL: "example.com", - HTTPConfig: &models.HTTPConfig{ - TLSConfig: &models.TLSConfig{ - KeyFile: "keyfile", - KeyFileContent: "keyfile content", - }, - }, - }, - Disabled: false, - }, - errorMsg: "rpc error: code = InvalidArgument desc = Fields KeyFile and KeyFileContent shouldn't be set at the same time.", - }, - } - - for _, test := range cases { - test := test - - t.Run(test.name, func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - c, err := models.CreateChannel(q, &test.channel) - if test.errorMsg != "" { - assert.EqualError(t, err, test.errorMsg) - return - } - assert.NoError(t, err) - assert.NotNil(t, c) - }) - } -} diff --git a/managed/models/channel_reform.go b/managed/models/channel_reform.go deleted file mode 100644 index faee5f1943..0000000000 --- a/managed/models/channel_reform.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by gopkg.in/reform.v1. DO NOT EDIT. - -package models - -import ( - "fmt" - "strings" - - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/parse" -) - -type channelTableType struct { - s parse.StructInfo - z []interface{} -} - -// Schema returns a schema name in SQL database (""). -func (v *channelTableType) Schema() string { - return v.s.SQLSchema -} - -// Name returns a view or table name in SQL database ("ia_channels"). -func (v *channelTableType) Name() string { - return v.s.SQLName -} - -// Columns returns a new slice of column names for that view or table in SQL database. -func (v *channelTableType) Columns() []string { - return []string{ - "id", - "summary", - "type", - "email_config", - "pagerduty_config", - "slack_config", - "webhook_config", - "disabled", - "created_at", - "updated_at", - } -} - -// NewStruct makes a new struct for that view or table. -func (v *channelTableType) NewStruct() reform.Struct { - return new(Channel) -} - -// NewRecord makes a new record for that table. -func (v *channelTableType) NewRecord() reform.Record { - return new(Channel) -} - -// PKColumnIndex returns an index of primary key column for that table in SQL database. -func (v *channelTableType) PKColumnIndex() uint { - return uint(v.s.PKFieldIndex) -} - -// ChannelTable represents ia_channels view or table in SQL database. -var ChannelTable = &channelTableType{ - s: parse.StructInfo{ - Type: "Channel", - SQLName: "ia_channels", - Fields: []parse.FieldInfo{ - {Name: "ID", Type: "string", Column: "id"}, - {Name: "Summary", Type: "string", Column: "summary"}, - {Name: "Type", Type: "ChannelType", Column: "type"}, - {Name: "EmailConfig", Type: "*EmailConfig", Column: "email_config"}, - {Name: "PagerDutyConfig", Type: "*PagerDutyConfig", Column: "pagerduty_config"}, - {Name: "SlackConfig", Type: "*SlackConfig", Column: "slack_config"}, - {Name: "WebHookConfig", Type: "*WebHookConfig", Column: "webhook_config"}, - {Name: "Disabled", Type: "bool", Column: "disabled"}, - {Name: "CreatedAt", Type: "time.Time", Column: "created_at"}, - {Name: "UpdatedAt", Type: "time.Time", Column: "updated_at"}, - }, - PKFieldIndex: 0, - }, - z: new(Channel).Values(), -} - -// String returns a string representation of this struct or record. -func (s Channel) String() string { - res := make([]string, 10) - res[0] = "ID: " + reform.Inspect(s.ID, true) - res[1] = "Summary: " + reform.Inspect(s.Summary, true) - res[2] = "Type: " + reform.Inspect(s.Type, true) - res[3] = "EmailConfig: " + reform.Inspect(s.EmailConfig, true) - res[4] = "PagerDutyConfig: " + reform.Inspect(s.PagerDutyConfig, true) - res[5] = "SlackConfig: " + reform.Inspect(s.SlackConfig, true) - res[6] = "WebHookConfig: " + reform.Inspect(s.WebHookConfig, true) - res[7] = "Disabled: " + reform.Inspect(s.Disabled, true) - res[8] = "CreatedAt: " + reform.Inspect(s.CreatedAt, true) - res[9] = "UpdatedAt: " + reform.Inspect(s.UpdatedAt, true) - return strings.Join(res, ", ") -} - -// Values returns a slice of struct or record field values. -// Returned interface{} values are never untyped nils. -func (s *Channel) Values() []interface{} { - return []interface{}{ - s.ID, - s.Summary, - s.Type, - s.EmailConfig, - s.PagerDutyConfig, - s.SlackConfig, - s.WebHookConfig, - s.Disabled, - s.CreatedAt, - s.UpdatedAt, - } -} - -// Pointers returns a slice of pointers to struct or record fields. -// Returned interface{} values are never untyped nils. -func (s *Channel) Pointers() []interface{} { - return []interface{}{ - &s.ID, - &s.Summary, - &s.Type, - &s.EmailConfig, - &s.PagerDutyConfig, - &s.SlackConfig, - &s.WebHookConfig, - &s.Disabled, - &s.CreatedAt, - &s.UpdatedAt, - } -} - -// View returns View object for that struct. -func (s *Channel) View() reform.View { - return ChannelTable -} - -// Table returns Table object for that record. -func (s *Channel) Table() reform.Table { - return ChannelTable -} - -// PKValue returns a value of primary key for that record. -// Returned interface{} value is never untyped nil. -func (s *Channel) PKValue() interface{} { - return s.ID -} - -// PKPointer returns a pointer to primary key field for that record. -// Returned interface{} value is never untyped nil. -func (s *Channel) PKPointer() interface{} { - return &s.ID -} - -// HasPK returns true if record has non-zero primary key set, false otherwise. -func (s *Channel) HasPK() bool { - return s.ID != ChannelTable.z[ChannelTable.s.PKFieldIndex] -} - -// SetPK sets record primary key, if possible. -// -// Deprecated: prefer direct field assignment where possible: s.ID = pk. -func (s *Channel) SetPK(pk interface{}) { - reform.SetPK(s, pk) -} - -// check interfaces -var ( - _ reform.View = ChannelTable - _ reform.Struct = (*Channel)(nil) - _ reform.Table = ChannelTable - _ reform.Record = (*Channel)(nil) - _ fmt.Stringer = (*Channel)(nil) -) - -func init() { - parse.AssertUpToDate(&ChannelTable.s, new(Channel)) -} diff --git a/managed/models/database.go b/managed/models/database.go index 4897a7d3cb..4abfe803a9 100644 --- a/managed/models/database.go +++ b/managed/models/database.go @@ -915,6 +915,11 @@ var databaseSchema = [][]string{ `ALTER TABLE agents ALTER COLUMN comments_parsing_disabled DROP DEFAULT`, }, + 85: { + `DROP TABLE IF EXISTS ia_channels`, + `DROP TABLE IF EXISTS ia_rules`, + `ALTER TABLE ia_templates RENAME TO alert_rule_templates`, + }, } // ^^^ Avoid default values in schema definition. ^^^ diff --git a/managed/models/rule_helpers.go b/managed/models/rule_helpers.go deleted file mode 100644 index 38620c1c8e..0000000000 --- a/managed/models/rule_helpers.go +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models - -import ( - "encoding/json" - "time" - - "github.com/google/uuid" - "github.com/pkg/errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" -) - -func checkUniqueRuleID(q *reform.Querier, id string) error { - if id == "" { - panic("empty Rule ID") - } - - rule := &Rule{ID: id} - err := q.Reload(rule) - if err != nil { - if errors.Is(err, reform.ErrNoRows) { - return nil - } - return errors.WithStack(err) - } - - return status.Errorf(codes.AlreadyExists, "Rule with ID %q already exists.", id) -} - -// FindRules returns saved alert rules configuration. -func FindRules(q *reform.Querier) ([]*Rule, error) { - rows, err := q.SelectAllFrom(RuleTable, "") - if err != nil { - return nil, errors.Wrap(err, "failed to select alert rules") - } - - rules := make([]*Rule, len(rows)) - for i, s := range rows { - rules[i] = s.(*Rule) //nolint:forcetypeassert - } - - return rules, nil -} - -// FindRulesOnPage returns a page with saved alert rules configuration. -func FindRulesOnPage(q *reform.Querier, pageIndex, pageSize int) ([]*Rule, error) { - rows, err := q.SelectAllFrom(RuleTable, "ORDER BY id LIMIT $1 OFFSET $2", pageSize, pageIndex*pageSize) - if err != nil { - return nil, errors.Wrap(err, "failed to select alert rules") - } - - rules := make([]*Rule, len(rows)) - for i, s := range rows { - rules[i] = s.(*Rule) //nolint:forcetypeassert - } - - return rules, nil -} - -// CountRules returns number of alert rules. -func CountRules(q *reform.Querier) (int, error) { - count, err := q.Count(RuleTable, "") - if err != nil { - return 0, errors.Wrap(err, "failed to count alert rules") - } - - return count, nil -} - -// FindRuleByID finds Rule by ID. -func FindRuleByID(q *reform.Querier, id string) (*Rule, error) { - if id == "" { - return nil, status.Error(codes.InvalidArgument, "Empty Rule ID.") - } - - rule := &Rule{ID: id} - err := q.Reload(rule) - if err != nil { - if errors.Is(err, reform.ErrNoRows) { - return nil, status.Errorf(codes.NotFound, "Rule with ID %q not found.", id) - } - return nil, errors.WithStack(err) - } - - return rule, nil -} - -// CreateRuleParams are params for creating new Rule. -type CreateRuleParams struct { - Name string - TemplateName string - Summary string - Disabled bool - ExprTemplate string - ParamsDefinitions AlertExprParamsDefinitions - ParamsValues AlertExprParamsValues - DefaultFor time.Duration - For time.Duration - DefaultSeverity Severity - Severity Severity - CustomLabels map[string]string - Labels map[string]string - Annotations map[string]string - Filters Filters - ChannelIDs []string -} - -// CreateRule persists alert Rule. -func CreateRule(q *reform.Querier, params *CreateRuleParams) (*Rule, error) { - id := "/rule_id/" + uuid.New().String() - var err error - if err = checkUniqueRuleID(q, id); err != nil { - return nil, err - } - - row := &Rule{ - ID: id, - Name: params.Name, - TemplateName: params.TemplateName, - Summary: params.Summary, - Disabled: params.Disabled, - ExprTemplate: params.ExprTemplate, - ParamsDefinitions: params.ParamsDefinitions, - ParamsValues: params.ParamsValues, - DefaultFor: params.DefaultFor, - For: params.For, - DefaultSeverity: params.DefaultSeverity, - Severity: params.Severity, - Filters: params.Filters, - } - - if len(params.ChannelIDs) != 0 { - channelIDs := deduplicateStrings(params.ChannelIDs) - channels, err := FindChannelsByIDs(q, channelIDs) - if err != nil { - return nil, err - } - - if len(channelIDs) != len(channels) { - missingChannelsIDs := findMissingChannels(channelIDs, channels) - return nil, status.Errorf(codes.NotFound, "Failed to find all required channels: %v.", missingChannelsIDs) - } - - row.ChannelIDs = channelIDs - } - - if err = row.SetCustomLabels(params.CustomLabels); err != nil { - return nil, err - } - - if err = row.SetLabels(params.Labels); err != nil { - return nil, err - } - - if err = row.SetAnnotations(params.Annotations); err != nil { - return nil, err - } - - if err = q.Insert(row); err != nil { - return nil, errors.Wrap(err, "failed to create alert rule") - } - - return row, nil -} - -// ChangeRuleParams is params for updating existing Rule. -type ChangeRuleParams struct { - Name string - Disabled bool - ParamsValues AlertExprParamsValues - For time.Duration - Severity Severity - CustomLabels map[string]string - Filters Filters - ChannelIDs []string -} - -// ChangeRule updates existing alerts Rule. -func ChangeRule(q *reform.Querier, ruleID string, params *ChangeRuleParams) (*Rule, error) { - row, err := FindRuleByID(q, ruleID) - if err != nil { - return nil, err - } - - channelIDs := deduplicateStrings(params.ChannelIDs) - channels, err := FindChannelsByIDs(q, channelIDs) - if err != nil { - return nil, errors.Wrap(err, "failed to find channels") - } - - if len(channelIDs) != len(channels) { - missingChannelsIDs := findMissingChannels(channelIDs, channels) - return nil, status.Errorf(codes.NotFound, "Failed to find all required channels: %v.", missingChannelsIDs) - } - - row.Name = params.Name - row.Disabled = params.Disabled - row.For = params.For - row.Severity = params.Severity - row.Filters = params.Filters - row.ParamsValues = params.ParamsValues - - labels, err := json.Marshal(params.CustomLabels) - if err != nil { - return nil, errors.Wrap(err, "failed to update alert rule") - } - row.CustomLabels = labels - row.ChannelIDs = params.ChannelIDs - - if err = q.Update(row); err != nil { - return nil, errors.Wrap(err, "failed to change alerts Rule") - } - - return row, nil -} - -// ToggleRuleParams represents rule toggle parameters. -type ToggleRuleParams struct { - Disabled *bool // nil - do not change -} - -// ToggleRule updates some alert rule fields. -func ToggleRule(q *reform.Querier, ruleID string, params *ToggleRuleParams) (*Rule, error) { - row, err := FindRuleByID(q, ruleID) - if err != nil { - return nil, err - } - - if params.Disabled == nil { - return row, nil - } - - row.Disabled = *params.Disabled - - if err = q.Update(row); err != nil { - return nil, errors.Wrap(err, "failed to toggle alerts Rule") - } - - return row, nil -} - -// RemoveRule removes alert Rule with specified id. -func RemoveRule(q *reform.Querier, id string) error { - var err error - if _, err = FindRuleByID(q, id); err != nil { - return err - } - - if err = q.Delete(&Rule{ID: id}); err != nil { - return errors.Wrap(err, "failed to delete alert Rule") - } - return nil -} - -func findMissingChannels(ids []string, channels []*Channel) []string { - m := make(map[string]bool, len(ids)) - for _, id := range ids { - m[id] = false - } - - for _, channel := range channels { - if _, ok := m[channel.ID]; ok { - m[channel.ID] = true - } - } - - var res []string - for k, v := range m { - if !v { - res = append(res, k) - } - } - - return res -} diff --git a/managed/models/rule_helpers_test.go b/managed/models/rule_helpers_test.go deleted file mode 100644 index f6c02c2c14..0000000000 --- a/managed/models/rule_helpers_test.go +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models_test - -import ( - "testing" - "time" - - "github.com/google/uuid" - "github.com/percona-platform/saas/pkg/common" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" -) - -func TestRules(t *testing.T) { - sqlDB := testdb.Open(t, models.SkipFixtures, nil) - db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - - nonEmptyFilters := []models.Filter{{Type: models.Equal, Key: "value", Val: "10"}} - - t.Run("create", func(t *testing.T) { - t.Run("normal", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template := createTemplate(t, q) - channel := createChannel(t, q) - - params := createCreateRuleParams(t, template, channel.ID, nonEmptyFilters) - rule, err := models.CreateRule(q, params) - require.NoError(t, err) - - assert.NotEmpty(t, rule.ID) - assert.Equal(t, template.Name, rule.TemplateName) - assert.Equal(t, template.Summary, rule.Summary) - assert.Equal(t, template.Severity, rule.DefaultSeverity) - assert.Equal(t, template.For, rule.DefaultFor) - assert.Equal(t, params.Name, rule.Name) - assert.Equal(t, params.Disabled, rule.Disabled) - assert.Equal(t, params.ParamsValues, rule.ParamsValues) - assert.Equal(t, params.For, rule.For) - assert.Equal(t, models.Severity(common.Warning), rule.Severity) - - customLabels, err := rule.GetCustomLabels() - require.NoError(t, err) - assert.Equal(t, params.CustomLabels, customLabels) - - labels, err := rule.GetLabels() - require.NoError(t, err) - templateLabels, err := template.GetLabels() - require.NoError(t, err) - assert.Equal(t, templateLabels, labels) - - annotations, err := rule.GetAnnotations() - require.NoError(t, err) - templateAnnotations, err := template.GetAnnotations() - require.NoError(t, err) - assert.Equal(t, templateAnnotations, annotations) - - assert.Equal(t, params.Filters, rule.Filters) - assert.ElementsMatch(t, params.ChannelIDs, rule.ChannelIDs) - }) - - t.Run("rule without channel and filters", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template := createTemplate(t, q) - - params := createCreateRuleParams(t, template, "", nil) - rule, err := models.CreateRule(q, params) - require.NoError(t, err) - - assert.NotEmpty(t, rule.ID) - assert.Equal(t, template.Name, rule.TemplateName) - assert.Equal(t, template.Summary, rule.Summary) - assert.Equal(t, template.Severity, rule.DefaultSeverity) - assert.Equal(t, template.For, rule.DefaultFor) - assert.Equal(t, params.Name, rule.Name) - assert.Equal(t, params.Disabled, rule.Disabled) - assert.Equal(t, params.ParamsValues, rule.ParamsValues) - assert.Equal(t, params.For, rule.For) - assert.Equal(t, models.Severity(common.Warning), rule.Severity) - - customLabels, err := rule.GetCustomLabels() - require.NoError(t, err) - assert.Equal(t, params.CustomLabels, customLabels) - - labels, err := rule.GetLabels() - require.NoError(t, err) - templateLabels, err := template.GetLabels() - require.NoError(t, err) - assert.Equal(t, templateLabels, labels) - - annotations, err := rule.GetAnnotations() - require.NoError(t, err) - templateAnnotations, err := template.GetAnnotations() - require.NoError(t, err) - assert.Equal(t, templateAnnotations, annotations) - - assert.Nil(t, rule.Filters) - assert.Empty(t, rule.ChannelIDs) - }) - - t.Run("unknown channel", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template := createTemplate(t, q) - channelID := uuid.New().String() - - params := createCreateRuleParams(t, template, channelID, nonEmptyFilters) - _, err = models.CreateRule(q, params) - tests.AssertGRPCError(t, status.Newf(codes.NotFound, "Failed to find all required channels: %v.", []string{channelID}), err) - }) - }) - - t.Run("change", func(t *testing.T) { - t.Run("normal", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template := createTemplate(t, q) - channel := createChannel(t, q) - rule, err := models.CreateRule(q, createCreateRuleParams(t, template, channel.ID, nonEmptyFilters)) - require.NoError(t, err) - - newChannel := createChannel(t, q) - - params := &models.ChangeRuleParams{ - Name: "summary", - Disabled: false, - ParamsValues: nil, - For: 3 * time.Second, - Severity: models.Severity(common.Info), - CustomLabels: map[string]string{"test": "example"}, - Filters: []models.Filter{{Type: models.Equal, Key: "number", Val: "42"}}, - ChannelIDs: []string{newChannel.ID}, - } - - updated, err := models.ChangeRule(q, rule.ID, params) - require.NoError(t, err) - - assert.NotEmpty(t, rule.ID, updated.ID) - assert.Equal(t, template.Name, updated.TemplateName) - assert.Equal(t, template.Summary, updated.Summary) - assert.Equal(t, template.Severity, updated.DefaultSeverity) - assert.Equal(t, template.For, updated.DefaultFor) - assert.Equal(t, params.Name, updated.Name) - assert.Equal(t, params.Disabled, updated.Disabled) - assert.Equal(t, params.ParamsValues, updated.ParamsValues) - assert.Equal(t, params.For, updated.For) - assert.Equal(t, models.Severity(common.Info), updated.Severity) - - labels, err := updated.GetCustomLabels() - require.NoError(t, err) - assert.Equal(t, params.CustomLabels, labels) - assert.Equal(t, params.Filters, updated.Filters) - assert.ElementsMatch(t, params.ChannelIDs, updated.ChannelIDs) - }) - - t.Run("unknown channel", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template := createTemplate(t, q) - channel := createChannel(t, q) - rule, err := models.CreateRule(q, createCreateRuleParams(t, template, channel.ID, nonEmptyFilters)) - require.NoError(t, err) - - newChannelID := uuid.New().String() - - params := &models.ChangeRuleParams{ - Disabled: false, - ParamsValues: nil, - For: 3 * time.Second, - Severity: models.Severity(common.Info), - CustomLabels: map[string]string{"test": "example"}, - Filters: []models.Filter{{Type: models.Equal, Key: "number", Val: "42"}}, - ChannelIDs: []string{newChannelID}, - } - - _, err = models.ChangeRule(q, rule.ID, params) - tests.AssertGRPCError(t, status.Newf(codes.NotFound, "Failed to find all required channels: %v.", []string{newChannelID}), err) - }) - }) - - t.Run("remove", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template := createTemplate(t, q) - channel := createChannel(t, q) - - params := createCreateRuleParams(t, template, channel.ID, nonEmptyFilters) - rule, err := models.CreateRule(q, params) - require.NoError(t, err) - - err = models.RemoveRule(q, rule.ID) - require.NoError(t, err) - - rules, err := models.FindRules(q) - require.NoError(t, err) - assert.Empty(t, rules) - }) - - t.Run("list", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template := createTemplate(t, q) - channel := createChannel(t, q) - - params := createCreateRuleParams(t, template, channel.ID, nonEmptyFilters) - rule, err := models.CreateRule(q, params) - require.NoError(t, err) - - rules, err := models.FindRules(q) - require.NoError(t, err) - assert.Len(t, rules, 1) - - actual := rules[0] - assert.NotEmpty(t, rule.ID) - assert.Equal(t, rule.Summary, actual.Summary) - assert.Equal(t, rule.TemplateName, actual.TemplateName) - assert.Equal(t, rule.Disabled, actual.Disabled) - assert.Equal(t, rule.ParamsValues, actual.ParamsValues) - assert.Equal(t, rule.For, actual.For) - assert.Equal(t, rule.Severity, actual.Severity) - assert.Equal(t, rule.CustomLabels, actual.CustomLabels) - assert.Equal(t, rule.Filters, actual.Filters) - assert.ElementsMatch(t, rule.ChannelIDs, actual.ChannelIDs) - }) -} - -func createCreateRuleParams(t *testing.T, template *models.Template, channelID string, filters []models.Filter) *models.CreateRuleParams { - t.Helper() - - labels, err := template.GetLabels() - require.NoError(t, err) - - annotations, err := template.GetAnnotations() - require.NoError(t, err) - - rule := &models.CreateRuleParams{ - TemplateName: template.Name, - Name: "rule name", - Summary: template.Summary, - Disabled: true, - ParamsValues: []models.AlertExprParamValue{ - { - Name: "test", - Type: models.Float, - FloatValue: 3.14, - }, - }, - DefaultFor: template.For, - For: 5 * time.Second, - DefaultSeverity: template.Severity, - Severity: models.Severity(common.Warning), - CustomLabels: map[string]string{"foo": "bar"}, - Labels: labels, - Annotations: annotations, - } - if channelID != "" { - rule.ChannelIDs = []string{channelID} - } - - if filters != nil { - rule.Filters = filters - } - - return rule -} - -func createTemplate(t *testing.T, q *reform.Querier) *models.Template { - t.Helper() - - template, err := models.CreateTemplate(q, createTemplateParams(uuid.New().String())) - require.NoError(t, err) - return template -} - -func createChannel(t *testing.T, q *reform.Querier) *models.Channel { - t.Helper() - - params := models.CreateChannelParams{ - Summary: "some summary", - EmailConfig: &models.EmailConfig{ - To: []string{"test@test.test"}, - }, - Disabled: false, - } - - channel, err := models.CreateChannel(q, ¶ms) - require.NoError(t, err) - - return channel -} diff --git a/managed/models/rule_model.go b/managed/models/rule_model.go index 5866910bec..18b276ba4a 100644 --- a/managed/models/rule_model.go +++ b/managed/models/rule_model.go @@ -1,196 +1,69 @@ // Copyright (C) 2017 Percona LLC +// // +// // This program is free software: you can redistribute it and/or modify +// // it under the terms of the GNU Affero General Public License as published by +// // the Free Software Foundation, either version 3 of the License, or +// // (at your option) any later version. +// // +// // This program is distributed in the hope that it will be useful, +// // but WITHOUT ANY WARRANTY; without even the implied warranty of +// // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// // GNU Affero General Public License for more details. +// // +// // You should have received a copy of the GNU Affero General Public License +// // along with this program. If not, see . +package models + // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// import ( +// "database/sql/driver" // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. +// "gopkg.in/reform.v1" +// ) // -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models - -import ( - "database/sql/driver" - "fmt" - "time" - - "gopkg.in/reform.v1" -) - -//go:generate ../../bin/reform - -// Rule represents alert rule configuration. +// // FilterType represents rule filter type. +// type FilterType string // -//reform:ia_rules -type Rule struct { - ID string `reform:"id,pk"` - Name string `reform:"name"` - Summary string `reform:"summary"` - TemplateName string `reform:"template_name"` - Disabled bool `reform:"disabled"` - ExprTemplate string `reform:"expr_template"` - ParamsDefinitions AlertExprParamsDefinitions `reform:"params_definitions"` - ParamsValues AlertExprParamsValues `reform:"params_values"` - DefaultFor time.Duration `reform:"default_for"` - For time.Duration `reform:"for"` - DefaultSeverity Severity `reform:"default_severity"` - Severity Severity `reform:"severity"` - CustomLabels []byte `reform:"custom_labels"` - Labels []byte `reform:"labels"` - Annotations []byte `reform:"annotations"` - Filters Filters `reform:"filters"` - ChannelIDs ChannelIDs `reform:"channel_ids"` - CreatedAt time.Time `reform:"created_at"` - UpdatedAt time.Time `reform:"updated_at"` -} - -// BeforeInsert implements reform.BeforeInserter interface. -func (r *Rule) BeforeInsert() error { - now := Now() - r.CreatedAt = now - r.UpdatedAt = now - return nil -} - -// BeforeUpdate implements reform.BeforeUpdater interface. -func (r *Rule) BeforeUpdate() error { - r.UpdatedAt = Now() - - return nil -} - -// AfterFind implements reform.AfterFinder interface. -func (r *Rule) AfterFind() error { - r.CreatedAt = r.CreatedAt.UTC() - r.UpdatedAt = r.UpdatedAt.UTC() - - return nil -} - -// GetCustomLabels decodes template labels. -func (r *Rule) GetCustomLabels() (map[string]string, error) { - return getLabels(r.CustomLabels) -} - -// SetCustomLabels encodes template labels. -func (r *Rule) SetCustomLabels(m map[string]string) error { - return setLabels(m, &r.CustomLabels) -} - -// GetLabels decodes template labels. -func (r *Rule) GetLabels() (map[string]string, error) { - return getLabels(r.Labels) -} - -// SetLabels encodes template labels. -func (r *Rule) SetLabels(m map[string]string) error { - return setLabels(m, &r.Labels) -} - -// GetAnnotations decodes template annotations. -func (r *Rule) GetAnnotations() (map[string]string, error) { - return getLabels(r.Annotations) -} - -// SetAnnotations encodes template annotations. -func (r *Rule) SetAnnotations(m map[string]string) error { - return setLabels(m, &r.Annotations) -} - -// FilterType represents rule filter type. -type FilterType string - -// Available filter types. -const ( - Equal = FilterType("=") - Regex = FilterType("=~") -) - -// Filters represents filters slice. -type Filters []Filter - -// Value implements database/sql/driver Valuer interface. -func (t Filters) Value() (driver.Value, error) { return jsonValue(t) } - -// Scan implements database/sql Scanner interface. -func (t *Filters) Scan(src interface{}) error { return jsonScan(t, src) } - -// Filter represents rule filter. -type Filter struct { - Type FilterType `json:"type"` - Key string `json:"key"` - Val string `json:"value"` -} - -// Value implements database/sql/driver.Valuer interface. Should be defined on the value. -func (f Filter) Value() (driver.Value, error) { return jsonValue(f) } - -// Scan implements database/sql.Scanner interface. Should be defined on the pointer. -func (f *Filter) Scan(src interface{}) error { return jsonScan(f, src) } - -// AlertExprParamsValues represents rule parameters values slice. -type AlertExprParamsValues []AlertExprParamValue - -// Value implements database/sql/driver Valuer interface. -func (p AlertExprParamsValues) Value() (driver.Value, error) { return jsonValue(p) } - -// Scan implements database/sql Scanner interface. -func (p *AlertExprParamsValues) Scan(src interface{}) error { return jsonScan(p, src) } - -// AsStringMap convert param values to string map, where parameter name is a map key and parameter value is a map value. -func (p AlertExprParamsValues) AsStringMap() map[string]string { - m := make(map[string]string, len(p)) - for _, rp := range p { - var value string - switch rp.Type { - case Float: - value = fmt.Sprint(rp.FloatValue) - case Bool: - value = fmt.Sprint(rp.BoolValue) - case String: - value = rp.StringValue - } - // do not add `default:` to make exhaustive linter do its job - - m[rp.Name] = value - } - - return m -} - -// AlertExprParamValue represents rule parameter value. -type AlertExprParamValue struct { - Name string `json:"name"` - Type ParamType `json:"type"` - BoolValue bool `json:"bool"` - FloatValue float64 `json:"float"` - StringValue string `json:"string"` -} - -// Value implements database/sql/driver.Valuer interface. Should be defined on the value. -func (p AlertExprParamValue) Value() (driver.Value, error) { return jsonValue(p) } - -// Scan implements database/sql.Scanner interface. Should be defined on the pointer. -func (p *AlertExprParamValue) Scan(src interface{}) error { return jsonScan(p, src) } - -// ChannelIDs is a slice of notification channel ids. -type ChannelIDs []string - -// Value implements database/sql/driver Valuer interface. -func (t ChannelIDs) Value() (driver.Value, error) { return jsonValue(t) } - -// Scan implements database/sql Scanner interface. -func (t *ChannelIDs) Scan(src interface{}) error { return jsonScan(t, src) } - -// check interfaces. -var ( - _ reform.BeforeInserter = (*Rule)(nil) - _ reform.BeforeUpdater = (*Rule)(nil) - _ reform.AfterFinder = (*Rule)(nil) -) +// // Available filter types. +// const ( +// Equal = FilterType("=") +// Regex = FilterType("=~") +// ) +// +// // Filters represents filters slice. +// type Filters []Filter +// +// // Value implements database/sql/driver Valuer interface. +// func (t Filters) Value() (driver.Value, error) { return jsonValue(t) } +// +// // Scan implements database/sql Scanner interface. +// func (t *Filters) Scan(src interface{}) error { return jsonScan(t, src) } +// +// // Filter represents rule filter. +// type Filter struct { +// Type FilterType `json:"type"` +// Key string `json:"key"` +// Val string `json:"value"` +// } +// +// // Value implements database/sql/driver.Valuer interface. Should be defined on the value. +// func (f Filter) Value() (driver.Value, error) { return jsonValue(f) } +// +// // Scan implements database/sql.Scanner interface. Should be defined on the pointer. +// func (f *Filter) Scan(src interface{}) error { return jsonScan(f, src) } +// +// // ChannelIDs is a slice of notification channel ids. +// type ChannelIDs []string +// +// // Value implements database/sql/driver Valuer interface. +// func (t ChannelIDs) Value() (driver.Value, error) { return jsonValue(t) } +// +// // Scan implements database/sql Scanner interface. +// func (t *ChannelIDs) Scan(src interface{}) error { return jsonScan(t, src) } +// +// // check interfaces. +// var ( +// _ reform.BeforeInserter = (*Rule)(nil) +// _ reform.BeforeUpdater = (*Rule)(nil) +// _ reform.AfterFinder = (*Rule)(nil) +// ) diff --git a/managed/models/rule_model_reform.go b/managed/models/rule_model_reform.go deleted file mode 100644 index e23b61961c..0000000000 --- a/managed/models/rule_model_reform.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by gopkg.in/reform.v1. DO NOT EDIT. - -package models - -import ( - "fmt" - "strings" - - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/parse" -) - -type ruleTableType struct { - s parse.StructInfo - z []interface{} -} - -// Schema returns a schema name in SQL database (""). -func (v *ruleTableType) Schema() string { - return v.s.SQLSchema -} - -// Name returns a view or table name in SQL database ("ia_rules"). -func (v *ruleTableType) Name() string { - return v.s.SQLName -} - -// Columns returns a new slice of column names for that view or table in SQL database. -func (v *ruleTableType) Columns() []string { - return []string{ - "id", - "name", - "summary", - "template_name", - "disabled", - "expr_template", - "params_definitions", - "params_values", - "default_for", - "for", - "default_severity", - "severity", - "custom_labels", - "labels", - "annotations", - "filters", - "channel_ids", - "created_at", - "updated_at", - } -} - -// NewStruct makes a new struct for that view or table. -func (v *ruleTableType) NewStruct() reform.Struct { - return new(Rule) -} - -// NewRecord makes a new record for that table. -func (v *ruleTableType) NewRecord() reform.Record { - return new(Rule) -} - -// PKColumnIndex returns an index of primary key column for that table in SQL database. -func (v *ruleTableType) PKColumnIndex() uint { - return uint(v.s.PKFieldIndex) -} - -// RuleTable represents ia_rules view or table in SQL database. -var RuleTable = &ruleTableType{ - s: parse.StructInfo{ - Type: "Rule", - SQLName: "ia_rules", - Fields: []parse.FieldInfo{ - {Name: "ID", Type: "string", Column: "id"}, - {Name: "Name", Type: "string", Column: "name"}, - {Name: "Summary", Type: "string", Column: "summary"}, - {Name: "TemplateName", Type: "string", Column: "template_name"}, - {Name: "Disabled", Type: "bool", Column: "disabled"}, - {Name: "ExprTemplate", Type: "string", Column: "expr_template"}, - {Name: "ParamsDefinitions", Type: "AlertExprParamsDefinitions", Column: "params_definitions"}, - {Name: "ParamsValues", Type: "AlertExprParamsValues", Column: "params_values"}, - {Name: "DefaultFor", Type: "time.Duration", Column: "default_for"}, - {Name: "For", Type: "time.Duration", Column: "for"}, - {Name: "DefaultSeverity", Type: "Severity", Column: "default_severity"}, - {Name: "Severity", Type: "Severity", Column: "severity"}, - {Name: "CustomLabels", Type: "[]uint8", Column: "custom_labels"}, - {Name: "Labels", Type: "[]uint8", Column: "labels"}, - {Name: "Annotations", Type: "[]uint8", Column: "annotations"}, - {Name: "Filters", Type: "Filters", Column: "filters"}, - {Name: "ChannelIDs", Type: "ChannelIDs", Column: "channel_ids"}, - {Name: "CreatedAt", Type: "time.Time", Column: "created_at"}, - {Name: "UpdatedAt", Type: "time.Time", Column: "updated_at"}, - }, - PKFieldIndex: 0, - }, - z: new(Rule).Values(), -} - -// String returns a string representation of this struct or record. -func (s Rule) String() string { - res := make([]string, 19) - res[0] = "ID: " + reform.Inspect(s.ID, true) - res[1] = "Name: " + reform.Inspect(s.Name, true) - res[2] = "Summary: " + reform.Inspect(s.Summary, true) - res[3] = "TemplateName: " + reform.Inspect(s.TemplateName, true) - res[4] = "Disabled: " + reform.Inspect(s.Disabled, true) - res[5] = "ExprTemplate: " + reform.Inspect(s.ExprTemplate, true) - res[6] = "ParamsDefinitions: " + reform.Inspect(s.ParamsDefinitions, true) - res[7] = "ParamsValues: " + reform.Inspect(s.ParamsValues, true) - res[8] = "DefaultFor: " + reform.Inspect(s.DefaultFor, true) - res[9] = "For: " + reform.Inspect(s.For, true) - res[10] = "DefaultSeverity: " + reform.Inspect(s.DefaultSeverity, true) - res[11] = "Severity: " + reform.Inspect(s.Severity, true) - res[12] = "CustomLabels: " + reform.Inspect(s.CustomLabels, true) - res[13] = "Labels: " + reform.Inspect(s.Labels, true) - res[14] = "Annotations: " + reform.Inspect(s.Annotations, true) - res[15] = "Filters: " + reform.Inspect(s.Filters, true) - res[16] = "ChannelIDs: " + reform.Inspect(s.ChannelIDs, true) - res[17] = "CreatedAt: " + reform.Inspect(s.CreatedAt, true) - res[18] = "UpdatedAt: " + reform.Inspect(s.UpdatedAt, true) - return strings.Join(res, ", ") -} - -// Values returns a slice of struct or record field values. -// Returned interface{} values are never untyped nils. -func (s *Rule) Values() []interface{} { - return []interface{}{ - s.ID, - s.Name, - s.Summary, - s.TemplateName, - s.Disabled, - s.ExprTemplate, - s.ParamsDefinitions, - s.ParamsValues, - s.DefaultFor, - s.For, - s.DefaultSeverity, - s.Severity, - s.CustomLabels, - s.Labels, - s.Annotations, - s.Filters, - s.ChannelIDs, - s.CreatedAt, - s.UpdatedAt, - } -} - -// Pointers returns a slice of pointers to struct or record fields. -// Returned interface{} values are never untyped nils. -func (s *Rule) Pointers() []interface{} { - return []interface{}{ - &s.ID, - &s.Name, - &s.Summary, - &s.TemplateName, - &s.Disabled, - &s.ExprTemplate, - &s.ParamsDefinitions, - &s.ParamsValues, - &s.DefaultFor, - &s.For, - &s.DefaultSeverity, - &s.Severity, - &s.CustomLabels, - &s.Labels, - &s.Annotations, - &s.Filters, - &s.ChannelIDs, - &s.CreatedAt, - &s.UpdatedAt, - } -} - -// View returns View object for that struct. -func (s *Rule) View() reform.View { - return RuleTable -} - -// Table returns Table object for that record. -func (s *Rule) Table() reform.Table { - return RuleTable -} - -// PKValue returns a value of primary key for that record. -// Returned interface{} value is never untyped nil. -func (s *Rule) PKValue() interface{} { - return s.ID -} - -// PKPointer returns a pointer to primary key field for that record. -// Returned interface{} value is never untyped nil. -func (s *Rule) PKPointer() interface{} { - return &s.ID -} - -// HasPK returns true if record has non-zero primary key set, false otherwise. -func (s *Rule) HasPK() bool { - return s.ID != RuleTable.z[RuleTable.s.PKFieldIndex] -} - -// SetPK sets record primary key, if possible. -// -// Deprecated: prefer direct field assignment where possible: s.ID = pk. -func (s *Rule) SetPK(pk interface{}) { - reform.SetPK(s, pk) -} - -// check interfaces -var ( - _ reform.View = RuleTable - _ reform.Struct = (*Rule)(nil) - _ reform.Table = RuleTable - _ reform.Record = (*Rule)(nil) - _ fmt.Stringer = (*Rule)(nil) -) - -func init() { - parse.AssertUpToDate(&RuleTable.s, new(Rule)) -} diff --git a/managed/models/settings.go b/managed/models/settings.go index 590920bde1..f6c3e53004 100644 --- a/managed/models/settings.go +++ b/managed/models/settings.go @@ -43,7 +43,7 @@ type SaaS struct { // Alerting contains settings related to Alerting. type Alerting struct { Disabled bool `json:"disabled"` - EmailAlertingSettings *EmailAlertingSettings `json:"email_settings"` + EmailAlertingSettings *EmailAlertingSettings `json:"email_settings"` // TODO: Remove SlackAlertingSettings *SlackAlertingSettings `json:"slack_settings"` } diff --git a/managed/models/template_model.go b/managed/models/template_model.go index 71dc652228..e32ace522d 100644 --- a/managed/models/template_model.go +++ b/managed/models/template_model.go @@ -25,9 +25,9 @@ import ( //go:generate ../../bin/reform -// Template represents Integrated Alerting rule template. +// Template represents Percona Alerting rule template. // -//reform:ia_templates +//reform:alert_rule_templates type Template struct { Name string `reform:"name,pk"` Version uint32 `reform:"version"` diff --git a/managed/models/template_model_reform.go b/managed/models/template_model_reform.go index 65e695524d..95b23a885e 100644 --- a/managed/models/template_model_reform.go +++ b/managed/models/template_model_reform.go @@ -20,7 +20,7 @@ func (v *templateTableType) Schema() string { return v.s.SQLSchema } -// Name returns a view or table name in SQL database ("ia_templates"). +// Name returns a view or table name in SQL database ("alert_rule_templates"). func (v *templateTableType) Name() string { return v.s.SQLName } @@ -59,11 +59,11 @@ func (v *templateTableType) PKColumnIndex() uint { return uint(v.s.PKFieldIndex) } -// TemplateTable represents ia_templates view or table in SQL database. +// TemplateTable represents alert_rule_templates view or table in SQL database. var TemplateTable = &templateTableType{ s: parse.StructInfo{ Type: "Template", - SQLName: "ia_templates", + SQLName: "alert_rule_templates", Fields: []parse.FieldInfo{ {Name: "Name", Type: "string", Column: "name"}, {Name: "Version", Type: "uint32", Column: "version"}, diff --git a/managed/services/alertmanager/alertmanager.go b/managed/services/alertmanager/alertmanager.go index 8f6f380ae4..12cf00aede 100644 --- a/managed/services/alertmanager/alertmanager.go +++ b/managed/services/alertmanager/alertmanager.go @@ -18,23 +18,19 @@ package alertmanager import ( "context" - "crypto/sha256" _ "embed" // for email templates - "encoding/hex" "fmt" "io" "net/http" "os" "os/exec" "path" - "sort" "strings" "time" "github.com/AlekSi/pointer" httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - "github.com/percona/promconfig" "github.com/percona/promconfig/alertmanager" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -46,7 +42,6 @@ import ( "github.com/percona/pmm/api/alertmanager/amclient/alert" "github.com/percona/pmm/api/alertmanager/amclient/silence" "github.com/percona/pmm/api/alertmanager/ammodels" - "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services" "github.com/percona/pmm/managed/utils/dir" "github.com/percona/pmm/utils/pdeathsig" @@ -64,12 +59,8 @@ const ( alertmanagerConfigPath = "/etc/alertmanager.yml" alertmanagerBaseConfigPath = "/srv/alertmanager/alertmanager.base.yml" - receiverNameSeparator = " + " - // CheckFilter represents AlertManager filter for Checks/Advisor results. CheckFilter = "stt_check=1" - // IAFilter represents AlertManager filter for Integrated Alerts. - IAFilter = "ia=1" ) var notificationLabels = []string{ @@ -77,9 +68,6 @@ var notificationLabels = []string{ "alertgroup", "template_name", "severity", "agent_id", "agent_type", "job", } -//go:embed email_template.html -var emailTemplate string - // Service is responsible for interactions with Alertmanager. type Service struct { db *reform.DB @@ -258,12 +246,7 @@ func (svc *Service) loadBaseConfig() *alertmanager.Config { // marshalConfig marshals Alertmanager configuration. func (svc *Service) marshalConfig(base *alertmanager.Config) ([]byte, error) { - cfg := base - if err := svc.populateConfig(cfg); err != nil { - return nil, err - } - - b, err := yaml.Marshal(cfg) + b, err := yaml.Marshal(base) if err != nil { return nil, errors.Wrap(err, "can't marshal Alertmanager configuration file") } @@ -344,36 +327,6 @@ func (svc *Service) configAndReload(ctx context.Context, b []byte) error { return nil } -// convertTLSConfig converts model TLSConfig to promconfig TLSConfig. -// Resulting promconfig field -// - CAFile is set to corresponding model field if CAFileContent is not specified, `sha256(id).ca` otherwise. -// - CertFile is set to corresponding model field if CertFileContent is not specified, `sha256(id).crt` otherwise. -// - KeyFile is set to corresponding model field if KeyFileContent is not specified, `sha256(id).key` otherwise. -func convertTLSConfig(id string, tls *models.TLSConfig) promconfig.TLSConfig { - hashedIDBytes := sha256.Sum256([]byte(id)) - hashedID := hex.EncodeToString(hashedIDBytes[:]) - - caFile := tls.CAFile - if tls.CAFileContent != "" { - caFile = path.Join(alertmanagerCertDir, fmt.Sprintf("%s.ca", hashedID)) - } - certFile := tls.CertFile - if tls.CertFileContent != "" { - certFile = path.Join(alertmanagerCertDir, fmt.Sprintf("%s.crt", hashedID)) - } - keyFile := tls.KeyFile - if tls.KeyFileContent != "" { - keyFile = path.Join(alertmanagerCertDir, fmt.Sprintf("%s.key", hashedID)) - } - return promconfig.TLSConfig{ - CAFile: caFile, - CertFile: certFile, - KeyFile: keyFile, - ServerName: tls.ServerName, - InsecureSkipVerify: tls.InsecureSkipVerify, - } -} - func cleanupTLSConfigFiles() error { des, err := os.ReadDir(alertmanagerCertDir) if err != nil { @@ -392,332 +345,6 @@ func cleanupTLSConfigFiles() error { return nil } -func tlsConfig(c *models.Channel) *models.TLSConfig { - if c.WebHookConfig != nil && - c.WebHookConfig.HTTPConfig != nil && - c.WebHookConfig.HTTPConfig.TLSConfig != nil { - return c.WebHookConfig.HTTPConfig.TLSConfig - } - - return nil -} - -// recreateTLSConfigFiles cleanups old tls config files and creates new ones for each channel using the content -// from CAFileContent, CertFileContent, KeyFileContent if it is set. -func recreateTLSConfigFiles(chanMap map[string]*models.Channel) error { - fi, err := os.Stat(alertmanagerCertDir) - if err != nil { - return errors.WithStack(err) - } - - if err := cleanupTLSConfigFiles(); err != nil { - return errors.WithStack(err) - } - - for _, c := range chanMap { - tlsConfig := tlsConfig(c) - if tlsConfig == nil { - continue - } - - convertedTLSConfig := convertTLSConfig(c.ID, tlsConfig) - fileContentMap := map[string]string{ - convertedTLSConfig.CAFile: tlsConfig.CAFileContent, - convertedTLSConfig.CertFile: tlsConfig.CertFileContent, - convertedTLSConfig.KeyFile: tlsConfig.KeyFileContent, - } - for filePath, content := range fileContentMap { - if filePath == "" || content == "" { - continue - } - - if err := os.WriteFile(filePath, []byte(content), fi.Mode()); err != nil { - return errors.WithStack(err) - } - } - } - - return nil -} - -// populateConfig adds configuration from the database to cfg. -func (svc *Service) populateConfig(cfg *alertmanager.Config) error { - var settings *models.Settings - var rules []*models.Rule - var channels []*models.Channel - e := svc.db.InTransaction(func(tx *reform.TX) error { - var err error - settings, err = models.GetSettings(tx.Querier) - if err != nil { - return err - } - - rules, err = models.FindRules(tx.Querier) - if err != nil { - return err - } - - channels, err = models.FindChannels(tx.Querier) - if err != nil { - return err - } - return nil - }) - if e != nil { - return errors.Errorf("failed to fetch items from database: %v", e) - } - - chanMap := make(map[string]*models.Channel, len(channels)) - for _, ch := range channels { - chanMap[ch.ID] = ch - } - if err := recreateTLSConfigFiles(chanMap); err != nil { - return err - } - - if cfg.Global == nil { - cfg.Global = &alertmanager.GlobalConfig{} - } - - findReceiverIdx := func(name string) int { - for i, r := range cfg.Receivers { - if r.Name == name { - return i - } - } - return -1 - } - - // make sure that "empty" receiver is there - if findReceiverIdx("empty") == -1 { - cfg.Receivers = append(cfg.Receivers, &alertmanager.Receiver{ - Name: "empty", - }) - } - - disabledReceiver := &alertmanager.Receiver{ - Name: "disabled", - } - // Override if there is any user defined receiver `disabled`, needs to be empty - if disabledReceiverIdx := findReceiverIdx("disabled"); disabledReceiverIdx != -1 { - cfg.Receivers[disabledReceiverIdx] = disabledReceiver - } else { - cfg.Receivers = append(cfg.Receivers, disabledReceiver) - } - - // set default route if absent - if cfg.Route == nil { - cfg.Route = &alertmanager.Route{ - Receiver: "empty", - } - } - - if settings.Alerting.EmailAlertingSettings != nil { - svc.l.Warn("Setting global email config, any user defined changes to the base config might be overwritten.") - - cfg.Global.SMTPFrom = settings.Alerting.EmailAlertingSettings.From - cfg.Global.SMTPHello = settings.Alerting.EmailAlertingSettings.Hello - cfg.Global.SMTPSmarthost = settings.Alerting.EmailAlertingSettings.Smarthost - cfg.Global.SMTPAuthIdentity = settings.Alerting.EmailAlertingSettings.Identity - cfg.Global.SMTPAuthUsername = settings.Alerting.EmailAlertingSettings.Username - cfg.Global.SMTPAuthPassword = settings.Alerting.EmailAlertingSettings.Password - cfg.Global.SMTPAuthSecret = settings.Alerting.EmailAlertingSettings.Secret - cfg.Global.SMTPRequireTLS = settings.Alerting.EmailAlertingSettings.RequireTLS - } - - if settings.Alerting.SlackAlertingSettings != nil { - svc.l.Warn("Setting global Slack config, any user defined changes to the base config might be overwritten.") - - cfg.Global.SlackAPIURL = settings.Alerting.SlackAlertingSettings.URL - } - - recvSet := make(map[string]models.ChannelIDs) // stores unique combinations of channel IDs - for _, r := range rules { - // skip rules with 0 notification channels - if len(r.ChannelIDs) == 0 { - continue - } - - route := &alertmanager.Route{ - Match: map[string]string{ - "rule_id": r.ID, - }, - MatchRE: make(map[string]string), - } - - for _, f := range r.Filters { - switch f.Type { - case models.Equal: - route.Match[f.Key] = f.Val - case models.Regex: - route.MatchRE[f.Key] = f.Val - default: - svc.l.Warnf("Unhandled filter: %+v", f) - } - } - enabledChannels := make(models.ChannelIDs, 0, len(r.ChannelIDs)) - for _, chID := range r.ChannelIDs { - if channel, ok := chanMap[chID]; ok { - if !channel.Disabled { - enabledChannels = append(enabledChannels, chID) - } - } - } - // make sure same slice with different order are not considered unique. - sort.Strings(enabledChannels) - recv := strings.Join(enabledChannels, receiverNameSeparator) - if len(enabledChannels) == 0 { - recv = "disabled" - } else { - recvSet[recv] = enabledChannels - } - route.Receiver = recv - - cfg.Route.Routes = append(cfg.Route.Routes, route) - } - - receivers, err := svc.generateReceivers(chanMap, recvSet) - if err != nil { - return err - } - - cfg.Receivers = append(cfg.Receivers, receivers...) - return nil -} - -func formatSlackText(labels ...string) string { - const listEntryFormat = "{{ if .Labels.%[1]s }} • *%[1]s:* `{{ .Labels.%[1]s }}`\n{{ end }}" - - text := "{{ range .Alerts -}}\n" + - "*Alert:* {{ if .Labels.severity }}`{{ .Labels.severity | toUpper }}`{{ end }} {{ .Annotations.summary }}\n" + - "*Description:* {{ .Annotations.description }}\n" + - "*Details:*\n" - for _, l := range labels { - text += fmt.Sprintf(listEntryFormat, l) - } - - text += "\n\n{{ end }}" - - return text -} - -func formatPagerDutyFiringDetails(labels ...string) string { - const listEntryFormat = "{{ if .Labels.%[1]s }} - %[1]s: {{ .Labels.%[1]s }}\n{{ end }}" - - text := "{{ range .Alerts -}}\n" + - "Alert: {{ if .Labels.severity }}[{{ .Labels.severity | toUpper }}]{{ end }} {{ .Annotations.summary }}\n" + - "Description: {{ .Annotations.description }}\n" + - "Details:\n" - for _, l := range labels { - text += fmt.Sprintf(listEntryFormat, l) - } - - text += "\n\n{{ end }}" - - return text -} - -// generateReceivers takes the channel map and a unique set of rule combinations and generates a slice of receivers. -func (svc *Service) generateReceivers(chanMap map[string]*models.Channel, recvSet map[string]models.ChannelIDs) ([]*alertmanager.Receiver, error) { - receivers := make([]*alertmanager.Receiver, 0, len(recvSet)) - - for name, channelIDs := range recvSet { - recv := &alertmanager.Receiver{ - Name: name, - } - - for _, ch := range channelIDs { - channel, ok := chanMap[ch] - if !ok { - svc.l.Warnf("Missing channel %s, skip it.", ch) - continue - } - switch channel.Type { - case models.Email: - for _, to := range channel.EmailConfig.To { - recv.EmailConfigs = append(recv.EmailConfigs, &alertmanager.EmailConfig{ - NotifierConfig: alertmanager.NotifierConfig{ - SendResolved: channel.EmailConfig.SendResolved, - }, - To: to, - HTML: emailTemplate, - Headers: map[string]string{ - "Subject": `[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]`, - }, - }) - } - - case models.PagerDuty: - pdConfig := &alertmanager.PagerdutyConfig{ - NotifierConfig: alertmanager.NotifierConfig{ - SendResolved: channel.PagerDutyConfig.SendResolved, - }, - Description: `[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]` + - "{{ range .Alerts -}}{{ if .Labels.severity }}[{{ .Labels.severity | toUpper }}]{{ end }} {{ .Annotations.summary }}{{ end }}", - Details: map[string]string{ - "firing": formatPagerDutyFiringDetails(notificationLabels...), - }, - } - if channel.PagerDutyConfig.RoutingKey != "" { - pdConfig.RoutingKey = channel.PagerDutyConfig.RoutingKey - } - if channel.PagerDutyConfig.ServiceKey != "" { - pdConfig.ServiceKey = channel.PagerDutyConfig.ServiceKey - } - recv.PagerdutyConfigs = append(recv.PagerdutyConfigs, pdConfig) - - case models.Slack: - recv.SlackConfigs = append(recv.SlackConfigs, &alertmanager.SlackConfig{ - NotifierConfig: alertmanager.NotifierConfig{ - SendResolved: channel.SlackConfig.SendResolved, - }, - Channel: channel.SlackConfig.Channel, - Title: `[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]`, - Text: formatSlackText(notificationLabels...), - }) - - case models.WebHook: - webhookConfig := &alertmanager.WebhookConfig{ - NotifierConfig: alertmanager.NotifierConfig{ - SendResolved: channel.WebHookConfig.SendResolved, - }, - URL: channel.WebHookConfig.URL, - MaxAlerts: uint64(channel.WebHookConfig.MaxAlerts), - } - - if channel.WebHookConfig.HTTPConfig != nil { - webhookConfig.HTTPConfig = promconfig.HTTPClientConfig{ - BearerToken: channel.WebHookConfig.HTTPConfig.BearerToken, - BearerTokenFile: channel.WebHookConfig.HTTPConfig.BearerTokenFile, - ProxyURL: channel.WebHookConfig.HTTPConfig.ProxyURL, - } - if channel.WebHookConfig.HTTPConfig.BasicAuth != nil { - webhookConfig.HTTPConfig.BasicAuth = &promconfig.BasicAuth{ - Username: channel.WebHookConfig.HTTPConfig.BasicAuth.Username, - Password: channel.WebHookConfig.HTTPConfig.BasicAuth.Password, - PasswordFile: channel.WebHookConfig.HTTPConfig.BasicAuth.PasswordFile, - } - } - if channel.WebHookConfig.HTTPConfig.TLSConfig != nil { - webhookConfig.HTTPConfig.TLSConfig = convertTLSConfig(channel.ID, - channel.WebHookConfig.HTTPConfig.TLSConfig) - } - } - - recv.WebhookConfigs = append(recv.WebhookConfigs, webhookConfig) - - default: - return nil, errors.Errorf("invalid channel type: %q", channel.Type) - } - } - - receivers = append(receivers, recv) - } - - sort.Slice(receivers, func(i, j int) bool { return receivers[i].Name < receivers[j].Name }) - return receivers, nil -} - // SendAlerts sends given alerts. It is the caller's responsibility // to call this method every now and then. func (svc *Service) SendAlerts(ctx context.Context, alerts ammodels.PostableAlerts) { @@ -745,9 +372,6 @@ func (svc *Service) GetAlerts(ctx context.Context, fp *services.FilterParams) ([ if fp.IsCheck { alertParams.Filter = append(alertParams.Filter, CheckFilter) } - if fp.IsIA { - alertParams.Filter = append(alertParams.Filter, IAFilter) - } if fp.ServiceID != "" { alertParams.Filter = append(alertParams.Filter, fmt.Sprintf("service_id=\"%s\"", fp.ServiceID)) } diff --git a/managed/services/alertmanager/email_template.html b/managed/services/alertmanager/email_template.html deleted file mode 100644 index 72b699f714..0000000000 --- a/managed/services/alertmanager/email_template.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - {{ template "__subject" . }} - - - - - - - - - - -
-
- - - {{ if eq .CommonLabels.severity "notice" }} - - - - - -
- {{ else if eq .CommonLabels.severity "warning" }} - - {{ else if eq .CommonLabels.severity "error" }} - - {{ else }} - - {{ end }} - You have {{ .Alerts | len }} {{ .CommonLabels.severity }} alert{{ if gt (len .Alerts) 1 }}s{{ end }} firing -
- - - - - {{ range .Alerts.Firing }} - - - - {{ end }} -
- View in {{ template "__alertmanager" . }} -
-
-
- Alert: - {{ if .Labels.severity }} - [{{ .Labels.severity | toUpper }}] - {{ end }} - {{ .Annotations.summary }} -
-
- Description: - {{ .Annotations.description }} -
-
- Violated rule: - {{ .Annotations.rule }} -
- Details:
- {{ with .Labels }} - {{ with .Remove (stringSlice "alertname" "ia" "instance" "node_type" "server") }} - {{ range .SortedPairs }} - • {{ .Name }}: {{ .Value }}
- {{ end }} - {{ end }} - {{ end }} -
-
- - -
-
- - - - diff --git a/managed/services/alertmanager/emailer.go b/managed/services/alertmanager/emailer.go deleted file mode 100644 index 1153587a02..0000000000 --- a/managed/services/alertmanager/emailer.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package alertmanager - -import ( - "context" - "fmt" - "net" - "net/url" - "time" - - "github.com/prometheus/alertmanager/config" - "github.com/prometheus/alertmanager/notify/email" - "github.com/prometheus/alertmanager/template" - "github.com/prometheus/alertmanager/types" - "github.com/prometheus/common/model" - "github.com/sirupsen/logrus" - - "github.com/percona/pmm/managed/models" -) - -// Emailer is responsible for sending emails using alertmanger Email notifier. -type Emailer struct { - l *logrus.Logger -} - -// NewEmailer creates Emailer instance. -func NewEmailer(l *logrus.Logger) *Emailer { - return &Emailer{l: l} -} - -type loggerFunc func(level logrus.Level, args ...interface{}) - -// Log performs logging operation to logrus logger. -func (f loggerFunc) Log(values ...interface{}) error { - f(logrus.DebugLevel, values) - return nil -} - -// Send sends an email to `emailTo` recipient using given settings. -func (e *Emailer) Send(ctx context.Context, settings *models.EmailAlertingSettings, emailTo string) error { - host, port, err := net.SplitHostPort(settings.Smarthost) - if err != nil { - return models.NewInvalidArgumentError("invalid smarthost: %q", err.Error()) - } - - if port == "" { - return models.NewInvalidArgumentError("address %q: port cannot be empty", port) - } - - emailConfig := &config.EmailConfig{ - NotifierConfig: config.NotifierConfig{}, - To: emailTo, - From: settings.From, - Hello: settings.Hello, - Smarthost: config.HostPort{ - Host: host, - Port: port, - }, - AuthUsername: settings.Username, - AuthPassword: config.Secret(settings.Password), - AuthSecret: config.Secret(settings.Secret), - AuthIdentity: settings.Identity, - Headers: map[string]string{ - "Subject": `Test alert.`, - }, - HTML: emailTemplate, - RequireTLS: &settings.RequireTLS, - } - - tmpl, err := template.FromGlobs() - if err != nil { - return err - } - tmpl.ExternalURL, err = url.Parse("https://example.com") - if err != nil { - return err - } - - alertmanagerEmail := email.New(emailConfig, tmpl, loggerFunc(e.l.Log)) - if _, err := alertmanagerEmail.Notify(ctx, &types.Alert{ - Alert: model.Alert{ - Labels: model.LabelSet{ - model.AlertNameLabel: model.LabelValue(fmt.Sprintf("Test alert %s", time.Now().String())), - "severity": "notice", - }, - Annotations: model.LabelSet{ - "summary": "This is a test alert.", - "description": "Long description.", - "rule": "example-violated-rule", - }, - StartsAt: time.Now(), - EndsAt: time.Now().Add(time.Minute), - }, - Timeout: true, - }); err != nil { - return models.NewInvalidArgumentError(err.Error()) - } - - return nil -} diff --git a/managed/services/management/alerting/service.go b/managed/services/management/alerting/service.go index 040e5188bf..f656ec4229 100644 --- a/managed/services/management/alerting/service.go +++ b/managed/services/management/alerting/service.go @@ -826,10 +826,10 @@ func (s *Service) CreateRule(ctx context.Context, req *alerting.CreateRuleReques return &alerting.CreateRuleResponse{}, nil } -func convertParamsValuesToModel(params []*alerting.ParamValue) (models.AlertExprParamsValues, error) { - ruleParams := make(models.AlertExprParamsValues, len(params)) +func convertParamsValuesToModel(params []*alerting.ParamValue) (AlertExprParamsValues, error) { + ruleParams := make(AlertExprParamsValues, len(params)) for i, param := range params { - p := models.AlertExprParamValue{Name: param.Name} + p := AlertExprParamValue{Name: param.Name} switch param.Type { case alerting.ParamType_PARAM_TYPE_INVALID: @@ -898,13 +898,13 @@ func fillExprWithParams(expr string, values map[string]string) (string, error) { return buf.String(), nil } -func validateParameters(definitions models.AlertExprParamsDefinitions, values models.AlertExprParamsValues) error { +func validateParameters(definitions models.AlertExprParamsDefinitions, values AlertExprParamsValues) error { if len(definitions) != len(values) { return status.Errorf(codes.InvalidArgument, "Expression requires %d parameters, but got %d.", len(definitions), len(values)) } - valuesM := make(map[string]models.AlertExprParamValue) + valuesM := make(map[string]AlertExprParamValue) for _, v := range values { valuesM[v.Name] = v } @@ -942,3 +942,36 @@ func validateParameters(definitions models.AlertExprParamsDefinitions, values mo var ( _ alerting.AlertingServer = (*Service)(nil) ) + +// AlertExprParamValue represents rule parameter value. +type AlertExprParamValue struct { + Name string `json:"name"` + Type models.ParamType `json:"type"` + BoolValue bool `json:"bool"` + FloatValue float64 `json:"float"` + StringValue string `json:"string"` +} + +// AlertExprParamsValues represents rule parameters values slice. +type AlertExprParamsValues []AlertExprParamValue + +// AsStringMap convert param values to string map, where parameter name is a map key and parameter value is a map value. +func (p AlertExprParamsValues) AsStringMap() map[string]string { + m := make(map[string]string, len(p)) + for _, rp := range p { + var value string + switch rp.Type { + case models.Float: + value = fmt.Sprint(rp.FloatValue) + case models.Bool: + value = fmt.Sprint(rp.BoolValue) + case models.String: + value = rp.StringValue + } + // do not add `default:` to make exhaustive linter do its job + + m[rp.Name] = value + } + + return m +} diff --git a/managed/services/management/ia/alerts_service.go b/managed/services/management/ia/alerts_service.go deleted file mode 100644 index fe882023e8..0000000000 --- a/managed/services/management/ia/alerts_service.go +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package ia contains Integrated Alerting APIs implementations. -package ia - -import ( - "context" - "regexp" - "strings" - "time" - - "github.com/percona-platform/saas/pkg/common" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/types/known/timestamppb" - "gopkg.in/reform.v1" - - "github.com/percona/pmm/api/alertmanager/ammodels" - "github.com/percona/pmm/api/managementpb" - iav1beta1 "github.com/percona/pmm/api/managementpb/ia" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services" -) - -// AlertsService represents integrated alerting alerts API. -// Deprecated. Do not use -type AlertsService struct { - db *reform.DB - l *logrus.Entry - alertManager alertManager - templatesService templatesService - - iav1beta1.UnimplementedAlertsServer -} - -// NewAlertsService creates new alerts API service. -func NewAlertsService(db *reform.DB, alertManager alertManager, templatesService templatesService) *AlertsService { - return &AlertsService{ - l: logrus.WithField("component", "management/ia/alerts"), - db: db, - alertManager: alertManager, - templatesService: templatesService, - } -} - -// Enabled returns if service is enabled and can be used. -// Deprecated. Do not use -func (s *AlertsService) Enabled() bool { - settings, err := models.GetSettings(s.db) - if err != nil { - s.l.WithError(err).Error("can't get settings") - return false - } - return !settings.Alerting.Disabled -} - -// ListAlerts returns list of existing alerts. -// Deprecated. Do not use -func (s *AlertsService) ListAlerts(ctx context.Context, req *iav1beta1.ListAlertsRequest) (*iav1beta1.ListAlertsResponse, error) { - filter := &services.FilterParams{ - IsIA: true, - } - alerts, err := s.alertManager.GetAlerts(ctx, filter) - if err != nil { - return nil, errors.Wrap(err, "failed to get alerts from alertmanager") - } - - var res []*iav1beta1.Alert //nolint:prealloc - for _, alert := range alerts { - updatedAt := timestamppb.New(time.Time(*alert.UpdatedAt)) - if err := updatedAt.CheckValid(); err != nil { - return nil, errors.Wrap(err, "failed to convert timestamp") - } - - createdAt := timestamppb.New(time.Time(*alert.StartsAt)) - if err := updatedAt.CheckValid(); err != nil { - return nil, errors.Wrap(err, "failed to convert timestamp") - } - - st := iav1beta1.Status_STATUS_INVALID - if *alert.Status.State == "active" { - st = iav1beta1.Status_TRIGGERING - } - - if len(alert.Status.SilencedBy) != 0 { - st = iav1beta1.Status_SILENCED - } - - var rule *iav1beta1.Rule - // Rules files created by user in directory /srv/prometheus/rules/ doesn't have associated rules in DB. - // So alertname field will be empty or will keep invalid value. Don't fill rule field in that case. - ruleID, ok := alert.Labels["alertname"] - if ok && strings.HasPrefix(ruleID, "/rule_id/") { - var r *models.Rule - var channels []*models.Channel - e := s.db.InTransaction(func(tx *reform.TX) error { - var err error - r, err = models.FindRuleByID(tx.Querier, ruleID) - if err != nil { - return err - } - - channels, err = models.FindChannelsByIDs(tx.Querier, r.ChannelIDs) - return err - }) - if e != nil { - // The codes.NotFound code can be returned just only by the FindRulesByID func - // from the transaction above. - if st, ok := status.FromError(e); ok && st.Code() == codes.NotFound { - s.l.Warnf("The related alert rule was most likely removed: %s", st.Message()) - continue - } - - return nil, e - } - - rule, err = convertRule(s.l, r, channels) - if err != nil { - return nil, errors.Wrapf(err, "failed to convert alert rule") - } - } - - if rule != nil && len(rule.Filters) != 0 { - pass, err := satisfiesFilters(alert, rule.Filters) - if err != nil { - return nil, err - } - - if !pass { - continue - } - } - - res = append(res, &iav1beta1.Alert{ - AlertId: getAlertID(alert), - Summary: alert.Annotations["summary"], - Severity: managementpb.Severity(common.ParseSeverity(alert.Labels["severity"])), - Status: st, - Labels: alert.Labels, - Rule: rule, - CreatedAt: createdAt, - UpdatedAt: updatedAt, - }) - } - - pageTotals := &managementpb.PageTotals{ - TotalPages: 1, - } - - var pageIndex int - var pageSize int - if req.PageParams != nil { - pageIndex = int(req.PageParams.Index) - pageSize = int(req.PageParams.PageSize) - } - - from, to := pageIndex*pageSize, (pageIndex+1)*pageSize - if to > len(res) || to == 0 { - to = len(res) - } - - if from > len(res) { - from = len(res) - } - - if pageSize > 0 { - pageTotals.TotalPages = int32(len(res) / pageSize) - if len(res)%pageSize > 0 { - pageTotals.TotalPages++ - } - } - pageTotals.TotalItems = int32(len(res)) - - return &iav1beta1.ListAlertsResponse{Alerts: res[from:to], Totals: pageTotals}, nil -} - -// satisfiesFilters checks that alert passes filters, returns true in case of success. -func satisfiesFilters(alert *ammodels.GettableAlert, filters []*iav1beta1.Filter) (bool, error) { - for _, filter := range filters { - value, ok := alert.Labels[filter.Key] - if !ok { - return false, nil - } - - switch filter.Type { - case iav1beta1.FilterType_EQUAL: - if filter.Value != value { - return false, nil - } - case iav1beta1.FilterType_REGEX: - match, err := regexp.Match(filter.Value, []byte(value)) - if err != nil { - return false, status.Errorf(codes.InvalidArgument, "bad regular expression: +%v", err) - } - - if !match { - return false, nil - } - case iav1beta1.FilterType_FILTER_TYPE_INVALID: - fallthrough - default: - return false, status.Error(codes.Internal, "Unexpected filter type.") - } - } - - return true, nil -} - -// getAlertID returns the alert's ID. -// Deprecated. Do not use. -func getAlertID(alert *ammodels.GettableAlert) string { - return *alert.Fingerprint -} - -// ToggleAlerts allows to silence/unsilence specified alerts. -// Deprecated. Do not use -func (s *AlertsService) ToggleAlerts(ctx context.Context, req *iav1beta1.ToggleAlertsRequest) (*iav1beta1.ToggleAlertsResponse, error) { - var err error - var alerts []*ammodels.GettableAlert - - filters := &services.FilterParams{ - IsIA: true, - } - if len(req.AlertIds) == 0 { - alerts, err = s.alertManager.GetAlerts(ctx, filters) - } else { - alerts, err = s.alertManager.FindAlertsByID(ctx, filters, req.AlertIds) - } - if err != nil { - return nil, err - } - - switch req.Silenced { - case managementpb.BooleanFlag_DO_NOT_CHANGE: - // nothing - case managementpb.BooleanFlag_TRUE: - err = s.alertManager.SilenceAlerts(ctx, alerts) - case managementpb.BooleanFlag_FALSE: - err = s.alertManager.UnsilenceAlerts(ctx, alerts) - } - if err != nil { - return nil, err - } - - return &iav1beta1.ToggleAlertsResponse{}, nil -} - -// Check interfaces. -var ( - _ iav1beta1.AlertsServer = (*AlertsService)(nil) -) diff --git a/managed/services/management/ia/alerts_service_test.go b/managed/services/management/ia/alerts_service_test.go deleted file mode 100644 index 1ca2a3e25d..0000000000 --- a/managed/services/management/ia/alerts_service_test.go +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "context" - "strconv" - "testing" - "time" - - "github.com/AlekSi/pointer" - "github.com/brianvoe/gofakeit/v6" - "github.com/go-openapi/strfmt" - "github.com/percona-platform/saas/pkg/alert" - "github.com/percona-platform/saas/pkg/common" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - - "github.com/percona/pmm/api/alertmanager/ammodels" - "github.com/percona/pmm/api/managementpb" - iav1beta1 "github.com/percona/pmm/api/managementpb/ia" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/testdb" -) - -func TestSatisfiesFilters(t *testing.T) { - t.Parallel() - - t.Run("alerts", func(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - alert *ammodels.GettableAlert - result bool - errMsg string - }{{ - name: "normal", - alert: &ammodels.GettableAlert{Alert: ammodels.Alert{Labels: map[string]string{ - "label1": "value1", - "label2": "value2", - }}}, - result: true, - errMsg: "", - }, { - name: "only one label match", - alert: &ammodels.GettableAlert{Alert: ammodels.Alert{Labels: map[string]string{ - "label1": "value1", - "label2": "wrong", - }}}, - result: false, - errMsg: "", - }, { - name: "only one label present", - alert: &ammodels.GettableAlert{Alert: ammodels.Alert{Labels: map[string]string{ - "label2": "value2", - }}}, - result: false, - errMsg: "", - }, { - name: "no labels", - alert: &ammodels.GettableAlert{ - Alert: ammodels.Alert{Labels: make(map[string]string)}, - }, - result: false, - errMsg: "", - }, { - name: "match labels + unknown label", - alert: &ammodels.GettableAlert{Alert: ammodels.Alert{Labels: map[string]string{ - "label1": "value1", - "label2": "value2", - "unknown": "value", - }}}, - result: true, - errMsg: "", - }, { - name: "not match labels + unknown label", - alert: &ammodels.GettableAlert{Alert: ammodels.Alert{Labels: map[string]string{ - "label2": "value2", - "unknown": "value", - }}}, - result: false, - errMsg: "", - }} - - filters := []*iav1beta1.Filter{{ - Type: iav1beta1.FilterType_EQUAL, - Key: "label1", - Value: "value1", - }, { - Type: iav1beta1.FilterType_REGEX, - Key: "label2", - Value: "v.*2", - }} - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - res, err := satisfiesFilters(tt.alert, filters) - if tt.errMsg != "" { - assert.EqualError(t, err, tt.errMsg) - return - } - - require.NoError(t, err) - assert.Equal(t, tt.result, res) - }) - } - }) - - t.Run("filters", func(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - filters []*iav1beta1.Filter - result bool - errMsg string - }{ - { - name: "normal multiple filters", - filters: []*iav1beta1.Filter{{ - Type: iav1beta1.FilterType_EQUAL, - Key: "label1", - Value: "value1", - }, { - Type: iav1beta1.FilterType_REGEX, - Key: "label2", - Value: "v.*2", - }}, - result: true, - errMsg: "", - }, { - name: "normal simple filter", - filters: []*iav1beta1.Filter{{ - Type: iav1beta1.FilterType_EQUAL, - Key: "label1", - Value: "value1", - }}, - result: true, - errMsg: "", - }, { - name: "normal regex filter", - filters: []*iav1beta1.Filter{{ - Type: iav1beta1.FilterType_REGEX, - Key: "label2", - Value: "v.*2", - }}, - result: true, - errMsg: "", - }, { - name: "invalid type", - filters: []*iav1beta1.Filter{{ - Type: iav1beta1.FilterType_FILTER_TYPE_INVALID, - Key: "label1", - Value: "value1", - }}, - result: false, - errMsg: "rpc error: code = Internal desc = Unexpected filter type.", - }, { - name: "unknown type", - filters: []*iav1beta1.Filter{{ - Type: iav1beta1.FilterType(12), - Key: "label1", - Value: "value1", - }}, - result: false, - errMsg: "rpc error: code = Internal desc = Unexpected filter type.", - }, { - name: "bad regexp", - filters: []*iav1beta1.Filter{{ - Type: iav1beta1.FilterType_REGEX, - Key: "label2", - Value: ".***", - }}, - result: false, - errMsg: "rpc error: code = InvalidArgument desc = bad regular expression: +error parsing regexp: invalid nested repetition operator: `**`", - }, - } - - alert := &ammodels.GettableAlert{ - Alert: ammodels.Alert{ - Labels: map[string]string{ - "label1": "value1", - "label2": "value2", - }, - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - res, err := satisfiesFilters(alert, tt.filters) - if tt.errMsg != "" { - assert.EqualError(t, err, tt.errMsg) - return - } - - require.NoError(t, err) - assert.Equal(t, tt.result, res) - }) - } - }) -} - -func TestListAlerts(t *testing.T) { - ctx := context.Background() - sqlDB := testdb.Open(t, models.SkipFixtures, nil) - db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - - q := db.Querier - now := strfmt.DateTime(time.Now()) - - tmpl, err := models.CreateTemplate(q, &models.CreateTemplateParams{ - Template: &alert.Template{ - Name: "test_Template", - Version: 1, - Summary: gofakeit.Quote(), - Expr: gofakeit.Quote(), - Severity: common.Warning, - }, - Source: "USER_FILE", - }) - require.NoError(t, err) - - rule, err := models.CreateRule(q, &models.CreateRuleParams{ - TemplateName: tmpl.Name, - DefaultSeverity: tmpl.Severity, - Severity: models.Severity(common.Warning), - }) - require.NoError(t, err) - - const alertsCount = 25 - mockAlert := &mockAlertManager{} - var mockedAlerts []*ammodels.GettableAlert - - for i := 0; i < alertsCount-1; i++ { - mockedAlerts = append(mockedAlerts, &ammodels.GettableAlert{ - Alert: ammodels.Alert{ - Labels: map[string]string{ - "ia": "1", - "alertname": rule.ID, - }, - }, - Fingerprint: pointer.ToString(strconv.Itoa(i)), - Status: &ammodels.AlertStatus{ - State: pointer.ToString("active"), - }, - StartsAt: &now, - UpdatedAt: &now, - }) - } - - // This additional alert emulates the one created by user directly, without IA UI. - // Since user added "ia" label, he wants to see alert in IA UI. We want to be sure he will. - mockedAlerts = append(mockedAlerts, &ammodels.GettableAlert{ - Alert: ammodels.Alert{ - Labels: map[string]string{ - "ia": "1", - }, - }, - Fingerprint: pointer.ToString(strconv.Itoa(alertsCount - 1)), - Status: &ammodels.AlertStatus{ - State: pointer.ToString("active"), - }, - StartsAt: &now, - UpdatedAt: &now, - }) - - mockAlert.On("GetAlerts", ctx, mock.Anything).Return(mockedAlerts, nil) - - var tmplSvc mockTemplatesService - require.NoError(t, err) - svc := NewAlertsService(db, mockAlert, &tmplSvc) - - findAlerts := func(alerts []*iav1beta1.Alert, alertIDs ...string) bool { - if len(alerts) != len(alertIDs) { - return false - } - m := make(map[string]bool) - for _, alertID := range alertIDs { - m[alertID] = false - } - for _, a := range alerts { - val, ok := m[a.AlertId] - // Extra alert - if !ok { - return false - } - // Duplicate - if val { - return false - } - m[a.AlertId] = true - } - for _, v := range m { - // AlertID was not in alerts - if !v { - return false - } - } - return true - } - - t.Run("without pagination", func(t *testing.T) { - res, err := svc.ListAlerts(ctx, &iav1beta1.ListAlertsRequest{}) - assert.NoError(t, err) - var expect []string - for _, m := range mockedAlerts { - expect = append(expect, *m.Fingerprint) - } - assert.True(t, findAlerts(res.Alerts, expect...), "wrong alerts returned") - assert.EqualValues(t, res.Totals.TotalItems, len(mockedAlerts)) - }) - - t.Run("pagination", func(t *testing.T) { - res, err := svc.ListAlerts(ctx, &iav1beta1.ListAlertsRequest{ - PageParams: &managementpb.PageParams{ - PageSize: 1, - }, - }) - assert.NoError(t, err) - assert.Len(t, res.Alerts, 1) - assert.True(t, findAlerts(res.Alerts, "0"), "wrong alerts returned") - assert.EqualValues(t, res.Totals.TotalItems, alertsCount) - assert.EqualValues(t, res.Totals.TotalPages, alertsCount) - - res, err = svc.ListAlerts(ctx, &iav1beta1.ListAlertsRequest{ - PageParams: &managementpb.PageParams{ - PageSize: 10, - Index: 2, - }, - }) - assert.NoError(t, err) - assert.Len(t, res.Alerts, 5) - assert.True(t, findAlerts(res.Alerts, "20", "21", "22", "23", "24"), "wrong alerts returned") - assert.EqualValues(t, res.Totals.TotalItems, alertsCount) - assert.EqualValues(t, res.Totals.TotalPages, 3) - }) - - t.Run("fetch more than available", func(t *testing.T) { - var expect []string - for _, m := range mockedAlerts { - expect = append(expect, *m.Fingerprint) - } - res, err := svc.ListAlerts(ctx, &iav1beta1.ListAlertsRequest{ - PageParams: &managementpb.PageParams{ - PageSize: alertsCount * 2, - }, - }) - assert.NoError(t, err) - assert.True(t, findAlerts(res.Alerts, expect...), "wrong alerts returned") - assert.EqualValues(t, res.Totals.TotalItems, len(mockedAlerts)) - - res, err = svc.ListAlerts(ctx, &iav1beta1.ListAlertsRequest{ - PageParams: &managementpb.PageParams{ - PageSize: 1, - Index: alertsCount * 2, - }, - }) - assert.NoError(t, err) - assert.Len(t, res.Alerts, 0) - assert.EqualValues(t, res.Totals.TotalItems, len(mockedAlerts)) - }) -} diff --git a/managed/services/management/ia/channels_service.go b/managed/services/management/ia/channels_service.go deleted file mode 100644 index fe31991d66..0000000000 --- a/managed/services/management/ia/channels_service.go +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "context" - - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "gopkg.in/reform.v1" - - "github.com/percona/pmm/api/managementpb" - iav1beta1 "github.com/percona/pmm/api/managementpb/ia" - "github.com/percona/pmm/managed/models" -) - -// ChannelsService represents integrated alerting channels API. -// Deprecated. Do not use. -type ChannelsService struct { - l *logrus.Entry - db *reform.DB - alertManager alertManager - - iav1beta1.UnimplementedChannelsServer -} - -// NewChannelsService creates new channels API service. -// Deprecated. Do not use. -func NewChannelsService(db *reform.DB, alertManager alertManager) *ChannelsService { - return &ChannelsService{ - l: logrus.WithField("component", "management/ia/channels"), - db: db, - alertManager: alertManager, - } -} - -// Enabled returns if service is enabled and can be used. -// Deprecated. Do not use. -func (s *ChannelsService) Enabled() bool { - settings, err := models.GetSettings(s.db) - if err != nil { - s.l.WithError(err).Error("can't get settings") - return false - } - return !settings.Alerting.Disabled -} - -// ListChannels returns list of available channels. -// Deprecated. Do not use. -func (s *ChannelsService) ListChannels(ctx context.Context, req *iav1beta1.ListChannelsRequest) (*iav1beta1.ListChannelsResponse, error) { - var pageIndex int - var pageSize int - if req.PageParams != nil { - pageIndex = int(req.PageParams.Index) - pageSize = int(req.PageParams.PageSize) - } - - var channels []*iav1beta1.Channel - pageTotals := &managementpb.PageTotals{ - TotalPages: 1, - } - - var err error - if pageSize == 0 { - channels, err = s.getNotificationChannels() - pageTotals.TotalItems = int32(len(channels)) - } else { - channels, pageTotals, err = s.getNotificationChannelsPage(pageIndex, pageSize) - } - - if err != nil { - return nil, err - } - - return &iav1beta1.ListChannelsResponse{Channels: channels, Totals: pageTotals}, nil -} - -func (s *ChannelsService) getNotificationChannels() ([]*iav1beta1.Channel, error) { - var channels []*models.Channel - errTx := s.db.InTransaction(func(tx *reform.TX) error { - var err error - channels, err = models.FindChannels(tx.Querier) - if err != nil { - return errors.WithStack(err) - } - return nil - }) - - if errTx != nil { - return nil, errors.WithStack(errTx) - } - - res := make([]*iav1beta1.Channel, len(channels)) - for i, channel := range channels { - c, err := convertChannel(channel) - if err != nil { - return nil, err - } - res[i] = c - } - - return res, nil -} - -// Deprecated. Do not use. -func (s *ChannelsService) getNotificationChannelsPage(pageIndex, pageSize int) ([]*iav1beta1.Channel, *managementpb.PageTotals, error) { - var channels []*models.Channel - var totalItems int - errTx := s.db.InTransaction(func(tx *reform.TX) error { - var err error - channels, err = models.FindChannelsOnPage(tx.Querier, pageIndex, pageSize) - if err != nil { - return errors.WithStack(err) - } - - totalItems, err = models.CountChannels(tx.Querier) - if err != nil { - return errors.WithStack(err) - } - - return nil - }) - if errTx != nil { - return nil, nil, errors.WithStack(errTx) - } - - res := make([]*iav1beta1.Channel, len(channels)) - for i, channel := range channels { - c, err := convertChannel(channel) - if err != nil { - return nil, nil, err - } - res[i] = c - } - - totalPages := totalItems / pageSize - if totalItems%pageSize > 0 { - totalPages++ - } - - totals := &managementpb.PageTotals{ - TotalItems: int32(totalItems), - TotalPages: int32(totalPages), - } - - return res, totals, nil -} - -// AddChannel adds new notification channel. -// Deprecated. Do not use. -func (s *ChannelsService) AddChannel(ctx context.Context, req *iav1beta1.AddChannelRequest) (*iav1beta1.AddChannelResponse, error) { - params := &models.CreateChannelParams{ - Summary: req.Summary, - Disabled: req.Disabled, - } - - if req.EmailConfig != nil { - params.EmailConfig = &models.EmailConfig{ - SendResolved: req.EmailConfig.SendResolved, - To: req.EmailConfig.To, - } - } - if req.PagerdutyConfig != nil { - params.PagerDutyConfig = &models.PagerDutyConfig{ - SendResolved: req.PagerdutyConfig.SendResolved, - RoutingKey: req.PagerdutyConfig.RoutingKey, - ServiceKey: req.PagerdutyConfig.ServiceKey, - } - } - if req.SlackConfig != nil { - params.SlackConfig = &models.SlackConfig{ - SendResolved: req.SlackConfig.SendResolved, - Channel: req.SlackConfig.Channel, - } - } - if req.WebhookConfig != nil { - params.WebHookConfig = &models.WebHookConfig{ - SendResolved: req.WebhookConfig.SendResolved, - URL: req.WebhookConfig.Url, - MaxAlerts: req.WebhookConfig.MaxAlerts, - HTTPConfig: convertHTTPConfigToModel(req.WebhookConfig.HttpConfig), - } - } - - var channel *models.Channel - e := s.db.InTransaction(func(tx *reform.TX) error { - var err error - channel, err = models.CreateChannel(tx.Querier, params) - return err - }) - if e != nil { - return nil, e - } - - s.alertManager.RequestConfigurationUpdate() - - return &iav1beta1.AddChannelResponse{ChannelId: channel.ID}, nil -} - -// ChangeChannel changes existing notification channel. -// Deprecated. Do not use. -func (s *ChannelsService) ChangeChannel(ctx context.Context, req *iav1beta1.ChangeChannelRequest) (*iav1beta1.ChangeChannelResponse, error) { - params := &models.ChangeChannelParams{ - Summary: req.Summary, - Disabled: req.Disabled, - } - - if c := req.EmailConfig; c != nil { - params.EmailConfig = &models.EmailConfig{ - SendResolved: c.SendResolved, - To: c.To, - } - } - if c := req.PagerdutyConfig; c != nil { - params.PagerDutyConfig = &models.PagerDutyConfig{ - SendResolved: c.SendResolved, - RoutingKey: c.RoutingKey, - ServiceKey: c.ServiceKey, - } - } - if c := req.SlackConfig; c != nil { - params.SlackConfig = &models.SlackConfig{ - SendResolved: c.SendResolved, - Channel: c.Channel, - } - } - if c := req.WebhookConfig; c != nil { - params.WebHookConfig = &models.WebHookConfig{ - SendResolved: c.SendResolved, - URL: c.Url, - MaxAlerts: c.MaxAlerts, - HTTPConfig: convertHTTPConfigToModel(req.WebhookConfig.HttpConfig), - } - } - - e := s.db.InTransaction(func(tx *reform.TX) error { - _, err := models.ChangeChannel(tx.Querier, req.ChannelId, params) - return err - }) - if e != nil { - return nil, e - } - - s.alertManager.RequestConfigurationUpdate() - - return &iav1beta1.ChangeChannelResponse{}, nil -} - -// RemoveChannel removes notification channel. -// Deprecated. Do not use. -func (s *ChannelsService) RemoveChannel(ctx context.Context, req *iav1beta1.RemoveChannelRequest) (*iav1beta1.RemoveChannelResponse, error) { - e := s.db.InTransaction(func(tx *reform.TX) error { - return models.RemoveChannel(tx.Querier, req.ChannelId) - }) - if e != nil { - return nil, e - } - - s.alertManager.RequestConfigurationUpdate() - - return &iav1beta1.RemoveChannelResponse{}, nil -} - -// convertChannel converts a channel model to its protobuf representation. -// Deprecated. Do not use. -func convertChannel(channel *models.Channel) (*iav1beta1.Channel, error) { - c := &iav1beta1.Channel{ - ChannelId: channel.ID, - Summary: channel.Summary, - Disabled: channel.Disabled, - } - - switch channel.Type { - case models.Email: - config := channel.EmailConfig - c.Channel = &iav1beta1.Channel_EmailConfig{ - EmailConfig: &iav1beta1.EmailConfig{ - SendResolved: config.SendResolved, - To: config.To, - }, - } - case models.PagerDuty: - config := channel.PagerDutyConfig - c.Channel = &iav1beta1.Channel_PagerdutyConfig{ - PagerdutyConfig: &iav1beta1.PagerDutyConfig{ - SendResolved: config.SendResolved, - RoutingKey: config.RoutingKey, - ServiceKey: config.ServiceKey, - }, - } - case models.Slack: - config := channel.SlackConfig - c.Channel = &iav1beta1.Channel_SlackConfig{ - SlackConfig: &iav1beta1.SlackConfig{ - SendResolved: config.SendResolved, - Channel: config.Channel, - }, - } - case models.WebHook: - config := channel.WebHookConfig - c.Channel = &iav1beta1.Channel_WebhookConfig{ - WebhookConfig: &iav1beta1.WebhookConfig{ - SendResolved: config.SendResolved, - Url: config.URL, - HttpConfig: convertModelToHTTPConfig(config.HTTPConfig), - MaxAlerts: config.MaxAlerts, - }, - } - default: - return nil, errors.Errorf("unknown notification channel type %s", channel.Type) - } - - return c, nil -} - -// convertHTTPConfigToModel converts a protobuf HTTPConfig to its model representation. -// Deprecated. Do not use. -func convertHTTPConfigToModel(config *iav1beta1.HTTPConfig) *models.HTTPConfig { - if config == nil { - return nil - } - - res := &models.HTTPConfig{ - BearerToken: config.BearerToken, - BearerTokenFile: config.BearerTokenFile, - ProxyURL: config.ProxyUrl, - } - - if basicAuthConf := config.BasicAuth; basicAuthConf != nil { - res.BasicAuth = &models.HTTPBasicAuth{ - Username: basicAuthConf.Username, - Password: basicAuthConf.Password, - PasswordFile: basicAuthConf.PasswordFile, - } - } - - if tlsConfig := config.TlsConfig; tlsConfig != nil { - res.TLSConfig = &models.TLSConfig{ - CAFile: tlsConfig.CaFile, - CertFile: tlsConfig.CertFile, - KeyFile: tlsConfig.KeyFile, - ServerName: tlsConfig.ServerName, - InsecureSkipVerify: tlsConfig.InsecureSkipVerify, - CAFileContent: tlsConfig.CaFileContent, - CertFileContent: tlsConfig.CertFileContent, - KeyFileContent: tlsConfig.KeyFileContent, - } - } - - return res -} - -// convertModelToHTTPConfig converts a HTTPConfig model to its protobuf representation. -// Deprecated. Do not use. -func convertModelToHTTPConfig(config *models.HTTPConfig) *iav1beta1.HTTPConfig { - if config == nil { - return nil - } - - res := &iav1beta1.HTTPConfig{ - BearerToken: config.BearerToken, - BearerTokenFile: config.BearerTokenFile, - ProxyUrl: config.ProxyURL, - } - - if basicAuthConf := config.BasicAuth; basicAuthConf != nil { - res.BasicAuth = &iav1beta1.BasicAuth{ - Username: basicAuthConf.Username, - Password: basicAuthConf.Password, - PasswordFile: basicAuthConf.PasswordFile, - } - } - - if tlsConfig := config.TLSConfig; tlsConfig != nil { - res.TlsConfig = &iav1beta1.TLSConfig{ - CaFile: tlsConfig.CAFile, - CertFile: tlsConfig.CertFile, - KeyFile: tlsConfig.KeyFile, - ServerName: tlsConfig.ServerName, - InsecureSkipVerify: tlsConfig.InsecureSkipVerify, - CaFileContent: tlsConfig.CAFileContent, - CertFileContent: tlsConfig.CertFileContent, - KeyFileContent: tlsConfig.KeyFileContent, - } - } - - return res -} - -// Check interfaces. -var ( - _ iav1beta1.ChannelsServer = (*ChannelsService)(nil) -) diff --git a/managed/services/management/ia/common.go b/managed/services/management/ia/common.go deleted file mode 100644 index 4f219fa67c..0000000000 --- a/managed/services/management/ia/common.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "bytes" - "os" - "text/template" - - "github.com/AlekSi/pointer" - "github.com/percona-platform/saas/pkg/alert" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/types/known/durationpb" - "google.golang.org/protobuf/types/known/timestamppb" - - "github.com/percona/pmm/api/managementpb" - alerting "github.com/percona/pmm/api/managementpb/alerting" - iav1beta1 "github.com/percona/pmm/api/managementpb/ia" - "github.com/percona/pmm/managed/models" -) - -const ( - dirPerm = os.FileMode(0o775) -) - -func convertParamUnit(u alert.Unit) alerting.ParamUnit { - switch u { - case alert.Percentage: - return alerting.ParamUnit_PERCENTAGE - case alert.Seconds: - return alerting.ParamUnit_SECONDS - } - - // do not add `default:` to make exhaustive linter do its job - - return alerting.ParamUnit_PARAM_UNIT_INVALID -} - -func convertRule(l *logrus.Entry, rule *models.Rule, channels []*models.Channel) (*iav1beta1.Rule, error) { - r := &iav1beta1.Rule{ - RuleId: rule.ID, - TemplateName: rule.TemplateName, - Disabled: rule.Disabled, - Summary: rule.Summary, - Name: rule.Name, - ExprTemplate: rule.ExprTemplate, - DefaultSeverity: managementpb.Severity(rule.DefaultSeverity), - Severity: managementpb.Severity(rule.Severity), - DefaultFor: durationpb.New(rule.DefaultFor), - For: durationpb.New(rule.For), - CreatedAt: timestamppb.New(rule.CreatedAt), - } - - var err error - if err = r.CreatedAt.CheckValid(); err != nil { - return nil, errors.Wrap(err, "failed to convert timestamp") - } - - r.Expr, err = fillExprWithParams(rule.ExprTemplate, rule.ParamsValues.AsStringMap()) - if err != nil { - return nil, errors.Wrap(err, "failed to fill expression template with parameters values") - } - - r.ParamsDefinitions, err = convertModelToParamsDefinitions(rule.ParamsDefinitions) - if err != nil { - return nil, errors.Wrap(err, "failed to convert parameters definitions") - } - - r.ParamsValues, err = convertModelToParamValues(rule.ParamsValues) - if err != nil { - return nil, errors.Wrap(err, "failed to convert parameters values") - } - - r.CustomLabels, err = rule.GetCustomLabels() - if err != nil { - return nil, errors.Wrap(err, "failed to load rule custom labels") - } - - r.Labels, err = rule.GetLabels() - if err != nil { - return nil, errors.Wrap(err, "failed to load rule labels") - } - - r.Annotations, err = rule.GetAnnotations() - if err != nil { - return nil, errors.Wrap(err, "failed to load rule annotations") - } - - r.Filters = make([]*iav1beta1.Filter, len(rule.Filters)) - for i, filter := range rule.Filters { - r.Filters[i] = &iav1beta1.Filter{ - Type: convertModelToFilterType(filter.Type), - Key: filter.Key, - Value: filter.Val, - } - } - - cm := make(map[string]*models.Channel) - for _, channel := range channels { - cm[channel.ID] = channel - } - - for _, id := range rule.ChannelIDs { - channel, ok := cm[id] - if !ok { - l.Warningf("Skip missing channel with ID %s", id) - continue - } - - c, err := convertChannel(channel) - if err != nil { - return nil, errors.Wrap(err, "failed to convert channel") - } - r.Channels = append(r.Channels, c) - } - - return r, nil -} - -func newParamTemplate() *template.Template { - return template.New("").Option("missingkey=error").Delims("[[", "]]") -} - -func fillExprWithParams(expr string, values map[string]string) (string, error) { - var buf bytes.Buffer - t, err := newParamTemplate().Parse(expr) - if err != nil { - return "", errors.Wrap(err, "failed to parse expression") - } - if err = t.Execute(&buf, values); err != nil { - return "", errors.Wrap(err, "failed to fill expression placeholders") - } - return buf.String(), nil -} - -func validateParameters(definitions models.AlertExprParamsDefinitions, values models.AlertExprParamsValues) error { - if len(definitions) != len(values) { - return status.Errorf(codes.InvalidArgument, "Expression requires %d parameters, but got %d.", - len(definitions), len(values)) - } - - valuesM := make(map[string]models.AlertExprParamValue) - for _, v := range values { - valuesM[v.Name] = v - } - - for _, d := range definitions { - value, ok := valuesM[d.Name] - if !ok { - return status.Errorf(codes.InvalidArgument, "Parameter %s is missing.", d.Name) - } - - if string(d.Type) != string(value.Type) { - return status.Errorf(codes.InvalidArgument, "Parameter %s has type %s instead of %s.", d.Name, value.Type, d.Type) - } - - if d.Type == models.Float { - v := d.FloatParam - fv := value.FloatValue - if v.Min != nil && pointer.GetFloat64(v.Min) > fv { - return status.Errorf(codes.InvalidArgument, "Parameter %s value is less than required minimum.", d.Name) - } - - if v.Max != nil && pointer.GetFloat64(v.Max) < fv { - return status.Errorf(codes.InvalidArgument, "Parameter %s value is greater than required maximum.", d.Name) - } - } - } - - return nil -} diff --git a/managed/services/management/ia/deps.go b/managed/services/management/ia/deps.go deleted file mode 100644 index b047152e00..0000000000 --- a/managed/services/management/ia/deps.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "context" - - "github.com/percona/pmm/api/alertmanager/ammodels" - "github.com/percona/pmm/managed/services" - "github.com/percona/pmm/managed/services/management/alerting" -) - -//go:generate ../../../../bin/mockery -name=alertManager -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=vmAlert -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=templatesService -case=snake -inpkg -testonly - -// alertManager is a subset of methods of alertmanager.Service used by this package. -// We use it instead of real type for testing and to avoid dependency cycle. -type alertManager interface { - GetAlerts(ctx context.Context, params *services.FilterParams) ([]*ammodels.GettableAlert, error) - FindAlertsByID(ctx context.Context, params *services.FilterParams, ids []string) ([]*ammodels.GettableAlert, error) - SilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error - UnsilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error - RequestConfigurationUpdate() -} - -// vmAlert is a subset of methods of vmalert.Service used by this package. -// We use it instead of real type for testing and to avoid dependency cycle. -type vmAlert interface { - RequestConfigurationUpdate() -} - -type templatesService interface { - GetTemplates() map[string]alerting.TemplateInfo -} diff --git a/managed/services/management/ia/mock_alert_manager_test.go b/managed/services/management/ia/mock_alert_manager_test.go deleted file mode 100644 index 5832587b47..0000000000 --- a/managed/services/management/ia/mock_alert_manager_test.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. - -package ia - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - ammodels "github.com/percona/pmm/api/alertmanager/ammodels" - services "github.com/percona/pmm/managed/services" -) - -// mockAlertManager is an autogenerated mock type for the alertManager type -type mockAlertManager struct { - mock.Mock -} - -// FindAlertsByID provides a mock function with given fields: ctx, params, ids -func (_m *mockAlertManager) FindAlertsByID(ctx context.Context, params *services.FilterParams, ids []string) ([]*ammodels.GettableAlert, error) { - ret := _m.Called(ctx, params, ids) - - var r0 []*ammodels.GettableAlert - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams, []string) []*ammodels.GettableAlert); ok { - r0 = rf(ctx, params, ids) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*ammodels.GettableAlert) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams, []string) error); ok { - r1 = rf(ctx, params, ids) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetAlerts provides a mock function with given fields: ctx, params -func (_m *mockAlertManager) GetAlerts(ctx context.Context, params *services.FilterParams) ([]*ammodels.GettableAlert, error) { - ret := _m.Called(ctx, params) - - var r0 []*ammodels.GettableAlert - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) []*ammodels.GettableAlert); ok { - r0 = rf(ctx, params) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*ammodels.GettableAlert) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams) error); ok { - r1 = rf(ctx, params) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RequestConfigurationUpdate provides a mock function with given fields: -func (_m *mockAlertManager) RequestConfigurationUpdate() { - _m.Called() -} - -// SilenceAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertManager) SilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error { - ret := _m.Called(ctx, alerts) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*ammodels.GettableAlert) error); ok { - r0 = rf(ctx, alerts) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UnsilenceAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertManager) UnsilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error { - ret := _m.Called(ctx, alerts) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*ammodels.GettableAlert) error); ok { - r0 = rf(ctx, alerts) - } else { - r0 = ret.Error(0) - } - - return r0 -} diff --git a/managed/services/management/ia/mock_templates_service_test.go b/managed/services/management/ia/mock_templates_service_test.go deleted file mode 100644 index 6f1e68ad29..0000000000 --- a/managed/services/management/ia/mock_templates_service_test.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. - -package ia - -import ( - mock "github.com/stretchr/testify/mock" - - alerting "github.com/percona/pmm/managed/services/management/alerting" -) - -// mockTemplatesService is an autogenerated mock type for the templatesService type -type mockTemplatesService struct { - mock.Mock -} - -// GetTemplates provides a mock function with given fields: -func (_m *mockTemplatesService) GetTemplates() map[string]alerting.TemplateInfo { - ret := _m.Called() - - var r0 map[string]alerting.TemplateInfo - if rf, ok := ret.Get(0).(func() map[string]alerting.TemplateInfo); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]alerting.TemplateInfo) - } - } - - return r0 -} diff --git a/managed/services/management/ia/mock_vm_alert_test.go b/managed/services/management/ia/mock_vm_alert_test.go deleted file mode 100644 index 83722527c7..0000000000 --- a/managed/services/management/ia/mock_vm_alert_test.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. - -package ia - -import mock "github.com/stretchr/testify/mock" - -// mockVmAlert is an autogenerated mock type for the vmAlert type -type mockVmAlert struct { - mock.Mock -} - -// RequestConfigurationUpdate provides a mock function with given fields: -func (_m *mockVmAlert) RequestConfigurationUpdate() { - _m.Called() -} diff --git a/managed/services/management/ia/rules_service.go b/managed/services/management/ia/rules_service.go deleted file mode 100644 index 134b2c60a5..0000000000 --- a/managed/services/management/ia/rules_service.go +++ /dev/null @@ -1,708 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "bytes" - "context" - "math" - "os" - "path/filepath" - "strings" - "time" - - "github.com/AlekSi/pointer" - "github.com/percona-platform/saas/pkg/alert" - "github.com/percona-platform/saas/pkg/common" - "github.com/percona/promconfig" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - "gopkg.in/yaml.v3" - - "github.com/percona/pmm/api/managementpb" - alerting "github.com/percona/pmm/api/managementpb/alerting" - iav1beta1 "github.com/percona/pmm/api/managementpb/ia" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/dir" - "github.com/percona/pmm/managed/utils/stringset" -) - -const ( - rulesDir = "/etc/ia/rules" -) - -// RulesService represents API for Integrated Alerting Rules. -// Deprecated. Do not use. -type RulesService struct { - db *reform.DB - l *logrus.Entry - templates templatesService - vmalert vmAlert - alertManager alertManager - rulesPath string // used for testing - - iav1beta1.UnimplementedRulesServer -} - -// NewRulesService creates an API for Integrated Alerting Rules. -// Deprecated. Do not use. -func NewRulesService(db *reform.DB, templates templatesService, vmalert vmAlert, alertManager alertManager) *RulesService { - l := logrus.WithField("component", "management/ia/rules") - - err := dir.CreateDataDir(rulesDir, "pmm", "pmm", dirPerm) - if err != nil { - l.Error(err) - } - - s := &RulesService{ - db: db, - l: l, - templates: templates, - vmalert: vmalert, - alertManager: alertManager, - rulesPath: rulesDir, - } - s.updateConfigurations() - - return s -} - -// Enabled returns if service is enabled and can be used. -// Deprecated. Do not use. -func (s *RulesService) Enabled() bool { - settings, err := models.GetSettings(s.db) - if err != nil { - s.l.WithError(err).Error("can't get settings") - return false - } - return !settings.Alerting.Disabled -} - -// TODO Move this and related types to https://github.com/percona/promconfig -// https://jira.percona.com/browse/PMM-7069 -type ruleFile struct { - Group []ruleGroup `yaml:"groups"` -} - -type ruleGroup struct { - Name string `yaml:"name"` - Rules []rule `yaml:"rules"` -} - -type rule struct { - Alert string `yaml:"alert"` // Rule ID. - Expr string `yaml:"expr"` - Duration promconfig.Duration `yaml:"for"` - Labels map[string]string `yaml:"labels,omitempty"` - Annotations map[string]string `yaml:"annotations,omitempty"` -} - -// RemoveVMAlertRulesFiles removes all generated rules files (*.yml) on the ia path. -// Deprecated. Do not use. -func (s *RulesService) RemoveVMAlertRulesFiles() error { - matches, err := filepath.Glob(s.rulesPath + "/*.yml") - if err != nil { - return errors.WithStack(err) - } - for _, match := range matches { - if err = os.RemoveAll(match); err != nil { - return errors.WithStack(err) - } - } - - return nil -} - -// WriteVMAlertRulesFiles converts all available rules to VMAlert rule files. -// Deprecated. Do not use. -func (s *RulesService) WriteVMAlertRulesFiles() { - rules, err := models.FindRules(s.db.Querier) - if err != nil { - s.l.Errorf("Failed to get available alert rules: %+v", err) - return - } - - ruleFiles, err := s.prepareRulesFiles(rules) - if err != nil { - s.l.Errorf("Failed to prepare alert rule files: %+v", err) - return - } - - if err = s.RemoveVMAlertRulesFiles(); err != nil { - s.l.Errorf("Failed to clean old alert rule files: %+v", err) - return - } - - for _, file := range ruleFiles { - err = s.writeRuleFile(&file) //nolint:gosec - if err != nil { - s.l.Errorf("Failed to write alert rule file: %+v", err) - } - } -} - -// prepareRulesFiles converts collected IA rules to Alertmanager rule files content. -// Deprecated. Do not use. -func (s *RulesService) prepareRulesFiles(rules []*models.Rule) ([]ruleFile, error) { - res := make([]ruleFile, 0, len(rules)) - for _, ruleM := range rules { - if ruleM.Disabled { - s.l.Debugf("Skipping rule %s as it is disabled.", ruleM.ID) - continue - } - - r := rule{ - Alert: ruleM.ID, - Duration: promconfig.Duration(ruleM.For), - Labels: make(map[string]string), - Annotations: make(map[string]string), - } - - params := ruleM.ParamsValues.AsStringMap() - - var err error - r.Expr, err = fillExprWithParams(ruleM.ExprTemplate, params) - if err != nil { - return nil, errors.Wrap(err, "failed to fill rule expression with parameters") - } - - annotations, err := ruleM.GetAnnotations() - if err != nil { - return nil, errors.Wrap(err, "failed to read rule annotations") - } - // Copy annotations form template - if err = transformMaps(annotations, r.Annotations, params); err != nil { - return nil, errors.Wrap(err, "failed to fill template annotations placeholders") - } - - r.Annotations["rule"] = ruleM.Name - - labels, err := ruleM.GetLabels() - if err != nil { - return nil, errors.Wrap(err, "failed to read rule labels") - } - - // Copy labels form template - if err = transformMaps(labels, r.Labels, params); err != nil { - return nil, errors.Wrap(err, "failed to fill template labels placeholders") - } - - customLabels, err := ruleM.GetCustomLabels() - if err != nil { - return nil, errors.Wrap(err, "failed to read rule custom labels") - } - - // Add rule labels - if err = transformMaps(customLabels, r.Labels, params); err != nil { - return nil, errors.Wrap(err, "failed to fill rule labels placeholders") - } - - // Do not add volatile values like `{{ $value }}` to labels as it will break alerts identity. - r.Labels["ia"] = "1" - r.Labels["severity"] = common.Severity(ruleM.Severity).String() - r.Labels["rule_id"] = ruleM.ID - r.Labels["template_name"] = ruleM.TemplateName - - res = append(res, ruleFile{ - Group: []ruleGroup{{ - Name: "PMM Integrated Alerting", - Rules: []rule{r}, - }}, - }) - } - - return res, nil -} - -// fills templates found in labels and annotaitons with values. -// Deprecated. Do not use. -func transformMaps(src map[string]string, dest map[string]string, data map[string]string) error { - var buf bytes.Buffer - for k, v := range src { - buf.Reset() - t, err := newParamTemplate().Parse(v) - if err != nil { - return err - } - if err = t.Execute(&buf, data); err != nil { - return err - } - dest[k] = buf.String() - } - return nil -} - -// dump the transformed IA templates to a file. -// Deprecated. Do not use. -func (s *RulesService) writeRuleFile(rule *ruleFile) error { - b, err := yaml.Marshal(rule) - if err != nil { - return errors.Errorf("failed to marshal rule %v", err) - } - b = append([]byte("---\n"), b...) - - alertRule := rule.Group[0].Rules[0] - if alertRule.Alert == "" { - return errors.New("alert rule not initialized") - } - - fileName := strings.TrimPrefix(alertRule.Alert, "/rule_id/") - path := s.rulesPath + "/" + fileName + ".yml" - if err = os.WriteFile(path, b, 0o644); err != nil { //nolint:gosec - return errors.Errorf("failed to dump rule to file %s: %v", s.rulesPath, err) - } - - return nil -} - -// ListAlertRules returns a list of all Integrated Alerting rules. -// Deprecated. Do not use. -func (s *RulesService) ListAlertRules(ctx context.Context, req *iav1beta1.ListAlertRulesRequest) (*iav1beta1.ListAlertRulesResponse, error) { - var pageIndex int - pageSize := math.MaxInt32 - if req.PageParams != nil { - pageIndex = int(req.PageParams.Index) - pageSize = int(req.PageParams.PageSize) - } - - var rules []*models.Rule - var channels []*models.Channel - var totalItems int - errTx := s.db.InTransaction(func(tx *reform.TX) error { - var err error - rules, err = models.FindRulesOnPage(tx.Querier, pageIndex, pageSize) - if err != nil { - return errors.WithStack(err) - } - - totalItems, err = models.CountRules(tx.Querier) - if err != nil { - return errors.WithStack(err) - } - - channelsIDs := make(map[string]struct{}, len(rules)) - for _, rule := range rules { - for _, id := range rule.ChannelIDs { - channelsIDs[id] = struct{}{} - } - } - - channels, err = models.FindChannelsByIDs(tx.Querier, stringset.ToSlice(channelsIDs)) - if err != nil { - return errors.WithStack(err) - } - - return nil - }) - if errTx != nil { - return nil, errors.WithStack(errTx) - } - - res, err := s.convertAlertRules(rules, channels) - if err != nil { - return nil, errors.WithStack(err) - } - - totalPages := totalItems / pageSize - if totalItems%pageSize > 0 { - totalPages++ - } - - totals := &managementpb.PageTotals{ - TotalItems: int32(totalItems), - TotalPages: int32(totalPages), - } - - return &iav1beta1.ListAlertRulesResponse{Rules: res, Totals: totals}, nil -} - -func (s *RulesService) convertAlertRules(rules []*models.Rule, channels []*models.Channel) ([]*iav1beta1.Rule, error) { - res := make([]*iav1beta1.Rule, 0, len(rules)) - for _, rule := range rules { - r, err := convertRule(s.l, rule, channels) - if err != nil { - return nil, errors.WithStack(err) - } - res = append(res, r) - } - - return res, nil -} - -// CreateAlertRule creates Integrated Alerting rule. -// Deprecated. Do not use. -func (s *RulesService) CreateAlertRule(ctx context.Context, req *iav1beta1.CreateAlertRuleRequest) (*iav1beta1.CreateAlertRuleResponse, error) { - if req.TemplateName != "" && req.SourceRuleId != "" { - return nil, status.Errorf(codes.InvalidArgument, "Both template name and source rule id are specified.") - } - if req.TemplateName == "" && req.SourceRuleId == "" { - return nil, status.Errorf(codes.InvalidArgument, "Template name or source rule id should be specified.") - } - - params := &models.CreateRuleParams{ - Name: req.Name, - Disabled: req.Disabled, - For: req.For.AsDuration(), - Severity: models.Severity(req.Severity), - CustomLabels: req.CustomLabels, - ChannelIDs: req.ChannelIds, - } - - var err error - params.ParamsValues, err = convertParamsValuesToModel(req.Params) - if err != nil { - return nil, err - } - - params.Filters, err = convertFiltersToModel(req.Filters) - if err != nil { - return nil, err - } - - if req.TemplateName != "" { - template, ok := s.templates.GetTemplates()[req.TemplateName] - if !ok { - return nil, status.Errorf(codes.NotFound, "Unknown template %s.", req.TemplateName) - } - - params.TemplateName = template.Name - params.Summary = template.Summary - params.ExprTemplate = template.Expr - params.DefaultFor = time.Duration(template.For) - params.DefaultSeverity = models.Severity(template.Severity) - params.Labels = template.Labels - params.Annotations = template.Annotations - - params.ParamsDefinitions, err = models.ConvertParamsDefinitions(template.Params) - if err != nil { - return nil, err - } - } else { - sourceRule, err := models.FindRuleByID(s.db.Querier, req.SourceRuleId) - if err != nil { - return nil, err - } - - params.TemplateName = sourceRule.TemplateName - params.Summary = sourceRule.Summary - params.ExprTemplate = sourceRule.ExprTemplate - params.DefaultFor = sourceRule.DefaultFor - params.DefaultSeverity = sourceRule.DefaultSeverity - params.ParamsDefinitions = sourceRule.ParamsDefinitions - - params.Labels, err = sourceRule.GetLabels() - if err != nil { - return nil, err - } - - params.Annotations, err = sourceRule.GetAnnotations() - if err != nil { - return nil, err - } - } - - if err := validateParameters(params.ParamsDefinitions, params.ParamsValues); err != nil { - return nil, err - } - - // Check that we can compile expression with given parameters - _, err = fillExprWithParams(params.ExprTemplate, params.ParamsValues.AsStringMap()) - if err != nil { - return nil, err - } - - var rule *models.Rule - errTX := s.db.InTransaction(func(tx *reform.TX) error { - var err error - rule, err = models.CreateRule(tx.Querier, params) - return err - }) - if errTX != nil { - return nil, errTX - } - - s.updateConfigurations() - - return &iav1beta1.CreateAlertRuleResponse{RuleId: rule.ID}, nil -} - -// UpdateAlertRule updates Integrated Alerting rule. -// Deprecated. Do not use. -func (s *RulesService) UpdateAlertRule(ctx context.Context, req *iav1beta1.UpdateAlertRuleRequest) (*iav1beta1.UpdateAlertRuleResponse, error) { - params := &models.ChangeRuleParams{ - Name: req.Name, - Disabled: req.Disabled, - For: req.For.AsDuration(), - Severity: models.Severity(req.Severity), - CustomLabels: req.CustomLabels, - ChannelIDs: req.ChannelIds, - } - - var err error - params.Filters, err = convertFiltersToModel(req.Filters) - if err != nil { - return nil, err - } - - params.ParamsValues, err = convertParamsValuesToModel(req.Params) - if err != nil { - return nil, err - } - e := s.db.InTransaction(func(tx *reform.TX) error { - rule, err := models.FindRuleByID(tx.Querier, req.RuleId) - if err != nil { - return err - } - - if err = validateParameters(rule.ParamsDefinitions, params.ParamsValues); err != nil { - return err - } - - // Check that we can compile expression with given parameters - if _, err = fillExprWithParams(rule.ExprTemplate, params.ParamsValues.AsStringMap()); err != nil { - return errors.Wrap(err, "failed to fill expression template with parameters values") - } - - _, err = models.ChangeRule(tx.Querier, req.RuleId, params) - return err - }) - if e != nil { - return nil, e - } - - s.updateConfigurations() - - return &iav1beta1.UpdateAlertRuleResponse{}, nil -} - -// ToggleAlertRule allows switching between disabled and enabled states of an Alert Rule. -// Deprecated. Do not use. -func (s *RulesService) ToggleAlertRule(ctx context.Context, req *iav1beta1.ToggleAlertRuleRequest) (*iav1beta1.ToggleAlertRuleResponse, error) { - params := &models.ToggleRuleParams{Disabled: parseBooleanFlag(req.Disabled)} - e := s.db.InTransaction(func(tx *reform.TX) error { - _, err := models.ToggleRule(tx.Querier, req.RuleId, params) - return err - }) - if e != nil { - return nil, e - } - - s.updateConfigurations() - - return &iav1beta1.ToggleAlertRuleResponse{}, nil -} - -// DeleteAlertRule deletes Integrated Alerting rule. -// Deprecated. Do not use. -func (s *RulesService) DeleteAlertRule(ctx context.Context, req *iav1beta1.DeleteAlertRuleRequest) (*iav1beta1.DeleteAlertRuleResponse, error) { - e := s.db.InTransaction(func(tx *reform.TX) error { - return models.RemoveRule(tx.Querier, req.RuleId) - }) - if e != nil { - return nil, e - } - - s.updateConfigurations() - - return &iav1beta1.DeleteAlertRuleResponse{}, nil -} - -func (s *RulesService) updateConfigurations() { - s.WriteVMAlertRulesFiles() - s.vmalert.RequestConfigurationUpdate() - s.alertManager.RequestConfigurationUpdate() -} - -// convertParamType converts an alert type to its alerting API equivalent. -// Deprecated. Do not use. -func convertParamType(t alert.Type) alerting.ParamType { - // TODO: add another types. - switch t { - case alert.Float: - return alerting.ParamType_FLOAT - default: - return alerting.ParamType_PARAM_TYPE_INVALID - } -} - -// convertModelToParamsDefinitions converts a parameter definition model to its alerting API equivalent. -// Deprecated. Do not use. -func convertModelToParamsDefinitions(definitions models.AlertExprParamsDefinitions) ([]*alerting.ParamDefinition, error) { - res := make([]*alerting.ParamDefinition, 0, len(definitions)) - for _, definition := range definitions { - t := alert.Type(definition.Type) - p := &alerting.ParamDefinition{ - Name: definition.Name, - Summary: definition.Summary, - Unit: convertParamUnit(alert.Unit(definition.Unit)), - Type: convertParamType(t), - } - - switch t { - case alert.Float: - var value alerting.FloatParamDefinition - float := definition.FloatParam - if float.Default != nil { - value.HasDefault = true - value.Default = pointer.GetFloat64(float.Default) - } - - if float.Min != nil { - value.HasMin = true - value.Min = pointer.GetFloat64(float.Min) - } - - if float.Max != nil { - value.HasMax = true - value.Max = pointer.GetFloat64(float.Max) - } - p.Value = &alerting.ParamDefinition_Float{Float: &value} - case alert.Bool, alert.String: - return nil, errors.Errorf("unsupported parameter type %s", t) - } - - // do not add `default:` to make exhaustive linter do its job - - res = append(res, p) - } - - return res, nil -} - -// convertModelToParamValues converts a parameter value to its protobuf representation. -// Deprecated. Do not use. -func convertModelToParamValues(values models.AlertExprParamsValues) ([]*iav1beta1.ParamValue, error) { - res := make([]*iav1beta1.ParamValue, len(values)) - for i, param := range values { - p := &iav1beta1.ParamValue{Name: param.Name} - - switch param.Type { - case models.Bool: - p.Type = alerting.ParamType_BOOL - p.Value = &iav1beta1.ParamValue_Bool{Bool: param.BoolValue} - case models.Float: - p.Type = alerting.ParamType_FLOAT - p.Value = &iav1beta1.ParamValue_Float{Float: param.FloatValue} - case models.String: - p.Type = alerting.ParamType_STRING - p.Value = &iav1beta1.ParamValue_String_{String_: param.StringValue} - default: - return nil, errors.Errorf("unknown rule param value type %s", param.Type) - } - res[i] = p - } - return res, nil -} - -// convertParamsValuesToModel converts a parameter value to its model equivalent. -// Deprecated. Do not use. -func convertParamsValuesToModel(params []*iav1beta1.ParamValue) (models.AlertExprParamsValues, error) { - ruleParams := make(models.AlertExprParamsValues, len(params)) - for i, param := range params { - p := models.AlertExprParamValue{Name: param.Name} - - switch param.Type { - case alerting.ParamType_PARAM_TYPE_INVALID: - return nil, errors.New("invalid model rule param value type") - case alerting.ParamType_BOOL: - p.Type = models.Bool - p.BoolValue = param.GetBool() - case alerting.ParamType_FLOAT: - p.Type = models.Float - p.FloatValue = param.GetFloat() - case alerting.ParamType_STRING: - p.Type = models.Float - p.StringValue = param.GetString_() - default: - return nil, errors.New("invalid model rule param value type") - } - - ruleParams[i] = p - } - return ruleParams, nil -} - -// parseBooleanFlag converts a protobuf boolean value to a boolean pointer. -// Deprecated. Do not use. -func parseBooleanFlag(bf managementpb.BooleanFlag) *bool { - switch bf { - case managementpb.BooleanFlag_TRUE: - return pointer.ToBool(true) - case managementpb.BooleanFlag_FALSE: - return pointer.ToBool(false) - case managementpb.BooleanFlag_DO_NOT_CHANGE: - return nil - default: - panic("unexpected value of boolean flag") - } -} - -// convertModelToFilterType converts a filter type model to its protobuf representation. -// Deprecated. Do not use. -func convertModelToFilterType(filterType models.FilterType) iav1beta1.FilterType { - switch filterType { - case models.Equal: - return iav1beta1.FilterType_EQUAL - case models.Regex: - return iav1beta1.FilterType_REGEX - default: - return iav1beta1.FilterType_FILTER_TYPE_INVALID - } -} - -// convertFiltersToModel converts an IA filter to its model representation. -// Deprecated. Do not use. -func convertFiltersToModel(filters []*iav1beta1.Filter) (models.Filters, error) { - res := make(models.Filters, len(filters)) - for i, filter := range filters { - f := models.Filter{ - Key: filter.Key, - } - - // Unquote the first encountered quote. - // Do it only for filters as only they can be set in PMM 2.13. - f.Val = filter.Value - for _, q := range []string{`"`, `'`} { - if strings.HasPrefix(f.Val, q) && strings.HasSuffix(f.Val, q) { - f.Val = strings.TrimPrefix(f.Val, q) - f.Val = strings.TrimSuffix(f.Val, q) - break - } - } - - switch filter.Type { - case iav1beta1.FilterType_EQUAL: - f.Type = models.Equal - case iav1beta1.FilterType_REGEX: - f.Type = models.Regex - case iav1beta1.FilterType_FILTER_TYPE_INVALID: - fallthrough - default: - return nil, status.Errorf(codes.InvalidArgument, "Unexpected filter type.") - } - res[i] = f - } - - return res, nil -} - -// Check interfaces. -var ( - _ iav1beta1.RulesServer = (*RulesService)(nil) -) diff --git a/managed/services/management/ia/rules_service_test.go b/managed/services/management/ia/rules_service_test.go deleted file mode 100644 index 542e621cb2..0000000000 --- a/managed/services/management/ia/rules_service_test.go +++ /dev/null @@ -1,380 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "strings" - "testing" - - "github.com/stretchr/testify/require" -) - -/* -// func TestCreateAlertRule(t *testing.T) { -// ctx := context.Background() -// sqlDB := testdb.Open(t, models.SkipFixtures, nil) -// db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) -// -// // Enable IA and disable telemetry to prevent network calls -// settings, err := models.GetSettings(db) -// require.NoError(t, err) -// settings.Alerting.Disabled = false -// settings.Telemetry.Disabled = true -// err = models.SaveSettings(db, settings) -// require.NoError(t, err) -// -// var alertManager mockAlertManager -// alertManager.On("RequestConfigurationUpdate").Return() -// var vmAlert mockVmAlert -// vmAlert.On("RequestConfigurationUpdate").Return() -// -// // Create channel -// channels := NewChannelsService(db, &alertManager) -// respC, err := channels.AddChannel(context.Background(), &iav1beta1.AddChannelRequest{ -// Summary: "test channel", -// EmailConfig: &iav1beta1.EmailConfig{ -// SendResolved: false, -// To: []string{"test@test.test"}, -// }, -// Disabled: false, -// }) -// require.NoError(t, err) -// channelID := respC.ChannelId -// -// // Load test templates -// templates, err := NewTemplatesService(db, nil) -// require.NoError(t, err) -// templates.userTemplatesPath = testTemplates2 -// templates.CollectTemplates(ctx) -// -// t.Run("normal", func(t *testing.T) { -// testDir := t.TempDir() -// -// // Create test rule -// rules := NewRulesService(db, templates, &vmAlert, &alertManager) -// rules.rulesPath = testDir -// resp, err := rules.CreateAlertRule(context.Background(), &iav1beta1.CreateAlertRuleRequest{ -// TemplateName: "test_template", -// Disabled: false, -// Name: "some testing rule", -// Params: []*iav1beta1.ParamValue{ -// { -// Name: "param1", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 85}, -// }, -// { -// Name: "param2", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 1.22}, -// }, -// }, -// For: durationpb.New(2 * time.Second), -// Severity: managementpb.Severity_SEVERITY_INFO, -// CustomLabels: map[string]string{ -// "baz": "faz", -// }, -// Filters: []*iav1beta1.Filter{{ -// Type: iav1beta1.FilterType_EQUAL, -// Key: "some_key", -// Value: "'60'", -// }}, -// ChannelIds: []string{channelID}, -// }) -// require.NoError(t, err) -// ruleID := resp.RuleId -// -// // Write vmAlert rules files -// rules.WriteVMAlertRulesFiles() -// -// file, err := os.ReadFile(ruleFileName(testDir, ruleID)) -// require.NoError(t, err) -// -// expected := fmt.Sprintf(`--- -// groups: -// - name: PMM Integrated Alerting -// rules: -// - alert: %s -// expr: 1.22 * 100 > 85 -// for: 2s -// labels: -// baz: faz -// foo: bar -// ia: "1" -// rule_id: %s -// severity: info -// template_name: test_template -// annotations: -// description: |- -// Test template with param1=85 and param2=1.22 -// VALUE = {{ $value }} -// LABELS: {{ $labels }} -// rule: some testing rule -// summary: Test rule (instance {{ $labels.instance }}) -// `, ruleID, ruleID) -// -// assert.Equal(t, expected, string(file)) -// -// // Removes the rules files -// err = rules.RemoveVMAlertRulesFiles() -// require.NoError(t, err) -// -// matches, err := dir.FindFilesWithExtensions(testDir, "yml", "yaml") -// -// assert.Empty(t, matches) -// assert.NoError(t, err) -// }) -// -// t.Run("wrong parameter value", func(t *testing.T) { -// testDir := t.TempDir() -// -// // Create test rule -// rules := NewRulesService(db, templates, &vmAlert, &alertManager) -// rules.rulesPath = testDir -// _, err = rules.CreateAlertRule(context.Background(), &iav1beta1.CreateAlertRuleRequest{ -// TemplateName: "test_template", -// Disabled: false, -// Name: "some testing rule", -// Params: []*iav1beta1.ParamValue{ -// { -// Name: "param1", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 123}, -// }, { -// Name: "param2", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 1.22}, -// }, -// }, -// For: durationpb.New(2 * time.Second), -// Severity: managementpb.Severity_SEVERITY_INFO, -// CustomLabels: map[string]string{ -// "baz": "faz", -// }, -// Filters: []*iav1beta1.Filter{{ -// Type: iav1beta1.FilterType_EQUAL, -// Key: "some_key", -// Value: "'60'", -// }}, -// ChannelIds: []string{channelID}, -// }) -// tests.AssertGRPCError(t, status.New(codes.InvalidArgument, "Parameter param1 value is greater than required maximum."), err) -// }) -// -// t.Run("wrong parameter", func(t *testing.T) { -// testDir := t.TempDir() -// -// // Create test rule -// rules := NewRulesService(db, templates, &vmAlert, &alertManager) -// rules.rulesPath = testDir -// _, err = rules.CreateAlertRule(context.Background(), &iav1beta1.CreateAlertRuleRequest{ -// TemplateName: "test_template", -// Disabled: false, -// Name: "some testing rule", -// Params: []*iav1beta1.ParamValue{ -// { -// Name: "param2", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 22.1}, -// }, { -// Name: "unknown parameter", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 1.22}, -// }, -// }, -// For: durationpb.New(2 * time.Second), -// Severity: managementpb.Severity_SEVERITY_INFO, -// CustomLabels: map[string]string{ -// "baz": "faz", -// }, -// Filters: []*iav1beta1.Filter{{ -// Type: iav1beta1.FilterType_EQUAL, -// Key: "some_key", -// Value: "'60'", -// }}, -// ChannelIds: []string{channelID}, -// }) -// tests.AssertGRPCError(t, status.New(codes.InvalidArgument, "Parameter param1 is missing."), err) -// }) -// -// t.Run("missing parameter", func(t *testing.T) { -// testDir := t.TempDir() -// -// // Create test rule -// rules := NewRulesService(db, templates, &vmAlert, &alertManager) -// rules.rulesPath = testDir -// _, err = rules.CreateAlertRule(context.Background(), &iav1beta1.CreateAlertRuleRequest{ -// TemplateName: "test_template", -// Disabled: false, -// Name: "some testing rule", -// Params: []*iav1beta1.ParamValue{ -// { -// Name: "param2", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 22.1}, -// }, -// }, -// For: durationpb.New(2 * time.Second), -// Severity: managementpb.Severity_SEVERITY_INFO, -// CustomLabels: map[string]string{ -// "baz": "faz", -// }, -// Filters: []*iav1beta1.Filter{{ -// Type: iav1beta1.FilterType_EQUAL, -// Key: "some_key", -// Value: "'60'", -// }}, -// ChannelIds: []string{channelID}, -// }) -// tests.AssertGRPCError(t, status.New(codes.InvalidArgument, "Expression requires 2 parameters, but got 1."), err) -// }) -// -// t.Run("wrong parameter type", func(t *testing.T) { -// testDir := t.TempDir() -// -// // Create test rule -// rules := NewRulesService(db, templates, &vmAlert, &alertManager) -// rules.rulesPath = testDir -// _, err = rules.CreateAlertRule(context.Background(), &iav1beta1.CreateAlertRuleRequest{ -// TemplateName: "test_template", -// Disabled: false, -// Name: "some testing rule", -// Params: []*iav1beta1.ParamValue{ -// { -// Name: "param1", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 1.22}, -// }, -// { -// Name: "param2", -// Type: alerting.ParamType_BOOL, -// Value: &iav1beta1.ParamValue_Bool{Bool: true}, -// }, -// }, -// For: durationpb.New(2 * time.Second), -// Severity: managementpb.Severity_SEVERITY_INFO, -// CustomLabels: map[string]string{ -// "baz": "faz", -// }, -// Filters: []*iav1beta1.Filter{{ -// Type: iav1beta1.FilterType_EQUAL, -// Key: "some_key", -// Value: "'60'", -// }}, -// ChannelIds: []string{channelID}, -// }) -// tests.AssertGRPCError(t, status.New(codes.InvalidArgument, "Parameter param2 has type bool instead of float."), err) -// }) -// -// t.Run("missing template", func(t *testing.T) { -// testDir := t.TempDir() -// -// // Create test rule -// rules := NewRulesService(db, templates, &vmAlert, &alertManager) -// rules.rulesPath = testDir -// _, err = rules.CreateAlertRule(context.Background(), &iav1beta1.CreateAlertRuleRequest{ -// TemplateName: "unknown template", -// Disabled: false, -// Name: "some testing rule", -// Params: []*iav1beta1.ParamValue{{ -// Name: "param2", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{ -// Float: 1.22, -// }, -// }}, -// For: durationpb.New(2 * time.Second), -// Severity: managementpb.Severity_SEVERITY_INFO, -// CustomLabels: map[string]string{ -// "baz": "faz", -// }, -// Filters: []*iav1beta1.Filter{{ -// Type: iav1beta1.FilterType_EQUAL, -// Key: "some_key", -// Value: "'60'", -// }}, -// ChannelIds: []string{channelID}, -// }) -// tests.AssertGRPCError(t, status.New(codes.NotFound, "Unknown template unknown template."), err) -// }) -// -// t.Run("disabled", func(t *testing.T) { -// testDir := t.TempDir() -// -// vmAlert = mockVmAlert{} -// vmAlert.On("RequestConfigurationUpdate").Return() -// -// // Create test rule -// rules := NewRulesService(db, templates, &vmAlert, &alertManager) -// rules.rulesPath = testDir -// resp, err := rules.CreateAlertRule(context.Background(), &iav1beta1.CreateAlertRuleRequest{ -// TemplateName: "test_template", -// Disabled: true, -// Name: "some testing rule", -// Params: []*iav1beta1.ParamValue{ -// { -// Name: "param1", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 85}, -// }, -// { -// Name: "param2", -// Type: alerting.ParamType_FLOAT, -// Value: &iav1beta1.ParamValue_Float{Float: 1.22}, -// }, -// }, -// For: durationpb.New(2 * time.Second), -// Severity: managementpb.Severity_SEVERITY_INFO, -// CustomLabels: map[string]string{ -// "baz": "faz", -// }, -// Filters: []*iav1beta1.Filter{{ -// Type: iav1beta1.FilterType_EQUAL, -// Key: "some_key", -// Value: "60", -// }}, -// ChannelIds: []string{channelID}, -// }) -// require.NoError(t, err) -// ruleID := resp.RuleId -// -// // Write vmAlert rules files -// rules.WriteVMAlertRulesFiles() -// -// filename := ruleFileName(testDir, ruleID) -// _, err = os.Stat(filename) -// assert.EqualError(t, err, fmt.Sprintf("stat %s: no such file or directory", filename)) -// }) -// } -*/ - -func ruleFileName(testDir, ruleID string) string { - return testDir + "/" + strings.TrimPrefix(ruleID, "/rule_id/") + ".yml" -} - -func TestTemplatesRuleExpr(t *testing.T) { - expr := "[[ .param1 ]] > [[ .param2 ]] and [[ .param2 ]] < [[ .param3 ]]" - - params := map[string]string{ - "param1": "5", - "param2": "2", - "param3": "4", - } - actual, err := fillExprWithParams(expr, params) - require.NoError(t, err) - - require.Equal(t, "5 > 2 and 2 < 4", actual) -} diff --git a/managed/services/server/server.go b/managed/services/server/server.go index 258fb7647f..6d7c351d57 100644 --- a/managed/services/server/server.go +++ b/managed/services/server/server.go @@ -30,7 +30,6 @@ import ( "sync" "time" - "github.com/asaskevich/govalidator" "github.com/google/uuid" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -63,7 +62,6 @@ type Server struct { grafanaClient grafanaClient rulesService rulesService dbaasInitializer dbaasInitializer - emailer emailer l *logrus.Entry @@ -103,7 +101,6 @@ type Params struct { GrafanaClient grafanaClient RulesService rulesService DBaaSInitializer dbaasInitializer - Emailer emailer } // NewServer returns new server for Server service. @@ -129,7 +126,6 @@ func NewServer(params *Params) (*Server, error) { grafanaClient: params.GrafanaClient, rulesService: params.RulesService, dbaasInitializer: params.DBaaSInitializer, - emailer: params.Emailer, l: logrus.WithField("component", "server"), pmmUpdateAuthFile: path, envSettings: &models.ChangeSettingsParams{}, @@ -760,43 +756,6 @@ func (s *Server) ChangeSettings(ctx context.Context, req *serverpb.ChangeSetting }, nil } -// TestEmailAlertingSettings tests email alerting SMTP settings by sending testing email. -func (s *Server) TestEmailAlertingSettings( - ctx context.Context, - req *serverpb.TestEmailAlertingSettingsRequest, -) (*serverpb.TestEmailAlertingSettingsResponse, error) { - eas := req.EmailAlertingSettings - settings := &models.EmailAlertingSettings{ - From: eas.From, - Smarthost: eas.Smarthost, - Hello: eas.Hello, - Username: eas.Username, - Password: eas.Password, - Identity: eas.Identity, - Secret: eas.Secret, - RequireTLS: eas.RequireTls, - } - - if err := settings.Validate(); err != nil { - return nil, status.Errorf(codes.InvalidArgument, "Invalid argument: %s.", err.Error()) - } - - if !govalidator.IsEmail(req.EmailTo) { - return nil, status.Errorf(codes.InvalidArgument, "invalid \"emailTo\" email %q", req.EmailTo) - } - - err := s.emailer.Send(ctx, settings, req.EmailTo) - if err != nil { - var errInvalidArgument *models.InvalidArgumentError - if errors.As(err, &errInvalidArgument) { - return nil, status.Errorf(codes.InvalidArgument, "Cannot send email: %s.", errInvalidArgument.Details) - } - return nil, status.Errorf(codes.Internal, "Cannot send email: %s.", err.Error()) - } - - return &serverpb.TestEmailAlertingSettingsResponse{}, nil -} - // UpdateConfigurations updates supervisor config and requests configuration update for VictoriaMetrics components. func (s *Server) UpdateConfigurations(ctx context.Context) error { settings, err := models.GetSettings(s.db) From 054714702793f8bec831f0d5e8af67eba162c845 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 26 Jun 2023 19:52:13 +0200 Subject: [PATCH 02/22] PMM-11079 Cleanup IA leftovwers --- api-tests/init.go | 6 - build/docker/server/README.md | 4 +- managed/CONTRIBUTING.md | 1 - managed/data/gen.go | 4 +- managed/models/database.go | 2 + managed/models/settings.go | 44 +---- managed/models/settings_helpers.go | 64 +------ managed/models/settings_helpers_test.go | 144 +++------------ managed/services/errors.go | 3 - .../services/management/alerting/service.go | 8 +- .../management/alerting/service_test.go | 7 - managed/services/server/deps.go | 13 +- managed/services/server/server.go | 65 +------ managed/services/server/server_test.go | 172 +----------------- managed/utils/envvars/parser.go | 2 +- 15 files changed, 49 insertions(+), 490 deletions(-) diff --git a/api-tests/init.go b/api-tests/init.go index f79450d255..b3c5bc054e 100644 --- a/api-tests/init.go +++ b/api-tests/init.go @@ -67,9 +67,6 @@ var ( // RunSTTTests is true if STT tests should be run. RunSTTTests bool - // RunIATests is true if IA tests should be run. - RunIATests bool - // Kubeconfig contains kubeconfig. Kubeconfig string ) @@ -138,9 +135,6 @@ func init() { // FIXME we should rethink it once https://jira.percona.com/browse/PMM-5106 is implemented runSTTTestsF := flag.Bool("pmm.run-stt-tests", false, "Run STT tests that require connected clients [PMM_RUN_STT_TESTS].") - // TODO remove once IA is out of beta: https://jira.percona.com/browse/PMM-7001 - runIATestsF := flag.Bool("pmm.run-ia-tests", false, "Run IA tests that require connected clients [PMM_RUN_IA_TESTS].") - testing.Init() flag.Parse() diff --git a/build/docker/server/README.md b/build/docker/server/README.md index 9806ab0513..6b90b74388 100644 --- a/build/docker/server/README.md +++ b/build/docker/server/README.md @@ -24,16 +24,16 @@ This example uses the tag `:2` to pull the latest PMM 2.x version, but other, [m You can use these environment variables (-e VAR) when running the Docker image. | Variable | Description | -| ------------------------ | --------------------------------------------------------------------------------------------------------------------------- | +|--------------------------|-----------------------------------------------------------------------------------------------------------------------------| | DISABLE_UPDATES | Disable automatic updates | | DISABLE_TELEMETRY | Disable built-in telemetry and disable STT if telemetry is disabled | +| DISABLE_ALERTING | Disable percona alerting | | METRICS_RESOLUTION | High metrics resolution in seconds | | METRICS_RESOLUTION_HR | High metrics resolution (same as above) | | METRICS_RESOLUTION_MR | Medium metrics resolution in seconds | | METRICS_RESOLUTION_LR | Low metrics resolution in seconds | | DATA_RETENTION | How long to keep time-series data in ClickHouse. This variable accepts golang style duration format, example: 24h, 30m, 10s | | ENABLE_VM_CACHE | Enable cache in VM | -| ENABLE_ALERTING | Enable integrated alerting | | ENABLE_AZUREDISCOVER | Enable support for discovery of Azure databases | | ENABLE_BACKUP_MANAGEMENT | Enable integrated backup tools | | ENABLE_DBAAS | Enable DBaaS features | diff --git a/managed/CONTRIBUTING.md b/managed/CONTRIBUTING.md index 81a37aa86e..09b9699fc1 100644 --- a/managed/CONTRIBUTING.md +++ b/managed/CONTRIBUTING.md @@ -120,7 +120,6 @@ Devcontainer initialization code is located in `.devcontainer/setup.py`. It uses - If the changes require multiple PRs spanning multiple repos make sure to keep the branch names same. - If the PR requires any API changes then make your changes in `main` branch of the [API repo](https://github.com/percona/pmm) and pull those changes in your pmm-managed branch by mentioning the API changes branch name in the `Gopkg.toml` constraint and running `dep ensure -v -update github.com/percona/pmm`. -- If the PR introduces changes to the IA templates make sure to run `make gen` to udpate the generated code. - If the PR changes any files named `deps.go` make sure to run `make gen` to generate mock clients. Before making PR, please run these commands locally: - `make env TARGET=check-all` to run all checkers and linters. diff --git a/managed/data/gen.go b/managed/data/gen.go index 4e01fb7a53..5f276bc4e9 100644 --- a/managed/data/gen.go +++ b/managed/data/gen.go @@ -18,10 +18,10 @@ package data import "embed" -// IATemplates holds IA template files in the struct of type embed.FS which implements the io/fs package's FS interface. +// AlertRuleTemplates holds Percona Alerting template files in the struct of type embed.FS which implements the io/fs package's FS interface. // //go:embed iatemplates/* -var IATemplates embed.FS +var AlertRuleTemplates embed.FS //go:embed crds/* var OLMCRDs embed.FS diff --git a/managed/models/database.go b/managed/models/database.go index 4abfe803a9..342a76dc39 100644 --- a/managed/models/database.go +++ b/managed/models/database.go @@ -919,6 +919,8 @@ var databaseSchema = [][]string{ `DROP TABLE IF EXISTS ia_channels`, `DROP TABLE IF EXISTS ia_rules`, `ALTER TABLE ia_templates RENAME TO alert_rule_templates`, + `UPDATE settings SET settings = settings #- '{alerting, email_settings}';`, + `UPDATE settings SET settings = settings #- '{alerting, slack_settings}';`, }, } diff --git a/managed/models/settings.go b/managed/models/settings.go index f6c3e53004..30087b1469 100644 --- a/managed/models/settings.go +++ b/managed/models/settings.go @@ -18,9 +18,7 @@ package models import ( "time" - "github.com/asaskevich/govalidator" "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/pkg/errors" ) // MetricsResolutions contains standard VictoriaMetrics metrics resolutions. @@ -40,11 +38,9 @@ type SaaS struct { STTCheckIntervals STTCheckIntervals `json:"stt_check_intervals"` } -// Alerting contains settings related to Alerting. +// Alerting contains settings related to Percona Alerting. type Alerting struct { - Disabled bool `json:"disabled"` - EmailAlertingSettings *EmailAlertingSettings `json:"email_settings"` // TODO: Remove - SlackAlertingSettings *SlackAlertingSettings `json:"slack_settings"` + Disabled bool `json:"disabled"` } // Settings contains PMM Server settings. @@ -107,42 +103,6 @@ type Settings struct { } `json:"access_control"` } -// EmailAlertingSettings represents email settings for Integrated Alerting. -type EmailAlertingSettings struct { - From string `json:"from"` - Smarthost string `json:"smarthost"` - Hello string `json:"hello"` - Username string `json:"username"` - Password string `json:"password"` - Identity string `json:"identity"` - Secret string `json:"secret"` - RequireTLS bool `json:"require_tls"` -} - -// Validate validates structure's fields. -func (e *EmailAlertingSettings) Validate() error { - if !govalidator.IsEmail(e.From) { - return errors.Errorf("invalid \"from\" email %q", e.From) - } - - if !govalidator.IsDialString(e.Smarthost) { - return errors.New("invalid server address, expected format host:port") - } - - if e.Hello != "" { - if !govalidator.IsHost(e.Hello) { - return errors.New("invalid hello field, expected valid host") - } - } - - return nil -} - -// SlackAlertingSettings represents Slack settings for Integrated Alerting. -type SlackAlertingSettings struct { - URL string `json:"url"` -} - // STTCheckIntervals represents intervals between STT checks. type STTCheckIntervals struct { StandardInterval time.Duration `json:"standard_interval"` diff --git a/managed/models/settings_helpers.go b/managed/models/settings_helpers.go index 8e73d73601..5c83332368 100644 --- a/managed/models/settings_helpers.go +++ b/managed/models/settings_helpers.go @@ -22,7 +22,6 @@ import ( "strings" "time" - "github.com/asaskevich/govalidator" "github.com/google/uuid" "github.com/pkg/errors" "gopkg.in/reform.v1" @@ -91,9 +90,9 @@ type ChangeSettingsParams struct { // Disable Azure Discover features. DisableAzurediscover bool - // Enable Integrated Alerting features. + // Enable Percona Alerting features. EnableAlerting bool - // Disable Integrated Alerting features. + // Disable Percona Alerting features. DisableAlerting bool // Enable Access Control features. @@ -101,16 +100,6 @@ type ChangeSettingsParams struct { // Disable Access Control features. DisableAccessControl bool - // Email config for Integrated Alerting. - EmailAlertingSettings *EmailAlertingSettings - // If true removes email alerting settings. - RemoveEmailAlertingSettings bool - - // Slack config for Integrated Alerting. - SlackAlertingSettings *SlackAlertingSettings - // If true removes Slack alerting settings. - RemoveSlackAlertingSettings bool - // EnableVMCache enables caching for vmdb search queries EnableVMCache bool // DisableVMCache disables caching for vmdb search queries @@ -286,21 +275,6 @@ func UpdateSettings(q reform.DBTX, params *ChangeSettingsParams) (*Settings, err settings.AccessControl.Enabled = true } - if params.RemoveEmailAlertingSettings { - settings.Alerting.EmailAlertingSettings = nil - } - - if params.RemoveSlackAlertingSettings { - settings.Alerting.SlackAlertingSettings = nil - } - - if params.EmailAlertingSettings != nil { - settings.Alerting.EmailAlertingSettings = params.EmailAlertingSettings - } - if params.SlackAlertingSettings != nil { - settings.Alerting.SlackAlertingSettings = params.SlackAlertingSettings - } - if params.DisableBackupManagement { settings.BackupManagement.Disabled = true } @@ -329,34 +303,6 @@ func lockRoleForChange(tx *reform.TX, roleID int) error { return nil } -func validateSlackAlertingSettings(params *ChangeSettingsParams) error { - if params.SlackAlertingSettings != nil && params.RemoveSlackAlertingSettings { - return errors.New("both slack_alerting_settings and remove_slack_alerting_settings are present") - } - - if params.SlackAlertingSettings == nil { - return nil - } - - if !govalidator.IsURL(params.SlackAlertingSettings.URL) { - return errors.New("invalid url value") - } - - return nil -} - -func validateEmailAlertingSettings(params *ChangeSettingsParams) error { - if params.EmailAlertingSettings != nil && params.RemoveEmailAlertingSettings { - return errors.New("both email_alerting_settings and remove_email_alerting_settings are present") - } - - if params.EmailAlertingSettings == nil { - return nil - } - - return params.EmailAlertingSettings.Validate() -} - // ValidateSettings validates settings changes. func ValidateSettings(params *ChangeSettingsParams) error { //nolint:cyclop if params.EnableUpdates && params.DisableUpdates { @@ -374,12 +320,6 @@ func ValidateSettings(params *ChangeSettingsParams) error { //nolint:cyclop if params.EnableAlerting && params.DisableAlerting { return errors.New("both enable_alerting and disable_alerting are present") } - if err := validateEmailAlertingSettings(params); err != nil { - return err - } - if err := validateSlackAlertingSettings(params); err != nil { - return err - } if params.EnableBackupManagement && params.DisableBackupManagement { return errors.New("both enable_backup_management and disable_backup_management are present") } diff --git a/managed/models/settings_helpers_test.go b/managed/models/settings_helpers_test.go index 941e1745d7..a5c6f91946 100644 --- a/managed/models/settings_helpers_test.go +++ b/managed/models/settings_helpers_test.go @@ -19,14 +19,12 @@ import ( "testing" "time" - "github.com/brianvoe/gofakeit/v6" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" ) func TestSettings(t *testing.T) { @@ -345,131 +343,45 @@ func TestSettings(t *testing.T) { assert.True(t, ns.AccessControl.Enabled) }) - t.Run("Integrated Alerting settings validation", func(t *testing.T) { - emailSettings := &models.EmailAlertingSettings{ - From: tests.GenEmail(t), - Smarthost: "0.0.0.0:8080", - Hello: "smtp_host", - Username: "smtp_username", - Password: "smtp_password", - Secret: "smtp_secret", - } - slackSettings := &models.SlackAlertingSettings{URL: gofakeit.URL()} - ns, err := models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - EnableAlerting: true, - EmailAlertingSettings: emailSettings, - SlackAlertingSettings: slackSettings, - }) + t.Run("enable percona alerting", func(t *testing.T) { + s, err := models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{DisableAlerting: true}) require.NoError(t, err) - assert.False(t, ns.Alerting.Disabled) - assert.Equal(t, ns.Alerting.EmailAlertingSettings, emailSettings) - assert.Equal(t, ns.Alerting.SlackAlertingSettings, slackSettings) + assert.False(t, s.Alerting.Disabled) - // check that we don't lose settings on empty updates - ns, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{}) + ns, err := models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{EnableAlerting: false}) require.NoError(t, err) assert.False(t, ns.Alerting.Disabled) - assert.Equal(t, ns.Alerting.EmailAlertingSettings, emailSettings) - assert.Equal(t, ns.Alerting.SlackAlertingSettings, slackSettings) - - _, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - RemoveEmailAlertingSettings: true, - EmailAlertingSettings: emailSettings, - }) - var errInvalidArgument *models.InvalidArgumentError - assert.True(t, errors.As(err, &errInvalidArgument)) - assert.EqualError(t, err, "invalid argument: both email_alerting_settings and remove_email_alerting_settings are present") - _, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - EmailAlertingSettings: &models.EmailAlertingSettings{ - From: "from", - Smarthost: "example.com:1234", - Hello: "example.com", - }, - }) - assert.True(t, errors.As(err, &errInvalidArgument)) - assert.EqualError(t, err, "invalid argument: invalid \"from\" email \"from\"") - - _, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - EmailAlertingSettings: &models.EmailAlertingSettings{ - From: "from@example.com", - Smarthost: "@invalid-host", - Hello: "example.com", - }, - }) - assert.True(t, errors.As(err, &errInvalidArgument)) - assert.EqualError(t, err, "invalid argument: invalid server address, expected format host:port") + }) - _, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - EmailAlertingSettings: &models.EmailAlertingSettings{ - From: "from@example.com", - Smarthost: "example.com:1234", - Hello: "%", - }, - }) - assert.True(t, errors.As(err, &errInvalidArgument)) - assert.EqualError(t, err, "invalid argument: invalid hello field, expected valid host") + t.Run("Set PMM server ID", func(t *testing.T) { + t.Run("not set", func(t *testing.T) { + settings, err := models.GetSettings(sqlDB) + require.NoError(t, err) + require.NotNil(t, settings) + assert.Empty(t, settings.PMMServerID) - _, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - RemoveSlackAlertingSettings: true, - SlackAlertingSettings: slackSettings, - }) - assert.True(t, errors.As(err, &errInvalidArgument)) - assert.EqualError(t, err, "invalid argument: both slack_alerting_settings and remove_slack_alerting_settings are present") + err = models.SetPMMServerID(sqlDB) + require.NoError(t, err) - _, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - SlackAlertingSettings: &models.SlackAlertingSettings{ - URL: "invalid@url", - }, + settings, err = models.GetSettings(sqlDB) + require.NoError(t, err) + require.NotNil(t, settings) + assert.NotEmpty(t, settings.PMMServerID) }) - assert.True(t, errors.As(err, &errInvalidArgument)) - assert.EqualError(t, err, "invalid argument: invalid url value") + t.Run("already set", func(t *testing.T) { + settings, err := models.GetSettings(sqlDB) + require.NoError(t, err) + require.NotNil(t, settings) + pmmServerID := settings.PMMServerID - ns, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - DisableAlerting: true, - RemoveEmailAlertingSettings: true, - RemoveSlackAlertingSettings: true, - }) - require.NoError(t, err) - assert.Empty(t, ns.Alerting.EmailAlertingSettings) - assert.True(t, ns.Alerting.Disabled) + err = models.SetPMMServerID(sqlDB) + require.NoError(t, err) - _, err = models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{ - DisableAlerting: true, - EnableAlerting: true, + settings, err = models.GetSettings(sqlDB) + require.NoError(t, err) + require.NotNil(t, settings) + assert.Equal(t, pmmServerID, settings.PMMServerID) }) - assert.True(t, errors.As(err, &errInvalidArgument)) - assert.EqualError(t, err, "invalid argument: both enable_alerting and disable_alerting are present") - }) - }) - - t.Run("Set PMM server ID", func(t *testing.T) { - t.Run("not set", func(t *testing.T) { - settings, err := models.GetSettings(sqlDB) - require.NoError(t, err) - require.NotNil(t, settings) - assert.Empty(t, settings.PMMServerID) - - err = models.SetPMMServerID(sqlDB) - require.NoError(t, err) - - settings, err = models.GetSettings(sqlDB) - require.NoError(t, err) - require.NotNil(t, settings) - assert.NotEmpty(t, settings.PMMServerID) - }) - t.Run("already set", func(t *testing.T) { - settings, err := models.GetSettings(sqlDB) - require.NoError(t, err) - require.NotNil(t, settings) - pmmServerID := settings.PMMServerID - - err = models.SetPMMServerID(sqlDB) - require.NoError(t, err) - - settings, err = models.GetSettings(sqlDB) - require.NoError(t, err) - require.NotNil(t, settings) - assert.Equal(t, pmmServerID, settings.PMMServerID) }) }) } diff --git a/managed/services/errors.go b/managed/services/errors.go index ce8573b631..d982fa9a88 100644 --- a/managed/services/errors.go +++ b/managed/services/errors.go @@ -19,6 +19,3 @@ import "github.com/pkg/errors" // ErrAdvisorsDisabled means that advisors checks are disabled and can't be executed. var ErrAdvisorsDisabled = errors.New("Advisor checks are disabled") - -// ErrAlertingDisabled means Integrated Alerting is disabled and IA APIs can't be executed. -var ErrAlertingDisabled = errors.New("Alerting is disabled") diff --git a/managed/services/management/alerting/service.go b/managed/services/management/alerting/service.go index f656ec4229..3dd690d8e4 100644 --- a/managed/services/management/alerting/service.go +++ b/managed/services/management/alerting/service.go @@ -136,7 +136,7 @@ func (s *Service) GetTemplates() map[string]TemplateInfo { return res } -// CollectTemplates collects IA rule templates from various sources like: +// CollectTemplates collects Percona Alerting rule templates from various sources like: // builtin templates: read from the generated variable of type embed.FS // SaaS templates: templates downloaded from checks service. // User file templates: read from yaml files created by the user in `/srv/alerting/templates`. @@ -221,7 +221,7 @@ func (s *Service) loadTemplatesFromAssets(ctx context.Context) ([]alert.Template return nil } - data, err := fs.ReadFile(data.IATemplates, path) + data, err := fs.ReadFile(data.AlertRuleTemplates, path) if err != nil { return errors.Wrapf(err, "failed to read rule template asset: %s", path) } @@ -262,7 +262,7 @@ func (s *Service) loadTemplatesFromAssets(ctx context.Context) ([]alert.Template res = append(res, t) return nil } - err := fs.WalkDir(data.IATemplates, ".", walkDirFunc) + err := fs.WalkDir(data.AlertRuleTemplates, ".", walkDirFunc) if err != nil { return nil, err } @@ -381,7 +381,7 @@ func (s *Service) loadTemplatesFromDB() ([]TemplateInfo, error) { return res, nil } -// downloadTemplates downloads IA templates from SaaS. +// downloadTemplates downloads Percona Alerting templates from Percona Portal. func (s *Service) downloadTemplates(ctx context.Context) ([]alert.Template, error) { settings, err := models.GetSettings(s.db) if err != nil { diff --git a/managed/services/management/alerting/service_test.go b/managed/services/management/alerting/service_test.go index 37de5b37a2..4bf6094f24 100644 --- a/managed/services/management/alerting/service_test.go +++ b/managed/services/management/alerting/service_test.go @@ -168,13 +168,6 @@ func TestTemplateValidation(t *testing.T) { platformClient, err := platform.NewClient(db, devPlatformAddress) require.NoError(t, err) - // Enable IA - settings, err := models.GetSettings(db) - require.NoError(t, err) - settings.Alerting.Disabled = true - err = models.SaveSettings(db, settings) - require.NoError(t, err) - t.Run("create a template with missing param", func(t *testing.T) { t.Parallel() diff --git a/managed/services/server/deps.go b/managed/services/server/deps.go index 9563fa27a2..3b05ec0d26 100644 --- a/managed/services/server/deps.go +++ b/managed/services/server/deps.go @@ -116,18 +116,7 @@ type agentsStateUpdater interface { UpdateAgentsState(ctx context.Context) error } -// rulesService is a subset of methods of ia.RulesService used by this package. -// We use it instead of real type for testing and to avoid dependency cycle. -type rulesService interface { - WriteVMAlertRulesFiles() - RemoveVMAlertRulesFiles() error -} - -type emailer interface { - Send(ctx context.Context, settings *models.EmailAlertingSettings, emailTo string) error -} - -// rulesService is a subset of methods of ia.TemplatesService used by this package. +// templatesService is a subset of methods of ia.TemplatesService used by this package. // We use it instead of real type for testing and to avoid dependency cycle. type templatesService interface { CollectTemplates(ctx context.Context) diff --git a/managed/services/server/server.go b/managed/services/server/server.go index 6d7c351d57..ad9bf98f51 100644 --- a/managed/services/server/server.go +++ b/managed/services/server/server.go @@ -60,7 +60,6 @@ type Server struct { telemetryService telemetryService awsInstanceChecker *AWSInstanceChecker grafanaClient grafanaClient - rulesService rulesService dbaasInitializer dbaasInitializer l *logrus.Entry @@ -99,7 +98,6 @@ type Params struct { TelemetryService telemetryService AwsInstanceChecker *AWSInstanceChecker GrafanaClient grafanaClient - RulesService rulesService DBaaSInitializer dbaasInitializer } @@ -124,7 +122,6 @@ func NewServer(params *Params) (*Server, error) { telemetryService: params.TelemetryService, awsInstanceChecker: params.AwsInstanceChecker, grafanaClient: params.GrafanaClient, - rulesService: params.RulesService, dbaasInitializer: params.DBaaSInitializer, l: logrus.WithField("component", "server"), pmmUpdateAuthFile: path, @@ -455,25 +452,6 @@ func (s *Server) convertSettings(settings *models.Settings, connectedToPlatform DefaultRoleId: uint32(settings.DefaultRoleID), } - if settings.Alerting.EmailAlertingSettings != nil { - res.EmailAlertingSettings = &serverpb.EmailAlertingSettings{ - From: settings.Alerting.EmailAlertingSettings.From, - Smarthost: settings.Alerting.EmailAlertingSettings.Smarthost, - Hello: settings.Alerting.EmailAlertingSettings.Hello, - Username: settings.Alerting.EmailAlertingSettings.Username, - Password: "", - Identity: settings.Alerting.EmailAlertingSettings.Identity, - Secret: settings.Alerting.EmailAlertingSettings.Secret, - RequireTls: settings.Alerting.EmailAlertingSettings.RequireTLS, - } - } - - if settings.Alerting.SlackAlertingSettings != nil { - res.SlackAlertingSettings = &serverpb.SlackAlertingSettings{ - Url: settings.Alerting.SlackAlertingSettings.URL, - } - } - b, err := s.vmalertExternalRules.ReadRules() if err != nil { s.l.Warnf("Cannot load Alert Manager rules: %s", err) @@ -611,12 +589,10 @@ func (s *Server) ChangeSettings(ctx context.Context, req *serverpb.ChangeSetting PMMPublicAddress: req.PmmPublicAddress, RemovePMMPublicAddress: req.RemovePmmPublicAddress, - EnableAlerting: req.EnableAlerting, - DisableAlerting: req.DisableAlerting, - RemoveEmailAlertingSettings: req.RemoveEmailAlertingSettings, - RemoveSlackAlertingSettings: req.RemoveSlackAlertingSettings, - EnableBackupManagement: req.EnableBackupManagement, - DisableBackupManagement: req.DisableBackupManagement, + EnableAlerting: req.EnableAlerting, + DisableAlerting: req.DisableAlerting, + EnableBackupManagement: req.EnableBackupManagement, + DisableBackupManagement: req.DisableBackupManagement, EnableDBaaS: req.EnableDbaas, DisableDBaaS: req.DisableDbaas, @@ -625,27 +601,6 @@ func (s *Server) ChangeSettings(ctx context.Context, req *serverpb.ChangeSetting DisableAccessControl: req.DisableAccessControl, } - if req.EmailAlertingSettings != nil { - settingsParams.EmailAlertingSettings = &models.EmailAlertingSettings{ - From: req.EmailAlertingSettings.From, - Smarthost: req.EmailAlertingSettings.Smarthost, - Hello: req.EmailAlertingSettings.Hello, - Username: req.EmailAlertingSettings.Username, - Identity: req.EmailAlertingSettings.Identity, - Secret: req.EmailAlertingSettings.Secret, - RequireTLS: req.EmailAlertingSettings.RequireTls, - } - if req.EmailAlertingSettings.Password != "" { - settingsParams.EmailAlertingSettings.Password = req.EmailAlertingSettings.Password - } - } - - if req.SlackAlertingSettings != nil { - settingsParams.SlackAlertingSettings = &models.SlackAlertingSettings{ - URL: req.SlackAlertingSettings.Url, - } - } - var errInvalidArgument *models.InvalidArgumentError newSettings, err = models.UpdateSettings(tx, settingsParams) switch { @@ -684,18 +639,6 @@ func (s *Server) ChangeSettings(ctx context.Context, req *serverpb.ChangeSetting return nil, err } - // When IA moved from disabled state to enabled create rules files. - if oldSettings.Alerting.Disabled && req.EnableAlerting { - s.rulesService.WriteVMAlertRulesFiles() - } - - // When IA moved from enabled state to disabled cleanup rules files. - if !oldSettings.Alerting.Disabled && req.DisableAlerting { - if err := s.rulesService.RemoveVMAlertRulesFiles(); err != nil { - s.l.Errorf("Failed to clean old alert rule files: %+v", err) - } - } - // If STT intervals are changed reset timers. if oldSettings.SaaS.STTCheckIntervals != newSettings.SaaS.STTCheckIntervals { s.checksService.UpdateIntervals( diff --git a/managed/services/server/server_test.go b/managed/services/server/server_test.go index 004df80387..3d49ce3d2d 100644 --- a/managed/services/server/server_test.go +++ b/managed/services/server/server_test.go @@ -255,191 +255,21 @@ func TestServer(t *testing.T) { assert.True(t, settings.Settings.AzurediscoverEnabled) }) - t.Run("ChangeSettings IA", func(t *testing.T) { + t.Run("ChangeSettings Alerting", func(t *testing.T) { server := newServer(t) - var rs mockRulesService - server.rulesService = &rs server.UpdateSettingsFromEnv([]string{}) ctx := context.TODO() - rs.On("RemoveVMAlertRulesFiles").Return(nil) - defer rs.AssertExpectations(t) s, err := server.ChangeSettings(ctx, &serverpb.ChangeSettingsRequest{ DisableAlerting: true, }) require.NoError(t, err) require.NotNil(t, s) - rs.On("WriteVMAlertRulesFiles") s, err = server.ChangeSettings(ctx, &serverpb.ChangeSettingsRequest{ EnableAlerting: true, }) require.NoError(t, err) require.NotNil(t, s) - - rs.On("RemoveVMAlertRulesFiles").Return(nil) - s, err = server.ChangeSettings(ctx, &serverpb.ChangeSettingsRequest{ - DisableAlerting: true, - }) - require.NoError(t, err) - require.NotNil(t, s) }) } - -func TestServer_TestEmailAlertingSettings(t *testing.T) { //nolint:tparallel - t.Parallel() - - var server Server - - var e mockEmailer - server.emailer = &e - - ctx := context.TODO() - - normalRequest := &serverpb.TestEmailAlertingSettingsRequest{ - EmailAlertingSettings: &serverpb.EmailAlertingSettings{ - From: "me@example.com", - Smarthost: "example.com:465", - Hello: "example.com", - Username: "example-user", - Password: "some-password", - Identity: "example", - Secret: "example-secret", - RequireTls: true, - }, - EmailTo: "to@example.com", - } - eas := normalRequest.EmailAlertingSettings - - for _, tc := range []struct { - testName string - req *serverpb.TestEmailAlertingSettingsRequest - respErr string - mock func() - }{ - { - testName: "normal", - req: normalRequest, - respErr: "", - mock: func() { - s := &models.EmailAlertingSettings{ - From: eas.From, - Smarthost: eas.Smarthost, - Hello: eas.Hello, - Username: eas.Username, - Password: eas.Password, - Identity: eas.Identity, - Secret: eas.Secret, - RequireTLS: eas.RequireTls, - } - e.On("Send", mock.Anything, s, normalRequest.EmailTo).Return(nil).Once() - }, - }, - { - testName: "failed to send: invalid argument", - req: normalRequest, - respErr: "rpc error: code = InvalidArgument desc = Cannot send email: invalid argument.", - mock: func() { - s := &models.EmailAlertingSettings{ - From: eas.From, - Smarthost: eas.Smarthost, - Hello: eas.Hello, - Username: eas.Username, - Password: eas.Password, - Identity: eas.Identity, - Secret: eas.Secret, - RequireTLS: eas.RequireTls, - } - e.On("Send", mock.Anything, s, normalRequest.EmailTo). - Return(models.NewInvalidArgumentError("invalid argument")).Once() - }, - }, - { - testName: "invalid argument: from", - respErr: "rpc error: code = InvalidArgument desc = " + - "Invalid argument: invalid \"from\" email \"invalid-from\".", - req: &serverpb.TestEmailAlertingSettingsRequest{ - EmailAlertingSettings: &serverpb.EmailAlertingSettings{ - From: "invalid-from", - Smarthost: eas.Smarthost, - Hello: eas.Hello, - Username: eas.Username, - Password: eas.Password, - Identity: eas.Identity, - Secret: eas.Secret, - RequireTls: eas.RequireTls, - }, - EmailTo: normalRequest.EmailTo, - }, - }, - { - testName: "invalid argument: smarthost", - respErr: "rpc error: code = InvalidArgument desc = " + - "Invalid argument: invalid server address, expected format host:port.", - req: &serverpb.TestEmailAlertingSettingsRequest{ - EmailAlertingSettings: &serverpb.EmailAlertingSettings{ - From: eas.From, - Smarthost: "invalid-smart-host", - Hello: eas.Hello, - Username: eas.Username, - Password: eas.Password, - Identity: eas.Identity, - Secret: eas.Secret, - RequireTls: eas.RequireTls, - }, - EmailTo: normalRequest.EmailTo, - }, - }, - { - testName: "invalid argument: hello", - respErr: "rpc error: code = InvalidArgument desc = " + - "Invalid argument: invalid hello field, expected valid host.", - req: &serverpb.TestEmailAlertingSettingsRequest{ - EmailAlertingSettings: &serverpb.EmailAlertingSettings{ - From: eas.From, - Smarthost: eas.Smarthost, - Hello: "@invalid hello", - Username: eas.Username, - Password: eas.Password, - Identity: eas.Identity, - Secret: eas.Secret, - RequireTls: eas.RequireTls, - }, - EmailTo: normalRequest.EmailTo, - }, - }, - { - testName: "invalid argument: emailTo", - respErr: "rpc error: code = InvalidArgument desc = invalid \"emailTo\" email \"invalid email\"", - req: &serverpb.TestEmailAlertingSettingsRequest{ - EmailAlertingSettings: &serverpb.EmailAlertingSettings{ - From: eas.From, - Smarthost: eas.Smarthost, - Hello: eas.Hello, - Username: eas.Username, - Password: eas.Password, - Identity: eas.Identity, - Secret: eas.Secret, - RequireTls: eas.RequireTls, - }, - EmailTo: "invalid email", - }, - }, - } { - t.Run(tc.testName, func(t *testing.T) { - if tc.mock != nil { - tc.mock() - } - resp, err := server.TestEmailAlertingSettings(ctx, tc.req) - if tc.respErr != "" { - assert.Nil(t, resp) - assert.EqualError(t, err, tc.respErr) - } else { - assert.NoError(t, err) - assert.NotNil(t, resp) - } - }) - } - - mock.AssertExpectationsForObjects(t, &e) -} diff --git a/managed/utils/envvars/parser.go b/managed/utils/envvars/parser.go index b473d546fa..a478326743 100644 --- a/managed/utils/envvars/parser.go +++ b/managed/utils/envvars/parser.go @@ -59,9 +59,9 @@ func (e InvalidDurationError) Error() string { return string(e) } // - PATH, HOSTNAME, TERM, HOME are default environment variables that will be ignored; // - DISABLE_UPDATES is a boolean flag to enable or disable pmm-server update; // - DISABLE_TELEMETRY is a boolean flag to enable or disable pmm telemetry (and disable STT if telemetry is disabled); +// - DISABLE_ALERTING disables Percona Alerting; // - METRICS_RESOLUTION, METRICS_RESOLUTION_MR, METRICS_RESOLUTION_HR, METRICS_RESOLUTION_LR are durations of metrics resolution; // - DATA_RETENTION is the duration of how long keep time-series data in ClickHouse; -// - ENABLE_ALERTING enables Integrated Alerting; // - ENABLE_AZUREDISCOVER enables Azure Discover; // - ENABLE_DBAAS enables Database as a Service feature, it's a replacement for deprecated PERCONA_TEST_DBAAS which still works but will be removed eventually; // - ENABLE_RBAC enables Access control; From 9ba085b8d80d8d2d7c4a0c3e507cd83ba3bc22e0 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 26 Jun 2023 20:14:58 +0200 Subject: [PATCH 03/22] PMM-11079 Regenerate --- managed/services/server/deps.go | 2 -- managed/services/server/mock_emailer_test.go | 30 ------------------- .../server/mock_rules_service_test.go | 29 ------------------ 3 files changed, 61 deletions(-) delete mode 100644 managed/services/server/mock_emailer_test.go delete mode 100644 managed/services/server/mock_rules_service_test.go diff --git a/managed/services/server/deps.go b/managed/services/server/deps.go index 3b05ec0d26..9c28671aa1 100644 --- a/managed/services/server/deps.go +++ b/managed/services/server/deps.go @@ -32,8 +32,6 @@ import ( //go:generate ../../../bin/mockery -name=supervisordService -case=snake -inpkg -testonly //go:generate ../../../bin/mockery -name=telemetryService -case=snake -inpkg -testonly //go:generate ../../../bin/mockery -name=agentsStateUpdater -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=rulesService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=emailer -case=snake -inpkg -testonly //go:generate ../../../bin/mockery -name=templatesService -case=snake -inpkg -testonly // healthChecker interface wraps all services that implements the IsReady method to report the diff --git a/managed/services/server/mock_emailer_test.go b/managed/services/server/mock_emailer_test.go deleted file mode 100644 index bf1475efd3..0000000000 --- a/managed/services/server/mock_emailer_test.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. - -package server - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - models "github.com/percona/pmm/managed/models" -) - -// mockEmailer is an autogenerated mock type for the emailer type -type mockEmailer struct { - mock.Mock -} - -// Send provides a mock function with given fields: ctx, settings, emailTo -func (_m *mockEmailer) Send(ctx context.Context, settings *models.EmailAlertingSettings, emailTo string) error { - ret := _m.Called(ctx, settings, emailTo) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *models.EmailAlertingSettings, string) error); ok { - r0 = rf(ctx, settings, emailTo) - } else { - r0 = ret.Error(0) - } - - return r0 -} diff --git a/managed/services/server/mock_rules_service_test.go b/managed/services/server/mock_rules_service_test.go deleted file mode 100644 index 81c9348dd8..0000000000 --- a/managed/services/server/mock_rules_service_test.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. - -package server - -import mock "github.com/stretchr/testify/mock" - -// mockRulesService is an autogenerated mock type for the rulesService type -type mockRulesService struct { - mock.Mock -} - -// RemoveVMAlertRulesFiles provides a mock function with given fields: -func (_m *mockRulesService) RemoveVMAlertRulesFiles() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteVMAlertRulesFiles provides a mock function with given fields: -func (_m *mockRulesService) WriteVMAlertRulesFiles() { - _m.Called() -} From 6a0835cdb7ca5bcee262372b17aaa8b61f04109e Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 26 Jun 2023 20:15:07 +0200 Subject: [PATCH 04/22] PMM-11079 Fix --- api-tests/init.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api-tests/init.go b/api-tests/init.go index b3c5bc054e..12073e9c5c 100644 --- a/api-tests/init.go +++ b/api-tests/init.go @@ -166,7 +166,6 @@ func init() { Debug = *debugF || *traceF RunUpdateTest = *runUpdateTestF RunSTTTests = *runSTTTestsF - RunIATests = *runIATestsF var cancel context.CancelFunc Context, cancel = context.WithCancel(context.Background()) From 9e8b6c3b07e8eb8c9cd55b084003f954493a70e8 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Wed, 28 Jun 2023 19:23:11 +0200 Subject: [PATCH 05/22] PMM-11079 Refactoring and fixes --- managed/models/models.go | 40 --------------------- managed/models/models_json_test.go | 34 ++++++++++-------- managed/models/template_helpers_test.go | 47 ------------------------- managed/models/template_model.go | 40 +++++++++++++++++++++ 4 files changed, 60 insertions(+), 101 deletions(-) diff --git a/managed/models/models.go b/managed/models/models.go index 871e3766b3..b135a82f01 100644 --- a/managed/models/models.go +++ b/managed/models/models.go @@ -33,7 +33,6 @@ import ( "strings" "time" - "github.com/percona-platform/saas/pkg/common" "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -191,42 +190,3 @@ func jsonScan(v, src interface{}) error { } return nil } - -// Severity represents alert severity. -// Integer values is the same as common.Severity. Common constants can be used. -// Database representation is a string and is handled by Value and Scan methods below. -type Severity common.Severity - -// Value implements database/sql/driver Valuer interface. -func (s Severity) Value() (driver.Value, error) { - cs := common.Severity(s) - if err := cs.Validate(); err != nil { - return nil, err - } - return cs.String(), nil -} - -// Scan implements database/sql Scanner interface. -func (s *Severity) Scan(src interface{}) error { - switch src := src.(type) { - case string: - cs := common.ParseSeverity(src) - if err := cs.Validate(); err != nil { - return err - } - *s = Severity(cs) - return nil - default: - return errors.Errorf("expected string, got %T (%q)", src, src) - } -} - -// ParamType represents parameter type. -type ParamType string - -// Available parameter types. -const ( - Float = ParamType("float") - Bool = ParamType("bool") - String = ParamType("string") -) diff --git a/managed/models/models_json_test.go b/managed/models/models_json_test.go index 8baec878a5..18af8a2942 100644 --- a/managed/models/models_json_test.go +++ b/managed/models/models_json_test.go @@ -34,37 +34,43 @@ func TestJSON(t *testing.T) { //nolint:tparallel t.Run("Normal", func(t *testing.T) { t.Parallel() - c1 := models.Channel{ + j1 := models.Job{ ID: "Normal", - EmailConfig: &models.EmailConfig{ - To: []string{"foo@bar.test"}, + Data: &models.JobData{ + MySQLBackup: &models.MySQLBackupJobData{ + ServiceID: "test_service", + ArtifactID: "test_artifact", + }, }, } - err := db.Save(&c1) + err := db.Save(&j1) require.NoError(t, err) - var c2 models.Channel - err = db.FindByPrimaryKeyTo(&c2, c1.ID) + var j2 models.Job + err = db.FindByPrimaryKeyTo(&j2, j1.ID) require.NoError(t, err) - assert.Equal(t, c1, c2) + assert.Equal(t, j1, j2) }) t.Run("Nil", func(t *testing.T) { t.Parallel() - c1 := models.Channel{ + j1 := models.Job{ ID: "Nil", } - err := db.Save(&c1) + err := db.Save(&j1) require.NoError(t, err) - c2 := models.Channel{ - EmailConfig: &models.EmailConfig{ - To: []string{"foo@bar.test"}, + j2 := models.Job{ + Data: &models.JobData{ + MySQLBackup: &models.MySQLBackupJobData{ + ServiceID: "test_service", + ArtifactID: "test_artifact", + }, }, } - err = db.FindByPrimaryKeyTo(&c2, c1.ID) + err = db.FindByPrimaryKeyTo(&j2, j1.ID) require.NoError(t, err) - assert.Equal(t, c1, c2) + assert.Equal(t, j1, j2) }) } diff --git a/managed/models/template_helpers_test.go b/managed/models/template_helpers_test.go index 9e7bc11465..1b5f5b2508 100644 --- a/managed/models/template_helpers_test.go +++ b/managed/models/template_helpers_test.go @@ -177,30 +177,6 @@ func TestRuleTemplates(t *testing.T) { assert.Empty(t, templates) }) - t.Run("remove template that is used for some rule", func(t *testing.T) { - tx, err := db.Begin() - require.NoError(t, err) - defer func() { - require.NoError(t, tx.Rollback()) - }() - - q := tx.Querier - - template, err := models.CreateTemplate(q, createTemplateParams(uuid.New().String())) - require.NoError(t, err) - - channel := createChannel(t, q) - - _ = createRule(t, q, channel.ID, template) - - err = models.RemoveTemplate(q, template.Name) - require.NoError(t, err) - - templates, err := models.FindTemplates(q) - require.NoError(t, err) - assert.Empty(t, templates) - }) - t.Run("list", func(t *testing.T) { tx, err := db.Begin() require.NoError(t, err) @@ -281,26 +257,3 @@ func changeTemplateParams(name string) *models.ChangeTemplateParams { }, } } - -func createRule(t *testing.T, q *reform.Querier, channelID string, template *models.Template) string { //nolint:unparam - t.Helper() - rule, err := models.CreateRule(q, &models.CreateRuleParams{ - TemplateName: template.Name, - Disabled: true, - ParamsValues: []models.AlertExprParamValue{ - { - Name: "test", - Type: models.Float, - FloatValue: 3.14, - }, - }, - For: 5 * time.Second, - DefaultSeverity: models.Severity(common.Info), - Severity: models.Severity(common.Warning), - CustomLabels: map[string]string{"foo": "bar"}, - Filters: []models.Filter{{Type: models.Equal, Key: "value", Val: "10"}}, - ChannelIDs: []string{channelID}, - }) - require.NoError(t, err) - return rule.ID -} diff --git a/managed/models/template_model.go b/managed/models/template_model.go index e32ace522d..2ecb5a656b 100644 --- a/managed/models/template_model.go +++ b/managed/models/template_model.go @@ -20,6 +20,7 @@ import ( "time" "github.com/percona-platform/saas/pkg/common" + "github.com/pkg/errors" "gopkg.in/reform.v1" ) @@ -119,6 +120,16 @@ type AlertExprParamDefinition struct { // StringParam *StringParam `json:"string_param"` } +// ParamType represents parameter type. +type ParamType string + +// Available parameter types. +const ( + Float = ParamType("float") + Bool = ParamType("bool") + String = ParamType("string") +) + // BoolParam represents boolean template parameter. type BoolParam struct { Default *bool `json:"default,omitempty"` @@ -136,6 +147,35 @@ type StringParam struct { Default *string `json:"default,omitempty"` } +// Severity represents alert severity. +// Integer values is the same as common.Severity. Common constants can be used. +// Database representation is a string and is handled by Value and Scan methods below. +type Severity common.Severity + +// Value implements database/sql/driver Valuer interface. +func (s Severity) Value() (driver.Value, error) { + cs := common.Severity(s) + if err := cs.Validate(); err != nil { + return nil, err + } + return cs.String(), nil +} + +// Scan implements database/sql Scanner interface. +func (s *Severity) Scan(src interface{}) error { + switch src := src.(type) { + case string: + cs := common.ParseSeverity(src) + if err := cs.Validate(); err != nil { + return err + } + *s = Severity(cs) + return nil + default: + return errors.Errorf("expected string, got %T (%q)", src, src) + } +} + // Source represents template source. type Source string From 880d08778d96c49ccd59d5c52bf7d52bce28ef8f Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Wed, 28 Jun 2023 19:33:48 +0200 Subject: [PATCH 06/22] PMM-11079 Fix tests --- .../alertmanager/alertmanager_test.go | 399 +----------------- 1 file changed, 1 insertion(+), 398 deletions(-) diff --git a/managed/services/alertmanager/alertmanager_test.go b/managed/services/alertmanager/alertmanager_test.go index 7c323d2dbf..52cb990df0 100644 --- a/managed/services/alertmanager/alertmanager_test.go +++ b/managed/services/alertmanager/alertmanager_test.go @@ -17,21 +17,14 @@ package alertmanager import ( "context" - "fmt" - "os" "strings" "testing" - "time" - "github.com/percona-platform/saas/pkg/alert" - "github.com/percona-platform/saas/pkg/common" - "github.com/percona/promconfig" "github.com/percona/promconfig/alertmanager" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gopkg.in/reform.v1" "gopkg.in/reform.v1/dialects/postgresql" - "gopkg.in/yaml.v3" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/utils/testdb" @@ -353,7 +346,7 @@ func marshalAndValidate(t *testing.T, svc *Service, base *alertmanager.Config) s return string(b) } -func TestPopulateConfig(t *testing.T) { +func TestConfig(t *testing.T) { New(nil).GenerateBaseConfigs() // this method should not use database t.Run("without receivers and routes", func(t *testing.T) { @@ -385,394 +378,4 @@ templates: [] `) + "\n" assert.Equal(t, expected, actual, "actual:\n%s", actual) }) - - t.Run("with receivers and routes", func(t *testing.T) { - tests.SetTestIDReader(t) - sqlDB := testdb.Open(t, models.SkipFixtures, nil) - db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - svc := New(db) - - channel1, err := models.CreateChannel(db.Querier, &models.CreateChannelParams{ - Summary: "channel1", - EmailConfig: &models.EmailConfig{ - To: []string{"test@test.test", "test2@test.test"}, - }, - Disabled: false, - }) - require.NoError(t, err) - - channel2, err := models.CreateChannel(db.Querier, &models.CreateChannelParams{ - Summary: "channel2", - PagerDutyConfig: &models.PagerDutyConfig{ - RoutingKey: "ms-pagerduty-dev", - }, - Disabled: false, - }) - require.NoError(t, err) - - channel3, err := models.CreateChannel(db.Querier, &models.CreateChannelParams{ - Summary: "channel3", - PagerDutyConfig: &models.PagerDutyConfig{ - RoutingKey: "ms-pagerduty-dev", - }, - Disabled: true, - }) - require.NoError(t, err) - - tlsConfig := &models.TLSConfig{ - CAFileContent: "cafilecontent", - CertFileContent: "certfilecontent", - KeyFileContent: "keyfilecontent", - } - channel4, err := models.CreateChannel(db.Querier, &models.CreateChannelParams{ - Summary: "channel4", - WebHookConfig: &models.WebHookConfig{ - URL: "https://example.com", - HTTPConfig: &models.HTTPConfig{ - TLSConfig: tlsConfig, - }, - }, - Disabled: false, - }) - require.NoError(t, err) - - _, err = models.CreateTemplate(db.Querier, &models.CreateTemplateParams{ - Template: &alert.Template{ - Name: "test_template", - Version: 1, - Summary: "summary", - Tiers: []common.Tier{common.Anonymous}, - Expr: "expr", - Params: []alert.Parameter{{ - Name: "param", - Summary: "param summary", - Unit: "%", - Type: alert.Float, - Range: []interface{}{float64(10), float64(100)}, - Value: float64(50), - }}, - For: promconfig.Duration(3 * time.Second), - Severity: common.Warning, - Labels: map[string]string{"foo": "bar"}, - Annotations: nil, - }, - Source: "USER_FILE", - }) - require.NoError(t, err) - - rule1, err := models.CreateRule(db.Querier, &models.CreateRuleParams{ - TemplateName: "test_template", - Disabled: true, - ParamsValues: []models.AlertExprParamValue{{ - Name: "test", - Type: models.Float, - FloatValue: 3.14, - }}, - For: 5 * time.Second, - DefaultSeverity: models.Severity(common.Warning), - Severity: models.Severity(common.Warning), - CustomLabels: map[string]string{ - "foo": "bar", - }, - Filters: []models.Filter{{ - Type: models.Equal, - Key: "service_name", - Val: "mysql1", - }}, - ChannelIDs: []string{channel1.ID, channel2.ID}, - }) - require.NoError(t, err) - - // create another rule with same channelIDs to check for redundant receivers. - rule2, err := models.CreateRule(db.Querier, &models.CreateRuleParams{ - TemplateName: "test_template", - Disabled: true, - ParamsValues: []models.AlertExprParamValue{{ - Name: "test", - Type: models.Float, - FloatValue: 3.14, - }}, - For: 5 * time.Second, - DefaultSeverity: models.Severity(common.Warning), - Severity: models.Severity(common.Warning), - CustomLabels: map[string]string{ - "foo": "baz", - }, - Filters: []models.Filter{{ - Type: models.Equal, - Key: "service_name", - Val: "mysql2", - }}, - ChannelIDs: []string{channel1.ID, channel2.ID, channel3.ID, channel4.ID}, - }) - require.NoError(t, err) - - // create another rule without channelID and check if it is absent in the config. - _, err = models.CreateRule(db.Querier, &models.CreateRuleParams{ - TemplateName: "test_template", - Disabled: true, - ParamsValues: []models.AlertExprParamValue{{ - Name: "test", - Type: models.Float, - FloatValue: 3.14, - }}, - For: 5 * time.Second, - DefaultSeverity: models.Severity(common.Warning), - Severity: models.Severity(common.Warning), - CustomLabels: map[string]string{ - "foo": "baz", - }, - }) - require.NoError(t, err) - - // CreateRule with disabled channel - rule4, err := models.CreateRule(db.Querier, &models.CreateRuleParams{ - TemplateName: "test_template", - Disabled: true, - ParamsValues: []models.AlertExprParamValue{{ - Name: "test", - Type: models.Float, - FloatValue: 3.14, - }}, - Filters: []models.Filter{{ - Type: models.Equal, - Key: "service_name", - Val: "mysql3", - }}, - For: 5 * time.Second, - DefaultSeverity: models.Severity(common.Warning), - Severity: models.Severity(common.Warning), - CustomLabels: map[string]string{ - "foo": "baz", - }, - ChannelIDs: []string{channel3.ID}, - }) - require.NoError(t, err) - - _, err = models.UpdateSettings(db.Querier, &models.ChangeSettingsParams{ - EmailAlertingSettings: &models.EmailAlertingSettings{ - From: "from@test.com", - Smarthost: "1.2.3.4:80", - Hello: "host", - Username: "user", - Password: "password", - Identity: "id", - Secret: "secret", - RequireTLS: true, - }, - SlackAlertingSettings: &models.SlackAlertingSettings{ - URL: "https://hooks.slack.com/services/abc/456/xyz", - }, - }) - require.NoError(t, err) - - actual := marshalAndValidate(t, svc, svc.loadBaseConfig()) - convertedTLSConfig := convertTLSConfig(channel4.ID, tlsConfig) - - tlsFileContents := []struct { - file string - content string - }{ - { - file: convertedTLSConfig.CAFile, - content: "cafilecontent", - }, - { - file: convertedTLSConfig.CertFile, - content: "certfilecontent", - }, - { - file: convertedTLSConfig.KeyFile, - content: "keyfilecontent", - }, - } - for _, f := range tlsFileContents { - actualContent, err := os.ReadFile(f.file) - require.NoError(t, err) - assert.Equal(t, f.content, string(actualContent)) - } - - pagerDutyConfigs := ` pagerduty_configs: - - send_resolved: false - routing_key: ms-pagerduty-dev - description: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]{{ range .Alerts -}}{{ if .Labels.severity }}[{{ .Labels.severity | toUpper }}]{{ end }} {{ .Annotations.summary }}{{ end }}' - details: - firing: |- - {{ range .Alerts -}} - Alert: {{ if .Labels.severity }}[{{ .Labels.severity | toUpper }}]{{ end }} {{ .Annotations.summary }} - Description: {{ .Annotations.description }} - Details: - {{ if .Labels.node_name }} - node_name: {{ .Labels.node_name }} - {{ end }}{{ if .Labels.node_id }} - node_id: {{ .Labels.node_id }} - {{ end }}{{ if .Labels.service_name }} - service_name: {{ .Labels.service_name }} - {{ end }}{{ if .Labels.service_id }} - service_id: {{ .Labels.service_id }} - {{ end }}{{ if .Labels.service_type }} - service_type: {{ .Labels.service_type }} - {{ end }}{{ if .Labels.rule_id }} - rule_id: {{ .Labels.rule_id }} - {{ end }}{{ if .Labels.alertgroup }} - alertgroup: {{ .Labels.alertgroup }} - {{ end }}{{ if .Labels.template_name }} - template_name: {{ .Labels.template_name }} - {{ end }}{{ if .Labels.severity }} - severity: {{ .Labels.severity }} - {{ end }}{{ if .Labels.agent_id }} - agent_id: {{ .Labels.agent_id }} - {{ end }}{{ if .Labels.agent_type }} - agent_type: {{ .Labels.agent_type }} - {{ end }}{{ if .Labels.job }} - job: {{ .Labels.job }} - {{ end }} - - {{ end }}` - - expected := strings.TrimSpace(fmt.Sprintf(` -# Managed by pmm-managed. DO NOT EDIT. ---- -global: - resolve_timeout: 0s - smtp_from: from@test.com - smtp_hello: host - smtp_smarthost: 1.2.3.4:80 - smtp_auth_username: user - smtp_auth_password: password - smtp_auth_secret: secret - smtp_auth_identity: id - smtp_require_tls: true - slack_api_url: https://hooks.slack.com/services/abc/456/xyz -route: - receiver: empty - continue: false - routes: - - receiver: %[1]s + %[2]s - match: - rule_id: %[3]s - service_name: mysql1 - continue: false - - receiver: %[1]s + %[2]s + %[8]s - match: - rule_id: %[4]s - service_name: mysql2 - continue: false - - receiver: disabled - match: - rule_id: %[5]s - service_name: mysql3 - continue: false -receivers: - - name: empty - - name: disabled - - name: %[1]s + %[2]s - email_configs: - - send_resolved: false - to: test@test.test - headers: - Subject: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]' - html: %[12]s - - send_resolved: false - to: test2@test.test - headers: - Subject: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]' - html: %[12]s -`+pagerDutyConfigs+` - - name: %[6]s + %[7]s + %[8]s - email_configs: - - send_resolved: false - to: test@test.test - headers: - Subject: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]' - html: %[12]s - - send_resolved: false - to: test2@test.test - headers: - Subject: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]' - html: %[12]s -`+pagerDutyConfigs+` - webhook_configs: - - send_resolved: false - http_config: - tls_config: - ca_file: %[9]s - cert_file: %[10]s - key_file: %[11]s - insecure_skip_verify: false - follow_redirects: false - url: https://example.com - max_alerts: 0 -templates: []`, channel1.ID, channel2.ID, rule1.ID, rule2.ID, rule4.ID, channel1.ID, channel2.ID, channel4.ID, - tlsFileContents[0].file, tlsFileContents[1].file, tlsFileContents[2].file, htmlTemplate)) + "\n" - assert.Equal(t, expected, actual, "actual:\n%s", actual) - }) -} - -func TestGenerateReceivers(t *testing.T) { - t.Parallel() - - chanMap := map[string]*models.Channel{ - "1": { - ID: "1", - Type: models.Slack, - SlackConfig: &models.SlackConfig{ - Channel: "channel1", - }, - }, - "2": { - ID: "2", - Type: models.Slack, - SlackConfig: &models.SlackConfig{ - Channel: "channel2", - }, - }, - "3": { - ID: "3", - Type: models.Slack, - SlackConfig: &models.SlackConfig{ - Channel: "channel3", - }, - Disabled: true, - }, - } - recvSet := map[string]models.ChannelIDs{ - "1": {"1"}, - "2": {"2"}, - "1+2": {"1", "2"}, - } - s := New(nil) - actualR, err := s.generateReceivers(chanMap, recvSet) - require.NoError(t, err) - actual, err := yaml.Marshal(actualR) - require.NoError(t, err) - - slackConfigs := func(channelName string) string { - return fmt.Sprintf(` - send_resolved: false - channel: %s - title: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]' - text: |- - {{ range .Alerts -}} - *Alert:* {{ if .Labels.severity }}`+"`{{ .Labels.severity | toUpper }}`"+`{{ end }} {{ .Annotations.summary }} - *Description:* {{ .Annotations.description }} - *Details:* - {{ if .Labels.node_name }} • *node_name:* `+"`{{ .Labels.node_name }}`"+` - {{ end }}{{ if .Labels.node_id }} • *node_id:* `+"`{{ .Labels.node_id }}`"+` - {{ end }}{{ if .Labels.service_name }} • *service_name:* `+"`{{ .Labels.service_name }}`"+` - {{ end }}{{ if .Labels.service_id }} • *service_id:* `+"`{{ .Labels.service_id }}`"+` - {{ end }}{{ if .Labels.service_type }} • *service_type:* `+"`{{ .Labels.service_type }}`"+` - {{ end }}{{ if .Labels.rule_id }} • *rule_id:* `+"`{{ .Labels.rule_id }}`"+` - {{ end }}{{ if .Labels.alertgroup }} • *alertgroup:* `+"`{{ .Labels.alertgroup }}`"+` - {{ end }}{{ if .Labels.template_name }} • *template_name:* `+"`{{ .Labels.template_name }}`"+` - {{ end }}{{ if .Labels.severity }} • *severity:* `+"`{{ .Labels.severity }}`"+` - {{ end }}{{ if .Labels.agent_id }} • *agent_id:* `+"`{{ .Labels.agent_id }}`"+` - {{ end }}{{ if .Labels.agent_type }} • *agent_type:* `+"`{{ .Labels.agent_type }}`"+` - {{ end }}{{ if .Labels.job }} • *job:* `+"`{{ .Labels.job }}`"+` - {{ end }} - - {{ end }} - short_fields: false - link_names: false`, channelName) - } - - expected := strings.TrimSpace(` -- name: "1" - slack_configs: -`+slackConfigs("channel1")+` -- name: 1+2 - slack_configs: -`+slackConfigs("channel1")+` -`+slackConfigs("channel2")+` -- name: "2" - slack_configs: -`+slackConfigs("channel2")) + "\n" - assert.Equal(t, expected, string(actual), "actual:\n%s", actual) } From 80420e8bf1a13388bafa070b70a99990d45b8936 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Wed, 28 Jun 2023 19:44:40 +0200 Subject: [PATCH 07/22] PMM-11079 go mod tidy --- go.mod | 26 +----------------- go.sum | 83 ---------------------------------------------------------- 2 files changed, 1 insertion(+), 108 deletions(-) diff --git a/go.mod b/go.mod index 81b78cdd38..5a356a0d27 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/alecthomas/kong v0.8.0 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 github.com/aws/aws-sdk-go v1.44.273 github.com/blang/semver v3.5.1+incompatible github.com/brianvoe/gofakeit/v6 v6.22.0 @@ -64,7 +63,6 @@ require ( github.com/pganalyze/pg_query_go/v2 v2.2.0 github.com/pkg/errors v0.9.1 github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/alertmanager v0.25.0 github.com/prometheus/client_golang v1.16.0 github.com/prometheus/common v0.44.0 github.com/ramr/go-reaper v0.2.1 @@ -99,10 +97,9 @@ require ( require ( github.com/Azure/azure-pipeline-go v0.2.3 // indirect github.com/Azure/azure-storage-blob-go v0.14.0 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/benbjohnson/clock v1.3.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/coreos/go-systemd/v22 v22.4.0 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect @@ -115,7 +112,6 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/mattn/go-ieproxy v0.0.1 // indirect @@ -169,9 +165,7 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/andybalholm/brotli v1.0.5 // indirect - github.com/armon/go-metrics v0.4.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.2.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/charmbracelet/harmonica v0.2.0 // indirect github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 // indirect @@ -181,29 +175,19 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/go-faster/city v1.0.1 // indirect github.com/go-faster/errors v0.6.1 // indirect - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-openapi/analysis v0.21.4 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.1 // indirect github.com/go-openapi/loads v0.21.2 // indirect github.com/go-openapi/spec v0.20.8 // indirect - github.com/gofrs/uuid v4.3.1+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-msgpack v0.5.5 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-sockaddr v1.0.2 // indirect - github.com/hashicorp/golang-lru v0.6.0 // indirect - github.com/hashicorp/memberlist v0.5.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/jpillora/backoff v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.16.5 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect @@ -214,7 +198,6 @@ require ( github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/miekg/dns v1.1.50 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -225,8 +208,6 @@ require ( github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/reflow v0.3.0 // indirect github.com/muesli/termenv v0.15.1 // indirect - github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect - github.com/oklog/run v1.1.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect @@ -235,16 +216,11 @@ require ( github.com/pierrec/lz4/v4 v4.1.17 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common/sigv4 v0.1.0 // indirect - github.com/prometheus/exporter-toolkit v0.8.2 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rs/xid v1.5.0 // indirect - github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/segmentio/asm v1.2.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect - github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect - github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect diff --git a/go.sum b/go.sum index 362f421e9b..bc62ded933 100644 --- a/go.sum +++ b/go.sum @@ -76,7 +76,6 @@ github.com/ClickHouse/clickhouse-go/v2 v2.10.0 h1:0w/A50D5MfsRUYBaV6rLKwZ4LXWKLZ github.com/ClickHouse/clickhouse-go/v2 v2.10.0/go.mod h1:teXfZNM90iQ99Jnuht+dxQXCuhDZ8nvvMoTJOFrcmcg= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -108,17 +107,12 @@ github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.40.7/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.44.273 h1:CX8O0gK+cGrgUyv7bgJ6QQP9mQg7u5mweHdNzULH47c= github.com/aws/aws-sdk-go v1.44.273/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= @@ -126,13 +120,10 @@ github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bkaradzic/go-lz4 v1.0.0 h1:RXc4wYsyz985CkXXeX04y4VnZFGG8Rd43pRaHsOXAKk= github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= @@ -144,8 +135,6 @@ github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7 github.com/brianvoe/gofakeit/v6 v6.22.0 h1:BzOsDot1o3cufTfOk+fWKE9nFYojyDV+XHdCWL2+uyE= github.com/brianvoe/gofakeit/v6 v6.22.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= -github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -164,8 +153,6 @@ github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNW github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= @@ -176,8 +163,6 @@ github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMe github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= -github.com/coreos/go-systemd/v22 v22.4.0 h1:y9YHcjnjynCd/DVbg5j9L/33jQM3MxJlbj/zWskzfGU= -github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/craiggwilson/goke v0.0.0-20200309222237-69a77cdfe646/go.mod h1:IX+FckvUr3c6SNWSzspUD94HqCMFCW+sIK0lJGSkWkg= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -216,7 +201,6 @@ github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCv github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= @@ -240,13 +224,9 @@ github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3I github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= @@ -319,10 +299,7 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI= -github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -373,8 +350,6 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= -github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -424,33 +399,15 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9K github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= -github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= -github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= -github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= @@ -476,7 +433,6 @@ github.com/jotaen/kong-completion v0.0.5/go.mod h1:Pic1KtmJkOiWtr9XEVbyWXvn3AuCg github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -537,7 +493,6 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI= github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -561,9 +516,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= -github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go v6.0.14+incompatible h1:fnV+GD28LeqdN6vT2XdGKW8Qe/IfjJDswNVuni6km9o= @@ -572,10 +524,8 @@ github.com/minio/minio-go/v7 v7.0.55 h1:ZXqUO/8cgfHzI+08h/zGuTTFpISSA32BZmBE3FCL github.com/minio/minio-go/v7 v7.0.55/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -615,8 +565,6 @@ github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURS github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/termbox-go v0.0.0-20160718140619-0723e7c3d0a3/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= -github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= -github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -634,9 +582,6 @@ github.com/operator-framework/api v0.17.6 h1:E6+vlvYUKafvoXYtCuHlDZrXX4vl8AT+r93 github.com/operator-framework/api v0.17.6/go.mod h1:l/cuwtPxkVUY7fzYgdust2m9tlmb8I4pOvbsUufRb24= github.com/operator-framework/operator-lifecycle-manager v0.24.0 h1:9LOfvyohGEkNHwcOGOgw+w3ZAnGeT6JVh3CvIbWpnus= github.com/operator-framework/operator-lifecycle-manager v0.24.0/go.mod h1:2zDUxcpW2idTLjRw36WlMetHZ50Nlf1C3JxASPfYS20= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulmach/orb v0.9.0 h1:MwA1DqOKtvCgm7u9RZ/pnYejTeDJPnr0+0oFajBbJqk= github.com/paulmach/orb v0.9.0/go.mod h1:SudmOk85SXtmXAB3sLGyJ6tZy/8pdfrV0o6ef98Xc30= github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY= @@ -676,14 +621,10 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/prometheus/alertmanager v0.25.0 h1:vbXKUR6PYRiZPRIKfmXaG+dmCKG52RtPL4Btl8hQGvg= -github.com/prometheus/alertmanager v0.25.0/go.mod h1:MEZ3rFVHqKZsw7IcNS/m4AWZeXThmJhumpiWR4eHU/w= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= @@ -695,20 +636,13 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= -github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= -github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= -github.com/prometheus/exporter-toolkit v0.8.2 h1:sbJAfBXQFkG6sUkbwBun8MNdzW9+wd5YfPYofbmj0YM= -github.com/prometheus/exporter-toolkit v0.8.2/go.mod h1:00shzmJL7KxcsabLWcONwpyNEuWhREOnFqZW7vadFS0= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= @@ -734,10 +668,7 @@ github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4 github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -745,10 +676,6 @@ github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= -github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 h1:pXY9qYc/MP5zdvqWEUH6SjNiu7VhSjuVFTFiTcphaLU= -github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -782,7 +709,6 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= @@ -805,7 +731,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.mongodb.org/mongo-driver v1.6.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= @@ -891,7 +816,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -908,11 +832,9 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -942,7 +864,6 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -958,7 +879,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -998,7 +918,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1049,7 +968,6 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1081,7 +999,6 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= From 69af99157e9a2c9e8fbc5a8fcc326b99b63a5cf6 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 30 Jun 2023 16:56:25 +0200 Subject: [PATCH 08/22] PMM-11079 Fix API tests --- .../management/alerting/alerting_test.go | 741 +++++++---- api-tests/management/alerts_test.go | 748 ----------- api-tests/server/helpers.go | 10 +- api-tests/server/settings_test.go | 72 +- .../server/change_settings_responses.go | 376 ------ .../client/server/get_settings_responses.go | 185 --- .../json/client/server/server_client.go | 41 - ...test_email_alerting_settings_parameters.go | 144 -- .../test_email_alerting_settings_responses.go | 518 -------- api/serverpb/json/serverpb.json | 356 +---- api/serverpb/server.pb.go | 1184 ++++++----------- api/serverpb/server.pb.gw.go | 81 -- api/serverpb/server.pb.validate.go | 610 --------- api/serverpb/server.proto | 62 +- api/serverpb/server_grpc.pb.go | 56 +- api/swagger/swagger-dev.json | 356 +---- api/swagger/swagger.json | 356 +---- descriptor.bin | Bin 734766 -> 731711 bytes managed/services/grafana/client.go | 35 + 19 files changed, 954 insertions(+), 4977 deletions(-) delete mode 100644 api-tests/management/alerts_test.go delete mode 100644 api/serverpb/json/client/server/test_email_alerting_settings_parameters.go delete mode 100644 api/serverpb/json/client/server/test_email_alerting_settings_responses.go diff --git a/api-tests/management/alerting/alerting_test.go b/api-tests/management/alerting/alerting_test.go index 960500e36e..f5116c8ffa 100644 --- a/api-tests/management/alerting/alerting_test.go +++ b/api-tests/management/alerting/alerting_test.go @@ -16,121 +16,46 @@ package alerting import ( + "context" + "encoding/base64" "fmt" "os" "strings" "testing" "time" + "github.com/AlekSi/pointer" "github.com/google/uuid" "github.com/percona-platform/saas/pkg/alert" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" "gopkg.in/yaml.v3" pmmapitests "github.com/percona/pmm/api-tests" alertingClient "github.com/percona/pmm/api/managementpb/alerting/json/client" "github.com/percona/pmm/api/managementpb/alerting/json/client/alerting" + "github.com/percona/pmm/managed/services/grafana" ) // Note: Even though the IA services check for alerting enabled or disabled before returning results // we don't enable or disable IA explicit in our tests since it is enabled by default through // ENABLE_ALERTING env var. -func assertTemplate(t *testing.T, expectedTemplate alert.Template, listTemplates []*alerting.ListTemplatesOKBodyTemplatesItems0) { - t.Helper() - convertParamUnit := func(u string) alert.Unit { - switch u { - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPERCENTAGE: - return alert.Percentage - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitSECONDS: - return alert.Seconds - } - return "INVALID" - } - convertParamType := func(u string) alert.Type { - switch u { - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeFLOAT: - return alert.Float - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeSTRING: - return alert.String - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeBOOL: - return alert.Bool - } - return "INVALID" - } - var tmpl *alerting.ListTemplatesOKBodyTemplatesItems0 - for _, listTmpl := range listTemplates { - if listTmpl.Name == expectedTemplate.Name { - tmpl = listTmpl - break - } - } - require.NotNilf(t, tmpl, "template %s not found", expectedTemplate.Name) - // IDE doesn't recognize that require stops execution - if tmpl == nil { - return - } - assert.Equal(t, expectedTemplate.Expr, tmpl.Expr) - assert.Equal(t, expectedTemplate.Summary, tmpl.Summary) - assert.Equal(t, "USER_API", *tmpl.Source) - assert.Equal(t, "SEVERITY_WARNING", *tmpl.Severity) - - forDuration := fmt.Sprintf("%.0fs", time.Duration(expectedTemplate.For).Seconds()) - assert.Equal(t, forDuration, tmpl.For) - - require.Len(t, tmpl.Params, len(expectedTemplate.Params)) - for i, expectedParam := range expectedTemplate.Params { - param := tmpl.Params[i] - assert.Equal(t, expectedParam.Name, param.Name) - assert.Equal(t, expectedParam.Summary, param.Summary) - assert.Equal(t, expectedParam.Type, convertParamType(*param.Type)) - assert.Equal(t, expectedParam.Unit, convertParamUnit(*param.Unit)) - switch expectedParam.Type { - case alert.Float: - if expectedParam.Value != nil { - require.NotNil(t, param.Float) - value, err := expectedParam.GetValueForFloat() - require.NoError(t, err) - assert.True(t, param.Float.HasDefault) - assert.Equal(t, value, param.Float.Default) - } - - if len(expectedParam.Range) != 0 { - min, max, err := expectedParam.GetRangeForFloat() - require.NoError(t, err) - assert.True(t, param.Float.HasMax) - assert.True(t, param.Float.HasMin) - assert.Equal(t, min, param.Float.Min) - assert.Equal(t, max, param.Float.Max) - } - - assert.Nil(t, param.Bool) - assert.Nil(t, param.String) - default: - } - } - - assert.Equal(t, expectedTemplate.Labels, tmpl.Labels) - assert.Equal(t, expectedTemplate.Annotations, tmpl.Annotations) - - assert.NotEmpty(t, tmpl.CreatedAt) -} - -func TestTemplatesAPI(t *testing.T) { +func TestAlertingAPI(t *testing.T) { t.Parallel() client := alertingClient.Default.Alerting - templateData, err := os.ReadFile("../../testdata/ia/template.yaml") - require.NoError(t, err) + t.Run("templates", func(t *testing.T) { + t.Parallel() - invalidTemplateData, err := os.ReadFile("../../testdata/ia/invalid-template.yaml") - require.NoError(t, err) + templateData, err := os.ReadFile("../../testdata/ia/template.yaml") + require.NoError(t, err) - t.Run("add", func(t *testing.T) { - t.Parallel() + invalidTemplateData, err := os.ReadFile("../../testdata/ia/invalid-template.yaml") + require.NoError(t, err) - t.Run("normal", func(t *testing.T) { + t.Run("add", func(t *testing.T) { t.Parallel() name := uuid.New().String() @@ -156,7 +81,7 @@ func TestTemplatesAPI(t *testing.T) { assertTemplate(t, alertTemplates[0], resp.Payload.Templates) }) - t.Run("duplicate", func(t *testing.T) { + t.Run("add duplicate", func(t *testing.T) { t.Parallel() name := uuid.New().String() @@ -203,192 +128,162 @@ func TestTemplatesAPI(t *testing.T) { pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") }) - }) - - t.Run("change", func(t *testing.T) { - t.Parallel() - t.Run("normal", func(t *testing.T) { + t.Run("change", func(t *testing.T) { t.Parallel() - name := uuid.New().String() - expr := uuid.New().String() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(templateData), name, expr, "s", "%"), - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) - - newExpr := uuid.New().String() - alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, newExpr, "s", "%")) - _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ - Body: alerting.UpdateTemplateBody{ - Name: name, - Yaml: yml, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) + t.Run("normal", func(t *testing.T) { + t.Parallel() - resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: alerting.ListTemplatesBody{ - Reload: true, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) + name := uuid.New().String() + expr := uuid.New().String() + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(templateData), name, expr, "s", "%"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) - assertTemplate(t, alertTemplates[0], resp.Payload.Templates) - }) + newExpr := uuid.New().String() + alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, newExpr, "s", "%")) + _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ + Body: alerting.UpdateTemplateBody{ + Name: name, + Yaml: yml, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) - t.Run("unknown template", func(t *testing.T) { - t.Parallel() + resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: alerting.ListTemplatesBody{ + Reload: true, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) - name := uuid.New().String() - _, err := client.UpdateTemplate(&alerting.UpdateTemplateParams{ - Body: alerting.UpdateTemplateBody{ - Name: name, - Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), - }, - Context: pmmapitests.Context, + assertTemplate(t, alertTemplates[0], resp.Payload.Templates) }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf("Template with name \"%s\" not found.", name)) - }) - t.Run("invalid yaml", func(t *testing.T) { - t.Parallel() + t.Run("unknown template", func(t *testing.T) { + t.Parallel() - name := uuid.New().String() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), - }, - Context: pmmapitests.Context, + name := uuid.New().String() + _, err := client.UpdateTemplate(&alerting.UpdateTemplateParams{ + Body: alerting.UpdateTemplateBody{ + Name: name, + Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf("Template with name \"%s\" not found.", name)) }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) - _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ - Body: alerting.UpdateTemplateBody{ - Name: name, - Yaml: "not a yaml", - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") - }) + t.Run("invalid yaml", func(t *testing.T) { + t.Parallel() - t.Run("invalid template", func(t *testing.T) { - t.Parallel() + name := uuid.New().String() + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) - name := uuid.New().String() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), - }, - Context: pmmapitests.Context, + _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ + Body: alerting.UpdateTemplateBody{ + Name: name, + Yaml: "not a yaml", + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) - _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ - Body: alerting.UpdateTemplateBody{ - Name: name, - Yaml: fmt.Sprintf(string(invalidTemplateData), name, uuid.New().String()), - }, - Context: pmmapitests.Context, + t.Run("invalid template", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) + + _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ + Body: alerting.UpdateTemplateBody{ + Name: name, + Yaml: fmt.Sprintf(string(invalidTemplateData), name, uuid.New().String()), + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") }) - }) - - t.Run("delete", func(t *testing.T) { - t.Parallel() - t.Run("normal", func(t *testing.T) { + t.Run("delete", func(t *testing.T) { t.Parallel() - name := uuid.New().String() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - _, err = client.DeleteTemplate(&alerting.DeleteTemplateParams{ - Body: alerting.DeleteTemplateBody{ - Name: name, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) + t.Run("normal", func(t *testing.T) { + t.Parallel() - resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: alerting.ListTemplatesBody{ - Reload: true, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) + name := uuid.New().String() + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) - for _, template := range resp.Payload.Templates { - assert.NotEqual(t, name, template.Name) - } - }) + _, err = client.DeleteTemplate(&alerting.DeleteTemplateParams{ + Body: alerting.DeleteTemplateBody{ + Name: name, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) - t.Run("unknown template", func(t *testing.T) { - t.Parallel() + resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: alerting.ListTemplatesBody{ + Reload: true, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) - name := uuid.New().String() - _, err := client.DeleteTemplate(&alerting.DeleteTemplateParams{ - Body: alerting.DeleteTemplateBody{ - Name: name, - }, - Context: pmmapitests.Context, + for _, template := range resp.Payload.Templates { + assert.NotEqual(t, name, template.Name) + } }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf("Template with name \"%s\" not found.", name)) - }) - }) - t.Run("list", func(t *testing.T) { - t.Run("without pagination", func(t *testing.T) { - name := uuid.New().String() - expr := uuid.New().String() - alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: yml, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) + t.Run("unknown template", func(t *testing.T) { + t.Parallel() - resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: alerting.ListTemplatesBody{ - Reload: true, - }, - Context: pmmapitests.Context, + name := uuid.New().String() + _, err := client.DeleteTemplate(&alerting.DeleteTemplateParams{ + Body: alerting.DeleteTemplateBody{ + Name: name, + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf("Template with name \"%s\" not found.", name)) }) - require.NoError(t, err) - - assertTemplate(t, alertTemplates[0], resp.Payload.Templates) }) - t.Run("with pagination", func(t *testing.T) { - const templatesCount = 5 - - templateNames := make(map[string]struct{}) - - for i := 0; i < templatesCount; i++ { + t.Run("list", func(t *testing.T) { + t.Run("without pagination", func(t *testing.T) { name := uuid.New().String() expr := uuid.New().String() - _, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) + alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ Body: alerting.CreateTemplateBody{ Yaml: yml, @@ -396,75 +291,287 @@ func TestTemplatesAPI(t *testing.T) { Context: pmmapitests.Context, }) require.NoError(t, err) + defer deleteTemplate(t, client, name) - templateNames[name] = struct{}{} - } - defer func() { - for name := range templateNames { - deleteTemplate(t, client, name) - } - }() + resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: alerting.ListTemplatesBody{ + Reload: true, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) - // list rules, so they are all on the first page - body := alerting.ListTemplatesBody{ - PageParams: &alerting.ListTemplatesParamsBodyPageParams{ - PageSize: 30, - Index: 0, - }, - } - listAllTemplates, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: body, - Context: pmmapitests.Context, + assertTemplate(t, alertTemplates[0], resp.Payload.Templates) }) - require.NoError(t, err) - assert.GreaterOrEqual(t, len(listAllTemplates.Payload.Templates), templatesCount) - assert.Equal(t, int32(len(listAllTemplates.Payload.Templates)), listAllTemplates.Payload.Totals.TotalItems) - assert.Equal(t, int32(1), listAllTemplates.Payload.Totals.TotalPages) + t.Run("with pagination", func(t *testing.T) { + const templatesCount = 5 - assertFindTemplate := func(list []*alerting.ListTemplatesOKBodyTemplatesItems0, name string) func() bool { - return func() bool { - for _, tmpl := range list { - if tmpl.Name == name { - return true - } - } - return false - } - } + templateNames := make(map[string]struct{}) - for name := range templateNames { - assert.Conditionf(t, assertFindTemplate(listAllTemplates.Payload.Templates, name), "template %s not found", name) - } + for i := 0; i < templatesCount; i++ { + name := uuid.New().String() + expr := uuid.New().String() + _, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: yml, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + templateNames[name] = struct{}{} + } + defer func() { + for name := range templateNames { + deleteTemplate(t, client, name) + } + }() - // paginate page over page with page size 1 and check the order - it should be the same as in listAllTemplates. - // last iteration checks that there is no elements for not existing page. - for pageIndex := 0; pageIndex <= len(listAllTemplates.Payload.Templates); pageIndex++ { + // list rules, so they are all on the first page body := alerting.ListTemplatesBody{ PageParams: &alerting.ListTemplatesParamsBodyPageParams{ - PageSize: 1, - Index: int32(pageIndex), + PageSize: 30, + Index: 0, }, } - listOneTemplate, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: body, Context: pmmapitests.Context, + listAllTemplates, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: body, + Context: pmmapitests.Context, }) require.NoError(t, err) - assert.Equal(t, listAllTemplates.Payload.Totals.TotalItems, listOneTemplate.Payload.Totals.TotalItems) - assert.GreaterOrEqual(t, listOneTemplate.Payload.Totals.TotalPages, int32(templatesCount)) + assert.GreaterOrEqual(t, len(listAllTemplates.Payload.Templates), templatesCount) + assert.Equal(t, int32(len(listAllTemplates.Payload.Templates)), listAllTemplates.Payload.Totals.TotalItems) + assert.Equal(t, int32(1), listAllTemplates.Payload.Totals.TotalPages) - if pageIndex != len(listAllTemplates.Payload.Templates) { - require.Len(t, listOneTemplate.Payload.Templates, 1) - assert.Equal(t, listAllTemplates.Payload.Templates[pageIndex].Name, listOneTemplate.Payload.Templates[0].Name) - } else { - assert.Len(t, listOneTemplate.Payload.Templates, 0) + assertFindTemplate := func(list []*alerting.ListTemplatesOKBodyTemplatesItems0, name string) func() bool { + return func() bool { + for _, tmpl := range list { + if tmpl.Name == name { + return true + } + } + return false + } } - } + + for name := range templateNames { + assert.Conditionf(t, assertFindTemplate(listAllTemplates.Payload.Templates, name), "template %s not found", name) + } + + // paginate page over page with page size 1 and check the order - it should be the same as in listAllTemplates. + // last iteration checks that there is no elements for not existing page. + for pageIndex := 0; pageIndex <= len(listAllTemplates.Payload.Templates); pageIndex++ { + body := alerting.ListTemplatesBody{ + PageParams: &alerting.ListTemplatesParamsBodyPageParams{ + PageSize: 1, + Index: int32(pageIndex), + }, + } + listOneTemplate, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: body, Context: pmmapitests.Context, + }) + require.NoError(t, err) + + assert.Equal(t, listAllTemplates.Payload.Totals.TotalItems, listOneTemplate.Payload.Totals.TotalItems) + assert.GreaterOrEqual(t, listOneTemplate.Payload.Totals.TotalPages, int32(templatesCount)) + + if pageIndex != len(listAllTemplates.Payload.Templates) { + require.Len(t, listOneTemplate.Payload.Templates, 1) + assert.Equal(t, listAllTemplates.Payload.Templates[pageIndex].Name, listOneTemplate.Payload.Templates[0].Name) + } else { + assert.Len(t, listOneTemplate.Payload.Templates, 0) + } + } + }) + }) + }) + + t.Run("rules", func(t *testing.T) { + t.Parallel() + client := alertingClient.Default.Alerting + + // Create grafana folder for test alert rules + grafanaClient := grafana.NewClient("127.0.0.1:3000") + ctx := metadata.NewIncomingContext(context.Background(), metadata.New(map[string]string{"Authorization": "Basic " + base64.StdEncoding.EncodeToString([]byte("admin:admin"))})) + folder, err := grafanaClient.CreateFolder(ctx, "test-folder-"+uuid.NewString()) + require.NoError(t, err) + + t.Cleanup(func() { + assert.NoError(t, grafanaClient.DeleteFolder(ctx, folder.UID, true)) + }) + + dummyFilter := &alerting.CreateRuleParamsBodyFiltersItems0{ + Type: pointer.ToString("MATCH"), + Label: "threshold", + Regexp: "12", + } + + templateName := createTemplate(t) + t.Cleanup(func() { + deleteTemplate(t, alertingClient.Default.Alerting, templateName) + }) + + t.Run("add", func(t *testing.T) { + t.Parallel() + + t.Run("normal from template", func(t *testing.T) { + t.Parallel() + + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + _, err := client.CreateRule(params) + require.NoError(t, err) + }) + + t.Run("builtin_template", func(t *testing.T) { + t.Parallel() + + params := createAlertRuleParams("pmm_mongodb_restarted", folder.UID, dummyFilter) + params.Body.Params = []*alerting.CreateRuleParamsBodyParamsItems0{{ + Name: "threshold", + Type: pointer.ToString("FLOAT"), + Float: 3.14, + }} + _, err := client.CreateRule(params) + require.NoError(t, err) + }) + + t.Run("use default value for parameter", func(t *testing.T) { + t.Parallel() + + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + _, err := client.CreateRule(params) + require.NoError(t, err) + }) + + t.Run("unknown template", func(t *testing.T) { + t.Parallel() + + templateName := uuid.New().String() + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + _, err := client.CreateRule(params) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Unknown template %s.", templateName) + }) + + t.Run("wrong parameter", func(t *testing.T) { + t.Parallel() + + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + params.Body.Params = append( + params.Body.Params, + &alerting.CreateRuleParamsBodyParamsItems0{ + Name: "unknown parameter", + Type: pointer.ToString("FLOAT"), + Float: 12, + }) + _, err := client.CreateRule(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 3.") + }) + + t.Run("wrong parameter type", func(t *testing.T) { + t.Parallel() + + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + params.Body.Params = []*alerting.CreateRuleParamsBodyParamsItems0{ + { + Name: "param1", + Type: pointer.ToString("BOOL"), + Bool: true, + }, { + Name: "param2", + Type: pointer.ToString("FLOAT"), + Float: 12, + }, + } + _, err := client.CreateRule(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") + }) }) }) } +func assertTemplate(t *testing.T, expectedTemplate alert.Template, listTemplates []*alerting.ListTemplatesOKBodyTemplatesItems0) { + t.Helper() + convertParamUnit := func(u string) alert.Unit { + switch u { + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPERCENTAGE: + return alert.Percentage + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitSECONDS: + return alert.Seconds + } + return "INVALID" + } + convertParamType := func(u string) alert.Type { + switch u { + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeFLOAT: + return alert.Float + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeSTRING: + return alert.String + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeBOOL: + return alert.Bool + } + return "INVALID" + } + var tmpl *alerting.ListTemplatesOKBodyTemplatesItems0 + for _, listTmpl := range listTemplates { + if listTmpl.Name == expectedTemplate.Name { + tmpl = listTmpl + break + } + } + require.NotNilf(t, tmpl, "template %s not found", expectedTemplate.Name) + // IDE doesn't recognize that require stops execution + if tmpl == nil { + return + } + assert.Equal(t, expectedTemplate.Expr, tmpl.Expr) + assert.Equal(t, expectedTemplate.Summary, tmpl.Summary) + assert.Equal(t, "USER_API", *tmpl.Source) + assert.Equal(t, "SEVERITY_WARNING", *tmpl.Severity) + + forDuration := fmt.Sprintf("%.0fs", time.Duration(expectedTemplate.For).Seconds()) + assert.Equal(t, forDuration, tmpl.For) + + require.Len(t, tmpl.Params, len(expectedTemplate.Params)) + for i, expectedParam := range expectedTemplate.Params { + param := tmpl.Params[i] + assert.Equal(t, expectedParam.Name, param.Name) + assert.Equal(t, expectedParam.Summary, param.Summary) + assert.Equal(t, expectedParam.Type, convertParamType(*param.Type)) + assert.Equal(t, expectedParam.Unit, convertParamUnit(*param.Unit)) + switch expectedParam.Type { + case alert.Float: + if expectedParam.Value != nil { + require.NotNil(t, param.Float) + value, err := expectedParam.GetValueForFloat() + require.NoError(t, err) + assert.True(t, param.Float.HasDefault) + assert.Equal(t, value, param.Float.Default) + } + + if len(expectedParam.Range) != 0 { + min, max, err := expectedParam.GetRangeForFloat() + require.NoError(t, err) + assert.True(t, param.Float.HasMax) + assert.True(t, param.Float.HasMin) + assert.Equal(t, min, param.Float.Min) + assert.Equal(t, max, param.Float.Max) + } + + assert.Nil(t, param.Bool) + assert.Nil(t, param.String) + default: + } + } + + assert.Equal(t, expectedTemplate.Labels, tmpl.Labels) + assert.Equal(t, expectedTemplate.Annotations, tmpl.Annotations) + + assert.NotEmpty(t, tmpl.CreatedAt) +} + func deleteTemplate(t *testing.T, client alerting.ClientService, name string) { t.Helper() @@ -493,3 +600,55 @@ func formatTemplateYaml(t *testing.T, yml string) ([]alert.Template, string) { return r, string(s) } + +func createAlertRuleParams(templateName, folderUID string, filter *alerting.CreateRuleParamsBodyFiltersItems0) *alerting.CreateRuleParams { + rule := &alerting.CreateRuleParams{ + Body: alerting.CreateRuleBody{ + TemplateName: templateName, + Name: "test-rule-" + uuid.NewString(), + FolderUID: folderUID, + Group: "test", + Params: []*alerting.CreateRuleParamsBodyParamsItems0{ + { + Name: "param1", + Type: pointer.ToString("FLOAT"), + Float: 4, + }, + { + Name: "param2", + Type: pointer.ToString("FLOAT"), + Float: 12, + }, + }, + For: "90s", + Severity: pointer.ToString("SEVERITY_WARNING"), + CustomLabels: map[string]string{"foo": "bar"}, + }, + Context: pmmapitests.Context, + } + + if filter != nil { + rule.Body.Filters = []*alerting.CreateRuleParamsBodyFiltersItems0{filter} + } + + return rule +} + +func createTemplate(t *testing.T) string { + t.Helper() + + b, err := os.ReadFile("../../testdata/ia/template.yaml") + require.NoError(t, err) + + templateName := uuid.New().String() + expression := "'[[ .param1 ]] > 2 and 2 < [[ .param2 ]]'" + _, err = alertingClient.Default.Alerting.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(b), templateName, expression, "%", "s"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + return templateName +} diff --git a/api-tests/management/alerts_test.go b/api-tests/management/alerts_test.go deleted file mode 100644 index 4a217cac04..0000000000 --- a/api-tests/management/alerts_test.go +++ /dev/null @@ -1,748 +0,0 @@ -// // Copyright (C) 2017 Percona LLC -// // -// // This program is free software: you can redistribute it and/or modify -// // it under the terms of the GNU Affero General Public License as published by -// // the Free Software Foundation, either version 3 of the License, or -// // (at your option) any later version. -// // -// // This program is distributed in the hope that it will be useful, -// // but WITHOUT ANY WARRANTY; without even the implied warranty of -// // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// // GNU Affero General Public License for more details. -// // -// // You should have received a copy of the GNU Affero General Public License -// // along with this program. If not, see . -package management - -// -// import ( -// "fmt" -// "os" -// "testing" -// -// "github.com/AlekSi/pointer" -// "github.com/brianvoe/gofakeit/v6" -// "github.com/google/uuid" -// "github.com/stretchr/testify/assert" -// "github.com/stretchr/testify/require" -// "google.golang.org/grpc/codes" -// -// pmmapitests "github.com/percona/pmm/api-tests" -// alertingClient "github.com/percona/pmm/api/managementpb/alerting/json/client" -// "github.com/percona/pmm/api/managementpb/alerting/json/client/alerting" -// "github.com/percona/pmm/api/managementpb/ia/json/client" -// "github.com/percona/pmm/api/managementpb/ia/json/client/channels" -// "github.com/percona/pmm/api/managementpb/ia/json/client/rules" -// ) -// -// // Note: Even though the IA services check for alerting enabled or disabled before returning results -// // we don't enable or disable IA explicit in our tests since it is enabled by default through -// // ENABLE_ALERTING env var. -// func TestRulesAPI(t *testing.T) { -// t.Parallel() -// rulesClient := client.Default.Rules -// templatesClient := alertingClient.Default.Alerting -// channelsClient := client.Default.Channels -// -// dummyFilter := &rules.CreateAlertRuleParamsBodyFiltersItems0{ -// Type: pointer.ToString("EQUAL"), -// Key: "threshold", -// Value: "12", -// } -// -// templateName := createTemplate(t) -// channelID, _ := createChannel(t) -// newChannelID, _ := createChannel(t) -// t.Cleanup(func() { -// deleteTemplate(t, alertingClient.Default.Alerting, templateName) -// deleteChannel(t, channelsClient, channelID) -// deleteChannel(t, channelsClient, newChannelID) -// }) -// -// t.Run("add", func(t *testing.T) { -// t.Parallel() -// -// t.Run("normal from template", func(t *testing.T) { -// t.Parallel() -// -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(params) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// assert.NotEmpty(t, rule.Payload.RuleID) -// }) -// -// t.Run("without channels and filters", func(t *testing.T) { -// t.Parallel() -// -// params := createAlertRuleParams(templateName, "", "", nil) -// rule, err := rulesClient.CreateAlertRule(params) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// assert.NotEmpty(t, rule.Payload.RuleID) -// }) -// -// t.Run("builtin_template", func(t *testing.T) { -// t.Parallel() -// -// params := createAlertRuleParams("pmm_mongodb_restarted", "", channelID, dummyFilter) -// params.Body.Params = []*rules.CreateAlertRuleParamsBodyParamsItems0{{ -// Name: "threshold", -// Type: pointer.ToString("FLOAT"), -// Float: 3.14, -// }} -// rule, err := rulesClient.CreateAlertRule(params) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// assert.NotEmpty(t, rule.Payload.RuleID) -// }) -// -// t.Run("use default value for parameter", func(t *testing.T) { -// t.Parallel() -// -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(params) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// assert.NotEmpty(t, rule.Payload.RuleID) -// }) -// -// t.Run("normal from other rule", func(t *testing.T) { -// t.Parallel() -// -// sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) -// -// copyRuleParams := createAlertRuleParams("", sourceRule.Payload.RuleID, channelID, dummyFilter) -// copyRule, err := rulesClient.CreateAlertRule(copyRuleParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, copyRule.Payload.RuleID) -// -// assert.NotEmpty(t, copyRule.Payload.RuleID) -// }) -// -// t.Run("normal from other rule with deleted template", func(t *testing.T) { -// t.Parallel() -// -// sourceTemplateName := createTemplate(t) -// sourceRuleParams := createAlertRuleParams(sourceTemplateName, "", channelID, dummyFilter) -// sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) -// -// deleteTemplate(t, templatesClient, sourceTemplateName) -// -// copyRuleParams := createAlertRuleParams("", sourceRule.Payload.RuleID, channelID, dummyFilter) -// copyRule, err := rulesClient.CreateAlertRule(copyRuleParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, copyRule.Payload.RuleID) -// -// assert.NotEmpty(t, copyRule.Payload.RuleID) -// }) -// -// t.Run("both template name and source rule id specified", func(t *testing.T) { -// t.Parallel() -// -// sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) -// -// copyRuleParams := createAlertRuleParams(templateName, sourceRule.Payload.RuleID, channelID, dummyFilter) -// _, err = rulesClient.CreateAlertRule(copyRuleParams) -// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Both template name and source rule id are specified.") -// }) -// -// t.Run("both template name and source rule id are empty", func(t *testing.T) { -// t.Parallel() -// -// sourceRuleParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// sourceRule, err := rulesClient.CreateAlertRule(sourceRuleParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, sourceRule.Payload.RuleID) -// -// copyRuleParams := createAlertRuleParams("", "", channelID, dummyFilter) -// _, err = rulesClient.CreateAlertRule(copyRuleParams) -// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Template name or source rule id should be specified.") -// }) -// -// t.Run("unknown template", func(t *testing.T) { -// t.Parallel() -// -// templateName := uuid.New().String() -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// _, err := rulesClient.CreateAlertRule(params) -// pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Unknown template %s.", templateName) -// }) -// -// t.Run("unknown channel", func(t *testing.T) { -// t.Parallel() -// -// channelID := uuid.New().String() -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// _, err := rulesClient.CreateAlertRule(params) -// pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Failed to find all required channels: [%s].", channelID) -// }) -// -// t.Run("wrong parameter", func(t *testing.T) { -// t.Parallel() -// -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// params.Body.Params = append( -// params.Body.Params, -// &rules.CreateAlertRuleParamsBodyParamsItems0{ -// Name: "unknown parameter", -// Type: pointer.ToString("FLOAT"), -// Float: 12, -// }) -// _, err := rulesClient.CreateAlertRule(params) -// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 3.") -// }) -// -// t.Run("wrong parameter type", func(t *testing.T) { -// t.Parallel() -// -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// params.Body.Params = []*rules.CreateAlertRuleParamsBodyParamsItems0{ -// { -// Name: "param1", -// Type: pointer.ToString("BOOL"), -// Bool: true, -// }, { -// Name: "param2", -// Type: pointer.ToString("FLOAT"), -// Float: 12, -// }, -// } -// _, err := rulesClient.CreateAlertRule(params) -// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") -// }) -// }) -// -// t.Run("update", func(t *testing.T) { -// t.Parallel() -// -// t.Run("normal", func(t *testing.T) { -// t.Parallel() -// -// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(cParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// params := &rules.UpdateAlertRuleParams{ -// Body: rules.UpdateAlertRuleBody{ -// RuleID: rule.Payload.RuleID, -// Disabled: false, -// Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ -// { -// Name: "param1", -// Type: pointer.ToString("FLOAT"), -// Float: 3.14, -// }, -// { -// Name: "param2", -// Type: pointer.ToString("FLOAT"), -// Float: 21, -// }, -// }, -// For: "10s", -// Severity: pointer.ToString("SEVERITY_ERROR"), -// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, -// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ -// Type: pointer.ToString("EQUAL"), -// Key: "param1", -// Value: "21", -// }}, -// ChannelIds: []string{channelID, newChannelID}, -// }, -// Context: pmmapitests.Context, -// } -// _, err = rulesClient.UpdateAlertRule(params) -// require.NoError(t, err) -// -// list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) -// require.NoError(t, err) -// -// var found bool -// for _, r := range list.Payload.Rules { -// if r.RuleID == rule.Payload.RuleID { -// assert.Equal(t, params.Body.Name, r.Name) -// assert.Equal(t, "Test summary", r.Summary) -// assert.Equal(t, templateName, r.TemplateName) -// assert.False(t, r.Disabled) -// assert.Equal(t, "300s", r.DefaultFor) -// assert.Equal(t, "10s", r.For) -// assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.DefaultSeverity)) -// assert.Equal(t, params.Body.Severity, r.Severity) -// assert.Equal(t, params.Body.CustomLabels, r.CustomLabels) -// assert.Equal(t, map[string]string{"foo": "bar"}, r.Labels) -// assert.Equal(t, map[string]string{"description": "test description", "summary": "test summary"}, r.Annotations) -// assert.Len(t, r.ParamsValues, 2) -// assert.Equal(t, params.Body.Params[0].Type, r.ParamsValues[0].Type) -// assert.Equal(t, params.Body.Params[0].Name, r.ParamsValues[0].Name) -// assert.Equal(t, params.Body.Params[0].Float, r.ParamsValues[0].Float) -// assert.Equal(t, params.Body.Params[0].Bool, r.ParamsValues[0].Bool) -// assert.Equal(t, params.Body.Params[0].String, r.ParamsValues[0].String) -// assert.Equal(t, params.Body.Params[1].Type, r.ParamsValues[1].Type) -// assert.Equal(t, params.Body.Params[1].Name, r.ParamsValues[1].Name) -// assert.Equal(t, params.Body.Params[1].Float, r.ParamsValues[1].Float) -// assert.Equal(t, params.Body.Params[1].Bool, r.ParamsValues[1].Bool) -// assert.Equal(t, params.Body.Params[1].String, r.ParamsValues[1].String) -// assert.Equal(t, "[[ .param1 ]] > 2 and 2 < [[ .param2 ]]", r.ExprTemplate) -// assert.Equal(t, "3.14 > 2 and 2 < 21", r.Expr) -// found = true -// } -// } -// assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) -// }) -// -// t.Run("unknown channel", func(t *testing.T) { -// t.Parallel() -// -// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(cParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// unknownChannelID := uuid.New().String() -// params := &rules.UpdateAlertRuleParams{ -// Body: rules.UpdateAlertRuleBody{ -// RuleID: rule.Payload.RuleID, -// Disabled: false, -// Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ -// { -// Name: "param1", -// Type: pointer.ToString("FLOAT"), -// Float: 3.14, -// }, { -// Name: "param2", -// Type: pointer.ToString("FLOAT"), -// Float: 21, -// }, -// }, -// For: "10s", -// Severity: pointer.ToString("SEVERITY_ERROR"), -// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, -// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ -// Type: pointer.ToString("EQUAL"), -// Key: "param1", -// Value: "21", -// }}, -// ChannelIds: []string{channelID, unknownChannelID}, -// }, -// Context: pmmapitests.Context, -// } -// _, err = rulesClient.UpdateAlertRule(params) -// pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Failed to find all required channels: [%s].", unknownChannelID) -// }) -// -// t.Run("wrong parameter", func(t *testing.T) { -// t.Parallel() -// -// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(cParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// params := &rules.UpdateAlertRuleParams{ -// Body: rules.UpdateAlertRuleBody{ -// RuleID: rule.Payload.RuleID, -// Disabled: false, -// Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{{ -// Name: "param2", -// Type: pointer.ToString("FLOAT"), -// Float: 12, -// }, { -// Name: "unknown parameter", -// Type: pointer.ToString("FLOAT"), -// Float: 21, -// }}, -// For: "10s", -// Severity: pointer.ToString("SEVERITY_ERROR"), -// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, -// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ -// Type: pointer.ToString("EQUAL"), -// Key: "param1", -// Value: "21", -// }}, -// ChannelIds: []string{channelID, newChannelID}, -// }, -// Context: pmmapitests.Context, -// } -// _, err = rulesClient.UpdateAlertRule(params) -// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 is missing.") -// }) -// -// t.Run("missing parameters", func(t *testing.T) { -// t.Parallel() -// -// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(cParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// params := &rules.UpdateAlertRuleParams{ -// Body: rules.UpdateAlertRuleBody{ -// RuleID: rule.Payload.RuleID, -// Disabled: false, -// Params: nil, -// For: "10s", -// Severity: pointer.ToString("SEVERITY_ERROR"), -// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, -// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ -// Type: pointer.ToString("EQUAL"), -// Key: "param1", -// Value: "21", -// }}, -// ChannelIds: []string{channelID, newChannelID}, -// }, -// Context: pmmapitests.Context, -// } -// _, err = rulesClient.UpdateAlertRule(params) -// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 0.") -// }) -// -// t.Run("wrong parameter type", func(t *testing.T) { -// t.Parallel() -// -// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(cParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// params := &rules.UpdateAlertRuleParams{ -// Body: rules.UpdateAlertRuleBody{ -// RuleID: rule.Payload.RuleID, -// Disabled: false, -// Params: []*rules.UpdateAlertRuleParamsBodyParamsItems0{ -// { -// Name: "param1", -// Type: pointer.ToString("BOOL"), -// Bool: true, -// }, { -// Name: "param2", -// Type: pointer.ToString("FLOAT"), -// Float: 3.14, -// }, -// }, -// For: "10s", -// Severity: pointer.ToString("SEVERITY_ERROR"), -// CustomLabels: map[string]string{"foo": "bar", "baz": "faz"}, -// Filters: []*rules.UpdateAlertRuleParamsBodyFiltersItems0{{ -// Type: pointer.ToString("EQUAL"), -// Key: "param1", -// Value: "21", -// }}, -// ChannelIds: []string{channelID, newChannelID}, -// }, -// Context: pmmapitests.Context, -// } -// _, err = rulesClient.UpdateAlertRule(params) -// pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") -// }) -// }) -// -// t.Run("toggle", func(t *testing.T) { -// t.Parallel() -// -// cParams := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(cParams) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) -// require.NoError(t, err) -// -// var found bool -// for _, r := range list.Payload.Rules { -// if r.RuleID == rule.Payload.RuleID { -// assert.True(t, r.Disabled) -// assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.Severity)) -// found = true -// } -// } -// assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) -// -// _, err = rulesClient.ToggleAlertRule(&rules.ToggleAlertRuleParams{ -// Body: rules.ToggleAlertRuleBody{ -// RuleID: rule.Payload.RuleID, -// Disabled: pointer.ToString(rules.ToggleAlertRuleBodyDisabledFALSE), -// }, -// Context: pmmapitests.Context, -// }) -// require.NoError(t, err) -// -// list, err = rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) -// require.NoError(t, err) -// -// found = false -// for _, r := range list.Payload.Rules { -// if r.RuleID == rule.Payload.RuleID { -// assert.False(t, r.Disabled) -// assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.Severity)) -// found = true -// } -// } -// assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) -// }) -// -// t.Run("delete", func(t *testing.T) { -// t.Parallel() -// -// t.Run("normal", func(t *testing.T) { -// t.Parallel() -// -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(params) -// require.NoError(t, err) -// -// _, err = rulesClient.DeleteAlertRule(&rules.DeleteAlertRuleParams{ -// Body: rules.DeleteAlertRuleBody{RuleID: rule.Payload.RuleID}, -// Context: pmmapitests.Context, -// }) -// require.NoError(t, err) -// -// list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) -// require.NoError(t, err) -// -// for _, r := range list.Payload.Rules { -// assert.NotEqual(t, rule.Payload.RuleID, r.RuleID) -// } -// }) -// -// t.Run("missing rule", func(t *testing.T) { -// t.Parallel() -// ruleID := uuid.New().String() -// _, err := rulesClient.DeleteAlertRule(&rules.DeleteAlertRuleParams{ -// Body: rules.DeleteAlertRuleBody{RuleID: ruleID}, -// Context: pmmapitests.Context, -// }) -// pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Rule with ID %q not found.", ruleID) -// }) -// }) -// -// t.Run("list without pagination", func(t *testing.T) { -// t.Run("without pagination", func(t *testing.T) { -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(params) -// require.NoError(t, err) -// defer deleteRule(t, rulesClient, rule.Payload.RuleID) -// -// list, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Context: pmmapitests.Context}) -// require.NoError(t, err) -// -// var found bool -// for _, r := range list.Payload.Rules { -// if r.RuleID == rule.Payload.RuleID { -// assert.Equal(t, params.Body.TemplateName, r.TemplateName) -// assert.Equal(t, "Test summary", r.Summary) -// assert.True(t, r.Disabled) -// assert.Equal(t, params.Body.Name, r.Name) -// assert.Len(t, r.ParamsValues, 2) -// assert.Equal(t, params.Body.Params[0].Type, r.ParamsValues[0].Type) -// assert.Equal(t, params.Body.Params[0].Name, r.ParamsValues[0].Name) -// assert.Equal(t, params.Body.Params[0].Float, r.ParamsValues[0].Float) -// assert.Equal(t, params.Body.Params[0].Bool, r.ParamsValues[0].Bool) -// assert.Equal(t, params.Body.Params[0].String, r.ParamsValues[0].String) -// assert.Equal(t, params.Body.Params[1].Type, r.ParamsValues[1].Type) -// assert.Equal(t, params.Body.Params[1].Name, r.ParamsValues[1].Name) -// assert.Equal(t, params.Body.Params[1].Float, r.ParamsValues[1].Float) -// assert.Equal(t, params.Body.Params[1].Bool, r.ParamsValues[1].Bool) -// assert.Equal(t, params.Body.Params[1].String, r.ParamsValues[1].String) -// assert.Equal(t, "300s", r.DefaultFor) -// assert.Equal(t, params.Body.For, r.For) -// assert.Equal(t, "SEVERITY_WARNING", pointer.GetString(r.DefaultSeverity)) -// assert.Equal(t, params.Body.Severity, r.Severity) -// assert.Equal(t, params.Body.CustomLabels, r.CustomLabels) -// assert.Equal(t, map[string]string{"foo": "bar"}, r.Labels) -// assert.Equal(t, map[string]string{"description": "test description", "summary": "test summary"}, r.Annotations) -// assert.Len(t, params.Body.Filters, 1) -// assert.Equal(t, params.Body.Filters[0].Type, r.Filters[0].Type) -// assert.Equal(t, params.Body.Filters[0].Key, r.Filters[0].Key) -// assert.Equal(t, params.Body.Filters[0].Value, r.Filters[0].Value) -// assert.Len(t, r.Channels, 1) -// assert.Equal(t, r.Channels[0].ChannelID, channelID) -// assert.Equal(t, "[[ .param1 ]] > 2 and 2 < [[ .param2 ]]", r.ExprTemplate) -// assert.Equal(t, "4 > 2 and 2 < 12", r.Expr) -// found = true -// } -// } -// assert.Truef(t, found, "Rule with id %s not found", rule.Payload.RuleID) -// }) -// -// t.Run("with pagination", func(t *testing.T) { -// const rulesCount = 5 -// -// ruleIDs := make(map[string]struct{}) -// -// for i := 0; i < rulesCount; i++ { -// params := createAlertRuleParams(templateName, "", channelID, dummyFilter) -// rule, err := rulesClient.CreateAlertRule(params) -// require.NoError(t, err) -// -// ruleIDs[rule.Payload.RuleID] = struct{}{} -// } -// defer func() { -// for id := range ruleIDs { -// deleteRule(t, rulesClient, id) -// } -// }() -// -// // list rules, so they are all on the first page -// body := rules.ListAlertRulesBody{ -// PageParams: &rules.ListAlertRulesParamsBodyPageParams{ -// PageSize: 20, -// Index: 0, -// }, -// } -// list1, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Body: body, Context: pmmapitests.Context}) -// require.NoError(t, err) -// -// lp1 := list1.Payload -// // some tests didn't remove rules, so expect more elements than created in current test -// assert.GreaterOrEqual(t, len(lp1.Rules), rulesCount) -// assert.Equal(t, int32(len(lp1.Rules)), lp1.Totals.TotalItems) -// assert.Equal(t, int32(1), lp1.Totals.TotalPages) -// for id := range ruleIDs { -// var found bool -// for _, r := range list1.Payload.Rules { -// if r.RuleID == id { -// found = true -// -// break -// } -// } -// -// assert.Truef(t, found, "rule (%s) not found", id) -// } -// -// // paginate page over page with page size 1 and check the order - it should be the same as in list1. -// // last iteration checks that there is no elements for not existing page. -// for pageIndex := 0; pageIndex <= len(lp1.Rules); pageIndex++ { -// body := rules.ListAlertRulesBody{ -// PageParams: &rules.ListAlertRulesParamsBodyPageParams{ -// PageSize: 1, -// Index: int32(pageIndex), -// }, -// } -// list2, err := rulesClient.ListAlertRules(&rules.ListAlertRulesParams{Body: body, Context: pmmapitests.Context}) -// require.NoError(t, err) -// -// lp2 := list2.Payload -// assert.Equal(t, lp1.Totals.TotalItems, lp2.Totals.TotalItems) -// assert.GreaterOrEqual(t, lp2.Totals.TotalPages, int32(rulesCount)) -// -// if pageIndex != len(lp1.Rules) { -// require.Len(t, lp2.Rules, 1) -// assert.Equal(t, lp1.Rules[pageIndex].RuleID, lp2.Rules[0].RuleID) -// } else { -// assert.Len(t, lp2.Rules, 0) -// } -// } -// }) -// }) -// } -// -// func deleteRule(t *testing.T, client rules.ClientService, id string) { -// t.Helper() -// -// _, err := client.DeleteAlertRule(&rules.DeleteAlertRuleParams{ -// Body: rules.DeleteAlertRuleBody{RuleID: id}, -// Context: pmmapitests.Context, -// }) -// require.NoError(t, err) -// } -// -// func createAlertRuleParams(templateName, sourceRuleID, channelID string, filter *rules.CreateAlertRuleParamsBodyFiltersItems0) *rules.CreateAlertRuleParams { -// rule := &rules.CreateAlertRuleParams{ -// Body: rules.CreateAlertRuleBody{ -// TemplateName: templateName, -// SourceRuleID: sourceRuleID, -// Disabled: true, -// Name: "example rule", -// Params: []*rules.CreateAlertRuleParamsBodyParamsItems0{ -// { -// Name: "param1", -// Type: pointer.ToString("FLOAT"), -// Float: 4, -// }, -// { -// Name: "param2", -// Type: pointer.ToString("FLOAT"), -// Float: 12, -// }, -// }, -// For: "5s", -// Severity: pointer.ToString("SEVERITY_WARNING"), -// CustomLabels: map[string]string{"foo": "bar"}, -// }, -// Context: pmmapitests.Context, -// } -// -// if channelID != "" { -// rule.Body.ChannelIds = []string{channelID} -// } -// -// if filter != nil { -// rule.Body.Filters = []*rules.CreateAlertRuleParamsBodyFiltersItems0{filter} -// } -// -// return rule -// } -// -// func createTemplate(t *testing.T) string { -// t.Helper() -// -// b, err := os.ReadFile("../../testdata/ia/template.yaml") -// require.NoError(t, err) -// -// templateName := uuid.New().String() -// expression := "'[[ .param1 ]] > 2 and 2 < [[ .param2 ]]'" -// _, err = alertingClient.Default.Alerting.CreateTemplate(&alerting.CreateTemplateParams{ -// Body: alerting.CreateTemplateBody{ -// Yaml: fmt.Sprintf(string(b), templateName, expression, "%", "s"), -// }, -// Context: pmmapitests.Context, -// }) -// require.NoError(t, err) -// -// return templateName -// } -// -// func createChannel(t *testing.T) (string, channels.AddChannelBody) { -// t.Helper() -// -// body := channels.AddChannelBody{ -// Summary: gofakeit.Quote(), -// Disabled: gofakeit.Bool(), -// EmailConfig: &channels.AddChannelParamsBodyEmailConfig{ -// SendResolved: false, -// To: []string{gofakeit.Email()}, -// }, -// } -// resp, err := client.Default.Channels.AddChannel(&channels.AddChannelParams{ -// Body: body, -// Context: pmmapitests.Context, -// }) -// require.NoError(t, err) -// return resp.Payload.ChannelID, body -// } -// -// func deleteTemplate(t *testing.T, client alerting.ClientService, name string) { -// t.Helper() -// -// _, err := client.DeleteTemplate(&alerting.DeleteTemplateParams{ -// Body: alerting.DeleteTemplateBody{ -// Name: name, -// }, -// Context: pmmapitests.Context, -// }) -// assert.NoError(t, err) -// } diff --git a/api-tests/server/helpers.go b/api-tests/server/helpers.go index 8c2ed1dbca..a51bab6fcf 100644 --- a/api-tests/server/helpers.go +++ b/api-tests/server/helpers.go @@ -48,12 +48,10 @@ func restoreSettingsDefaults(t *testing.T) { StandardInterval: "86400s", RareInterval: "280800s", }, - DataRetention: "2592000s", - AWSPartitions: []string{"aws"}, - RemoveAlertManagerURL: true, - RemoveAlertManagerRules: true, - RemoveEmailAlertingSettings: true, - RemoveSlackAlertingSettings: true, + DataRetention: "2592000s", + AWSPartitions: []string{"aws"}, + RemoveAlertManagerURL: true, + RemoveAlertManagerRules: true, }, Context: pmmapitests.Context, }) diff --git a/api-tests/server/settings_test.go b/api-tests/server/settings_test.go index eca6865a29..ffdd65bf92 100644 --- a/api-tests/server/settings_test.go +++ b/api-tests/server/settings_test.go @@ -26,7 +26,6 @@ import ( "testing" "time" - "github.com/brianvoe/gofakeit/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -60,8 +59,6 @@ func TestSettings(t *testing.T) { assert.Equal(t, []string{"aws"}, res.Payload.Settings.AWSPartitions) assert.False(t, res.Payload.Settings.UpdatesDisabled) assert.True(t, res.Payload.Settings.AlertingEnabled) - assert.Empty(t, res.Payload.Settings.EmailAlertingSettings) - assert.Empty(t, res.Payload.Settings.SlackAlertingSettings) t.Run("ChangeSettings", func(t *testing.T) { defer restoreSettingsDefaults(t) @@ -115,79 +112,14 @@ func TestSettings(t *testing.T) { t.Run("ValidAlertingSettingsUpdate", func(t *testing.T) { defer restoreSettingsDefaults(t) - email := gofakeit.Email() - smarthost := "0.0.0.0:8080" - username := "username" - password := "password" - identity := "identity" - secret := "secret" - slackURL := gofakeit.URL() res, err := serverClient.Default.Server.ChangeSettings(&server.ChangeSettingsParams{ Body: server.ChangeSettingsBody{ - EnableAlerting: true, - EmailAlertingSettings: &server.ChangeSettingsParamsBodyEmailAlertingSettings{ - From: email, - Smarthost: smarthost, - Username: username, - Password: password, - Identity: identity, - Secret: secret, - }, - SlackAlertingSettings: &server.ChangeSettingsParamsBodySlackAlertingSettings{ - URL: slackURL, - }, + DisableAlerting: true, }, Context: pmmapitests.Context, }) require.NoError(t, err) - assert.True(t, res.Payload.Settings.AlertingEnabled) - assert.Equal(t, email, res.Payload.Settings.EmailAlertingSettings.From) - assert.Equal(t, smarthost, res.Payload.Settings.EmailAlertingSettings.Smarthost) - assert.Equal(t, username, res.Payload.Settings.EmailAlertingSettings.Username) - // check that we don't expose password through the API. - assert.Empty(t, res.Payload.Settings.EmailAlertingSettings.Password) - assert.Equal(t, identity, res.Payload.Settings.EmailAlertingSettings.Identity) - assert.Equal(t, secret, res.Payload.Settings.EmailAlertingSettings.Secret) - assert.Equal(t, slackURL, res.Payload.Settings.SlackAlertingSettings.URL) - }) - - t.Run("InvalidBothSlackAlertingSettingsAndRemoveSlackAlertingSettings", func(t *testing.T) { - defer restoreSettingsDefaults(t) - - res, err := serverClient.Default.Server.ChangeSettings(&server.ChangeSettingsParams{ - Body: server.ChangeSettingsBody{ - SlackAlertingSettings: &server.ChangeSettingsParamsBodySlackAlertingSettings{ - URL: gofakeit.URL(), - }, - RemoveSlackAlertingSettings: true, - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, - `Invalid argument: both slack_alerting_settings and remove_slack_alerting_settings are present.`) - assert.Empty(t, res) - }) - - t.Run("InvalidBothEmailAlertingSettingsAndRemoveEmailAlertingSettings", func(t *testing.T) { - defer restoreSettingsDefaults(t) - - res, err := serverClient.Default.Server.ChangeSettings(&server.ChangeSettingsParams{ - Body: server.ChangeSettingsBody{ - EmailAlertingSettings: &server.ChangeSettingsParamsBodyEmailAlertingSettings{ - From: gofakeit.Email(), - Smarthost: "0.0.0.0:8080", - Username: "username", - Password: "password", - Identity: "identity", - Secret: "secret", - }, - RemoveEmailAlertingSettings: true, - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, - `Invalid argument: both email_alerting_settings and remove_email_alerting_settings are present.`) - assert.Empty(t, res) + assert.False(t, res.Payload.Settings.AlertingEnabled) }) t.Run("InvalidBothEnableAndDisableSTT", func(t *testing.T) { diff --git a/api/serverpb/json/client/server/change_settings_responses.go b/api/serverpb/json/client/server/change_settings_responses.go index a1b37f8b1f..0036b81456 100644 --- a/api/serverpb/json/client/server/change_settings_responses.go +++ b/api/serverpb/json/client/server/change_settings_responses.go @@ -171,12 +171,6 @@ type ChangeSettingsBody struct { // Disable Alerting. DisableAlerting bool `json:"disable_alerting,omitempty"` - // If true, removes Alerting email (SMTP) settings. - RemoveEmailAlertingSettings bool `json:"remove_email_alerting_settings,omitempty"` - - // If true, removes Alerting Slack settings. - RemoveSlackAlertingSettings bool `json:"remove_slack_alerting_settings,omitempty"` - // PMM Server public address. PMMPublicAddress string `json:"pmm_public_address,omitempty"` @@ -207,15 +201,9 @@ type ChangeSettingsBody struct { // Disable Access Control DisableAccessControl bool `json:"disable_access_control,omitempty"` - // email alerting settings - EmailAlertingSettings *ChangeSettingsParamsBodyEmailAlertingSettings `json:"email_alerting_settings,omitempty"` - // metrics resolutions MetricsResolutions *ChangeSettingsParamsBodyMetricsResolutions `json:"metrics_resolutions,omitempty"` - // slack alerting settings - SlackAlertingSettings *ChangeSettingsParamsBodySlackAlertingSettings `json:"slack_alerting_settings,omitempty"` - // stt check intervals SttCheckIntervals *ChangeSettingsParamsBodySttCheckIntervals `json:"stt_check_intervals,omitempty"` } @@ -224,18 +212,10 @@ type ChangeSettingsBody struct { func (o *ChangeSettingsBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateEmailAlertingSettings(formats); err != nil { - res = append(res, err) - } - if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateSlackAlertingSettings(formats); err != nil { - res = append(res, err) - } - if err := o.validateSttCheckIntervals(formats); err != nil { res = append(res, err) } @@ -246,25 +226,6 @@ func (o *ChangeSettingsBody) Validate(formats strfmt.Registry) error { return nil } -func (o *ChangeSettingsBody) validateEmailAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.EmailAlertingSettings) { // not required - return nil - } - - if o.EmailAlertingSettings != nil { - if err := o.EmailAlertingSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "email_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "email_alerting_settings") - } - return err - } - } - - return nil -} - func (o *ChangeSettingsBody) validateMetricsResolutions(formats strfmt.Registry) error { if swag.IsZero(o.MetricsResolutions) { // not required return nil @@ -284,25 +245,6 @@ func (o *ChangeSettingsBody) validateMetricsResolutions(formats strfmt.Registry) return nil } -func (o *ChangeSettingsBody) validateSlackAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.SlackAlertingSettings) { // not required - return nil - } - - if o.SlackAlertingSettings != nil { - if err := o.SlackAlertingSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "slack_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "slack_alerting_settings") - } - return err - } - } - - return nil -} - func (o *ChangeSettingsBody) validateSttCheckIntervals(formats strfmt.Registry) error { if swag.IsZero(o.SttCheckIntervals) { // not required return nil @@ -326,18 +268,10 @@ func (o *ChangeSettingsBody) validateSttCheckIntervals(formats strfmt.Registry) func (o *ChangeSettingsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := o.contextValidateEmailAlertingSettings(ctx, formats); err != nil { - res = append(res, err) - } - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { res = append(res, err) } - if err := o.contextValidateSlackAlertingSettings(ctx, formats); err != nil { - res = append(res, err) - } - if err := o.contextValidateSttCheckIntervals(ctx, formats); err != nil { res = append(res, err) } @@ -348,21 +282,6 @@ func (o *ChangeSettingsBody) ContextValidate(ctx context.Context, formats strfmt return nil } -func (o *ChangeSettingsBody) contextValidateEmailAlertingSettings(ctx context.Context, formats strfmt.Registry) error { - if o.EmailAlertingSettings != nil { - if err := o.EmailAlertingSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "email_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "email_alerting_settings") - } - return err - } - } - - return nil -} - func (o *ChangeSettingsBody) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { if o.MetricsResolutions != nil { if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { @@ -378,21 +297,6 @@ func (o *ChangeSettingsBody) contextValidateMetricsResolutions(ctx context.Conte return nil } -func (o *ChangeSettingsBody) contextValidateSlackAlertingSettings(ctx context.Context, formats strfmt.Registry) error { - if o.SlackAlertingSettings != nil { - if err := o.SlackAlertingSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "slack_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "slack_alerting_settings") - } - return err - } - } - - return nil -} - func (o *ChangeSettingsBody) contextValidateSttCheckIntervals(ctx context.Context, formats strfmt.Registry) error { if o.SttCheckIntervals != nil { if err := o.SttCheckIntervals.ContextValidate(ctx, formats); err != nil { @@ -828,15 +732,9 @@ type ChangeSettingsOKBodySettings struct { // Default Access Control role ID for new users. DefaultRoleID int64 `json:"default_role_id,omitempty"` - // email alerting settings - EmailAlertingSettings *ChangeSettingsOKBodySettingsEmailAlertingSettings `json:"email_alerting_settings,omitempty"` - // metrics resolutions MetricsResolutions *ChangeSettingsOKBodySettingsMetricsResolutions `json:"metrics_resolutions,omitempty"` - // slack alerting settings - SlackAlertingSettings *ChangeSettingsOKBodySettingsSlackAlertingSettings `json:"slack_alerting_settings,omitempty"` - // stt check intervals SttCheckIntervals *ChangeSettingsOKBodySettingsSttCheckIntervals `json:"stt_check_intervals,omitempty"` } @@ -845,18 +743,10 @@ type ChangeSettingsOKBodySettings struct { func (o *ChangeSettingsOKBodySettings) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateEmailAlertingSettings(formats); err != nil { - res = append(res, err) - } - if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateSlackAlertingSettings(formats); err != nil { - res = append(res, err) - } - if err := o.validateSttCheckIntervals(formats); err != nil { res = append(res, err) } @@ -867,25 +757,6 @@ func (o *ChangeSettingsOKBodySettings) Validate(formats strfmt.Registry) error { return nil } -func (o *ChangeSettingsOKBodySettings) validateEmailAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.EmailAlertingSettings) { // not required - return nil - } - - if o.EmailAlertingSettings != nil { - if err := o.EmailAlertingSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "email_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "email_alerting_settings") - } - return err - } - } - - return nil -} - func (o *ChangeSettingsOKBodySettings) validateMetricsResolutions(formats strfmt.Registry) error { if swag.IsZero(o.MetricsResolutions) { // not required return nil @@ -905,25 +776,6 @@ func (o *ChangeSettingsOKBodySettings) validateMetricsResolutions(formats strfmt return nil } -func (o *ChangeSettingsOKBodySettings) validateSlackAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.SlackAlertingSettings) { // not required - return nil - } - - if o.SlackAlertingSettings != nil { - if err := o.SlackAlertingSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") - } - return err - } - } - - return nil -} - func (o *ChangeSettingsOKBodySettings) validateSttCheckIntervals(formats strfmt.Registry) error { if swag.IsZero(o.SttCheckIntervals) { // not required return nil @@ -947,18 +799,10 @@ func (o *ChangeSettingsOKBodySettings) validateSttCheckIntervals(formats strfmt. func (o *ChangeSettingsOKBodySettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := o.contextValidateEmailAlertingSettings(ctx, formats); err != nil { - res = append(res, err) - } - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { res = append(res, err) } - if err := o.contextValidateSlackAlertingSettings(ctx, formats); err != nil { - res = append(res, err) - } - if err := o.contextValidateSttCheckIntervals(ctx, formats); err != nil { res = append(res, err) } @@ -969,21 +813,6 @@ func (o *ChangeSettingsOKBodySettings) ContextValidate(ctx context.Context, form return nil } -func (o *ChangeSettingsOKBodySettings) contextValidateEmailAlertingSettings(ctx context.Context, formats strfmt.Registry) error { - if o.EmailAlertingSettings != nil { - if err := o.EmailAlertingSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "email_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "email_alerting_settings") - } - return err - } - } - - return nil -} - func (o *ChangeSettingsOKBodySettings) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { if o.MetricsResolutions != nil { if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { @@ -999,21 +828,6 @@ func (o *ChangeSettingsOKBodySettings) contextValidateMetricsResolutions(ctx con return nil } -func (o *ChangeSettingsOKBodySettings) contextValidateSlackAlertingSettings(ctx context.Context, formats strfmt.Registry) error { - if o.SlackAlertingSettings != nil { - if err := o.SlackAlertingSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") - } - return err - } - } - - return nil -} - func (o *ChangeSettingsOKBodySettings) contextValidateSttCheckIntervals(ctx context.Context, formats strfmt.Registry) error { if o.SttCheckIntervals != nil { if err := o.SttCheckIntervals.ContextValidate(ctx, formats); err != nil { @@ -1047,64 +861,6 @@ func (o *ChangeSettingsOKBodySettings) UnmarshalBinary(b []byte) error { return nil } -/* -ChangeSettingsOKBodySettingsEmailAlertingSettings EmailAlertingSettings represents email (SMTP) configuration for Alerting. -swagger:model ChangeSettingsOKBodySettingsEmailAlertingSettings -*/ -type ChangeSettingsOKBodySettingsEmailAlertingSettings struct { - // SMTP From header field. - From string `json:"from,omitempty"` - - // SMTP host and port. - Smarthost string `json:"smarthost,omitempty"` - - // Hostname to identify to the SMTP server. - Hello string `json:"hello,omitempty"` - - // Auth using CRAM-MD5, LOGIN and PLAIN. - Username string `json:"username,omitempty"` - - // Auth using LOGIN and PLAIN. - Password string `json:"password,omitempty"` - - // Auth using PLAIN. - Identity string `json:"identity,omitempty"` - - // Auth using CRAM-MD5. - Secret string `json:"secret,omitempty"` - - // Require TLS. - RequireTLS bool `json:"require_tls,omitempty"` -} - -// Validate validates this change settings OK body settings email alerting settings -func (o *ChangeSettingsOKBodySettingsEmailAlertingSettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings OK body settings email alerting settings based on context it is used -func (o *ChangeSettingsOKBodySettingsEmailAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettingsEmailAlertingSettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettingsEmailAlertingSettings) UnmarshalBinary(b []byte) error { - var res ChangeSettingsOKBodySettingsEmailAlertingSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /* ChangeSettingsOKBodySettingsMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. swagger:model ChangeSettingsOKBodySettingsMetricsResolutions @@ -1148,43 +904,6 @@ func (o *ChangeSettingsOKBodySettingsMetricsResolutions) UnmarshalBinary(b []byt return nil } -/* -ChangeSettingsOKBodySettingsSlackAlertingSettings SlackAlertingSettings represents Slack configuration for Alerting. -swagger:model ChangeSettingsOKBodySettingsSlackAlertingSettings -*/ -type ChangeSettingsOKBodySettingsSlackAlertingSettings struct { - // Slack API (webhook) URL. - URL string `json:"url,omitempty"` -} - -// Validate validates this change settings OK body settings slack alerting settings -func (o *ChangeSettingsOKBodySettingsSlackAlertingSettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings OK body settings slack alerting settings based on context it is used -func (o *ChangeSettingsOKBodySettingsSlackAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettingsSlackAlertingSettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsOKBodySettingsSlackAlertingSettings) UnmarshalBinary(b []byte) error { - var res ChangeSettingsOKBodySettingsSlackAlertingSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /* ChangeSettingsOKBodySettingsSttCheckIntervals STTCheckIntervals represents intervals between STT checks. swagger:model ChangeSettingsOKBodySettingsSttCheckIntervals @@ -1228,64 +947,6 @@ func (o *ChangeSettingsOKBodySettingsSttCheckIntervals) UnmarshalBinary(b []byte return nil } -/* -ChangeSettingsParamsBodyEmailAlertingSettings EmailAlertingSettings represents email (SMTP) configuration for Alerting. -swagger:model ChangeSettingsParamsBodyEmailAlertingSettings -*/ -type ChangeSettingsParamsBodyEmailAlertingSettings struct { - // SMTP From header field. - From string `json:"from,omitempty"` - - // SMTP host and port. - Smarthost string `json:"smarthost,omitempty"` - - // Hostname to identify to the SMTP server. - Hello string `json:"hello,omitempty"` - - // Auth using CRAM-MD5, LOGIN and PLAIN. - Username string `json:"username,omitempty"` - - // Auth using LOGIN and PLAIN. - Password string `json:"password,omitempty"` - - // Auth using PLAIN. - Identity string `json:"identity,omitempty"` - - // Auth using CRAM-MD5. - Secret string `json:"secret,omitempty"` - - // Require TLS. - RequireTLS bool `json:"require_tls,omitempty"` -} - -// Validate validates this change settings params body email alerting settings -func (o *ChangeSettingsParamsBodyEmailAlertingSettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings params body email alerting settings based on context it is used -func (o *ChangeSettingsParamsBodyEmailAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsParamsBodyEmailAlertingSettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsParamsBodyEmailAlertingSettings) UnmarshalBinary(b []byte) error { - var res ChangeSettingsParamsBodyEmailAlertingSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /* ChangeSettingsParamsBodyMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. swagger:model ChangeSettingsParamsBodyMetricsResolutions @@ -1329,43 +990,6 @@ func (o *ChangeSettingsParamsBodyMetricsResolutions) UnmarshalBinary(b []byte) e return nil } -/* -ChangeSettingsParamsBodySlackAlertingSettings SlackAlertingSettings represents Slack configuration for Alerting. -swagger:model ChangeSettingsParamsBodySlackAlertingSettings -*/ -type ChangeSettingsParamsBodySlackAlertingSettings struct { - // Slack API (webhook) URL. - URL string `json:"url,omitempty"` -} - -// Validate validates this change settings params body slack alerting settings -func (o *ChangeSettingsParamsBodySlackAlertingSettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this change settings params body slack alerting settings based on context it is used -func (o *ChangeSettingsParamsBodySlackAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ChangeSettingsParamsBodySlackAlertingSettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangeSettingsParamsBodySlackAlertingSettings) UnmarshalBinary(b []byte) error { - var res ChangeSettingsParamsBodySlackAlertingSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /* ChangeSettingsParamsBodySttCheckIntervals STTCheckIntervals represents intervals between STT checks. swagger:model ChangeSettingsParamsBodySttCheckIntervals diff --git a/api/serverpb/json/client/server/get_settings_responses.go b/api/serverpb/json/client/server/get_settings_responses.go index 706128020b..d13229e29f 100644 --- a/api/serverpb/json/client/server/get_settings_responses.go +++ b/api/serverpb/json/client/server/get_settings_responses.go @@ -520,15 +520,9 @@ type GetSettingsOKBodySettings struct { // Default Access Control role ID for new users. DefaultRoleID int64 `json:"default_role_id,omitempty"` - // email alerting settings - EmailAlertingSettings *GetSettingsOKBodySettingsEmailAlertingSettings `json:"email_alerting_settings,omitempty"` - // metrics resolutions MetricsResolutions *GetSettingsOKBodySettingsMetricsResolutions `json:"metrics_resolutions,omitempty"` - // slack alerting settings - SlackAlertingSettings *GetSettingsOKBodySettingsSlackAlertingSettings `json:"slack_alerting_settings,omitempty"` - // stt check intervals SttCheckIntervals *GetSettingsOKBodySettingsSttCheckIntervals `json:"stt_check_intervals,omitempty"` } @@ -537,18 +531,10 @@ type GetSettingsOKBodySettings struct { func (o *GetSettingsOKBodySettings) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateEmailAlertingSettings(formats); err != nil { - res = append(res, err) - } - if err := o.validateMetricsResolutions(formats); err != nil { res = append(res, err) } - if err := o.validateSlackAlertingSettings(formats); err != nil { - res = append(res, err) - } - if err := o.validateSttCheckIntervals(formats); err != nil { res = append(res, err) } @@ -559,25 +545,6 @@ func (o *GetSettingsOKBodySettings) Validate(formats strfmt.Registry) error { return nil } -func (o *GetSettingsOKBodySettings) validateEmailAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.EmailAlertingSettings) { // not required - return nil - } - - if o.EmailAlertingSettings != nil { - if err := o.EmailAlertingSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "email_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "email_alerting_settings") - } - return err - } - } - - return nil -} - func (o *GetSettingsOKBodySettings) validateMetricsResolutions(formats strfmt.Registry) error { if swag.IsZero(o.MetricsResolutions) { // not required return nil @@ -597,25 +564,6 @@ func (o *GetSettingsOKBodySettings) validateMetricsResolutions(formats strfmt.Re return nil } -func (o *GetSettingsOKBodySettings) validateSlackAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.SlackAlertingSettings) { // not required - return nil - } - - if o.SlackAlertingSettings != nil { - if err := o.SlackAlertingSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") - } - return err - } - } - - return nil -} - func (o *GetSettingsOKBodySettings) validateSttCheckIntervals(formats strfmt.Registry) error { if swag.IsZero(o.SttCheckIntervals) { // not required return nil @@ -639,18 +587,10 @@ func (o *GetSettingsOKBodySettings) validateSttCheckIntervals(formats strfmt.Reg func (o *GetSettingsOKBodySettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := o.contextValidateEmailAlertingSettings(ctx, formats); err != nil { - res = append(res, err) - } - if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { res = append(res, err) } - if err := o.contextValidateSlackAlertingSettings(ctx, formats); err != nil { - res = append(res, err) - } - if err := o.contextValidateSttCheckIntervals(ctx, formats); err != nil { res = append(res, err) } @@ -661,21 +601,6 @@ func (o *GetSettingsOKBodySettings) ContextValidate(ctx context.Context, formats return nil } -func (o *GetSettingsOKBodySettings) contextValidateEmailAlertingSettings(ctx context.Context, formats strfmt.Registry) error { - if o.EmailAlertingSettings != nil { - if err := o.EmailAlertingSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "email_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "email_alerting_settings") - } - return err - } - } - - return nil -} - func (o *GetSettingsOKBodySettings) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { if o.MetricsResolutions != nil { if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { @@ -691,21 +616,6 @@ func (o *GetSettingsOKBodySettings) contextValidateMetricsResolutions(ctx contex return nil } -func (o *GetSettingsOKBodySettings) contextValidateSlackAlertingSettings(ctx context.Context, formats strfmt.Registry) error { - if o.SlackAlertingSettings != nil { - if err := o.SlackAlertingSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") - } - return err - } - } - - return nil -} - func (o *GetSettingsOKBodySettings) contextValidateSttCheckIntervals(ctx context.Context, formats strfmt.Registry) error { if o.SttCheckIntervals != nil { if err := o.SttCheckIntervals.ContextValidate(ctx, formats); err != nil { @@ -739,64 +649,6 @@ func (o *GetSettingsOKBodySettings) UnmarshalBinary(b []byte) error { return nil } -/* -GetSettingsOKBodySettingsEmailAlertingSettings EmailAlertingSettings represents email (SMTP) configuration for Alerting. -swagger:model GetSettingsOKBodySettingsEmailAlertingSettings -*/ -type GetSettingsOKBodySettingsEmailAlertingSettings struct { - // SMTP From header field. - From string `json:"from,omitempty"` - - // SMTP host and port. - Smarthost string `json:"smarthost,omitempty"` - - // Hostname to identify to the SMTP server. - Hello string `json:"hello,omitempty"` - - // Auth using CRAM-MD5, LOGIN and PLAIN. - Username string `json:"username,omitempty"` - - // Auth using LOGIN and PLAIN. - Password string `json:"password,omitempty"` - - // Auth using PLAIN. - Identity string `json:"identity,omitempty"` - - // Auth using CRAM-MD5. - Secret string `json:"secret,omitempty"` - - // Require TLS. - RequireTLS bool `json:"require_tls,omitempty"` -} - -// Validate validates this get settings OK body settings email alerting settings -func (o *GetSettingsOKBodySettingsEmailAlertingSettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get settings OK body settings email alerting settings based on context it is used -func (o *GetSettingsOKBodySettingsEmailAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetSettingsOKBodySettingsEmailAlertingSettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetSettingsOKBodySettingsEmailAlertingSettings) UnmarshalBinary(b []byte) error { - var res GetSettingsOKBodySettingsEmailAlertingSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /* GetSettingsOKBodySettingsMetricsResolutions MetricsResolutions represents Prometheus exporters metrics resolutions. swagger:model GetSettingsOKBodySettingsMetricsResolutions @@ -840,43 +692,6 @@ func (o *GetSettingsOKBodySettingsMetricsResolutions) UnmarshalBinary(b []byte) return nil } -/* -GetSettingsOKBodySettingsSlackAlertingSettings SlackAlertingSettings represents Slack configuration for Alerting. -swagger:model GetSettingsOKBodySettingsSlackAlertingSettings -*/ -type GetSettingsOKBodySettingsSlackAlertingSettings struct { - // Slack API (webhook) URL. - URL string `json:"url,omitempty"` -} - -// Validate validates this get settings OK body settings slack alerting settings -func (o *GetSettingsOKBodySettingsSlackAlertingSettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get settings OK body settings slack alerting settings based on context it is used -func (o *GetSettingsOKBodySettingsSlackAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetSettingsOKBodySettingsSlackAlertingSettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetSettingsOKBodySettingsSlackAlertingSettings) UnmarshalBinary(b []byte) error { - var res GetSettingsOKBodySettingsSlackAlertingSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /* GetSettingsOKBodySettingsSttCheckIntervals STTCheckIntervals represents intervals between STT checks. swagger:model GetSettingsOKBodySettingsSttCheckIntervals diff --git a/api/serverpb/json/client/server/server_client.go b/api/serverpb/json/client/server/server_client.go index fffdea9044..4ea4103a70 100644 --- a/api/serverpb/json/client/server/server_client.go +++ b/api/serverpb/json/client/server/server_client.go @@ -44,8 +44,6 @@ type ClientService interface { StartUpdate(params *StartUpdateParams, opts ...ClientOption) (*StartUpdateOK, error) - TestEmailAlertingSettings(params *TestEmailAlertingSettingsParams, opts ...ClientOption) (*TestEmailAlertingSettingsOK, error) - UpdateStatus(params *UpdateStatusParams, opts ...ClientOption) (*UpdateStatusOK, error) Version(params *VersionParams, opts ...ClientOption) (*VersionOK, error) @@ -326,45 +324,6 @@ func (a *Client) StartUpdate(params *StartUpdateParams, opts ...ClientOption) (* return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } -/* -TestEmailAlertingSettings tests email alerting - -Sends test email to check current SMTP settings for email alerting. -*/ -func (a *Client) TestEmailAlertingSettings(params *TestEmailAlertingSettingsParams, opts ...ClientOption) (*TestEmailAlertingSettingsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewTestEmailAlertingSettingsParams() - } - op := &runtime.ClientOperation{ - ID: "TestEmailAlertingSettings", - Method: "POST", - PathPattern: "/v1/Settings/TestEmailAlertingSettings", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &TestEmailAlertingSettingsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*TestEmailAlertingSettingsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*TestEmailAlertingSettingsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - /* UpdateStatus updates status diff --git a/api/serverpb/json/client/server/test_email_alerting_settings_parameters.go b/api/serverpb/json/client/server/test_email_alerting_settings_parameters.go deleted file mode 100644 index df14058507..0000000000 --- a/api/serverpb/json/client/server/test_email_alerting_settings_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server - -// 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" -) - -// NewTestEmailAlertingSettingsParams creates a new TestEmailAlertingSettingsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewTestEmailAlertingSettingsParams() *TestEmailAlertingSettingsParams { - return &TestEmailAlertingSettingsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewTestEmailAlertingSettingsParamsWithTimeout creates a new TestEmailAlertingSettingsParams object -// with the ability to set a timeout on a request. -func NewTestEmailAlertingSettingsParamsWithTimeout(timeout time.Duration) *TestEmailAlertingSettingsParams { - return &TestEmailAlertingSettingsParams{ - timeout: timeout, - } -} - -// NewTestEmailAlertingSettingsParamsWithContext creates a new TestEmailAlertingSettingsParams object -// with the ability to set a context for a request. -func NewTestEmailAlertingSettingsParamsWithContext(ctx context.Context) *TestEmailAlertingSettingsParams { - return &TestEmailAlertingSettingsParams{ - Context: ctx, - } -} - -// NewTestEmailAlertingSettingsParamsWithHTTPClient creates a new TestEmailAlertingSettingsParams object -// with the ability to set a custom HTTPClient for a request. -func NewTestEmailAlertingSettingsParamsWithHTTPClient(client *http.Client) *TestEmailAlertingSettingsParams { - return &TestEmailAlertingSettingsParams{ - HTTPClient: client, - } -} - -/* -TestEmailAlertingSettingsParams contains all the parameters to send to the API endpoint - - for the test email alerting settings operation. - - Typically these are written to a http.Request. -*/ -type TestEmailAlertingSettingsParams struct { - // Body. - Body TestEmailAlertingSettingsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the test email alerting settings params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *TestEmailAlertingSettingsParams) WithDefaults() *TestEmailAlertingSettingsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the test email alerting settings params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *TestEmailAlertingSettingsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the test email alerting settings params -func (o *TestEmailAlertingSettingsParams) WithTimeout(timeout time.Duration) *TestEmailAlertingSettingsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the test email alerting settings params -func (o *TestEmailAlertingSettingsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the test email alerting settings params -func (o *TestEmailAlertingSettingsParams) WithContext(ctx context.Context) *TestEmailAlertingSettingsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the test email alerting settings params -func (o *TestEmailAlertingSettingsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the test email alerting settings params -func (o *TestEmailAlertingSettingsParams) WithHTTPClient(client *http.Client) *TestEmailAlertingSettingsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the test email alerting settings params -func (o *TestEmailAlertingSettingsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the test email alerting settings params -func (o *TestEmailAlertingSettingsParams) WithBody(body TestEmailAlertingSettingsBody) *TestEmailAlertingSettingsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the test email alerting settings params -func (o *TestEmailAlertingSettingsParams) SetBody(body TestEmailAlertingSettingsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *TestEmailAlertingSettingsParams) 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/api/serverpb/json/client/server/test_email_alerting_settings_responses.go b/api/serverpb/json/client/server/test_email_alerting_settings_responses.go deleted file mode 100644 index d244764a80..0000000000 --- a/api/serverpb/json/client/server/test_email_alerting_settings_responses.go +++ /dev/null @@ -1,518 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package server - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TestEmailAlertingSettingsReader is a Reader for the TestEmailAlertingSettings structure. -type TestEmailAlertingSettingsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *TestEmailAlertingSettingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewTestEmailAlertingSettingsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewTestEmailAlertingSettingsDefault(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 - } -} - -// NewTestEmailAlertingSettingsOK creates a TestEmailAlertingSettingsOK with default headers values -func NewTestEmailAlertingSettingsOK() *TestEmailAlertingSettingsOK { - return &TestEmailAlertingSettingsOK{} -} - -/* -TestEmailAlertingSettingsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type TestEmailAlertingSettingsOK struct { - Payload interface{} -} - -func (o *TestEmailAlertingSettingsOK) Error() string { - return fmt.Sprintf("[POST /v1/Settings/TestEmailAlertingSettings][%d] testEmailAlertingSettingsOk %+v", 200, o.Payload) -} - -func (o *TestEmailAlertingSettingsOK) GetPayload() interface{} { - return o.Payload -} - -func (o *TestEmailAlertingSettingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewTestEmailAlertingSettingsDefault creates a TestEmailAlertingSettingsDefault with default headers values -func NewTestEmailAlertingSettingsDefault(code int) *TestEmailAlertingSettingsDefault { - return &TestEmailAlertingSettingsDefault{ - _statusCode: code, - } -} - -/* -TestEmailAlertingSettingsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type TestEmailAlertingSettingsDefault struct { - _statusCode int - - Payload *TestEmailAlertingSettingsDefaultBody -} - -// Code gets the status code for the test email alerting settings default response -func (o *TestEmailAlertingSettingsDefault) Code() int { - return o._statusCode -} - -func (o *TestEmailAlertingSettingsDefault) Error() string { - return fmt.Sprintf("[POST /v1/Settings/TestEmailAlertingSettings][%d] TestEmailAlertingSettings default %+v", o._statusCode, o.Payload) -} - -func (o *TestEmailAlertingSettingsDefault) GetPayload() *TestEmailAlertingSettingsDefaultBody { - return o.Payload -} - -func (o *TestEmailAlertingSettingsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(TestEmailAlertingSettingsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -TestEmailAlertingSettingsBody test email alerting settings body -swagger:model TestEmailAlertingSettingsBody -*/ -type TestEmailAlertingSettingsBody struct { - // Target email address to send the email to. - EmailTo string `json:"email_to,omitempty"` - - // email alerting settings - EmailAlertingSettings *TestEmailAlertingSettingsParamsBodyEmailAlertingSettings `json:"email_alerting_settings,omitempty"` -} - -// Validate validates this test email alerting settings body -func (o *TestEmailAlertingSettingsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateEmailAlertingSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *TestEmailAlertingSettingsBody) validateEmailAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.EmailAlertingSettings) { // not required - return nil - } - - if o.EmailAlertingSettings != nil { - if err := o.EmailAlertingSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "email_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "email_alerting_settings") - } - return err - } - } - - return nil -} - -// ContextValidate validate this test email alerting settings body based on the context it is used -func (o *TestEmailAlertingSettingsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateEmailAlertingSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *TestEmailAlertingSettingsBody) contextValidateEmailAlertingSettings(ctx context.Context, formats strfmt.Registry) error { - if o.EmailAlertingSettings != nil { - if err := o.EmailAlertingSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "email_alerting_settings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "email_alerting_settings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *TestEmailAlertingSettingsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestEmailAlertingSettingsBody) UnmarshalBinary(b []byte) error { - var res TestEmailAlertingSettingsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -TestEmailAlertingSettingsDefaultBody test email alerting settings default body -swagger:model TestEmailAlertingSettingsDefaultBody -*/ -type TestEmailAlertingSettingsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*TestEmailAlertingSettingsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this test email alerting settings default body -func (o *TestEmailAlertingSettingsDefaultBody) 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 *TestEmailAlertingSettingsDefaultBody) 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("TestEmailAlertingSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("TestEmailAlertingSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this test email alerting settings default body based on the context it is used -func (o *TestEmailAlertingSettingsDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *TestEmailAlertingSettingsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Details); i++ { - if o.Details[i] != nil { - if err := o.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("TestEmailAlertingSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("TestEmailAlertingSettings default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *TestEmailAlertingSettingsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestEmailAlertingSettingsDefaultBody) UnmarshalBinary(b []byte) error { - var res TestEmailAlertingSettingsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -TestEmailAlertingSettingsDefaultBodyDetailsItems0 `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -swagger:model TestEmailAlertingSettingsDefaultBodyDetailsItems0 -*/ -type TestEmailAlertingSettingsDefaultBodyDetailsItems0 struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - AtType string `json:"@type,omitempty"` -} - -// Validate validates this test email alerting settings default body details items0 -func (o *TestEmailAlertingSettingsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this test email alerting settings default body details items0 based on context it is used -func (o *TestEmailAlertingSettingsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *TestEmailAlertingSettingsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestEmailAlertingSettingsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res TestEmailAlertingSettingsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -TestEmailAlertingSettingsParamsBodyEmailAlertingSettings EmailAlertingSettings represents email (SMTP) configuration for Alerting. -swagger:model TestEmailAlertingSettingsParamsBodyEmailAlertingSettings -*/ -type TestEmailAlertingSettingsParamsBodyEmailAlertingSettings struct { - // SMTP From header field. - From string `json:"from,omitempty"` - - // SMTP host and port. - Smarthost string `json:"smarthost,omitempty"` - - // Hostname to identify to the SMTP server. - Hello string `json:"hello,omitempty"` - - // Auth using CRAM-MD5, LOGIN and PLAIN. - Username string `json:"username,omitempty"` - - // Auth using LOGIN and PLAIN. - Password string `json:"password,omitempty"` - - // Auth using PLAIN. - Identity string `json:"identity,omitempty"` - - // Auth using CRAM-MD5. - Secret string `json:"secret,omitempty"` - - // Require TLS. - RequireTLS bool `json:"require_tls,omitempty"` -} - -// Validate validates this test email alerting settings params body email alerting settings -func (o *TestEmailAlertingSettingsParamsBodyEmailAlertingSettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this test email alerting settings params body email alerting settings based on context it is used -func (o *TestEmailAlertingSettingsParamsBodyEmailAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *TestEmailAlertingSettingsParamsBodyEmailAlertingSettings) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TestEmailAlertingSettingsParamsBodyEmailAlertingSettings) UnmarshalBinary(b []byte) error { - var res TestEmailAlertingSettingsParamsBodyEmailAlertingSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/serverpb/json/serverpb.json b/api/serverpb/json/serverpb.json index 4501cde473..9f5ff7b4d2 100644 --- a/api/serverpb/json/serverpb.json +++ b/api/serverpb/json/serverpb.json @@ -172,7 +172,7 @@ "disable_access_control": { "type": "boolean", "title": "Disable Access Control", - "x-order": 30 + "x-order": 26 }, "disable_alerting": { "description": "Disable Alerting.", @@ -182,17 +182,17 @@ "disable_azurediscover": { "description": "Disable Azure Discover.", "type": "boolean", - "x-order": 24 + "x-order": 20 }, "disable_backup_management": { "description": "Disable Backup Management.", "type": "boolean", - "x-order": 26 + "x-order": 22 }, "disable_dbaas": { "description": "Disable DBaaS.", "type": "boolean", - "x-order": 28 + "x-order": 24 }, "disable_stt": { "description": "Disable Security Threat Tool.", @@ -207,57 +207,10 @@ "type": "boolean", "x-order": 1 }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 16 - }, "enable_access_control": { "type": "boolean", "title": "Enable Access Control", - "x-order": 29 + "x-order": 25 }, "enable_alerting": { "description": "Enable Alerting.", @@ -267,17 +220,17 @@ "enable_azurediscover": { "description": "Enable Azure Discover.", "type": "boolean", - "x-order": 23 + "x-order": 19 }, "enable_backup_management": { "description": "Enable Backup Management.", "type": "boolean", - "x-order": 25 + "x-order": 21 }, "enable_dbaas": { "description": "Enable DBaaS.", "type": "boolean", - "x-order": 27 + "x-order": 23 }, "enable_stt": { "description": "Enable Security Threat Tool.", @@ -317,7 +270,7 @@ "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 20 + "x-order": 16 }, "remove_alert_manager_rules": { "description": "Remove custom alerting or recording rules.", @@ -329,31 +282,9 @@ "type": "boolean", "x-order": 9 }, - "remove_email_alerting_settings": { - "description": "If true, removes Alerting email (SMTP) settings.", - "type": "boolean", - "x-order": 17 - }, "remove_pmm_public_address": { "type": "boolean", - "x-order": 21 - }, - "remove_slack_alerting_settings": { - "description": "If true, removes Alerting Slack settings.", - "type": "boolean", - "x-order": 19 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 18 + "x-order": 17 }, "ssh_key": { "type": "string", @@ -379,7 +310,7 @@ "x-order": 0 } }, - "x-order": 22 + "x-order": 18 } } } @@ -420,17 +351,17 @@ "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 15 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 14 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 16 }, "data_retention": { "type": "string", @@ -445,59 +376,12 @@ "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 - }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 12 + "x-order": 19 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 18 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -529,19 +413,7 @@ "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 + "x-order": 12 }, "ssh_key": { "type": "string", @@ -567,7 +439,7 @@ "x-order": 0 } }, - "x-order": 15 + "x-order": 13 }, "stt_enabled": { "description": "True if Security Threat Tool is enabled.", @@ -585,7 +457,7 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 17 }, "updates_disabled": { "description": "True if updates are disabled.", @@ -687,17 +559,17 @@ "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 15 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 14 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 16 }, "data_retention": { "type": "string", @@ -712,59 +584,12 @@ "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 - }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 12 + "x-order": 19 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 18 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -796,19 +621,7 @@ "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 + "x-order": 12 }, "ssh_key": { "type": "string", @@ -834,7 +647,7 @@ "x-order": 0 } }, - "x-order": 15 + "x-order": 13 }, "stt_enabled": { "description": "True if Security Threat Tool is enabled.", @@ -852,7 +665,7 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 17 }, "updates_disabled": { "description": "True if updates are disabled.", @@ -901,121 +714,6 @@ } } }, - "/v1/Settings/TestEmailAlertingSettings": { - "post": { - "description": "Sends test email to check current SMTP settings for email alerting.", - "tags": [ - "Server" - ], - "summary": "Test email alerting", - "operationId": "TestEmailAlertingSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 0 - }, - "email_to": { - "description": "Target email address to send the email to.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }", - "type": "object", - "properties": { - "@type": { - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, "/v1/Updates/Check": { "post": { "description": "Checks for available PMM Server updates.", diff --git a/api/serverpb/server.pb.go b/api/serverpb/server.pb.go index f29abe64a9..0a7e5aab26 100644 --- a/api/serverpb/server.pb.go +++ b/api/serverpb/server.pb.go @@ -777,167 +777,6 @@ func (x *MetricsResolutions) GetLr() *durationpb.Duration { return nil } -// EmailAlertingSettings represents email (SMTP) configuration for Alerting. -type EmailAlertingSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // SMTP From header field. - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // SMTP host and port. - Smarthost string `protobuf:"bytes,2,opt,name=smarthost,proto3" json:"smarthost,omitempty"` - // Hostname to identify to the SMTP server. - Hello string `protobuf:"bytes,3,opt,name=hello,proto3" json:"hello,omitempty"` - // Auth using CRAM-MD5, LOGIN and PLAIN. - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - // Auth using LOGIN and PLAIN. - Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` - // Auth using PLAIN. - Identity string `protobuf:"bytes,6,opt,name=identity,proto3" json:"identity,omitempty"` - // Auth using CRAM-MD5. - Secret string `protobuf:"bytes,7,opt,name=secret,proto3" json:"secret,omitempty"` - // Require TLS. - RequireTls bool `protobuf:"varint,8,opt,name=require_tls,json=requireTls,proto3" json:"require_tls,omitempty"` -} - -func (x *EmailAlertingSettings) Reset() { - *x = EmailAlertingSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EmailAlertingSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EmailAlertingSettings) ProtoMessage() {} - -func (x *EmailAlertingSettings) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EmailAlertingSettings.ProtoReflect.Descriptor instead. -func (*EmailAlertingSettings) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{12} -} - -func (x *EmailAlertingSettings) GetFrom() string { - if x != nil { - return x.From - } - return "" -} - -func (x *EmailAlertingSettings) GetSmarthost() string { - if x != nil { - return x.Smarthost - } - return "" -} - -func (x *EmailAlertingSettings) GetHello() string { - if x != nil { - return x.Hello - } - return "" -} - -func (x *EmailAlertingSettings) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *EmailAlertingSettings) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *EmailAlertingSettings) GetIdentity() string { - if x != nil { - return x.Identity - } - return "" -} - -func (x *EmailAlertingSettings) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - -func (x *EmailAlertingSettings) GetRequireTls() bool { - if x != nil { - return x.RequireTls - } - return false -} - -// SlackAlertingSettings represents Slack configuration for Alerting. -type SlackAlertingSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Slack API (webhook) URL. - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` -} - -func (x *SlackAlertingSettings) Reset() { - *x = SlackAlertingSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SlackAlertingSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SlackAlertingSettings) ProtoMessage() {} - -func (x *SlackAlertingSettings) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SlackAlertingSettings.ProtoReflect.Descriptor instead. -func (*SlackAlertingSettings) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{13} -} - -func (x *SlackAlertingSettings) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - // STTCheckIntervals represents intervals between STT checks. type STTCheckIntervals struct { state protoimpl.MessageState @@ -955,7 +794,7 @@ type STTCheckIntervals struct { func (x *STTCheckIntervals) Reset() { *x = STTCheckIntervals{} if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[14] + mi := &file_serverpb_server_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -968,7 +807,7 @@ func (x *STTCheckIntervals) String() string { func (*STTCheckIntervals) ProtoMessage() {} func (x *STTCheckIntervals) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[14] + mi := &file_serverpb_server_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -981,7 +820,7 @@ func (x *STTCheckIntervals) ProtoReflect() protoreflect.Message { // Deprecated: Use STTCheckIntervals.ProtoReflect.Descriptor instead. func (*STTCheckIntervals) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{14} + return file_serverpb_server_proto_rawDescGZIP(), []int{12} } func (x *STTCheckIntervals) GetStandardInterval() *durationpb.Duration { @@ -1031,10 +870,6 @@ type Settings struct { DbaasEnabled bool `protobuf:"varint,11,opt,name=dbaas_enabled,json=dbaasEnabled,proto3" json:"dbaas_enabled,omitempty"` // True if Alerting is enabled. AlertingEnabled bool `protobuf:"varint,12,opt,name=alerting_enabled,json=alertingEnabled,proto3" json:"alerting_enabled,omitempty"` - // Alerting email (SMTP) settings. - EmailAlertingSettings *EmailAlertingSettings `protobuf:"bytes,13,opt,name=email_alerting_settings,json=emailAlertingSettings,proto3" json:"email_alerting_settings,omitempty"` - // Alerting Slack settings. - SlackAlertingSettings *SlackAlertingSettings `protobuf:"bytes,14,opt,name=slack_alerting_settings,json=slackAlertingSettings,proto3" json:"slack_alerting_settings,omitempty"` // PMM Server public address. PmmPublicAddress string `protobuf:"bytes,15,opt,name=pmm_public_address,json=pmmPublicAddress,proto3" json:"pmm_public_address,omitempty"` // Intervals between STT check runs. @@ -1056,7 +891,7 @@ type Settings struct { func (x *Settings) Reset() { *x = Settings{} if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[15] + mi := &file_serverpb_server_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1069,7 +904,7 @@ func (x *Settings) String() string { func (*Settings) ProtoMessage() {} func (x *Settings) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[15] + mi := &file_serverpb_server_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1082,7 +917,7 @@ func (x *Settings) ProtoReflect() protoreflect.Message { // Deprecated: Use Settings.ProtoReflect.Descriptor instead. func (*Settings) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{15} + return file_serverpb_server_proto_rawDescGZIP(), []int{13} } func (x *Settings) GetUpdatesDisabled() bool { @@ -1169,20 +1004,6 @@ func (x *Settings) GetAlertingEnabled() bool { return false } -func (x *Settings) GetEmailAlertingSettings() *EmailAlertingSettings { - if x != nil { - return x.EmailAlertingSettings - } - return nil -} - -func (x *Settings) GetSlackAlertingSettings() *SlackAlertingSettings { - if x != nil { - return x.SlackAlertingSettings - } - return nil -} - func (x *Settings) GetPmmPublicAddress() string { if x != nil { return x.PmmPublicAddress @@ -1248,7 +1069,7 @@ type GetSettingsRequest struct { func (x *GetSettingsRequest) Reset() { *x = GetSettingsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[16] + mi := &file_serverpb_server_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1261,7 +1082,7 @@ func (x *GetSettingsRequest) String() string { func (*GetSettingsRequest) ProtoMessage() {} func (x *GetSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[16] + mi := &file_serverpb_server_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1274,7 +1095,7 @@ func (x *GetSettingsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSettingsRequest.ProtoReflect.Descriptor instead. func (*GetSettingsRequest) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{16} + return file_serverpb_server_proto_rawDescGZIP(), []int{14} } type GetSettingsResponse struct { @@ -1288,7 +1109,7 @@ type GetSettingsResponse struct { func (x *GetSettingsResponse) Reset() { *x = GetSettingsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[17] + mi := &file_serverpb_server_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1301,7 +1122,7 @@ func (x *GetSettingsResponse) String() string { func (*GetSettingsResponse) ProtoMessage() {} func (x *GetSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[17] + mi := &file_serverpb_server_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1314,7 +1135,7 @@ func (x *GetSettingsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSettingsResponse.ProtoReflect.Descriptor instead. func (*GetSettingsResponse) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{17} + return file_serverpb_server_proto_rawDescGZIP(), []int{15} } func (x *GetSettingsResponse) GetSettings() *Settings { @@ -1354,14 +1175,6 @@ type ChangeSettingsRequest struct { EnableAlerting bool `protobuf:"varint,13,opt,name=enable_alerting,json=enableAlerting,proto3" json:"enable_alerting,omitempty"` // Disable Alerting. DisableAlerting bool `protobuf:"varint,14,opt,name=disable_alerting,json=disableAlerting,proto3" json:"disable_alerting,omitempty"` - // Change Alerting email (SMTP) settings, if set. - EmailAlertingSettings *EmailAlertingSettings `protobuf:"bytes,15,opt,name=email_alerting_settings,json=emailAlertingSettings,proto3" json:"email_alerting_settings,omitempty"` - // If true, removes Alerting email (SMTP) settings. - RemoveEmailAlertingSettings bool `protobuf:"varint,16,opt,name=remove_email_alerting_settings,json=removeEmailAlertingSettings,proto3" json:"remove_email_alerting_settings,omitempty"` - // Change Alerting Slack settings, if set. - SlackAlertingSettings *SlackAlertingSettings `protobuf:"bytes,17,opt,name=slack_alerting_settings,json=slackAlertingSettings,proto3" json:"slack_alerting_settings,omitempty"` - // If true, removes Alerting Slack settings. - RemoveSlackAlertingSettings bool `protobuf:"varint,18,opt,name=remove_slack_alerting_settings,json=removeSlackAlertingSettings,proto3" json:"remove_slack_alerting_settings,omitempty"` // PMM Server public address. PmmPublicAddress string `protobuf:"bytes,19,opt,name=pmm_public_address,json=pmmPublicAddress,proto3" json:"pmm_public_address,omitempty"` RemovePmmPublicAddress bool `protobuf:"varint,20,opt,name=remove_pmm_public_address,json=removePmmPublicAddress,proto3" json:"remove_pmm_public_address,omitempty"` @@ -1388,7 +1201,7 @@ type ChangeSettingsRequest struct { func (x *ChangeSettingsRequest) Reset() { *x = ChangeSettingsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[18] + mi := &file_serverpb_server_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1401,7 +1214,7 @@ func (x *ChangeSettingsRequest) String() string { func (*ChangeSettingsRequest) ProtoMessage() {} func (x *ChangeSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[18] + mi := &file_serverpb_server_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1414,7 +1227,7 @@ func (x *ChangeSettingsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeSettingsRequest.ProtoReflect.Descriptor instead. func (*ChangeSettingsRequest) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{18} + return file_serverpb_server_proto_rawDescGZIP(), []int{16} } func (x *ChangeSettingsRequest) GetEnableUpdates() bool { @@ -1529,34 +1342,6 @@ func (x *ChangeSettingsRequest) GetDisableAlerting() bool { return false } -func (x *ChangeSettingsRequest) GetEmailAlertingSettings() *EmailAlertingSettings { - if x != nil { - return x.EmailAlertingSettings - } - return nil -} - -func (x *ChangeSettingsRequest) GetRemoveEmailAlertingSettings() bool { - if x != nil { - return x.RemoveEmailAlertingSettings - } - return false -} - -func (x *ChangeSettingsRequest) GetSlackAlertingSettings() *SlackAlertingSettings { - if x != nil { - return x.SlackAlertingSettings - } - return nil -} - -func (x *ChangeSettingsRequest) GetRemoveSlackAlertingSettings() bool { - if x != nil { - return x.RemoveSlackAlertingSettings - } - return false -} - func (x *ChangeSettingsRequest) GetPmmPublicAddress() string { if x != nil { return x.PmmPublicAddress @@ -1645,7 +1430,7 @@ type ChangeSettingsResponse struct { func (x *ChangeSettingsResponse) Reset() { *x = ChangeSettingsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[19] + mi := &file_serverpb_server_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1658,7 +1443,7 @@ func (x *ChangeSettingsResponse) String() string { func (*ChangeSettingsResponse) ProtoMessage() {} func (x *ChangeSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[19] + mi := &file_serverpb_server_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1671,7 +1456,7 @@ func (x *ChangeSettingsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeSettingsResponse.ProtoReflect.Descriptor instead. func (*ChangeSettingsResponse) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{19} + return file_serverpb_server_proto_rawDescGZIP(), []int{17} } func (x *ChangeSettingsResponse) GetSettings() *Settings { @@ -1681,101 +1466,6 @@ func (x *ChangeSettingsResponse) GetSettings() *Settings { return nil } -type TestEmailAlertingSettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Alerting email (SMTP) settings. - EmailAlertingSettings *EmailAlertingSettings `protobuf:"bytes,1,opt,name=email_alerting_settings,json=emailAlertingSettings,proto3" json:"email_alerting_settings,omitempty"` - // Target email address to send the email to. - EmailTo string `protobuf:"bytes,2,opt,name=email_to,json=emailTo,proto3" json:"email_to,omitempty"` -} - -func (x *TestEmailAlertingSettingsRequest) Reset() { - *x = TestEmailAlertingSettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TestEmailAlertingSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestEmailAlertingSettingsRequest) ProtoMessage() {} - -func (x *TestEmailAlertingSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TestEmailAlertingSettingsRequest.ProtoReflect.Descriptor instead. -func (*TestEmailAlertingSettingsRequest) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{20} -} - -func (x *TestEmailAlertingSettingsRequest) GetEmailAlertingSettings() *EmailAlertingSettings { - if x != nil { - return x.EmailAlertingSettings - } - return nil -} - -func (x *TestEmailAlertingSettingsRequest) GetEmailTo() string { - if x != nil { - return x.EmailTo - } - return "" -} - -type TestEmailAlertingSettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *TestEmailAlertingSettingsResponse) Reset() { - *x = TestEmailAlertingSettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TestEmailAlertingSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestEmailAlertingSettingsResponse) ProtoMessage() {} - -func (x *TestEmailAlertingSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TestEmailAlertingSettingsResponse.ProtoReflect.Descriptor instead. -func (*TestEmailAlertingSettingsResponse) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{21} -} - type AWSInstanceCheckRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1788,7 +1478,7 @@ type AWSInstanceCheckRequest struct { func (x *AWSInstanceCheckRequest) Reset() { *x = AWSInstanceCheckRequest{} if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[22] + mi := &file_serverpb_server_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1801,7 +1491,7 @@ func (x *AWSInstanceCheckRequest) String() string { func (*AWSInstanceCheckRequest) ProtoMessage() {} func (x *AWSInstanceCheckRequest) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[22] + mi := &file_serverpb_server_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1814,7 +1504,7 @@ func (x *AWSInstanceCheckRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AWSInstanceCheckRequest.ProtoReflect.Descriptor instead. func (*AWSInstanceCheckRequest) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{22} + return file_serverpb_server_proto_rawDescGZIP(), []int{18} } func (x *AWSInstanceCheckRequest) GetInstanceId() string { @@ -1833,7 +1523,7 @@ type AWSInstanceCheckResponse struct { func (x *AWSInstanceCheckResponse) Reset() { *x = AWSInstanceCheckResponse{} if protoimpl.UnsafeEnabled { - mi := &file_serverpb_server_proto_msgTypes[23] + mi := &file_serverpb_server_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1846,7 +1536,7 @@ func (x *AWSInstanceCheckResponse) String() string { func (*AWSInstanceCheckResponse) ProtoMessage() {} func (x *AWSInstanceCheckResponse) ProtoReflect() protoreflect.Message { - mi := &file_serverpb_server_proto_msgTypes[23] + mi := &file_serverpb_server_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1859,7 +1549,7 @@ func (x *AWSInstanceCheckResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AWSInstanceCheckResponse.ProtoReflect.Descriptor instead. func (*AWSInstanceCheckResponse) Descriptor() ([]byte, []int) { - return file_serverpb_server_proto_rawDescGZIP(), []int{23} + return file_serverpb_server_proto_rawDescGZIP(), []int{19} } var File_serverpb_server_proto protoreflect.FileDescriptor @@ -1955,361 +1645,286 @@ var file_serverpb_server_proto_rawDesc = []byte{ 0x6e, 0x52, 0x02, 0x6d, 0x72, 0x12, 0x29, 0x0a, 0x02, 0x6c, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6c, 0x72, - 0x22, 0xfe, 0x01, 0x0a, 0x15, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x66, 0x72, - 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x25, 0x0a, 0x09, 0x73, 0x6d, 0x61, 0x72, 0x74, - 0x68, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x68, - 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, - 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x54, 0x6c, - 0x73, 0x22, 0x32, 0x0a, 0x15, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0xe3, 0x01, 0x0a, 0x11, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x46, 0x0a, 0x11, 0x73, - 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x10, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x76, 0x61, 0x6c, 0x12, 0x3e, 0x0a, 0x0d, 0x72, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x72, 0x61, 0x72, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x76, 0x61, 0x6c, 0x12, 0x46, 0x0a, 0x11, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x66, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0xfe, 0x08, 0x0a, 0x08, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, - 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, - 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x12, 0x4b, 0x0a, 0x13, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, - 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, - 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x12, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x40, 0x0a, - 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x22, 0xe3, 0x01, 0x0a, 0x11, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x46, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x73, 0x74, + 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x3e, + 0x0a, 0x0d, 0x72, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x17, 0x0a, 0x07, 0x73, 0x73, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0d, 0x61, 0x77, 0x73, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x2e, 0x0a, 0x13, 0x61, - 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, - 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x4d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, - 0x74, 0x74, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x73, 0x74, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x5f, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x12, 0x55, 0x0a, 0x17, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, - 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x52, 0x15, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x17, 0x73, 0x6c, - 0x61, 0x63, 0x6b, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x73, 0x6c, 0x61, 0x63, - 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, - 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x49, 0x0a, 0x13, 0x73, 0x74, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x52, 0x11, 0x73, 0x74, 0x74, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x62, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, - 0x2f, 0x0a, 0x13, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x74, 0x65, - 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, - 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x43, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xf0, 0x0c, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x73, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6c, 0x65, - 0x6d, 0x65, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, 0x2b, 0x0a, 0x11, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, 0x4b, 0x0a, 0x13, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x12, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, - 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x52, - 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x73, 0x68, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, - 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x77, 0x73, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x55, 0x72, 0x6c, 0x12, 0x37, 0x0a, 0x18, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x61, - 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x2e, 0x0a, - 0x13, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, - 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x3b, 0x0a, - 0x1a, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x17, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x69, 0x6e, 0x67, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, - 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x55, - 0x0a, 0x17, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, - 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, 0x1e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x72, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x17, 0x73, 0x6c, - 0x61, 0x63, 0x6b, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x73, 0x6c, 0x61, 0x63, - 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x43, 0x0a, 0x1e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x73, 0x6c, 0x61, 0x63, - 0x6b, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x72, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x13, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x10, 0x70, 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x70, - 0x6d, 0x6d, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, - 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x49, 0x0a, 0x13, 0x73, 0x74, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x52, 0x11, 0x73, 0x74, 0x74, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x41, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x33, 0x0a, - 0x15, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x12, 0x38, 0x0a, 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x18, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x19, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x17, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x62, 0x61, 0x61, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x18, 0x1b, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x62, 0x61, 0x61, 0x73, - 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x1f, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x46, 0x0a, 0x16, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x17, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x19, - 0x0a, 0x08, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x22, 0x23, 0x0a, 0x21, 0x54, 0x65, 0x73, - 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, - 0x0a, 0x17, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x49, 0x64, 0x22, 0x1a, 0x0a, 0x18, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, - 0x66, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1f, 0x0a, 0x1b, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, 0x42, - 0x55, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x49, 0x4e, 0x56, - 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x4f, 0x43, 0x4b, 0x45, 0x52, - 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x56, 0x46, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x41, - 0x4d, 0x49, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x10, 0x04, 0x12, - 0x06, 0x0a, 0x02, 0x44, 0x4f, 0x10, 0x05, 0x32, 0xef, 0x0c, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x12, 0x79, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, - 0x92, 0x41, 0x27, 0x12, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x1c, 0x52, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, - 0x12, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x9e, 0x02, - 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, - 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xdb, 0x01, 0x92, 0x41, 0xc5, 0x01, 0x12, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x1a, - 0xaa, 0x01, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, - 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, - 0x74, 0x20, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x79, 0x65, 0x74, 0x2e, 0x20, 0x55, 0x73, 0x65, - 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x20, 0x6f, 0x66, 0x20, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, - 0x72, 0x6f, 0x62, 0x69, 0x6e, 0x67, 0x20, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, - 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x7a, 0x12, 0xa3, - 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, - 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, + 0x52, 0x0c, 0x72, 0x61, 0x72, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x46, + 0x0a, 0x11, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0xdc, 0x07, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x5f, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2b, + 0x0a, 0x11, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x4b, 0x0a, 0x13, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x12, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, + 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x73, + 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x73, 0x68, + 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x77, 0x73, + 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, + 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x74, 0x5f, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x74, 0x74, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x23, + 0x0a, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x62, 0x61, 0x61, 0x73, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, + 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2c, + 0x0a, 0x12, 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, 0x6d, 0x6d, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, + 0x73, 0x74, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, + 0x61, 0x6c, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x73, 0x52, 0x11, 0x73, 0x74, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x62, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x14, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x54, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x2f, 0x0a, 0x13, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x69, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x32, 0x0a, + 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x72, 0x6f, 0x6c, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x0d, 0x10, 0x0e, 0x4a, + 0x04, 0x08, 0x0e, 0x10, 0x0f, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x13, 0x47, + 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x22, 0xd0, 0x0a, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x1c, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, + 0x72, 0x79, 0x12, 0x4b, 0x0a, 0x13, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, 0x72, 0x65, + 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x12, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x40, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x73, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x77, + 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0d, 0x61, 0x77, 0x73, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x6c, + 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x37, 0x0a, + 0x18, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, + 0x75, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x72, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, + 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, + 0x74, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, + 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x53, 0x74, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, + 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x29, 0x0a, 0x10, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, + 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6d, 0x6d, 0x5f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x13, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, + 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x50, 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x49, 0x0a, 0x13, 0x73, 0x74, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x52, 0x11, 0x73, 0x74, 0x74, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x33, + 0x0a, 0x15, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x18, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x0a, + 0x19, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x17, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x62, 0x61, 0x61, 0x73, 0x12, 0x23, 0x0a, 0x0d, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x18, 0x1b, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x62, 0x61, 0x61, + 0x73, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, + 0x1f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x4a, 0x04, 0x08, 0x0f, 0x10, + 0x10, 0x4a, 0x04, 0x08, 0x10, 0x10, 0x11, 0x4a, 0x04, 0x08, 0x11, 0x10, 0x12, 0x4a, 0x04, 0x08, + 0x12, 0x10, 0x13, 0x22, 0x46, 0x0a, 0x16, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, + 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x43, 0x0a, 0x17, 0x41, + 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, + 0x22, 0x1a, 0x0a, 0x18, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x66, 0x0a, 0x12, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x12, 0x1f, 0x0a, 0x1b, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, + 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x4f, 0x43, 0x4b, 0x45, 0x52, 0x10, 0x01, 0x12, + 0x07, 0x0a, 0x03, 0x4f, 0x56, 0x46, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4d, 0x49, 0x10, + 0x03, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, + 0x44, 0x4f, 0x10, 0x05, 0x32, 0xeb, 0x0a, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, + 0x79, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x92, 0x41, 0x27, + 0x12, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x1c, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, + 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x9e, 0x02, 0x0a, 0x09, 0x52, + 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, + 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdb, 0x01, + 0x92, 0x41, 0xc5, 0x01, 0x12, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x1a, 0xaa, 0x01, 0x52, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, + 0x77, 0x68, 0x65, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, + 0x65, 0x61, 0x64, 0x79, 0x20, 0x79, 0x65, 0x74, 0x2e, 0x20, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x20, 0x6f, + 0x66, 0x20, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x62, + 0x69, 0x6e, 0x67, 0x20, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x20, 0x72, + 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, + 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x7a, 0x12, 0xa3, 0x01, 0x0a, 0x0c, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x39, 0x12, - 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x1a, 0x28, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, - 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x12, 0x90, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, - 0x41, 0x29, 0x12, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x1a, 0x19, 0x53, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x2f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x9d, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x52, 0x92, 0x41, 0x32, 0x12, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x21, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, - 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, - 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, - 0x2f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x9a, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x52, 0x92, 0x41, 0x34, 0x12, 0x0c, 0x47, 0x65, 0x74, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x1a, 0x24, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, - 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2f, 0x47, 0x65, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2f, 0x12, 0x0f, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x1a, 0x1c, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, - 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x81, 0x02, 0x0a, 0x19, 0x54, 0x65, 0x73, - 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, - 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x29, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, 0x01, 0x92, 0x41, - 0x5a, 0x12, 0x13, 0x54, 0x65, 0x73, 0x74, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x61, 0x6c, - 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x43, 0x53, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x65, - 0x73, 0x74, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x4d, 0x54, 0x50, 0x20, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x2f, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xaa, 0x01, 0x0a, - 0x10, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x12, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, 0x57, 0x53, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, 0x57, 0x53, 0x49, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x31, 0x12, 0x12, 0x41, 0x57, 0x53, 0x20, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x1b, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x41, 0x57, 0x53, 0x20, 0x45, 0x43, 0x32, 0x20, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, - 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x42, 0x76, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x53, 0x58, - 0x58, 0xaa, 0x02, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0xca, 0x02, 0x06, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0xe2, 0x02, 0x12, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x39, 0x12, 0x0d, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x1a, 0x28, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, + 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x12, 0x90, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, 0x29, 0x12, + 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x1a, 0x19, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, + 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x9d, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x52, 0x92, 0x41, 0x32, 0x12, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x1a, 0x21, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x50, 0x4d, + 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, + 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x9a, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x52, 0x92, + 0x41, 0x34, 0x12, 0x0c, 0x47, 0x65, 0x74, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x1a, 0x24, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, + 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x47, 0x65, + 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2f, 0x12, 0x0f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x1a, 0x1c, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, + 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0xaa, 0x01, 0x0a, 0x10, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1f, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, + 0x41, 0x31, 0x12, 0x12, 0x41, 0x57, 0x53, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x1b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x41, + 0x57, 0x53, 0x20, 0x45, 0x43, 0x32, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, + 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, + 0x31, 0x2f, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x42, 0x76, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x42, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, + 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0xca, 0x02, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0xe2, 0x02, 0x12, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -2326,88 +1941,77 @@ func file_serverpb_server_proto_rawDescGZIP() []byte { var ( file_serverpb_server_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_serverpb_server_proto_msgTypes = make([]protoimpl.MessageInfo, 24) + file_serverpb_server_proto_msgTypes = make([]protoimpl.MessageInfo, 20) file_serverpb_server_proto_goTypes = []interface{}{ - (DistributionMethod)(0), // 0: server.DistributionMethod - (*VersionInfo)(nil), // 1: server.VersionInfo - (*VersionRequest)(nil), // 2: server.VersionRequest - (*VersionResponse)(nil), // 3: server.VersionResponse - (*ReadinessRequest)(nil), // 4: server.ReadinessRequest - (*ReadinessResponse)(nil), // 5: server.ReadinessResponse - (*CheckUpdatesRequest)(nil), // 6: server.CheckUpdatesRequest - (*CheckUpdatesResponse)(nil), // 7: server.CheckUpdatesResponse - (*StartUpdateRequest)(nil), // 8: server.StartUpdateRequest - (*StartUpdateResponse)(nil), // 9: server.StartUpdateResponse - (*UpdateStatusRequest)(nil), // 10: server.UpdateStatusRequest - (*UpdateStatusResponse)(nil), // 11: server.UpdateStatusResponse - (*MetricsResolutions)(nil), // 12: server.MetricsResolutions - (*EmailAlertingSettings)(nil), // 13: server.EmailAlertingSettings - (*SlackAlertingSettings)(nil), // 14: server.SlackAlertingSettings - (*STTCheckIntervals)(nil), // 15: server.STTCheckIntervals - (*Settings)(nil), // 16: server.Settings - (*GetSettingsRequest)(nil), // 17: server.GetSettingsRequest - (*GetSettingsResponse)(nil), // 18: server.GetSettingsResponse - (*ChangeSettingsRequest)(nil), // 19: server.ChangeSettingsRequest - (*ChangeSettingsResponse)(nil), // 20: server.ChangeSettingsResponse - (*TestEmailAlertingSettingsRequest)(nil), // 21: server.TestEmailAlertingSettingsRequest - (*TestEmailAlertingSettingsResponse)(nil), // 22: server.TestEmailAlertingSettingsResponse - (*AWSInstanceCheckRequest)(nil), // 23: server.AWSInstanceCheckRequest - (*AWSInstanceCheckResponse)(nil), // 24: server.AWSInstanceCheckResponse - (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 26: google.protobuf.Duration + (DistributionMethod)(0), // 0: server.DistributionMethod + (*VersionInfo)(nil), // 1: server.VersionInfo + (*VersionRequest)(nil), // 2: server.VersionRequest + (*VersionResponse)(nil), // 3: server.VersionResponse + (*ReadinessRequest)(nil), // 4: server.ReadinessRequest + (*ReadinessResponse)(nil), // 5: server.ReadinessResponse + (*CheckUpdatesRequest)(nil), // 6: server.CheckUpdatesRequest + (*CheckUpdatesResponse)(nil), // 7: server.CheckUpdatesResponse + (*StartUpdateRequest)(nil), // 8: server.StartUpdateRequest + (*StartUpdateResponse)(nil), // 9: server.StartUpdateResponse + (*UpdateStatusRequest)(nil), // 10: server.UpdateStatusRequest + (*UpdateStatusResponse)(nil), // 11: server.UpdateStatusResponse + (*MetricsResolutions)(nil), // 12: server.MetricsResolutions + (*STTCheckIntervals)(nil), // 13: server.STTCheckIntervals + (*Settings)(nil), // 14: server.Settings + (*GetSettingsRequest)(nil), // 15: server.GetSettingsRequest + (*GetSettingsResponse)(nil), // 16: server.GetSettingsResponse + (*ChangeSettingsRequest)(nil), // 17: server.ChangeSettingsRequest + (*ChangeSettingsResponse)(nil), // 18: server.ChangeSettingsResponse + (*AWSInstanceCheckRequest)(nil), // 19: server.AWSInstanceCheckRequest + (*AWSInstanceCheckResponse)(nil), // 20: server.AWSInstanceCheckResponse + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 22: google.protobuf.Duration } ) var file_serverpb_server_proto_depIdxs = []int32{ - 25, // 0: server.VersionInfo.timestamp:type_name -> google.protobuf.Timestamp + 21, // 0: server.VersionInfo.timestamp:type_name -> google.protobuf.Timestamp 1, // 1: server.VersionResponse.server:type_name -> server.VersionInfo 1, // 2: server.VersionResponse.managed:type_name -> server.VersionInfo 0, // 3: server.VersionResponse.distribution_method:type_name -> server.DistributionMethod 1, // 4: server.CheckUpdatesResponse.installed:type_name -> server.VersionInfo 1, // 5: server.CheckUpdatesResponse.latest:type_name -> server.VersionInfo - 25, // 6: server.CheckUpdatesResponse.last_check:type_name -> google.protobuf.Timestamp - 26, // 7: server.MetricsResolutions.hr:type_name -> google.protobuf.Duration - 26, // 8: server.MetricsResolutions.mr:type_name -> google.protobuf.Duration - 26, // 9: server.MetricsResolutions.lr:type_name -> google.protobuf.Duration - 26, // 10: server.STTCheckIntervals.standard_interval:type_name -> google.protobuf.Duration - 26, // 11: server.STTCheckIntervals.rare_interval:type_name -> google.protobuf.Duration - 26, // 12: server.STTCheckIntervals.frequent_interval:type_name -> google.protobuf.Duration + 21, // 6: server.CheckUpdatesResponse.last_check:type_name -> google.protobuf.Timestamp + 22, // 7: server.MetricsResolutions.hr:type_name -> google.protobuf.Duration + 22, // 8: server.MetricsResolutions.mr:type_name -> google.protobuf.Duration + 22, // 9: server.MetricsResolutions.lr:type_name -> google.protobuf.Duration + 22, // 10: server.STTCheckIntervals.standard_interval:type_name -> google.protobuf.Duration + 22, // 11: server.STTCheckIntervals.rare_interval:type_name -> google.protobuf.Duration + 22, // 12: server.STTCheckIntervals.frequent_interval:type_name -> google.protobuf.Duration 12, // 13: server.Settings.metrics_resolutions:type_name -> server.MetricsResolutions - 26, // 14: server.Settings.data_retention:type_name -> google.protobuf.Duration - 13, // 15: server.Settings.email_alerting_settings:type_name -> server.EmailAlertingSettings - 14, // 16: server.Settings.slack_alerting_settings:type_name -> server.SlackAlertingSettings - 15, // 17: server.Settings.stt_check_intervals:type_name -> server.STTCheckIntervals - 16, // 18: server.GetSettingsResponse.settings:type_name -> server.Settings - 12, // 19: server.ChangeSettingsRequest.metrics_resolutions:type_name -> server.MetricsResolutions - 26, // 20: server.ChangeSettingsRequest.data_retention:type_name -> google.protobuf.Duration - 13, // 21: server.ChangeSettingsRequest.email_alerting_settings:type_name -> server.EmailAlertingSettings - 14, // 22: server.ChangeSettingsRequest.slack_alerting_settings:type_name -> server.SlackAlertingSettings - 15, // 23: server.ChangeSettingsRequest.stt_check_intervals:type_name -> server.STTCheckIntervals - 16, // 24: server.ChangeSettingsResponse.settings:type_name -> server.Settings - 13, // 25: server.TestEmailAlertingSettingsRequest.email_alerting_settings:type_name -> server.EmailAlertingSettings - 2, // 26: server.Server.Version:input_type -> server.VersionRequest - 4, // 27: server.Server.Readiness:input_type -> server.ReadinessRequest - 6, // 28: server.Server.CheckUpdates:input_type -> server.CheckUpdatesRequest - 8, // 29: server.Server.StartUpdate:input_type -> server.StartUpdateRequest - 10, // 30: server.Server.UpdateStatus:input_type -> server.UpdateStatusRequest - 17, // 31: server.Server.GetSettings:input_type -> server.GetSettingsRequest - 19, // 32: server.Server.ChangeSettings:input_type -> server.ChangeSettingsRequest - 21, // 33: server.Server.TestEmailAlertingSettings:input_type -> server.TestEmailAlertingSettingsRequest - 23, // 34: server.Server.AWSInstanceCheck:input_type -> server.AWSInstanceCheckRequest - 3, // 35: server.Server.Version:output_type -> server.VersionResponse - 5, // 36: server.Server.Readiness:output_type -> server.ReadinessResponse - 7, // 37: server.Server.CheckUpdates:output_type -> server.CheckUpdatesResponse - 9, // 38: server.Server.StartUpdate:output_type -> server.StartUpdateResponse - 11, // 39: server.Server.UpdateStatus:output_type -> server.UpdateStatusResponse - 18, // 40: server.Server.GetSettings:output_type -> server.GetSettingsResponse - 20, // 41: server.Server.ChangeSettings:output_type -> server.ChangeSettingsResponse - 22, // 42: server.Server.TestEmailAlertingSettings:output_type -> server.TestEmailAlertingSettingsResponse - 24, // 43: server.Server.AWSInstanceCheck:output_type -> server.AWSInstanceCheckResponse - 35, // [35:44] is the sub-list for method output_type - 26, // [26:35] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name + 22, // 14: server.Settings.data_retention:type_name -> google.protobuf.Duration + 13, // 15: server.Settings.stt_check_intervals:type_name -> server.STTCheckIntervals + 14, // 16: server.GetSettingsResponse.settings:type_name -> server.Settings + 12, // 17: server.ChangeSettingsRequest.metrics_resolutions:type_name -> server.MetricsResolutions + 22, // 18: server.ChangeSettingsRequest.data_retention:type_name -> google.protobuf.Duration + 13, // 19: server.ChangeSettingsRequest.stt_check_intervals:type_name -> server.STTCheckIntervals + 14, // 20: server.ChangeSettingsResponse.settings:type_name -> server.Settings + 2, // 21: server.Server.Version:input_type -> server.VersionRequest + 4, // 22: server.Server.Readiness:input_type -> server.ReadinessRequest + 6, // 23: server.Server.CheckUpdates:input_type -> server.CheckUpdatesRequest + 8, // 24: server.Server.StartUpdate:input_type -> server.StartUpdateRequest + 10, // 25: server.Server.UpdateStatus:input_type -> server.UpdateStatusRequest + 15, // 26: server.Server.GetSettings:input_type -> server.GetSettingsRequest + 17, // 27: server.Server.ChangeSettings:input_type -> server.ChangeSettingsRequest + 19, // 28: server.Server.AWSInstanceCheck:input_type -> server.AWSInstanceCheckRequest + 3, // 29: server.Server.Version:output_type -> server.VersionResponse + 5, // 30: server.Server.Readiness:output_type -> server.ReadinessResponse + 7, // 31: server.Server.CheckUpdates:output_type -> server.CheckUpdatesResponse + 9, // 32: server.Server.StartUpdate:output_type -> server.StartUpdateResponse + 11, // 33: server.Server.UpdateStatus:output_type -> server.UpdateStatusResponse + 16, // 34: server.Server.GetSettings:output_type -> server.GetSettingsResponse + 18, // 35: server.Server.ChangeSettings:output_type -> server.ChangeSettingsResponse + 20, // 36: server.Server.AWSInstanceCheck:output_type -> server.AWSInstanceCheckResponse + 29, // [29:37] is the sub-list for method output_type + 21, // [21:29] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_serverpb_server_proto_init() } @@ -2561,30 +2165,6 @@ func file_serverpb_server_proto_init() { } } file_serverpb_server_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmailAlertingSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_serverpb_server_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SlackAlertingSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_serverpb_server_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*STTCheckIntervals); i { case 0: return &v.state @@ -2596,7 +2176,7 @@ func file_serverpb_server_proto_init() { return nil } } - file_serverpb_server_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_serverpb_server_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Settings); i { case 0: return &v.state @@ -2608,7 +2188,7 @@ func file_serverpb_server_proto_init() { return nil } } - file_serverpb_server_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_serverpb_server_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSettingsRequest); i { case 0: return &v.state @@ -2620,7 +2200,7 @@ func file_serverpb_server_proto_init() { return nil } } - file_serverpb_server_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_serverpb_server_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSettingsResponse); i { case 0: return &v.state @@ -2632,7 +2212,7 @@ func file_serverpb_server_proto_init() { return nil } } - file_serverpb_server_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_serverpb_server_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ChangeSettingsRequest); i { case 0: return &v.state @@ -2644,7 +2224,7 @@ func file_serverpb_server_proto_init() { return nil } } - file_serverpb_server_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_serverpb_server_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ChangeSettingsResponse); i { case 0: return &v.state @@ -2656,31 +2236,7 @@ func file_serverpb_server_proto_init() { return nil } } - file_serverpb_server_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestEmailAlertingSettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_serverpb_server_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestEmailAlertingSettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_serverpb_server_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_serverpb_server_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AWSInstanceCheckRequest); i { case 0: return &v.state @@ -2692,7 +2248,7 @@ func file_serverpb_server_proto_init() { return nil } } - file_serverpb_server_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_serverpb_server_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AWSInstanceCheckResponse); i { case 0: return &v.state @@ -2711,7 +2267,7 @@ func file_serverpb_server_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_serverpb_server_proto_rawDesc, NumEnums: 1, - NumMessages: 24, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/api/serverpb/server.pb.gw.go b/api/serverpb/server.pb.gw.go index 6b7c5f0f11..3fa3295641 100644 --- a/api/serverpb/server.pb.gw.go +++ b/api/serverpb/server.pb.gw.go @@ -241,38 +241,6 @@ func local_request_Server_ChangeSettings_0(ctx context.Context, marshaler runtim return msg, metadata, err } -func request_Server_TestEmailAlertingSettings_0(ctx context.Context, marshaler runtime.Marshaler, client ServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq TestEmailAlertingSettingsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TestEmailAlertingSettings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Server_TestEmailAlertingSettings_0(ctx context.Context, marshaler runtime.Marshaler, server ServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq TestEmailAlertingSettingsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TestEmailAlertingSettings(ctx, &protoReq) - return msg, metadata, err -} - func request_Server_AWSInstanceCheck_0(ctx context.Context, marshaler runtime.Marshaler, client ServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq AWSInstanceCheckRequest var metadata runtime.ServerMetadata @@ -478,30 +446,6 @@ func RegisterServerHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser forward_Server_ChangeSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Server_TestEmailAlertingSettings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/server.Server/TestEmailAlertingSettings", runtime.WithHTTPPathPattern("/v1/Settings/TestEmailAlertingSettings")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Server_TestEmailAlertingSettings_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Server_TestEmailAlertingSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_Server_AWSInstanceCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -713,27 +657,6 @@ func RegisterServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli forward_Server_ChangeSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Server_TestEmailAlertingSettings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/server.Server/TestEmailAlertingSettings", runtime.WithHTTPPathPattern("/v1/Settings/TestEmailAlertingSettings")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Server_TestEmailAlertingSettings_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Server_TestEmailAlertingSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_Server_AWSInstanceCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -773,8 +696,6 @@ var ( pattern_Server_ChangeSettings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "Settings", "Change"}, "")) - pattern_Server_TestEmailAlertingSettings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "Settings", "TestEmailAlertingSettings"}, "")) - pattern_Server_AWSInstanceCheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "AWSInstanceCheck"}, "")) ) @@ -793,7 +714,5 @@ var ( forward_Server_ChangeSettings_0 = runtime.ForwardResponseMessage - forward_Server_TestEmailAlertingSettings_0 = runtime.ForwardResponseMessage - forward_Server_AWSInstanceCheck_0 = runtime.ForwardResponseMessage ) diff --git a/api/serverpb/server.pb.validate.go b/api/serverpb/server.pb.validate.go index de4247a314..f27366398c 100644 --- a/api/serverpb/server.pb.validate.go +++ b/api/serverpb/server.pb.validate.go @@ -1541,255 +1541,6 @@ var _ interface { ErrorName() string } = MetricsResolutionsValidationError{} -// Validate checks the field values on EmailAlertingSettings with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *EmailAlertingSettings) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on EmailAlertingSettings with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// EmailAlertingSettingsMultiError, or nil if none found. -func (m *EmailAlertingSettings) ValidateAll() error { - return m.validate(true) -} - -func (m *EmailAlertingSettings) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetFrom()) < 1 { - err := EmailAlertingSettingsValidationError{ - field: "From", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetSmarthost()) < 1 { - err := EmailAlertingSettingsValidationError{ - field: "Smarthost", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Hello - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Identity - - // no validation rules for Secret - - // no validation rules for RequireTls - - if len(errors) > 0 { - return EmailAlertingSettingsMultiError(errors) - } - - return nil -} - -// EmailAlertingSettingsMultiError is an error wrapping multiple validation -// errors returned by EmailAlertingSettings.ValidateAll() if the designated -// constraints aren't met. -type EmailAlertingSettingsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m EmailAlertingSettingsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m EmailAlertingSettingsMultiError) AllErrors() []error { return m } - -// EmailAlertingSettingsValidationError is the validation error returned by -// EmailAlertingSettings.Validate if the designated constraints aren't met. -type EmailAlertingSettingsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e EmailAlertingSettingsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e EmailAlertingSettingsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e EmailAlertingSettingsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e EmailAlertingSettingsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e EmailAlertingSettingsValidationError) ErrorName() string { - return "EmailAlertingSettingsValidationError" -} - -// Error satisfies the builtin error interface -func (e EmailAlertingSettingsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sEmailAlertingSettings.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = EmailAlertingSettingsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = EmailAlertingSettingsValidationError{} - -// Validate checks the field values on SlackAlertingSettings with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *SlackAlertingSettings) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SlackAlertingSettings with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// SlackAlertingSettingsMultiError, or nil if none found. -func (m *SlackAlertingSettings) ValidateAll() error { - return m.validate(true) -} - -func (m *SlackAlertingSettings) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetUrl()) < 1 { - err := SlackAlertingSettingsValidationError{ - field: "Url", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return SlackAlertingSettingsMultiError(errors) - } - - return nil -} - -// SlackAlertingSettingsMultiError is an error wrapping multiple validation -// errors returned by SlackAlertingSettings.ValidateAll() if the designated -// constraints aren't met. -type SlackAlertingSettingsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SlackAlertingSettingsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m SlackAlertingSettingsMultiError) AllErrors() []error { return m } - -// SlackAlertingSettingsValidationError is the validation error returned by -// SlackAlertingSettings.Validate if the designated constraints aren't met. -type SlackAlertingSettingsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SlackAlertingSettingsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SlackAlertingSettingsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SlackAlertingSettingsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SlackAlertingSettingsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SlackAlertingSettingsValidationError) ErrorName() string { - return "SlackAlertingSettingsValidationError" -} - -// Error satisfies the builtin error interface -func (e SlackAlertingSettingsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sSlackAlertingSettings.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SlackAlertingSettingsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SlackAlertingSettingsValidationError{} - // Validate checks the field values on STTCheckIntervals with the rules defined // in the proto definition for this message. If any rules are violated, the // first error encountered is returned, or nil if there are no violations. @@ -2077,64 +1828,6 @@ func (m *Settings) validate(all bool) error { // no validation rules for AlertingEnabled - if all { - switch v := interface{}(m.GetEmailAlertingSettings()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEmailAlertingSettings()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SettingsValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetSlackAlertingSettings()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "SlackAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SettingsValidationError{ - field: "SlackAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSlackAlertingSettings()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SettingsValidationError{ - field: "SlackAlertingSettings", - reason: "embedded message failed validation", - cause: err, - } - } - } - // no validation rules for PmmPublicAddress if all { @@ -2592,68 +2285,6 @@ func (m *ChangeSettingsRequest) validate(all bool) error { // no validation rules for DisableAlerting - if all { - switch v := interface{}(m.GetEmailAlertingSettings()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEmailAlertingSettings()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeSettingsRequestValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for RemoveEmailAlertingSettings - - if all { - switch v := interface{}(m.GetSlackAlertingSettings()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "SlackAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeSettingsRequestValidationError{ - field: "SlackAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetSlackAlertingSettings()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeSettingsRequestValidationError{ - field: "SlackAlertingSettings", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for RemoveSlackAlertingSettings - // no validation rules for PmmPublicAddress // no validation rules for RemovePmmPublicAddress @@ -2914,247 +2545,6 @@ var _ interface { ErrorName() string } = ChangeSettingsResponseValidationError{} -// Validate checks the field values on TestEmailAlertingSettingsRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *TestEmailAlertingSettingsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on TestEmailAlertingSettingsRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// TestEmailAlertingSettingsRequestMultiError, or nil if none found. -func (m *TestEmailAlertingSettingsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *TestEmailAlertingSettingsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetEmailAlertingSettings()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, TestEmailAlertingSettingsRequestValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, TestEmailAlertingSettingsRequestValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEmailAlertingSettings()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return TestEmailAlertingSettingsRequestValidationError{ - field: "EmailAlertingSettings", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for EmailTo - - if len(errors) > 0 { - return TestEmailAlertingSettingsRequestMultiError(errors) - } - - return nil -} - -// TestEmailAlertingSettingsRequestMultiError is an error wrapping multiple -// validation errors returned by -// TestEmailAlertingSettingsRequest.ValidateAll() if the designated -// constraints aren't met. -type TestEmailAlertingSettingsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m TestEmailAlertingSettingsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m TestEmailAlertingSettingsRequestMultiError) AllErrors() []error { return m } - -// TestEmailAlertingSettingsRequestValidationError is the validation error -// returned by TestEmailAlertingSettingsRequest.Validate if the designated -// constraints aren't met. -type TestEmailAlertingSettingsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e TestEmailAlertingSettingsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e TestEmailAlertingSettingsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e TestEmailAlertingSettingsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e TestEmailAlertingSettingsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e TestEmailAlertingSettingsRequestValidationError) ErrorName() string { - return "TestEmailAlertingSettingsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e TestEmailAlertingSettingsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sTestEmailAlertingSettingsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = TestEmailAlertingSettingsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = TestEmailAlertingSettingsRequestValidationError{} - -// Validate checks the field values on TestEmailAlertingSettingsResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *TestEmailAlertingSettingsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on TestEmailAlertingSettingsResponse -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// TestEmailAlertingSettingsResponseMultiError, or nil if none found. -func (m *TestEmailAlertingSettingsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *TestEmailAlertingSettingsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return TestEmailAlertingSettingsResponseMultiError(errors) - } - - return nil -} - -// TestEmailAlertingSettingsResponseMultiError is an error wrapping multiple -// validation errors returned by -// TestEmailAlertingSettingsResponse.ValidateAll() if the designated -// constraints aren't met. -type TestEmailAlertingSettingsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m TestEmailAlertingSettingsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m TestEmailAlertingSettingsResponseMultiError) AllErrors() []error { return m } - -// TestEmailAlertingSettingsResponseValidationError is the validation error -// returned by TestEmailAlertingSettingsResponse.Validate if the designated -// constraints aren't met. -type TestEmailAlertingSettingsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e TestEmailAlertingSettingsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e TestEmailAlertingSettingsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e TestEmailAlertingSettingsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e TestEmailAlertingSettingsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e TestEmailAlertingSettingsResponseValidationError) ErrorName() string { - return "TestEmailAlertingSettingsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e TestEmailAlertingSettingsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sTestEmailAlertingSettingsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = TestEmailAlertingSettingsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = TestEmailAlertingSettingsResponseValidationError{} - // Validate checks the field values on AWSInstanceCheckRequest with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. diff --git a/api/serverpb/server.proto b/api/serverpb/server.proto index 616b91fd43..acb99210ea 100644 --- a/api/serverpb/server.proto +++ b/api/serverpb/server.proto @@ -108,32 +108,6 @@ message MetricsResolutions { google.protobuf.Duration lr = 3; } -// EmailAlertingSettings represents email (SMTP) configuration for Alerting. -message EmailAlertingSettings { - // SMTP From header field. - string from = 1 [(validate.rules).string.min_len = 1]; - // SMTP host and port. - string smarthost = 2 [(validate.rules).string.min_len = 1]; - // Hostname to identify to the SMTP server. - string hello = 3; - // Auth using CRAM-MD5, LOGIN and PLAIN. - string username = 4; - // Auth using LOGIN and PLAIN. - string password = 5; - // Auth using PLAIN. - string identity = 6; - // Auth using CRAM-MD5. - string secret = 7; - // Require TLS. - bool require_tls = 8; -} - -// SlackAlertingSettings represents Slack configuration for Alerting. -message SlackAlertingSettings { - // Slack API (webhook) URL. - string url = 1 [(validate.rules).string.min_len = 1]; -} - // STTCheckIntervals represents intervals between STT checks. message STTCheckIntervals { // Standard check interval. @@ -146,6 +120,8 @@ message STTCheckIntervals { // Settings represents PMM Server settings. message Settings { + reserved 13, 14; // Removed fields + // True if updates are disabled. bool updates_disabled = 1; // True if telemetry is enabled. @@ -169,10 +145,6 @@ message Settings { bool dbaas_enabled = 11; // True if Alerting is enabled. bool alerting_enabled = 12; - // Alerting email (SMTP) settings. - EmailAlertingSettings email_alerting_settings = 13; - // Alerting Slack settings. - SlackAlertingSettings slack_alerting_settings = 14; // PMM Server public address. string pmm_public_address = 15; // Intervals between STT check runs. @@ -198,6 +170,8 @@ message GetSettingsResponse { } message ChangeSettingsRequest { + reserved 15, 16, 17, 18; //Removed fields + bool enable_updates = 28; bool disable_updates = 29; bool enable_telemetry = 1; @@ -226,14 +200,6 @@ message ChangeSettingsRequest { bool enable_alerting = 13; // Disable Alerting. bool disable_alerting = 14; - // Change Alerting email (SMTP) settings, if set. - EmailAlertingSettings email_alerting_settings = 15; - // If true, removes Alerting email (SMTP) settings. - bool remove_email_alerting_settings = 16; - // Change Alerting Slack settings, if set. - SlackAlertingSettings slack_alerting_settings = 17; - // If true, removes Alerting Slack settings. - bool remove_slack_alerting_settings = 18; // PMM Server public address. string pmm_public_address = 19; bool remove_pmm_public_address = 20; @@ -261,15 +227,6 @@ message ChangeSettingsResponse { Settings settings = 1; } -message TestEmailAlertingSettingsRequest { - // Alerting email (SMTP) settings. - EmailAlertingSettings email_alerting_settings = 1; - // Target email address to send the email to. - string email_to = 2; -} - -message TestEmailAlertingSettingsResponse {} - message AWSInstanceCheckRequest { // AWS EC2 instance ID (i-1234567890abcdef0). string instance_id = 1 [(validate.rules).string.min_len = 1]; @@ -351,17 +308,6 @@ service Server { description: "Changes PMM Server settings." }; } - // TestEmailAlertingSettings sends test email to check current SMTP settings for email alerting. - rpc TestEmailAlertingSettings(TestEmailAlertingSettingsRequest) returns (TestEmailAlertingSettingsResponse) { - option (google.api.http) = { - post: "/v1/Settings/TestEmailAlertingSettings" - body: "*" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Test email alerting" - description: "Sends test email to check current SMTP settings for email alerting." - }; - } // AWSInstanceCheck checks AWS EC2 instance ID. rpc AWSInstanceCheck(AWSInstanceCheckRequest) returns (AWSInstanceCheckResponse) { option (google.api.http) = { diff --git a/api/serverpb/server_grpc.pb.go b/api/serverpb/server_grpc.pb.go index 63197e8537..70b49195fd 100644 --- a/api/serverpb/server_grpc.pb.go +++ b/api/serverpb/server_grpc.pb.go @@ -20,15 +20,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Server_Version_FullMethodName = "/server.Server/Version" - Server_Readiness_FullMethodName = "/server.Server/Readiness" - Server_CheckUpdates_FullMethodName = "/server.Server/CheckUpdates" - Server_StartUpdate_FullMethodName = "/server.Server/StartUpdate" - Server_UpdateStatus_FullMethodName = "/server.Server/UpdateStatus" - Server_GetSettings_FullMethodName = "/server.Server/GetSettings" - Server_ChangeSettings_FullMethodName = "/server.Server/ChangeSettings" - Server_TestEmailAlertingSettings_FullMethodName = "/server.Server/TestEmailAlertingSettings" - Server_AWSInstanceCheck_FullMethodName = "/server.Server/AWSInstanceCheck" + Server_Version_FullMethodName = "/server.Server/Version" + Server_Readiness_FullMethodName = "/server.Server/Readiness" + Server_CheckUpdates_FullMethodName = "/server.Server/CheckUpdates" + Server_StartUpdate_FullMethodName = "/server.Server/StartUpdate" + Server_UpdateStatus_FullMethodName = "/server.Server/UpdateStatus" + Server_GetSettings_FullMethodName = "/server.Server/GetSettings" + Server_ChangeSettings_FullMethodName = "/server.Server/ChangeSettings" + Server_AWSInstanceCheck_FullMethodName = "/server.Server/AWSInstanceCheck" ) // ServerClient is the client API for Server service. @@ -50,8 +49,6 @@ type ServerClient interface { GetSettings(ctx context.Context, in *GetSettingsRequest, opts ...grpc.CallOption) (*GetSettingsResponse, error) // ChangeSettings changes PMM Server settings. ChangeSettings(ctx context.Context, in *ChangeSettingsRequest, opts ...grpc.CallOption) (*ChangeSettingsResponse, error) - // TestEmailAlertingSettings sends test email to check current SMTP settings for email alerting. - TestEmailAlertingSettings(ctx context.Context, in *TestEmailAlertingSettingsRequest, opts ...grpc.CallOption) (*TestEmailAlertingSettingsResponse, error) // AWSInstanceCheck checks AWS EC2 instance ID. AWSInstanceCheck(ctx context.Context, in *AWSInstanceCheckRequest, opts ...grpc.CallOption) (*AWSInstanceCheckResponse, error) } @@ -127,15 +124,6 @@ func (c *serverClient) ChangeSettings(ctx context.Context, in *ChangeSettingsReq return out, nil } -func (c *serverClient) TestEmailAlertingSettings(ctx context.Context, in *TestEmailAlertingSettingsRequest, opts ...grpc.CallOption) (*TestEmailAlertingSettingsResponse, error) { - out := new(TestEmailAlertingSettingsResponse) - err := c.cc.Invoke(ctx, Server_TestEmailAlertingSettings_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *serverClient) AWSInstanceCheck(ctx context.Context, in *AWSInstanceCheckRequest, opts ...grpc.CallOption) (*AWSInstanceCheckResponse, error) { out := new(AWSInstanceCheckResponse) err := c.cc.Invoke(ctx, Server_AWSInstanceCheck_FullMethodName, in, out, opts...) @@ -164,8 +152,6 @@ type ServerServer interface { GetSettings(context.Context, *GetSettingsRequest) (*GetSettingsResponse, error) // ChangeSettings changes PMM Server settings. ChangeSettings(context.Context, *ChangeSettingsRequest) (*ChangeSettingsResponse, error) - // TestEmailAlertingSettings sends test email to check current SMTP settings for email alerting. - TestEmailAlertingSettings(context.Context, *TestEmailAlertingSettingsRequest) (*TestEmailAlertingSettingsResponse, error) // AWSInstanceCheck checks AWS EC2 instance ID. AWSInstanceCheck(context.Context, *AWSInstanceCheckRequest) (*AWSInstanceCheckResponse, error) mustEmbedUnimplementedServerServer() @@ -202,10 +188,6 @@ func (UnimplementedServerServer) ChangeSettings(context.Context, *ChangeSettings return nil, status.Errorf(codes.Unimplemented, "method ChangeSettings not implemented") } -func (UnimplementedServerServer) TestEmailAlertingSettings(context.Context, *TestEmailAlertingSettingsRequest) (*TestEmailAlertingSettingsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TestEmailAlertingSettings not implemented") -} - func (UnimplementedServerServer) AWSInstanceCheck(context.Context, *AWSInstanceCheckRequest) (*AWSInstanceCheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AWSInstanceCheck not implemented") } @@ -348,24 +330,6 @@ func _Server_ChangeSettings_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _Server_TestEmailAlertingSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TestEmailAlertingSettingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServer).TestEmailAlertingSettings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Server_TestEmailAlertingSettings_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServer).TestEmailAlertingSettings(ctx, req.(*TestEmailAlertingSettingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Server_AWSInstanceCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AWSInstanceCheckRequest) if err := dec(in); err != nil { @@ -419,10 +383,6 @@ var Server_ServiceDesc = grpc.ServiceDesc{ MethodName: "ChangeSettings", Handler: _Server_ChangeSettings_Handler, }, - { - MethodName: "TestEmailAlertingSettings", - Handler: _Server_TestEmailAlertingSettings_Handler, - }, { MethodName: "AWSInstanceCheck", Handler: _Server_AWSInstanceCheck_Handler, diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index 5b8c74a455..9acb518b72 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -3008,83 +3008,14 @@ "type": "boolean", "x-order": 15 }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 16 - }, - "remove_email_alerting_settings": { - "description": "If true, removes Alerting email (SMTP) settings.", - "type": "boolean", - "x-order": 17 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 18 - }, - "remove_slack_alerting_settings": { - "description": "If true, removes Alerting Slack settings.", - "type": "boolean", - "x-order": 19 - }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 20 + "x-order": 16 }, "remove_pmm_public_address": { "type": "boolean", - "x-order": 21 + "x-order": 17 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -3106,47 +3037,47 @@ "x-order": 2 } }, - "x-order": 22 + "x-order": 18 }, "enable_azurediscover": { "description": "Enable Azure Discover.", "type": "boolean", - "x-order": 23 + "x-order": 19 }, "disable_azurediscover": { "description": "Disable Azure Discover.", "type": "boolean", - "x-order": 24 + "x-order": 20 }, "enable_backup_management": { "description": "Enable Backup Management.", "type": "boolean", - "x-order": 25 + "x-order": 21 }, "disable_backup_management": { "description": "Disable Backup Management.", "type": "boolean", - "x-order": 26 + "x-order": 22 }, "enable_dbaas": { "description": "Enable DBaaS.", "type": "boolean", - "x-order": 27 + "x-order": 23 }, "disable_dbaas": { "description": "Disable DBaaS.", "type": "boolean", - "x-order": 28 + "x-order": 24 }, "enable_access_control": { "type": "boolean", "title": "Enable Access Control", - "x-order": 29 + "x-order": 25 }, "disable_access_control": { "type": "boolean", "title": "Disable Access Control", - "x-order": 30 + "x-order": 26 } } } @@ -3239,69 +3170,10 @@ "type": "boolean", "x-order": 11 }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 12 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 - }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 12 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -3323,22 +3195,22 @@ "x-order": 2 } }, - "x-order": 15 + "x-order": 13 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 14 }, "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 15 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 16 }, "telemetry_summaries": { "type": "array", @@ -3346,18 +3218,18 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 17 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 18 }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 + "x-order": 19 } }, "x-order": 0 @@ -3506,69 +3378,10 @@ "type": "boolean", "x-order": 11 }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 12 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 - }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 12 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -3590,22 +3403,22 @@ "x-order": 2 } }, - "x-order": 15 + "x-order": 13 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 14 }, "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 15 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 16 }, "telemetry_summaries": { "type": "array", @@ -3613,139 +3426,24 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 17 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 18 }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }", - "type": "object", - "properties": { - "@type": { - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Settings/TestEmailAlertingSettings": { - "post": { - "description": "Sends test email to check current SMTP settings for email alerting.", - "tags": [ - "Server" - ], - "summary": "Test email alerting", - "operationId": "TestEmailAlertingSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 + "x-order": 19 } }, "x-order": 0 - }, - "email_to": { - "description": "Target email address to send the email to.", - "type": "string", - "x-order": 1 } } } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } }, "default": { "description": "An unexpected error response.", diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 24f7b6c588..691518570b 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -241,83 +241,14 @@ "type": "boolean", "x-order": 15 }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 16 - }, - "remove_email_alerting_settings": { - "description": "If true, removes Alerting email (SMTP) settings.", - "type": "boolean", - "x-order": 17 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 18 - }, - "remove_slack_alerting_settings": { - "description": "If true, removes Alerting Slack settings.", - "type": "boolean", - "x-order": 19 - }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 20 + "x-order": 16 }, "remove_pmm_public_address": { "type": "boolean", - "x-order": 21 + "x-order": 17 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -339,47 +270,47 @@ "x-order": 2 } }, - "x-order": 22 + "x-order": 18 }, "enable_azurediscover": { "description": "Enable Azure Discover.", "type": "boolean", - "x-order": 23 + "x-order": 19 }, "disable_azurediscover": { "description": "Disable Azure Discover.", "type": "boolean", - "x-order": 24 + "x-order": 20 }, "enable_backup_management": { "description": "Enable Backup Management.", "type": "boolean", - "x-order": 25 + "x-order": 21 }, "disable_backup_management": { "description": "Disable Backup Management.", "type": "boolean", - "x-order": 26 + "x-order": 22 }, "enable_dbaas": { "description": "Enable DBaaS.", "type": "boolean", - "x-order": 27 + "x-order": 23 }, "disable_dbaas": { "description": "Disable DBaaS.", "type": "boolean", - "x-order": 28 + "x-order": 24 }, "enable_access_control": { "type": "boolean", "title": "Enable Access Control", - "x-order": 29 + "x-order": 25 }, "disable_access_control": { "type": "boolean", "title": "Disable Access Control", - "x-order": 30 + "x-order": 26 } } } @@ -472,69 +403,10 @@ "type": "boolean", "x-order": 11 }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 12 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 - }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 12 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -556,22 +428,22 @@ "x-order": 2 } }, - "x-order": 15 + "x-order": 13 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 14 }, "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 15 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 16 }, "telemetry_summaries": { "type": "array", @@ -579,18 +451,18 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 17 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 18 }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 + "x-order": 19 } }, "x-order": 0 @@ -739,69 +611,10 @@ "type": "boolean", "x-order": 11 }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 12 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 - }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 12 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -823,22 +636,22 @@ "x-order": 2 } }, - "x-order": 15 + "x-order": 13 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 14 }, "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 15 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 16 }, "telemetry_summaries": { "type": "array", @@ -846,139 +659,24 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 17 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 18 }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }", - "type": "object", - "properties": { - "@type": { - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics.", - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Settings/TestEmailAlertingSettings": { - "post": { - "description": "Sends test email to check current SMTP settings for email alerting.", - "tags": [ - "Server" - ], - "summary": "Test email alerting", - "operationId": "TestEmailAlertingSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 + "x-order": 19 } }, "x-order": 0 - }, - "email_to": { - "description": "Target email address to send the email to.", - "type": "string", - "x-order": 1 } } } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } }, "default": { "description": "An unexpected error response.", diff --git a/descriptor.bin b/descriptor.bin index 970fb942da29196cf8c633d12392225208495b07..13c15ce112b8cf15482422d12880a8d79c234797 100644 GIT binary patch delta 5003 zcmZ9QeTKj2{lV;DZdlEJOZ;?QeePRoPsZfN z)cfL!U;lVaO%?T%e^D<}(-&kmA2#D}b67C_*VMPfsH*?rn)*c4Z@#PU747IMgdzTh zVG)0ep~hbwmdw)k)%|AKxH=>Lrt0|*)QB{rAE`HUqhD3N&ZJVu&7YdQa((z8>e;;d zyb`iW%l_2r=N}2~X;msMn@FeovmI)hlCnvpbo#O9Uk@hEZ&DeS9<-<^r!e%f&c0Zs zp=QlieHKL5fGJTh*^vZtpg|IMcTRUCfgHHKPtCTZ(CJmCpMvR*6d+eMNC9$HV@&~a z71msYedKlKiPW#nA1Rns`NTMmI^*%C`) zS)LxtG|Suh>oE$omc$*dGYxbt)e!Y)sx;WO)OlMh?dZOlj+I)jBT;spGGk>nmO$50 zE{rA6byR9`D8@cbVv6g`U?xcAQ`T#djuFI|K1KdCp zt7@?Yvs!L4cV~k6i}NB2a1-HMMPbVV+(f>PCBRKoZdKp5U{1^DNOV^oFu!~=H^H3F z1dFhC4pX2xHl4#1&rz<;O_9SC&rzjI-DamyT5dLTyOXxlRW* z0o+Oxs%nk}^I8s>y`^9#z&t+H5Q&l-iJJ=9GA)(>hiFEhT42FuEw`Bmv%wsI%~)|; zVzn9IHuB>G(F|}K^-fW9Em+WUyQyb`I{+2{Zco4h!0qJ6U$g*lJ58LVK4Za9%N?dY z7c2!B0^E^+A;2987y{hE;Cu@fwcKf*$py2Q1o%Ze)km2NuB%%qS z@J%73yIZJnhJy~GZ;WoN_ae1&#uGBs-Yb;4=BDMCzCzh z&CAL0R>@;)+-(PQnDZbistfMt{+Ai?e@-z{sSw4d5J`0&Ig4v>gWDHKr180GC8 zAip(oAy5e*JED&h*0>fNOjrRHGG=+^gYg{?1!w<*gaQ;T3-uZjlbbjV6f#D6x33Wj zklnmU+rh2^g#w5E5LckZQLn_IfR2(7dchuwOAsX3LtKK^aRLw72hRV;sHfK!txzEUk3>Zazu|QxS(5YrNL;kg3vh&s z)}7WX^8a!3Vj)POPgdmof1LbDZbi=j$7%9ZTR1|2{C~m}Llh4D26!R?Iscy^ z-(5Gs`Tqp9w5pkQMdbgJ=Fu>?4PYMN$pqy5e=;tU=mmI^%5AD@K_sVB=5!cz-4)vW ze<}evSDi|(0O$Wxd<7<15c&TM*Vj_@vnvM7Xc)9$X)Xk4jZZVDv@^*?;6iXFE_R_n zAvkM`9S$THg0o3@Icc4Ziye9ap51%XO2Aftmy&3; z0=&f0>b5JkX?fW^R1P`-wgJ4HfNcOTlOM;b4d7*JZC4X4*skT6d9@r=0JZ}hOTc!3 zWAV!gy#U8Jolmh~hn82&&2lgax4Z-3l?3bncqIu=2f!;Foal2@w7g2@ORd2qoTduM zs|i^Fd6oP)etd5&bBU7V|w0DEVr3(QXUQyH|X}e;$E2eH_3U<1j)#RZHi2g)ZR^!|7n;Y z$tGOWebxiAz#1W*73s>N>b>7v{vGpaC0JTpgDU8jvHuPfC7XU=f~)%)G3RqCS^}Tm zTPx%s@=?jgLPR#=#$?obA)mphC>p{VaZQV?k+k+U3b7SNrd7?c&R|Y$qws9{$Es;W zVx!QLohN=LY!tJWITLA^*d*l78Ya@tglmjU@Tko~{=8u#ZB4kQd#niz84}`GFfqGo zzTXwxSsO|sAz@-Di3C45hLT7~utv!34HMFtaE*}(9`y?$cQ#B&Yr-`xvnDdy+bzV) zFfq4kdb@+WYP*w2WME=<5($30>`o$qfAe~KgxuROk#QzmV`PFy{YJ=_8YVK95hUL&V*}> zOz^1JgdA>|@T>{fbhkC(Yp*WE8!&N4)%cX?{R2cDLq%PX*|7lwPJ0q?!GQy)?7jmRw#J5JGriZ;Bt?Ylif1Vm^S8c0S)Mr(L|Cav; D%)43M delta 8159 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 Date: Fri, 30 Jun 2023 17:06:37 +0200 Subject: [PATCH 09/22] PMM-11079 Cleanup --- managed/models/rule_model.go | 69 ------------------------------------ 1 file changed, 69 deletions(-) delete mode 100644 managed/models/rule_model.go diff --git a/managed/models/rule_model.go b/managed/models/rule_model.go deleted file mode 100644 index 18b276ba4a..0000000000 --- a/managed/models/rule_model.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// // -// // This program is free software: you can redistribute it and/or modify -// // it under the terms of the GNU Affero General Public License as published by -// // the Free Software Foundation, either version 3 of the License, or -// // (at your option) any later version. -// // -// // This program is distributed in the hope that it will be useful, -// // but WITHOUT ANY WARRANTY; without even the implied warranty of -// // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// // GNU Affero General Public License for more details. -// // -// // You should have received a copy of the GNU Affero General Public License -// // along with this program. If not, see . -package models - -// -// import ( -// "database/sql/driver" -// -// "gopkg.in/reform.v1" -// ) -// -// // FilterType represents rule filter type. -// type FilterType string -// -// // Available filter types. -// const ( -// Equal = FilterType("=") -// Regex = FilterType("=~") -// ) -// -// // Filters represents filters slice. -// type Filters []Filter -// -// // Value implements database/sql/driver Valuer interface. -// func (t Filters) Value() (driver.Value, error) { return jsonValue(t) } -// -// // Scan implements database/sql Scanner interface. -// func (t *Filters) Scan(src interface{}) error { return jsonScan(t, src) } -// -// // Filter represents rule filter. -// type Filter struct { -// Type FilterType `json:"type"` -// Key string `json:"key"` -// Val string `json:"value"` -// } -// -// // Value implements database/sql/driver.Valuer interface. Should be defined on the value. -// func (f Filter) Value() (driver.Value, error) { return jsonValue(f) } -// -// // Scan implements database/sql.Scanner interface. Should be defined on the pointer. -// func (f *Filter) Scan(src interface{}) error { return jsonScan(f, src) } -// -// // ChannelIDs is a slice of notification channel ids. -// type ChannelIDs []string -// -// // Value implements database/sql/driver Valuer interface. -// func (t ChannelIDs) Value() (driver.Value, error) { return jsonValue(t) } -// -// // Scan implements database/sql Scanner interface. -// func (t *ChannelIDs) Scan(src interface{}) error { return jsonScan(t, src) } -// -// // check interfaces. -// var ( -// _ reform.BeforeInserter = (*Rule)(nil) -// _ reform.BeforeUpdater = (*Rule)(nil) -// _ reform.AfterFinder = (*Rule)(nil) -// ) From b9b82be0e1364b4970f51b17da048527c90a43a2 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 30 Jun 2023 17:40:37 +0200 Subject: [PATCH 10/22] PMM-11079 Fixes --- managed/models/models_json_test.go | 10 ++++- managed/services/errors.go | 3 ++ .../services/management/alerting/service.go | 45 +++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/managed/models/models_json_test.go b/managed/models/models_json_test.go index 18af8a2942..090067e332 100644 --- a/managed/models/models_json_test.go +++ b/managed/models/models_json_test.go @@ -31,11 +31,16 @@ func TestJSON(t *testing.T) { //nolint:tparallel sqlDB := testdb.Open(t, models.SkipFixtures, nil) db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) + agents, err := models.FindAgents(db.Querier, models.AgentFilters{AgentType: pointerToAgentType(models.PMMAgentType)}) + require.NoError(t, err) + require.NotEmpty(t, agents) + t.Run("Normal", func(t *testing.T) { t.Parallel() j1 := models.Job{ - ID: "Normal", + ID: "Normal", + PMMAgentID: agents[0].AgentID, Data: &models.JobData{ MySQLBackup: &models.MySQLBackupJobData{ ServiceID: "test_service", @@ -56,7 +61,8 @@ func TestJSON(t *testing.T) { //nolint:tparallel t.Parallel() j1 := models.Job{ - ID: "Nil", + PMMAgentID: agents[0].AgentID, + ID: "Nil", } err := db.Save(&j1) require.NoError(t, err) diff --git a/managed/services/errors.go b/managed/services/errors.go index d982fa9a88..ce8573b631 100644 --- a/managed/services/errors.go +++ b/managed/services/errors.go @@ -19,3 +19,6 @@ import "github.com/pkg/errors" // ErrAdvisorsDisabled means that advisors checks are disabled and can't be executed. var ErrAdvisorsDisabled = errors.New("Advisor checks are disabled") + +// ErrAlertingDisabled means Integrated Alerting is disabled and IA APIs can't be executed. +var ErrAlertingDisabled = errors.New("Alerting is disabled") diff --git a/managed/services/management/alerting/service.go b/managed/services/management/alerting/service.go index 3dd690d8e4..ff5453959a 100644 --- a/managed/services/management/alerting/service.go +++ b/managed/services/management/alerting/service.go @@ -480,6 +480,15 @@ func convertParamType(t alert.Type) alerting.ParamType { // ListTemplates returns a list of all collected Alert Rule Templates. func (s *Service) ListTemplates(ctx context.Context, req *alerting.ListTemplatesRequest) (*alerting.ListTemplatesResponse, error) { + settings, err := models.GetSettings(s.db) + if err != nil { + return nil, err + } + + if settings.Alerting.Disabled { + return nil, services.ErrAlertingDisabled + } + var pageIndex int var pageSize int if req.PageParams != nil { @@ -536,6 +545,15 @@ func (s *Service) ListTemplates(ctx context.Context, req *alerting.ListTemplates // CreateTemplate creates a new template. func (s *Service) CreateTemplate(ctx context.Context, req *alerting.CreateTemplateRequest) (*alerting.CreateTemplateResponse, error) { + settings, err := models.GetSettings(s.db) + if err != nil { + return nil, err + } + + if settings.Alerting.Disabled { + return nil, services.ErrAlertingDisabled + } + pParams := &alert.ParseParams{ DisallowUnknownFields: true, DisallowInvalidTemplates: true, @@ -579,6 +597,15 @@ func (s *Service) CreateTemplate(ctx context.Context, req *alerting.CreateTempla // UpdateTemplate updates existing template, previously created via API. func (s *Service) UpdateTemplate(ctx context.Context, req *alerting.UpdateTemplateRequest) (*alerting.UpdateTemplateResponse, error) { + settings, err := models.GetSettings(s.db) + if err != nil { + return nil, err + } + + if settings.Alerting.Disabled { + return nil, services.ErrAlertingDisabled + } + parseParams := &alert.ParseParams{ DisallowUnknownFields: true, DisallowInvalidTemplates: true, @@ -622,6 +649,15 @@ func (s *Service) UpdateTemplate(ctx context.Context, req *alerting.UpdateTempla // DeleteTemplate deletes existing, previously created via API. func (s *Service) DeleteTemplate(ctx context.Context, req *alerting.DeleteTemplateRequest) (*alerting.DeleteTemplateResponse, error) { + settings, err := models.GetSettings(s.db) + if err != nil { + return nil, err + } + + if settings.Alerting.Disabled { + return nil, services.ErrAlertingDisabled + } + e := s.db.InTransaction(func(tx *reform.TX) error { return models.RemoveTemplate(tx.Querier, req.Name) }) @@ -709,6 +745,15 @@ func convertParamDefinitions(l *logrus.Entry, params []alert.Parameter) ([]*aler // CreateRule creates alert rule from the given template. func (s *Service) CreateRule(ctx context.Context, req *alerting.CreateRuleRequest) (*alerting.CreateRuleResponse, error) { + settings, err := models.GetSettings(s.db) + if err != nil { + return nil, err + } + + if settings.Alerting.Disabled { + return nil, services.ErrAlertingDisabled + } + if req.TemplateName == "" { return nil, status.Error(codes.InvalidArgument, "Template name should be specified.") } From cd0e64aa15a5e406ef5642fd541ddae44c4a64f8 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 30 Jun 2023 18:04:45 +0200 Subject: [PATCH 11/22] PMM-11079 Fix tests --- managed/models/models_json_test.go | 12 +++++------- managed/models/models_test.go | 23 +++++++++++++++++------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/managed/models/models_json_test.go b/managed/models/models_json_test.go index 090067e332..0d26db01c1 100644 --- a/managed/models/models_json_test.go +++ b/managed/models/models_json_test.go @@ -27,20 +27,18 @@ import ( "github.com/percona/pmm/managed/utils/testdb" ) -func TestJSON(t *testing.T) { //nolint:tparallel +func TestJSON(t *testing.T) { + t.Parallel() + sqlDB := testdb.Open(t, models.SkipFixtures, nil) db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - agents, err := models.FindAgents(db.Querier, models.AgentFilters{AgentType: pointerToAgentType(models.PMMAgentType)}) - require.NoError(t, err) - require.NotEmpty(t, agents) - t.Run("Normal", func(t *testing.T) { t.Parallel() j1 := models.Job{ ID: "Normal", - PMMAgentID: agents[0].AgentID, + PMMAgentID: "test-agent", Data: &models.JobData{ MySQLBackup: &models.MySQLBackupJobData{ ServiceID: "test_service", @@ -61,7 +59,7 @@ func TestJSON(t *testing.T) { //nolint:tparallel t.Parallel() j1 := models.Job{ - PMMAgentID: agents[0].AgentID, + PMMAgentID: "test-agent", ID: "Nil", } err := db.Save(&j1) diff --git a/managed/models/models_test.go b/managed/models/models_test.go index 3a39b091d9..ed5a5a4f92 100644 --- a/managed/models/models_test.go +++ b/managed/models/models_test.go @@ -26,11 +26,13 @@ import ( ) func TestLabels(t *testing.T) { - var b []byte - var err error + t.Parallel() t.Run("Normal", func(t *testing.T) { - err = setLabels(map[string]string{"_1foo": "bar", "baz": " "}, &b) + t.Parallel() + + var b []byte + err := setLabels(map[string]string{"_1foo": "bar", "baz": " "}, &b) assert.NoError(t, err) assert.Equal(t, `{"_1foo":"bar","baz":""}`, string(b)) m, err := getLabels(b) @@ -39,7 +41,10 @@ func TestLabels(t *testing.T) { }) t.Run("Empty", func(t *testing.T) { - err = setLabels(make(map[string]string), &b) + t.Parallel() + + var b []byte + err := setLabels(make(map[string]string), &b) assert.NoError(t, err) assert.Nil(t, b) m, err := getLabels(b) @@ -48,12 +53,18 @@ func TestLabels(t *testing.T) { }) t.Run("Invalid", func(t *testing.T) { - err = setLabels(map[string]string{"1": "bar"}, &b) + t.Parallel() + + var b []byte + err := setLabels(map[string]string{"1": "bar"}, &b) tests.AssertGRPCError(t, status.New(codes.InvalidArgument, `Invalid label name "1".`), err) }) t.Run("Reserved", func(t *testing.T) { - err = setLabels(map[string]string{"__1": "bar"}, &b) + t.Parallel() + + var b []byte + err := setLabels(map[string]string{"__1": "bar"}, &b) tests.AssertGRPCError(t, status.New(codes.InvalidArgument, `Invalid label name "__1".`), err) }) } From 0ba46b16e848c987cb7282d361a45bb7f2c10050 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 30 Jun 2023 18:25:58 +0200 Subject: [PATCH 12/22] PMM-11079 Fix tests --- managed/models/settings_helpers_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/managed/models/settings_helpers_test.go b/managed/models/settings_helpers_test.go index a5c6f91946..a810559fda 100644 --- a/managed/models/settings_helpers_test.go +++ b/managed/models/settings_helpers_test.go @@ -343,12 +343,12 @@ func TestSettings(t *testing.T) { assert.True(t, ns.AccessControl.Enabled) }) - t.Run("enable percona alerting", func(t *testing.T) { + t.Run("disable percona alerting", func(t *testing.T) { s, err := models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{DisableAlerting: true}) require.NoError(t, err) - assert.False(t, s.Alerting.Disabled) + assert.True(t, s.Alerting.Disabled) - ns, err := models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{EnableAlerting: false}) + ns, err := models.UpdateSettings(sqlDB, &models.ChangeSettingsParams{EnableAlerting: true}) require.NoError(t, err) assert.False(t, ns.Alerting.Disabled) }) From b8a17a33e49ba251641da6ebc0b970e0e133a7fa Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 30 Jun 2023 18:33:44 +0200 Subject: [PATCH 13/22] PMM-11079 Fix tests --- managed/services/alertmanager/alertmanager_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/managed/services/alertmanager/alertmanager_test.go b/managed/services/alertmanager/alertmanager_test.go index 52cb990df0..9fe0e5ecd3 100644 --- a/managed/services/alertmanager/alertmanager_test.go +++ b/managed/services/alertmanager/alertmanager_test.go @@ -373,7 +373,6 @@ route: continue: false receivers: - name: empty - - name: disabled templates: [] `) + "\n" assert.Equal(t, expected, actual, "actual:\n%s", actual) From a0f774f3599e946aea17816935eb72ba161ab9c8 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 30 Jun 2023 18:52:46 +0200 Subject: [PATCH 14/22] PMM-11079 Fix tests --- managed/models/models_json_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/managed/models/models_json_test.go b/managed/models/models_json_test.go index 0d26db01c1..e23fd11dfc 100644 --- a/managed/models/models_json_test.go +++ b/managed/models/models_json_test.go @@ -28,8 +28,6 @@ import ( ) func TestJSON(t *testing.T) { - t.Parallel() - sqlDB := testdb.Open(t, models.SkipFixtures, nil) db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) From 86293d04113f8c267e863804a704589f0dc116bc Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 30 Jun 2023 18:56:43 +0200 Subject: [PATCH 15/22] PMM-11079 Hit CI From 34b82ca7d72918347629ec01b0d6a8d01ab695f0 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 30 Jun 2023 19:17:30 +0200 Subject: [PATCH 16/22] PMM-11079 Revert nolint --- managed/models/models_json_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/managed/models/models_json_test.go b/managed/models/models_json_test.go index e23fd11dfc..80e5c7a6d9 100644 --- a/managed/models/models_json_test.go +++ b/managed/models/models_json_test.go @@ -27,7 +27,7 @@ import ( "github.com/percona/pmm/managed/utils/testdb" ) -func TestJSON(t *testing.T) { +func TestJSON(t *testing.T) { //nolint:tparallel sqlDB := testdb.Open(t, models.SkipFixtures, nil) db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) From dfbd235a6a46745fc35c63aa419f8c8d3ee43a04 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 3 Jul 2023 11:41:10 +0200 Subject: [PATCH 17/22] PMM-11079 Remove IA migration script --- ia_migration.py | 149 ------------------------------------------------ 1 file changed, 149 deletions(-) delete mode 100755 ia_migration.py diff --git a/ia_migration.py b/ia_migration.py deleted file mode 100755 index 444796ea93..0000000000 --- a/ia_migration.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python3 -import argparse -import requests - -# Copyright (C) 2022 Percona LLC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details.# // -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - - -# This script migrates Integrated Alerting alert rules to the new Alerting system that was introduced in PMM 2.31 -# Migration is partial, it covers only alert rules but not Notification Channels, Silences, etc... - - -def remove_prefix(string, prefix): - if string.startswith(prefix): - return string[len(prefix):] - return string - - -def prepare_labels(rule): - custom_labels = rule.get("custom_labels", {}) - labels = rule.get("labels", {}) - labels.update(custom_labels) - labels.update({ - "percona_alerting": "1", - "severity": remove_prefix(rule.get("severity", ""), "SEVERITY_").lower(), - "template_name": rule.get("template_name", "") - }) - return labels - - -def prepare_annotations(rule): - annotations = rule.get("annotations", {}) - annotations.update({"rule": rule.get("name")}) - - return annotations - - -def prepare_expression(rule): - expr = rule.get("expr", "") - - if "filters" not in rule: - return expr - - for f in rule["filters"]: - key = f.get("key", "") - value = f.get("value", "") - expr = f'label_match({expr}, "{key}", "{value}")' - - return expr - - -def convert_rule(rule, datasource_uid): - return { - "grafana_alert": { - "title": rule.get("name", "") + "_" + rule.get("rule_id", ""), - "condition": "A", - "no_data_state": "OK", - "exec_err_state": "Alerting", - "data": [ - { - "refId": "A", - "datasourceUid": datasource_uid, - "relativeTimeRange": {"from": 600, "to": 0}, - "model": { - "expr": prepare_expression(rule), - "refId": "A", - "instant": True, - }, - }, - ] - }, - "for": rule.get("for"), - "annotations": prepare_annotations(rule), - "labels": prepare_labels(rule), - } - - -def main(): - parser = argparse.ArgumentParser(description="Migration script for Integrated Alerting alert rules") - parser.add_argument("-u", "--user", required=True, help="PMM user login") - parser.add_argument("-p", "--password", required=True, help="PMM user password") - parser.add_argument("-s", "--server-url", default="http://localhost/", help="PMM server URL (default: %(default)s)") - parser.add_argument("-i", "--insecure", action="store_false", help="skip TLS certificates verification") - parser.add_argument("-f", "--folder", default="Experimental", - help="folder in Grafana where to put migrated alert rules (default: %(default)s)") - parser.add_argument("-g", "--group", default="migrated", - help="alert group name for migrated alert rules (default: %(default)s)") - - config = vars(parser.parse_args()) - auth = (config["user"], config["password"]) - - # Get existing Integrated Alerting alert rules - print("Request existing IA rules.") - ia_rules_url = '{server_url}/v1/management/ia/Rules/List'.format(**config) - ia_rules_resp = requests.post(ia_rules_url, auth=auth, verify=config["insecure"]) - ia_rules = ia_rules_resp.json() - print("Request existing IA rules done.") - - if "rules" not in ia_rules: - print("There are no rules to migrate, exiting.") - return - - print("Found rules: {count}.".format(count=len(ia_rules["rules"]))) - - # Create alert group for migrated rules - print("Create alert group for migrated rules.") - group_url = '{server_url}/graph/api/ruler/grafana/api/v1/rules/{folder}/{group}'.format(**config) - group_resp = requests.get(group_url, auth=auth, verify=config["insecure"]) - alert_rules_group = group_resp.json() - print("Create alert group for migrated rules done.") - if "interval" not in alert_rules_group: - alert_rules_group["interval"] = "1m" - - # Get Metrics datasource UID - print("Get datasource UID.") - datasource_url = '{server_url}/graph/api/datasources/1'.format(**config) - datasource_resp = requests.get(datasource_url, auth=auth, verify=config["insecure"]) - datasource = datasource_resp.json() - datasource_uid = datasource["uid"] - print("Get datasource UID done.") - - # Convert IA rules and add them to alert group - print("Convert IA rules.") - for rule in ia_rules["rules"]: - alert_rules_group["rules"].append(convert_rule(rule, datasource_uid)) - print("Convert IA rules done.") - - # Update alert group - print("Send request to create migrated alerts.") - rules_url = '{server_url}/graph/api/ruler/grafana/api/v1/rules/{folder}'.format(**config) - resp = requests.post(rules_url, None, alert_rules_group, auth=auth, verify=config["insecure"]) - print("Send request to create migrated alerts done.") - print("Server response:") - print(resp.text) - - -if __name__ == "__main__": - main() From b8a7043f8d49fa4cd17032d2b4345641460ba14d Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 3 Jul 2023 11:43:18 +0200 Subject: [PATCH 18/22] PMM-11079 Cleanup --- api-tests/management/alerting/alerting_test.go | 6 +++--- api-tests/testdata/{ia => alerting}/invalid-template.yaml | 0 api-tests/testdata/{ia => alerting}/template.yaml | 0 managed/services/management/alerting/service_test.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) rename api-tests/testdata/{ia => alerting}/invalid-template.yaml (100%) rename api-tests/testdata/{ia => alerting}/template.yaml (100%) diff --git a/api-tests/management/alerting/alerting_test.go b/api-tests/management/alerting/alerting_test.go index f5116c8ffa..87ab23ff32 100644 --- a/api-tests/management/alerting/alerting_test.go +++ b/api-tests/management/alerting/alerting_test.go @@ -49,10 +49,10 @@ func TestAlertingAPI(t *testing.T) { t.Run("templates", func(t *testing.T) { t.Parallel() - templateData, err := os.ReadFile("../../testdata/ia/template.yaml") + templateData, err := os.ReadFile("../../testdata/alerting/template.yaml") require.NoError(t, err) - invalidTemplateData, err := os.ReadFile("../../testdata/ia/invalid-template.yaml") + invalidTemplateData, err := os.ReadFile("../../testdata/alerting/invalid-template.yaml") require.NoError(t, err) t.Run("add", func(t *testing.T) { @@ -637,7 +637,7 @@ func createAlertRuleParams(templateName, folderUID string, filter *alerting.Crea func createTemplate(t *testing.T) string { t.Helper() - b, err := os.ReadFile("../../testdata/ia/template.yaml") + b, err := os.ReadFile("../../testdata/alerting/template.yaml") require.NoError(t, err) templateName := uuid.New().String() diff --git a/api-tests/testdata/ia/invalid-template.yaml b/api-tests/testdata/alerting/invalid-template.yaml similarity index 100% rename from api-tests/testdata/ia/invalid-template.yaml rename to api-tests/testdata/alerting/invalid-template.yaml diff --git a/api-tests/testdata/ia/template.yaml b/api-tests/testdata/alerting/template.yaml similarity index 100% rename from api-tests/testdata/ia/template.yaml rename to api-tests/testdata/alerting/template.yaml diff --git a/managed/services/management/alerting/service_test.go b/managed/services/management/alerting/service_test.go index 4bf6094f24..9f69f8745d 100644 --- a/managed/services/management/alerting/service_test.go +++ b/managed/services/management/alerting/service_test.go @@ -35,9 +35,9 @@ import ( const ( devPlatformAddress = "https://check-dev.percona.com" devPlatformPublicKey = "RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX" - testBadTemplates = "../../../testdata/ia/bad" - testTemplates = "../../../testdata/ia/user2" - testTemplates2 = "../../../testdata/ia/user" + testBadTemplates = "../../../testdata/alerting/bad" + testTemplates = "../../../testdata/alerting/user2" + testTemplates2 = "../../../testdata/alerting/user" issuerURL = "https://id-dev.percona.com/oauth2/aus15pi5rjdtfrcH51d7/v1" ) From 7605d21031e475f62b5adfb38fc3bcff56d27b4e Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 3 Jul 2023 11:48:13 +0200 Subject: [PATCH 19/22] PMM-11079 Cleanup --- .../management/alerting/alerting_test.go | 6 +- api/swagger/swagger-dev-only.json | 13341 ---------------- managed/services/errors.go | 2 +- managed/services/server/deps.go | 2 +- managed/services/supervisord/supervisord.go | 1 - managed/testdata/supervisord.d/vmalert.ini | 1 - 6 files changed, 5 insertions(+), 13348 deletions(-) delete mode 100644 api/swagger/swagger-dev-only.json diff --git a/api-tests/management/alerting/alerting_test.go b/api-tests/management/alerting/alerting_test.go index 87ab23ff32..0a8c0e0d41 100644 --- a/api-tests/management/alerting/alerting_test.go +++ b/api-tests/management/alerting/alerting_test.go @@ -39,9 +39,9 @@ import ( "github.com/percona/pmm/managed/services/grafana" ) -// Note: Even though the IA services check for alerting enabled or disabled before returning results -// we don't enable or disable IA explicit in our tests since it is enabled by default through -// ENABLE_ALERTING env var. +// Note: Even though the Alerting service checks for alerting enabled or disabled before returning results +// we don't enable or disable Alerting explicit in our tests since it is enabled by default through +// DISABLE_ALERTING env var. func TestAlertingAPI(t *testing.T) { t.Parallel() client := alertingClient.Default.Alerting diff --git a/api/swagger/swagger-dev-only.json b/api/swagger/swagger-dev-only.json deleted file mode 100644 index bda80314e4..0000000000 --- a/api/swagger/swagger-dev-only.json +++ /dev/null @@ -1,13341 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "description": "This API is for development and testing purposes.", - "title": "PMM API", - "version": "develop" - }, - "paths": { - "/v0/qan/Filters/Get": { - "post": { - "tags": [ - "Filters" - ], - "summary": "Get gets map of metrics names.", - "operationId": "Get", - "parameters": [ - { - "description": "FiltersRequest contains period for which we need filters.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "FiltersRequest contains period for which we need filters.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "main_metric_name": { - "type": "string", - "x-order": 2 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "FiltersReply is map of labels for given period by key.\nKey is label's name and value is label's value and how many times it occur.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "description": "ListLabels is list of label's values: duplicates are impossible.", - "type": "object", - "properties": { - "name": { - "type": "array", - "items": { - "description": "Values is label values and main metric percent and per second.", - "type": "object", - "properties": { - "value": { - "type": "string", - "x-order": 0 - }, - "main_metric_percent": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "main_metric_per_sec": { - "type": "number", - "format": "float", - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/GetMetricsNames": { - "post": { - "tags": [ - "MetricsNames" - ], - "summary": "GetMetricsNames gets map of metrics names.", - "operationId": "GetMetricsNames", - "parameters": [ - { - "description": "MetricsNamesRequest is emty.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsNamesRequest is emty.", - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "MetricsNamesReply is map of stored metrics:\nkey is root of metric name in db (Ex:. [m_]query_time[_sum]);\nvalue - Human readable name of metrics.", - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/GetReport": { - "post": { - "tags": [ - "Profile" - ], - "summary": "GetReport returns list of metrics group by queryid or other dimentions.", - "operationId": "GetReport", - "parameters": [ - { - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ReportRequest defines filtering of metrics report for db server or other dimentions.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "group_by": { - "type": "string", - "x-order": 2 - }, - "labels": { - "type": "array", - "items": { - "description": "ReportMapFieldEntry allows to pass labels/dimentions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "columns": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 4 - }, - "order_by": { - "type": "string", - "x-order": 5 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "main_metric": { - "type": "string", - "x-order": 8 - }, - "search": { - "type": "string", - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ReportReply is list of reports per quieryids, hosts etc.", - "type": "object", - "properties": { - "total_rows": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 2 - }, - "rows": { - "type": "array", - "items": { - "description": "Row define metrics for selected dimention.", - "type": "object", - "properties": { - "rank": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "dimension": { - "type": "string", - "x-order": 1 - }, - "database": { - "type": "string", - "x-order": 2 - }, - "metrics": { - "type": "object", - "additionalProperties": { - "description": "Metric cell.", - "type": "object", - "properties": { - "stats": { - "description": "Stat is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "sum_per_sec": { - "type": "number", - "format": "float", - "x-order": 7 - } - }, - "x-order": 0 - } - } - }, - "x-order": 3 - }, - "sparkline": { - "type": "array", - "items": { - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines.", - "type": "object", - "properties": { - "point": { - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "time_frame": { - "description": "Duration beetween two points.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "timestamp": { - "description": "Time of point in format RFC3339.", - "type": "string", - "x-order": 2 - }, - "load": { - "description": "load is query_time / time_range.", - "type": "number", - "format": "float", - "x-order": 3 - }, - "num_queries_per_sec": { - "description": "number of queries in bucket.", - "type": "number", - "format": "float", - "x-order": 4 - }, - "num_queries_with_errors_per_sec": { - "description": "number of queries with errors.", - "type": "number", - "format": "float", - "x-order": 5 - }, - "num_queries_with_warnings_per_sec": { - "description": "number of queries with warnings.", - "type": "number", - "format": "float", - "x-order": 6 - }, - "m_query_time_sum_per_sec": { - "description": "The statement execution time in seconds.", - "type": "number", - "format": "float", - "x-order": 7 - }, - "m_lock_time_sum_per_sec": { - "description": "The time to acquire locks in seconds.", - "type": "number", - "format": "float", - "x-order": 8 - }, - "m_rows_sent_sum_per_sec": { - "description": "The number of rows sent to the client.", - "type": "number", - "format": "float", - "x-order": 9 - }, - "m_rows_examined_sum_per_sec": { - "description": "Number of rows scanned - SELECT.", - "type": "number", - "format": "float", - "x-order": 10 - }, - "m_rows_affected_sum_per_sec": { - "description": "Number of rows changed - UPDATE, DELETE, INSERT.", - "type": "number", - "format": "float", - "x-order": 11 - }, - "m_rows_read_sum_per_sec": { - "description": "The number of rows read from tables.", - "type": "number", - "format": "float", - "x-order": 12 - }, - "m_merge_passes_sum_per_sec": { - "description": "The number of merge passes that the sort algorithm has had to do.", - "type": "number", - "format": "float", - "x-order": 13 - }, - "m_innodb_io_r_ops_sum_per_sec": { - "description": "Counts the number of page read operations scheduled.", - "type": "number", - "format": "float", - "x-order": 14 - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "description": "Similar to innodb_IO_r_ops, but the unit is bytes.", - "type": "number", - "format": "float", - "x-order": 15 - }, - "m_innodb_io_r_wait_sum_per_sec": { - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage.", - "type": "number", - "format": "float", - "x-order": 16 - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query waited for row locks.", - "type": "number", - "format": "float", - "x-order": 17 - }, - "m_innodb_queue_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution.", - "type": "number", - "format": "float", - "x-order": 18 - }, - "m_innodb_pages_distinct_sum_per_sec": { - "description": "Counts approximately the number of unique pages the query accessed.", - "type": "number", - "format": "float", - "x-order": 19 - }, - "m_query_length_sum_per_sec": { - "description": "Shows how long the query is.", - "type": "number", - "format": "float", - "x-order": 20 - }, - "m_bytes_sent_sum_per_sec": { - "description": "The number of bytes sent to all clients.", - "type": "number", - "format": "float", - "x-order": 21 - }, - "m_tmp_tables_sum_per_sec": { - "description": "Number of temporary tables created on memory for the query.", - "type": "number", - "format": "float", - "x-order": 22 - }, - "m_tmp_disk_tables_sum_per_sec": { - "description": "Number of temporary tables created on disk for the query.", - "type": "number", - "format": "float", - "x-order": 23 - }, - "m_tmp_table_sizes_sum_per_sec": { - "description": "Total Size in bytes for all temporary tables used in the query.", - "type": "number", - "format": "float", - "x-order": 24 - }, - "m_qc_hit_sum_per_sec": { - "description": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery Cache hits.", - "type": "number", - "format": "float", - "x-order": 25 - }, - "m_full_scan_sum_per_sec": { - "description": "The query performed a full table scan.", - "type": "number", - "format": "float", - "x-order": 26 - }, - "m_full_join_sum_per_sec": { - "description": "The query performed a full join (a join without indexes).", - "type": "number", - "format": "float", - "x-order": 27 - }, - "m_tmp_table_sum_per_sec": { - "description": "The query created an implicit internal temporary table.", - "type": "number", - "format": "float", - "x-order": 28 - }, - "m_tmp_table_on_disk_sum_per_sec": { - "description": "The querys temporary table was stored on disk.", - "type": "number", - "format": "float", - "x-order": 29 - }, - "m_filesort_sum_per_sec": { - "description": "The query used a filesort.", - "type": "number", - "format": "float", - "x-order": 30 - }, - "m_filesort_on_disk_sum_per_sec": { - "description": "The filesort was performed on disk.", - "type": "number", - "format": "float", - "x-order": 31 - }, - "m_select_full_range_join_sum_per_sec": { - "description": "The number of joins that used a range search on a reference table.", - "type": "number", - "format": "float", - "x-order": 32 - }, - "m_select_range_sum_per_sec": { - "description": "The number of joins that used ranges on the first table.", - "type": "number", - "format": "float", - "x-order": 33 - }, - "m_select_range_check_sum_per_sec": { - "description": "The number of joins without keys that check for key usage after each row.", - "type": "number", - "format": "float", - "x-order": 34 - }, - "m_sort_range_sum_per_sec": { - "description": "The number of sorts that were done using ranges.", - "type": "number", - "format": "float", - "x-order": 35 - }, - "m_sort_rows_sum_per_sec": { - "description": "The number of sorted rows.", - "type": "number", - "format": "float", - "x-order": 36 - }, - "m_sort_scan_sum_per_sec": { - "description": "The number of sorts that were done by scanning the table.", - "type": "number", - "format": "float", - "x-order": 37 - }, - "m_no_index_used_sum_per_sec": { - "description": "The number of queries without index.", - "type": "number", - "format": "float", - "x-order": 38 - }, - "m_no_good_index_used_sum_per_sec": { - "description": "The number of queries without good index.", - "type": "number", - "format": "float", - "x-order": 39 - }, - "m_docs_returned_sum_per_sec": { - "description": "MongoDB metrics.\n\nThe number of returned documents.", - "type": "number", - "format": "float", - "x-order": 40 - }, - "m_response_length_sum_per_sec": { - "description": "The response length of the query result in bytes.", - "type": "number", - "format": "float", - "x-order": 41 - }, - "m_docs_scanned_sum_per_sec": { - "description": "The number of scanned documents.", - "type": "number", - "format": "float", - "x-order": 42 - }, - "m_shared_blks_hit_sum_per_sec": { - "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "m_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 53 - }, - "m_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 54 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "title": "pg_stat_monitor 0.9 metrics", - "x-order": 57 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 58 - }, - "m_wal_fpi_sum_per_sec": { - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 59 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 61 - } - } - }, - "x-order": 4 - }, - "fingerprint": { - "type": "string", - "x-order": 5 - }, - "num_queries": { - "type": "integer", - "format": "int64", - "x-order": 6 - }, - "qps": { - "type": "number", - "format": "float", - "x-order": 7 - }, - "load": { - "type": "number", - "format": "float", - "x-order": 8 - } - } - }, - "x-order": 3 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/ExplainFingerprintByQueryID": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "ExplainFingerprintByQueryID get explain fingerprint for given query ID.", - "operationId": "ExplainFingerprintByQueryID", - "parameters": [ - { - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID.", - "type": "object", - "properties": { - "serviceid": { - "type": "string", - "x-order": 0 - }, - "query_id": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ExplainFingerprintByQueryIDReply is explain fingerprint and placeholders count for given query ID.", - "type": "object", - "properties": { - "explain_fingerprint": { - "type": "string", - "x-order": 0 - }, - "placeholders_count": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetHistogram": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetHistogram gets histogram items for specific filtering.", - "operationId": "GetHistogram", - "parameters": [ - { - "description": "HistogramRequest defines filtering by time range, labels and queryid.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "HistogramRequest defines filtering by time range, labels and queryid.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 2 - }, - "queryid": { - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "HistogramReply is histogram items as a list.", - "type": "object", - "properties": { - "histogram_items": { - "type": "array", - "items": { - "description": "HistogramItem represents one item in histogram.", - "type": "object", - "properties": { - "range": { - "type": "string", - "x-order": 0 - }, - "frequency": { - "type": "integer", - "format": "int64", - "x-order": 1 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetLabels": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetLabels gets list of labels for object details.", - "operationId": "GetLabels", - "parameters": [ - { - "description": "ObjectDetailsLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ObjectDetailsLabelsRequest defines filtering of object detail's labels for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "ObjectDetailsLabelsReply is a map of labels names as keys and labels values as a list.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "description": "ListLabelValues is list of label's values.", - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetMetrics": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetMetrics gets map of metrics for specific filtering.", - "operationId": "GetMetrics", - "parameters": [ - { - "description": "MetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "include_only_fields": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "totals": { - "type": "boolean", - "title": "retrieve only values for totals, excluding N/A values", - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "MetricsReply defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "metrics": { - "type": "object", - "additionalProperties": { - "description": "MetricValues is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "percent_of_total": { - "type": "number", - "format": "float", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "text_metrics": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 1 - }, - "sparkline": { - "type": "array", - "items": { - "description": "Point contains values that represents abscissa (time) and ordinate (volume etc.)\nof every point in a coordinate system of Sparklines.", - "type": "object", - "properties": { - "point": { - "description": "The serial number of the chart point from the largest time in the time interval to the lowest time in the time range.", - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "time_frame": { - "description": "Duration beetween two points.", - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "timestamp": { - "description": "Time of point in format RFC3339.", - "type": "string", - "x-order": 2 - }, - "load": { - "description": "load is query_time / time_range.", - "type": "number", - "format": "float", - "x-order": 3 - }, - "num_queries_per_sec": { - "description": "number of queries in bucket.", - "type": "number", - "format": "float", - "x-order": 4 - }, - "num_queries_with_errors_per_sec": { - "description": "number of queries with errors.", - "type": "number", - "format": "float", - "x-order": 5 - }, - "num_queries_with_warnings_per_sec": { - "description": "number of queries with warnings.", - "type": "number", - "format": "float", - "x-order": 6 - }, - "m_query_time_sum_per_sec": { - "description": "The statement execution time in seconds.", - "type": "number", - "format": "float", - "x-order": 7 - }, - "m_lock_time_sum_per_sec": { - "description": "The time to acquire locks in seconds.", - "type": "number", - "format": "float", - "x-order": 8 - }, - "m_rows_sent_sum_per_sec": { - "description": "The number of rows sent to the client.", - "type": "number", - "format": "float", - "x-order": 9 - }, - "m_rows_examined_sum_per_sec": { - "description": "Number of rows scanned - SELECT.", - "type": "number", - "format": "float", - "x-order": 10 - }, - "m_rows_affected_sum_per_sec": { - "description": "Number of rows changed - UPDATE, DELETE, INSERT.", - "type": "number", - "format": "float", - "x-order": 11 - }, - "m_rows_read_sum_per_sec": { - "description": "The number of rows read from tables.", - "type": "number", - "format": "float", - "x-order": 12 - }, - "m_merge_passes_sum_per_sec": { - "description": "The number of merge passes that the sort algorithm has had to do.", - "type": "number", - "format": "float", - "x-order": 13 - }, - "m_innodb_io_r_ops_sum_per_sec": { - "description": "Counts the number of page read operations scheduled.", - "type": "number", - "format": "float", - "x-order": 14 - }, - "m_innodb_io_r_bytes_sum_per_sec": { - "description": "Similar to innodb_IO_r_ops, but the unit is bytes.", - "type": "number", - "format": "float", - "x-order": 15 - }, - "m_innodb_io_r_wait_sum_per_sec": { - "description": "Shows how long (in seconds) it took InnoDB to actually read the data from storage.", - "type": "number", - "format": "float", - "x-order": 16 - }, - "m_innodb_rec_lock_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query waited for row locks.", - "type": "number", - "format": "float", - "x-order": 17 - }, - "m_innodb_queue_wait_sum_per_sec": { - "description": "Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution.", - "type": "number", - "format": "float", - "x-order": 18 - }, - "m_innodb_pages_distinct_sum_per_sec": { - "description": "Counts approximately the number of unique pages the query accessed.", - "type": "number", - "format": "float", - "x-order": 19 - }, - "m_query_length_sum_per_sec": { - "description": "Shows how long the query is.", - "type": "number", - "format": "float", - "x-order": 20 - }, - "m_bytes_sent_sum_per_sec": { - "description": "The number of bytes sent to all clients.", - "type": "number", - "format": "float", - "x-order": 21 - }, - "m_tmp_tables_sum_per_sec": { - "description": "Number of temporary tables created on memory for the query.", - "type": "number", - "format": "float", - "x-order": 22 - }, - "m_tmp_disk_tables_sum_per_sec": { - "description": "Number of temporary tables created on disk for the query.", - "type": "number", - "format": "float", - "x-order": 23 - }, - "m_tmp_table_sizes_sum_per_sec": { - "description": "Total Size in bytes for all temporary tables used in the query.", - "type": "number", - "format": "float", - "x-order": 24 - }, - "m_qc_hit_sum_per_sec": { - "description": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery Cache hits.", - "type": "number", - "format": "float", - "x-order": 25 - }, - "m_full_scan_sum_per_sec": { - "description": "The query performed a full table scan.", - "type": "number", - "format": "float", - "x-order": 26 - }, - "m_full_join_sum_per_sec": { - "description": "The query performed a full join (a join without indexes).", - "type": "number", - "format": "float", - "x-order": 27 - }, - "m_tmp_table_sum_per_sec": { - "description": "The query created an implicit internal temporary table.", - "type": "number", - "format": "float", - "x-order": 28 - }, - "m_tmp_table_on_disk_sum_per_sec": { - "description": "The querys temporary table was stored on disk.", - "type": "number", - "format": "float", - "x-order": 29 - }, - "m_filesort_sum_per_sec": { - "description": "The query used a filesort.", - "type": "number", - "format": "float", - "x-order": 30 - }, - "m_filesort_on_disk_sum_per_sec": { - "description": "The filesort was performed on disk.", - "type": "number", - "format": "float", - "x-order": 31 - }, - "m_select_full_range_join_sum_per_sec": { - "description": "The number of joins that used a range search on a reference table.", - "type": "number", - "format": "float", - "x-order": 32 - }, - "m_select_range_sum_per_sec": { - "description": "The number of joins that used ranges on the first table.", - "type": "number", - "format": "float", - "x-order": 33 - }, - "m_select_range_check_sum_per_sec": { - "description": "The number of joins without keys that check for key usage after each row.", - "type": "number", - "format": "float", - "x-order": 34 - }, - "m_sort_range_sum_per_sec": { - "description": "The number of sorts that were done using ranges.", - "type": "number", - "format": "float", - "x-order": 35 - }, - "m_sort_rows_sum_per_sec": { - "description": "The number of sorted rows.", - "type": "number", - "format": "float", - "x-order": 36 - }, - "m_sort_scan_sum_per_sec": { - "description": "The number of sorts that were done by scanning the table.", - "type": "number", - "format": "float", - "x-order": 37 - }, - "m_no_index_used_sum_per_sec": { - "description": "The number of queries without index.", - "type": "number", - "format": "float", - "x-order": 38 - }, - "m_no_good_index_used_sum_per_sec": { - "description": "The number of queries without good index.", - "type": "number", - "format": "float", - "x-order": 39 - }, - "m_docs_returned_sum_per_sec": { - "description": "MongoDB metrics.\n\nThe number of returned documents.", - "type": "number", - "format": "float", - "x-order": 40 - }, - "m_response_length_sum_per_sec": { - "description": "The response length of the query result in bytes.", - "type": "number", - "format": "float", - "x-order": 41 - }, - "m_docs_scanned_sum_per_sec": { - "description": "The number of scanned documents.", - "type": "number", - "format": "float", - "x-order": 42 - }, - "m_shared_blks_hit_sum_per_sec": { - "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "m_blk_read_time_sum_per_sec": { - "description": "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 53 - }, - "m_blk_write_time_sum_per_sec": { - "description": "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero).", - "type": "number", - "format": "float", - "x-order": 54 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "title": "pg_stat_monitor 0.9 metrics", - "x-order": 57 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 58 - }, - "m_wal_fpi_sum_per_sec": { - "description": "Total number of FPI (full page images) in WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 59 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 61 - } - } - }, - "x-order": 2 - }, - "totals": { - "type": "object", - "additionalProperties": { - "description": "MetricValues is statistics of specific metric.", - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "float", - "x-order": 0 - }, - "cnt": { - "type": "number", - "format": "float", - "x-order": 1 - }, - "sum": { - "type": "number", - "format": "float", - "x-order": 2 - }, - "min": { - "type": "number", - "format": "float", - "x-order": 3 - }, - "max": { - "type": "number", - "format": "float", - "x-order": 4 - }, - "avg": { - "type": "number", - "format": "float", - "x-order": 5 - }, - "p99": { - "type": "number", - "format": "float", - "x-order": 6 - }, - "percent_of_total": { - "type": "number", - "format": "float", - "x-order": 7 - } - } - }, - "x-order": 3 - }, - "fingerprint": { - "type": "string", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetQueryExample": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetQueryExample gets list of query examples.", - "operationId": "GetQueryExample", - "parameters": [ - { - "description": "QueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryExampleRequest defines filtering of query examples for specific value of\ndimension (ex.: host=hostname1 or queryid=1D410B4BE5060972.", - "type": "object", - "properties": { - "period_start_from": { - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "period_start_to": { - "type": "string", - "format": "date-time", - "x-order": 1 - }, - "filter_by": { - "description": "dimension value: ex: queryid - 1D410B4BE5060972.", - "type": "string", - "x-order": 2 - }, - "group_by": { - "description": "one of dimension: queryid | host ...", - "type": "string", - "x-order": 3 - }, - "labels": { - "type": "array", - "items": { - "description": "MapFieldEntry allows to pass labels/dimensions in form like {\"server\": [\"db1\", \"db2\"...]}.", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - } - }, - "x-order": 4 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "QueryExampleReply list of query examples.", - "type": "object", - "properties": { - "query_examples": { - "type": "array", - "items": { - "description": "QueryExample shows query examples and their metrics.", - "type": "object", - "properties": { - "example": { - "type": "string", - "x-order": 0 - }, - "example_format": { - "description": "ExampleFormat is format of query example: real or query without values.\n\nDeprecated: is not used, should not be used, should be removed.", - "type": "string", - "default": "EXAMPLE_FORMAT_INVALID", - "enum": [ - "EXAMPLE_FORMAT_INVALID", - "EXAMPLE", - "FINGERPRINT" - ], - "x-order": 1 - }, - "example_type": { - "description": "ExampleType is a type of query example selected for this query class in given period of time.", - "type": "string", - "default": "EXAMPLE_TYPE_INVALID", - "enum": [ - "EXAMPLE_TYPE_INVALID", - "RANDOM", - "SLOWEST", - "FASTEST", - "WITH_ERROR" - ], - "x-order": 2 - }, - "is_truncated": { - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "placeholders_count": { - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "explain_fingerprint": { - "type": "string", - "x-order": 5 - }, - "query_id": { - "type": "string", - "x-order": 6 - }, - "example_metrics": { - "type": "string", - "x-order": 7 - }, - "service_id": { - "type": "string", - "x-order": 8 - }, - "service_type": { - "type": "string", - "x-order": 9 - }, - "schema": { - "type": "string", - "x-order": 10 - }, - "tables": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 11 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetQueryPlan": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetQueryPlan gets query plan and plan id for specific filtering.", - "operationId": "GetQueryPlan", - "parameters": [ - { - "description": "QueryPlanRequest defines filtering by queryid.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryPlanRequest defines filtering by queryid.", - "type": "object", - "properties": { - "queryid": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "QueryPlanReply contains planid and query_plan.", - "type": "object", - "properties": { - "planid": { - "type": "string", - "x-order": 0 - }, - "query_plan": { - "type": "string", - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/QueryExists": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "QueryExists check if query exists in clickhouse.", - "operationId": "QueryExists", - "parameters": [ - { - "description": "QueryExistsRequest check if provided query exists or not.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryExistsRequest check if provided query exists or not.", - "type": "object", - "properties": { - "serviceid": { - "type": "string", - "x-order": 0 - }, - "query": { - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "boolean" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/Connect": { - "post": { - "description": "Connect a PMM server to the organization created on Percona Portal. That allows the user to sign in to the PMM server with their Percona Account.", - "tags": [ - "Platform" - ], - "summary": "Connect", - "operationId": "Connect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "server_name": { - "description": "User defined human readable PMM Server Name.", - "type": "string", - "x-order": 0 - }, - "email": { - "description": "Existing Percona Platform user's email.", - "type": "string", - "x-order": 1 - }, - "password": { - "description": "Existing Percona Platform user's password.", - "type": "string", - "x-order": 2 - }, - "personal_access_token": { - "description": "Personal Access Token that the user obtains from Percona Portal.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/Disconnect": { - "post": { - "description": "Disconnect a PMM server from the organization created on Percona Portal.", - "tags": [ - "Platform" - ], - "summary": "Disconnect", - "operationId": "Disconnect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "force": { - "type": "boolean", - "title": "Forces the cleanup process for connected PMM instances regardless of the Portal API response", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/GetContactInformation": { - "post": { - "description": "GetContactInformation fetches the contact details of the customer success employee handling the Percona customer account from Percona Platform.", - "tags": [ - "Platform" - ], - "summary": "GetContactInformation", - "operationId": "GetContactInformation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "customer_success": { - "description": "CustomerSuccess contains the contanct details of the customer success employee assigned to a customer's account.", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - }, - "email": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "new_ticket_url": { - "description": "URL to open a new support ticket.", - "type": "string", - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/SearchOrganizationEntitlements": { - "post": { - "description": "SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to.", - "tags": [ - "Platform" - ], - "summary": "SearchOrganizationEntitlements", - "operationId": "SearchOrganizationEntitlements", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "entitlements": { - "type": "array", - "items": { - "description": "OrganizationEntitlement contains information about Organization entitlement.", - "type": "object", - "properties": { - "number": { - "description": "Entitlement number.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Entitlement name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Entitlement short summary.", - "type": "string", - "x-order": 2 - }, - "tier": { - "description": "Entitlement tier.", - "type": "string", - "x-order": 3 - }, - "total_units": { - "description": "Total units covered by this entitlement.", - "type": "string", - "x-order": 4 - }, - "unlimited_units": { - "description": "Flag indicates that unlimited units are covered.", - "type": "boolean", - "x-order": 5 - }, - "support_level": { - "description": "Support level covered by this entitlement.", - "type": "string", - "x-order": 6 - }, - "software_families": { - "description": "Percona product families covered by this entitlement.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 7 - }, - "start_date": { - "description": "Entitlement start data.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 8 - }, - "end_date": { - "description": "Entitlement end date.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "platform": { - "description": "Platform indicates platform specific entitlements.", - "type": "object", - "properties": { - "security_advisor": { - "description": "Flag indicates that security advisors are covered by this entitlement.", - "type": "string", - "x-order": 0 - }, - "config_advisor": { - "description": "Flag indicates that config advisors are covered by this entitlement.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/SearchOrganizationTickets": { - "post": { - "description": "SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", - "tags": [ - "Platform" - ], - "summary": "SearchOrganizationTickets", - "operationId": "SearchOrganizationTickets", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "tickets": { - "description": "Support tickets belonging to the Percona Portal Organization.", - "type": "array", - "items": { - "description": "OrganizationTicket contains information about the support ticket.", - "type": "object", - "properties": { - "number": { - "description": "Ticket number.", - "type": "string", - "x-order": 0 - }, - "short_description": { - "description": "Ticket short description.", - "type": "string", - "x-order": 1 - }, - "priority": { - "description": "Ticket priority.", - "type": "string", - "x-order": 2 - }, - "state": { - "description": "Ticket state.", - "type": "string", - "x-order": 3 - }, - "create_time": { - "description": "Ticket creation time.", - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "department": { - "description": "Department.", - "type": "string", - "x-order": 5 - }, - "requester": { - "description": "Ticket requester.", - "type": "string", - "x-order": 6 - }, - "task_type": { - "description": "Task type.", - "type": "string", - "x-order": 7 - }, - "url": { - "description": "Ticket url.", - "type": "string", - "x-order": 8 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/ServerInfo": { - "post": { - "description": "ServerInfo returns PMM server ID and name.", - "tags": [ - "Platform" - ], - "summary": "ServerInfo", - "operationId": "ServerInfo", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_server_name": { - "type": "string", - "x-order": 0 - }, - "pmm_server_id": { - "type": "string", - "x-order": 1 - }, - "pmm_server_telemetry_id": { - "type": "string", - "x-order": 2 - }, - "connected_to_portal": { - "type": "boolean", - "x-order": 3 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/UserStatus": { - "post": { - "description": "UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not.", - "tags": [ - "Platform" - ], - "summary": "UserStatus", - "operationId": "UserStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "is_platform_user": { - "type": "boolean", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/ChangePSMDB": { - "post": { - "tags": [ - "Components" - ], - "summary": "ChangePSMDBComponents manages PSMDB related components.", - "operationId": "ChangePSMDBComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "mongod": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/ChangePXC": { - "post": { - "tags": [ - "Components" - ], - "summary": "ChangePXCComponents manages PXC related components.", - "operationId": "ChangePXCComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "pxc": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/CheckForOperatorUpdate": { - "post": { - "tags": [ - "Components" - ], - "summary": "CheckForOperatorUpdate checks if a new version of an operator is available.", - "operationId": "CheckForOperatorUpdate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "cluster_to_components": { - "description": "The cluster name is used as a key for this map, value contains components and their inforamtion about update.", - "type": "object", - "additionalProperties": { - "description": "ComponentsUpdateInformation contains info about components and their available latest versions.", - "type": "object", - "properties": { - "component_to_update_information": { - "description": "component_to_update_information stores, under the name of the component, information about the update.\n\"pxc-operator\", \"psmdb-operator\" are names used by backend for our operators.", - "type": "object", - "additionalProperties": { - "description": "ComponentUpdateInformation contains version we can update to for certain component.", - "type": "object", - "properties": { - "available_version": { - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/GetPSMDB": { - "post": { - "tags": [ - "Components" - ], - "summary": "GetPSMDBComponents returns list of available components for PSMDB Clusters.", - "operationId": "GetPSMDBComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "db_version": { - "description": "Version of DB.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "versions": { - "type": "array", - "items": { - "description": "OperatorVersion contains information about operator and components matrix.", - "type": "object", - "properties": { - "product": { - "type": "string", - "x-order": 0 - }, - "operator": { - "type": "string", - "x-order": 1 - }, - "matrix": { - "description": "Matrix contains all available components.", - "type": "object", - "properties": { - "mongod": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 0 - }, - "pxc": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 1 - }, - "pmm": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 4 - }, - "backup": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 5 - }, - "operator": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 6 - }, - "log_collector": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 7 - } - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/GetPXC": { - "post": { - "tags": [ - "Components" - ], - "summary": "GetPXCComponents returns list of available components for PXC Clusters.", - "operationId": "GetPXCComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "db_version": { - "description": "Version of DB.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "versions": { - "type": "array", - "items": { - "description": "OperatorVersion contains information about operator and components matrix.", - "type": "object", - "properties": { - "product": { - "type": "string", - "x-order": 0 - }, - "operator": { - "type": "string", - "x-order": 1 - }, - "matrix": { - "description": "Matrix contains all available components.", - "type": "object", - "properties": { - "mongod": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 0 - }, - "pxc": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 1 - }, - "pmm": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 4 - }, - "backup": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 5 - }, - "operator": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 6 - }, - "log_collector": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 7 - } - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/InstallOperator": { - "post": { - "tags": [ - "Components" - ], - "summary": "InstallOperator installs given operator in given version.", - "operationId": "InstallOperator", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "operator_type": { - "description": "operator_type tells what operator we are interested in updating.", - "type": "string", - "x-order": 1 - }, - "version": { - "description": "version tells what version of the operator we should update to.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Delete": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "DeleteDBCluster deletes DB cluster.", - "operationId": "DeleteDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "DB cluster name.", - "type": "string", - "x-order": 1 - }, - "cluster_type": { - "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", - "type": "string", - "default": "DB_CLUSTER_TYPE_INVALID", - "enum": [ - "DB_CLUSTER_TYPE_INVALID", - "DB_CLUSTER_TYPE_PXC", - "DB_CLUSTER_TYPE_PSMDB" - ], - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Get": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "GetDBCluster returns parameters used to create a database cluster", - "operationId": "GetDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "DB cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pxc_cluster": { - "description": "PXCCluster represents PXC cluster information.", - "type": "object", - "properties": { - "name": { - "description": "Cluster name.", - "type": "string", - "x-order": 0 - }, - "state": { - "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", - "type": "string", - "default": "DB_CLUSTER_STATE_INVALID", - "enum": [ - "DB_CLUSTER_STATE_INVALID", - "DB_CLUSTER_STATE_CHANGING", - "DB_CLUSTER_STATE_READY", - "DB_CLUSTER_STATE_FAILED", - "DB_CLUSTER_STATE_DELETING", - "DB_CLUSTER_STATE_PAUSED", - "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 - }, - "operation": { - "description": "RunningOperation respresents a long-running operation.", - "type": "object", - "properties": { - "finished_steps": { - "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "description": "Text describing the current operation progress step.", - "type": "string", - "x-order": 1 - }, - "total_steps": { - "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 2 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 4 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "destination": { - "type": "string", - "title": "Destination filename", - "x-order": 1 - } - }, - "x-order": 5 - } - }, - "x-order": 3 - }, - "exposed": { - "description": "DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 4 - }, - "installed_image": { - "description": "Installed XtraDB image.", - "type": "string", - "x-order": 5 - }, - "available_image": { - "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", - "type": "string", - "x-order": 6 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "psmdb_cluster": { - "description": "PSMDBCluster represents PSMDB cluster information.", - "type": "object", - "properties": { - "name": { - "description": "Cluster name.", - "type": "string", - "x-order": 0 - }, - "state": { - "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", - "type": "string", - "default": "DB_CLUSTER_STATE_INVALID", - "enum": [ - "DB_CLUSTER_STATE_INVALID", - "DB_CLUSTER_STATE_CHANGING", - "DB_CLUSTER_STATE_READY", - "DB_CLUSTER_STATE_FAILED", - "DB_CLUSTER_STATE_DELETING", - "DB_CLUSTER_STATE_PAUSED", - "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 - }, - "operation": { - "description": "RunningOperation respresents a long-running operation.", - "type": "object", - "properties": { - "finished_steps": { - "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "description": "Text describing the current operation progress step.", - "type": "string", - "x-order": 1 - }, - "total_steps": { - "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 2 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "destination": { - "type": "string", - "title": "Destination filename", - "x-order": 1 - } - }, - "x-order": 4 - } - }, - "x-order": 3 - }, - "exposed": { - "description": "DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 4 - }, - "installed_image": { - "description": "Installed PSMDB image.", - "type": "string", - "x-order": 5 - }, - "available_image": { - "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", - "type": "string", - "x-order": 6 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 8 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/List": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "ListDBClusters returns a list of DB clusters.", - "operationId": "ListDBClusters", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pxc_clusters": { - "description": "PXC clusters information.", - "type": "array", - "items": { - "description": "PXCCluster represents PXC cluster information.", - "type": "object", - "properties": { - "name": { - "description": "Cluster name.", - "type": "string", - "x-order": 0 - }, - "state": { - "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", - "type": "string", - "default": "DB_CLUSTER_STATE_INVALID", - "enum": [ - "DB_CLUSTER_STATE_INVALID", - "DB_CLUSTER_STATE_CHANGING", - "DB_CLUSTER_STATE_READY", - "DB_CLUSTER_STATE_FAILED", - "DB_CLUSTER_STATE_DELETING", - "DB_CLUSTER_STATE_PAUSED", - "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 - }, - "operation": { - "description": "RunningOperation respresents a long-running operation.", - "type": "object", - "properties": { - "finished_steps": { - "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "description": "Text describing the current operation progress step.", - "type": "string", - "x-order": 1 - }, - "total_steps": { - "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 2 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 4 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "destination": { - "type": "string", - "title": "Destination filename", - "x-order": 1 - } - }, - "x-order": 5 - } - }, - "x-order": 3 - }, - "exposed": { - "description": "DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 4 - }, - "installed_image": { - "description": "Installed XtraDB image.", - "type": "string", - "x-order": 5 - }, - "available_image": { - "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", - "type": "string", - "x-order": 6 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 8 - } - } - }, - "x-order": 0 - }, - "psmdb_clusters": { - "description": "PSMDB clusters information.", - "type": "array", - "items": { - "description": "PSMDBCluster represents PSMDB cluster information.", - "type": "object", - "properties": { - "name": { - "description": "Cluster name.", - "type": "string", - "x-order": 0 - }, - "state": { - "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", - "type": "string", - "default": "DB_CLUSTER_STATE_INVALID", - "enum": [ - "DB_CLUSTER_STATE_INVALID", - "DB_CLUSTER_STATE_CHANGING", - "DB_CLUSTER_STATE_READY", - "DB_CLUSTER_STATE_FAILED", - "DB_CLUSTER_STATE_DELETING", - "DB_CLUSTER_STATE_PAUSED", - "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 - }, - "operation": { - "description": "RunningOperation respresents a long-running operation.", - "type": "object", - "properties": { - "finished_steps": { - "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "description": "Text describing the current operation progress step.", - "type": "string", - "x-order": 1 - }, - "total_steps": { - "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 2 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "destination": { - "type": "string", - "title": "Destination filename", - "x-order": 1 - } - }, - "x-order": 4 - } - }, - "x-order": 3 - }, - "exposed": { - "description": "DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 4 - }, - "installed_image": { - "description": "Installed PSMDB image.", - "type": "string", - "x-order": 5 - }, - "available_image": { - "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", - "type": "string", - "x-order": 6 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 8 - } - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Restart": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "RestartDBCluster restarts DB cluster.", - "operationId": "RestartDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - }, - "cluster_type": { - "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", - "type": "string", - "default": "DB_CLUSTER_TYPE_INVALID", - "enum": [ - "DB_CLUSTER_TYPE_INVALID", - "DB_CLUSTER_TYPE_PXC", - "DB_CLUSTER_TYPE_PSMDB" - ], - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/GetLogs": { - "post": { - "tags": [ - "LogsAPI" - ], - "summary": "GetLogs gets all logs from db cluster.", - "operationId": "GetLogs", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "cluster_name": { - "description": "DB cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "description": "Log represents list of logs. Each entry contains either container's logs or,\nwhen container field is empty, pod's events.", - "type": "array", - "items": { - "description": "Logs contain logs for certain pod's container. If container is an empty\nstring, logs contain pod's events.", - "type": "object", - "properties": { - "pod": { - "description": "Pod name.", - "type": "string", - "x-order": 0 - }, - "container": { - "description": "Container name.", - "type": "string", - "x-order": 1 - }, - "logs": { - "description": "Content of container's log or pod's events.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Get": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "GetKubernetesCluster return KubeAuth with Kubernetes config.", - "operationId": "GetKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "kube_auth": { - "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", - "type": "object", - "properties": { - "kubeconfig": { - "description": "Kubeconfig file content.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/List": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "ListKubernetesClusters returns a list of all registered Kubernetes clusters.", - "operationId": "ListKubernetesClusters", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "kubernetes_clusters": { - "description": "Kubernetes clusters.", - "type": "array", - "items": { - "description": "Cluster contains public info about Kubernetes cluster.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "operators": { - "description": "Operators contains list of operators installed in Kubernetes cluster.", - "type": "object", - "properties": { - "pxc": { - "description": "Operator contains all information about operator installed in Kubernetes cluster.", - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - }, - "version": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "psmdb": { - "description": "Operator contains all information about operator installed in Kubernetes cluster.", - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - }, - "version": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 1 - }, - "dbaas": { - "description": "Operator contains all information about operator installed in Kubernetes cluster.", - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - }, - "version": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 2 - } - }, - "x-order": 1 - }, - "status": { - "description": "KubernetesClusterStatus defines status of Kubernetes cluster.\n\n - KUBERNETES_CLUSTER_STATUS_INVALID: KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state.\n - KUBERNETES_CLUSTER_STATUS_OK: KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible.\n - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE: KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible.\n - KUBERNETES_CLUSTER_STATUS_PROVISIONING: KUBERNETES_CLUSTER_STATUS_PROVISIONING represents that Kubernetes cluster is privisioning.", - "type": "string", - "default": "KUBERNETES_CLUSTER_STATUS_INVALID", - "enum": [ - "KUBERNETES_CLUSTER_STATUS_INVALID", - "KUBERNETES_CLUSTER_STATUS_OK", - "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE", - "KUBERNETES_CLUSTER_STATUS_PROVISIONING" - ], - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Register": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM.", - "operationId": "RegisterKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "kube_auth": { - "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", - "type": "object", - "properties": { - "kubeconfig": { - "description": "Kubeconfig file content.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 1 - }, - "aws_access_key_id": { - "description": "AWS access key id, only needed when registering EKS cluster and kubeconfig does not contain it.", - "type": "string", - "x-order": 2 - }, - "aws_secret_access_key": { - "description": "AWS secret access key, only needed when registering EKS cluster and kubeconfig does not contain it.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Resources/Get": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "GetResources returns all and available resources of a Kubernetes cluster.\nNOTE: The user defined in kubeconfig for the cluster has to have rights to\n list and get Pods from all Namespaces. Also getting and listing Nodes\n has to be allowed.", - "operationId": "GetResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "all": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - }, - "available": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/StorageClasses/List": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "ListStorageClasses returns the names of all storage classes available in a Kubernetes cluster.", - "operationId": "ListStorageClasses", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "storage_classes": { - "description": "Kubernetes storage classes names.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Unregister": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM.", - "operationId": "UnregisterKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "force": { - "description": "If true then Kubernetes cluster will be deleted\neven if it contains database clusters.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Create": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "CreatePSMDBCluster creates a new PSMDB cluster.", - "operationId": "CreatePSMDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "PSMDB cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", - "x-order": 1 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "destination": { - "type": "string", - "title": "Destination filename", - "x-order": 1 - } - }, - "x-order": 4 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Resources/Get": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "GetPSMDBClusterResources returns expected resources to be consumed by the cluster.", - "operationId": "GetPSMDBClusterResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "destination": { - "type": "string", - "title": "Destination filename", - "x-order": 1 - } - }, - "x-order": 4 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "expected": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Update": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "UpdatePSMDBCluster updates existing PSMDB cluster.", - "operationId": "UpdatePSMDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PSMDB cluster name.", - "type": "string", - "x-order": 1 - }, - "params": { - "description": "UpdatePSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 1 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 1 - }, - "suspend": { - "description": "Suspend cluster `pause: true`.", - "type": "boolean", - "x-order": 2 - }, - "resume": { - "description": "Resume cluster `pause: false`.", - "type": "boolean", - "x-order": 3 - }, - "image": { - "description": "PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBClusters/GetCredentials": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name.", - "operationId": "GetPSMDBClusterCredentials", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PSMDB cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "connection_credentials": { - "description": "PSMDBCredentials is a credentials to connect to PSMDB.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "username": { - "description": "MongoDB username.", - "type": "string", - "x-order": 0 - }, - "password": { - "description": "MongoDB password.", - "type": "string", - "x-order": 1 - }, - "host": { - "description": "MongoDB host.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "MongoDB port.", - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "replicaset": { - "description": "Replicaset name.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Create": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "CreatePXCCluster creates a new PXC cluster.", - "operationId": "CreatePXCCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "PXC cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", - "x-order": 1 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 4 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "destination": { - "type": "string", - "title": "Destination filename", - "x-order": 1 - } - }, - "x-order": 5 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Resources/Get": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "GetPXCClusterResources returns expected resources to be consumed by the cluster.", - "operationId": "GetPXCClusterResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copyies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "schedule": { - "description": "Schedule represents schedule configration.", - "type": "object", - "properties": { - "week": { - "description": "Weekly runs.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "weekday": { - "description": "Weekday configuration.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "hour": { - "description": "Hour configuration.", - "type": "integer", - "format": "int32", - "x-order": 2 - }, - "minute": { - "description": "Minutes configuration.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 2 - } - }, - "x-order": 4 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "format": "int64", - "x-order": 0 - }, - "destination": { - "type": "string", - "title": "Destination filename", - "x-order": 1 - } - }, - "x-order": 5 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "expected": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Update": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "UpdatePXCCluster updates existing PXC cluster.", - "operationId": "UpdatePXCCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - }, - "params": { - "description": "UpdatePXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "image": { - "description": "Image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", - "type": "string", - "x-order": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - } - }, - "x-order": 2 - }, - "suspend": { - "description": "Suspend cluster `pause: true`.", - "type": "boolean", - "x-order": 3 - }, - "resume": { - "description": "Resume cluster `pause: false`.", - "type": "boolean", - "x-order": 4 - }, - "haproxy": { - "description": "HAProxy container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - } - }, - "x-order": 5 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCClusters/GetCredentials": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "GetPXCClusterCredentials returns a PXC cluster credentials by cluster name.", - "operationId": "GetPXCClusterCredentials", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "connection_credentials": { - "description": "PXCClusterConnectionCredentials is cluster connection credentials.", - "type": "object", - "properties": { - "username": { - "description": "PXC username.", - "type": "string", - "x-order": 0 - }, - "password": { - "description": "PXC password.", - "type": "string", - "x-order": 1 - }, - "host": { - "description": "PXC host.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "PXC port.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/alerting/Rules/Create": { - "post": { - "tags": [ - "Alerting" - ], - "summary": "CreateRule creates alerting rule from the given template.", - "operationId": "CreateRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "template_name": { - "description": "Template name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "group": { - "description": "Rule group name.", - "type": "string", - "x-order": 2 - }, - "folder_uid": { - "description": "Folder UID.", - "type": "string", - "x-order": 3 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 4 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 5 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 6 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter represents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "MATCH", - "MISMATCH" - ], - "x-order": 0 - }, - "label": { - "type": "string", - "x-order": 1 - }, - "regexp": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/alerting/Templates/Create": { - "post": { - "tags": [ - "Alerting" - ], - "summary": "CreateTemplate creates a new template.", - "operationId": "CreateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML (or JSON) template file content.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/alerting/Templates/Delete": { - "post": { - "tags": [ - "Alerting" - ], - "summary": "DeleteTemplate deletes existing, previously created via API.", - "operationId": "DeleteTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/alerting/Templates/List": { - "post": { - "tags": [ - "Alerting" - ], - "summary": "ListTemplates returns a list of all collected alert rule templates.", - "operationId": "ListTemplates", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "reload": { - "description": "If true, template files will be re-read from disk.", - "type": "boolean", - "x-order": 0 - }, - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "templates": { - "type": "array", - "items": { - "description": "Template represents Alert Template that is used to create Alert Rule.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID).", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "expr": { - "description": "PromQL query expression with templating parameters.", - "type": "string", - "x-order": 2 - }, - "params": { - "description": "Query parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 3 - }, - "for": { - "description": "Default duration value.", - "type": "string", - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "source": { - "description": "TemplateSource defines template source.\n\n - BUILT_IN: Template that is shipped with PMM Server releases.\n - SAAS: Template that is downloaded from check.percona.com.\n - USER_FILE: Templated loaded from user-suplied file.\n - USER_API: Templated created via API.", - "type": "string", - "default": "TEMPLATE_SOURCE_INVALID", - "enum": [ - "TEMPLATE_SOURCE_INVALID", - "BUILT_IN", - "SAAS", - "USER_FILE", - "USER_API" - ], - "x-order": 8 - }, - "created_at": { - "description": "Template creation time. Empty for built-in and SaaS templates.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "yaml": { - "description": "YAML (or JSON) template file content. Empty for built-in and SaaS templates.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/alerting/Templates/Update": { - "post": { - "tags": [ - "Alerting" - ], - "summary": "UpdateTemplate updates existing template, previously created via API.", - "operationId": "UpdateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID).", - "type": "string", - "x-order": 0 - }, - "yaml": { - "description": "YAML (or JSON) template file content.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/azure/AzureDatabase/Add": { - "post": { - "tags": [ - "AzureDatabase" - ], - "summary": "AddAzureDatabase adds Azure Database instance.", - "operationId": "AddAzureDatabase", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "region": { - "description": "Azure database location.", - "type": "string", - "x-order": 0 - }, - "az": { - "description": "Azure database availability zone.", - "type": "string", - "x-order": 1 - }, - "instance_id": { - "description": "Azure database instance ID.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Represents a purchasable Stock Keeping Unit (SKU) under a product.\nhttps://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "port": { - "description": "Access port.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to Azure Database instance ID.", - "type": "string", - "x-order": 6 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to Azure Database instance ID.", - "type": "string", - "x-order": 7 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 8 - }, - "username": { - "description": "Username for scraping metrics.", - "type": "string", - "x-order": 9 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 10 - }, - "azure_client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 11 - }, - "azure_client_secret": { - "description": "Azure client secret.", - "type": "string", - "x-order": 12 - }, - "azure_tenant_id": { - "description": "Azure tanant ID.", - "type": "string", - "x-order": 13 - }, - "azure_subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 14 - }, - "azure_resource_group": { - "description": "Azure resource group.", - "type": "string", - "x-order": 15 - }, - "azure_database_exporter": { - "description": "If true, adds azure_database_exporter.", - "type": "boolean", - "x-order": 16 - }, - "qan": { - "description": "If true, adds qan-mysql-perfschema-agent or qan-postgresql-pgstatements-agent.", - "type": "boolean", - "x-order": 17 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Node and Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 18 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 19 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 20 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 21 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 22 - }, - "tablestats_group_table_limit": { - "description": "Tablestats group collectors will be disabled if there are more than that number of tables.\nIf zero, server's default value is used.\nUse negative value to disable them.", - "type": "integer", - "format": "int32", - "x-order": 23 - }, - "type": { - "description": "DiscoverAzureDatabaseType describes supported Azure Database instance engines.\n\n - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb\n - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql", - "type": "string", - "default": "DISCOVER_AZURE_DATABASE_TYPE_INVALID", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_INVALID", - "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", - "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - ], - "x-order": 24 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/azure/AzureDatabase/Discover": { - "post": { - "tags": [ - "AzureDatabase" - ], - "summary": "DiscoverAzureDatabase discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", - "operationId": "DiscoverAzureDatabase", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "DiscoverAzureDatabaseRequest discover azure databases request.", - "type": "object", - "properties": { - "azure_client_id": { - "description": "Azure client ID.", - "type": "string", - "x-order": 0 - }, - "azure_client_secret": { - "description": "Azure client secret.", - "type": "string", - "x-order": 1 - }, - "azure_tenant_id": { - "description": "Azure tanant ID.", - "type": "string", - "x-order": 2 - }, - "azure_subscription_id": { - "description": "Azure subscription ID.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "DiscoverAzureDatabaseResponse discover azure databases response.", - "type": "object", - "properties": { - "azure_database_instance": { - "type": "array", - "items": { - "description": "DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery.", - "type": "object", - "properties": { - "instance_id": { - "description": "Azure database instance ID.", - "type": "string", - "x-order": 0 - }, - "region": { - "description": "Azure database location.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Azure database server name.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Database username.", - "type": "string", - "x-order": 3 - }, - "address": { - "description": "Address used to connect to it.", - "type": "string", - "x-order": 4 - }, - "azure_resource_group": { - "description": "Azure Resource group.", - "type": "string", - "x-order": 5 - }, - "environment": { - "description": "Environment tag.", - "type": "string", - "x-order": 6 - }, - "type": { - "description": "DiscoverAzureDatabaseType describes supported Azure Database instance engines.\n\n - DISCOVER_AZURE_DATABASE_TYPE_MYSQL: MySQL type: microsoft.dbformysql or MariaDB type: microsoft.dbformariadb\n - DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL: PostgreSQL type: microsoft.dbformysql", - "type": "string", - "default": "DISCOVER_AZURE_DATABASE_TYPE_INVALID", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_INVALID", - "DISCOVER_AZURE_DATABASE_TYPE_MYSQL", - "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - ], - "x-order": 7 - }, - "az": { - "description": "Azure database availability zone.", - "type": "string", - "x-order": 8 - }, - "node_model": { - "description": "Represents a purchasable Stock Keeping Unit (SKU) under a product.\nhttps://docs.microsoft.com/en-us/partner-center/develop/product-resources#sku.", - "type": "string", - "x-order": 9 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Artifacts/Delete": { - "post": { - "tags": [ - "Artifacts" - ], - "summary": "DeleteArtifact deletes specified artifact.", - "operationId": "DeleteArtifact", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Machine-readable artifact ID.", - "type": "string", - "x-order": 0 - }, - "remove_files": { - "description": "Removes all the backup files associated with artifact if flag is set.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Artifacts/List": { - "post": { - "tags": [ - "Artifacts" - ], - "summary": "ListArtifacts returns a list of all backup artifacts.", - "operationId": "ListArtifacts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "artifacts": { - "type": "array", - "items": { - "description": "Artifact represents single backup artifact.", - "type": "object", - "properties": { - "artifact_id": { - "description": "Machine-readable artifact ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Artifact name", - "x-order": 1 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 2 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 3 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 4 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 5 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 6 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 7 - }, - "status": { - "description": "BackupStatus shows the current status of execution of backup.", - "type": "string", - "default": "BACKUP_STATUS_INVALID", - "enum": [ - "BACKUP_STATUS_INVALID", - "BACKUP_STATUS_PENDING", - "BACKUP_STATUS_IN_PROGRESS", - "BACKUP_STATUS_PAUSED", - "BACKUP_STATUS_SUCCESS", - "BACKUP_STATUS_ERROR", - "BACKUP_STATUS_DELETING", - "BACKUP_STATUS_FAILED_TO_DELETE" - ], - "x-order": 8 - }, - "created_at": { - "description": "Artifact creation time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 10 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Artifacts/ListPITRTimeranges": { - "post": { - "tags": [ - "Artifacts" - ], - "summary": "ListPitrTimeranges list the available MongoDB PITR timeranges in a given backup location", - "operationId": "ListPitrTimeranges", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Artifact ID represents artifact whose location has PITR timeranges to be retrieved.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "timeranges": { - "type": "array", - "items": { - "type": "object", - "properties": { - "start_timestamp": { - "description": "start_timestamp is the time of the first event in the PITR chunk.", - "type": "string", - "format": "date-time", - "x-order": 0 - }, - "end_timestamp": { - "description": "end_timestamp is the time of the last event in the PITR chunk.", - "type": "string", - "format": "date-time", - "x-order": 1 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ChangeScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ChangeScheduledBackup changes existing scheduled backup.", - "operationId": "ChangeScheduledBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - }, - "enabled": { - "type": "boolean", - "x-order": 1 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "x-order": 2 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 3 - }, - "name": { - "description": "Name of backup.", - "type": "string", - "x-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 5 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 6 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/GetLogs": { - "post": { - "tags": [ - "Backups" - ], - "summary": "GetLogs returns logs for provided artifact.", - "operationId": "GetLogsMixin3", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "type": "string", - "x-order": 0 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "description": "LogChunk represent one chunk of logs.", - "type": "object", - "properties": { - "chunk_id": { - "type": "integer", - "format": "int64", - "x-order": 0 - }, - "data": { - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - }, - "end": { - "type": "boolean", - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ListArtifactCompatibleServices": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ListArtifactCompatibleServices lists compatible services for restoring a backup.", - "operationId": "ListArtifactCompatibleServices", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Artifact id used to determine restore compatibility.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "mysql": { - "type": "array", - "items": { - "description": "MySQLService represents a generic MySQL instance.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "service_name": { - "description": "Unique across all Services user-defined name.", - "type": "string", - "x-order": 1 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 2 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 3 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 5 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 6 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 7 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - } - }, - "x-order": 0 - }, - "mongodb": { - "type": "array", - "items": { - "description": "MongoDBService represents a generic MongoDB instance.", - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "service_name": { - "description": "Unique across all Services user-defined name.", - "type": "string", - "x-order": 1 - }, - "node_id": { - "description": "Node identifier where this instance runs.", - "type": "string", - "x-order": 2 - }, - "address": { - "description": "Access address (DNS name or IP).\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 3 - }, - "port": { - "description": "Access port.\nPort is required when the address present.", - "type": "integer", - "format": "int64", - "x-order": 4 - }, - "socket": { - "description": "Access unix socket.\nAddress (and port) or socket is required.", - "type": "string", - "x-order": 5 - }, - "environment": { - "description": "Environment name.", - "type": "string", - "x-order": 6 - }, - "cluster": { - "description": "Cluster name.", - "type": "string", - "x-order": 7 - }, - "replication_set": { - "description": "Replication set name.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ListScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ListScheduledBackups returns all scheduled backups.", - "operationId": "ListScheduledBackups", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "scheduled_backups": { - "type": "array", - "items": { - "description": "ScheduledBackup represents scheduled task for backup.", - "type": "object", - "properties": { - "scheduled_backup_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 2 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 3 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 4 - }, - "cron_expression": { - "description": "How often backup will be run in cron format.", - "type": "string", - "x-order": 5 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 6 - }, - "name": { - "description": "Artifact name.", - "type": "string", - "x-order": 7 - }, - "description": { - "description": "Description.", - "type": "string", - "x-order": 8 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 9 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 10 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 11 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 12 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 13 - }, - "last_run": { - "description": "Last run.", - "type": "string", - "format": "date-time", - "x-order": 14 - }, - "next_run": { - "description": "Next run.", - "type": "string", - "format": "date-time", - "x-order": 15 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 17 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/RemoveScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "RemoveScheduledBackup removes existing scheduled backup.", - "operationId": "RemoveScheduledBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/Restore": { - "post": { - "description": "Could return the Error message in the details containing specific ErrorCode indicating failure reason:\nERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service\nERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud\nERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup\nERROR_CODE_INCOMPATIBLE_TARGET_MYSQL - target MySQL version is not compatible with the artifact for performing a restore of the backup", - "tags": [ - "Backups" - ], - "summary": "RestoreBackup requests the backup restore.", - "operationId": "RestoreBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier where backup should be restored.", - "type": "string", - "x-order": 0 - }, - "artifact_id": { - "description": "Artifact id to restore.", - "type": "string", - "x-order": 1 - }, - "pitr_timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp of PITR to restore to", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "restore_id": { - "description": "Unique restore identifier.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/Schedule": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ScheduleBackup schedules repeated backup.", - "operationId": "ScheduleBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier where backup should be performed.", - "type": "string", - "x-order": 0 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 1 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "x-order": 2 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 3 - }, - "name": { - "description": "Name of backup.", - "type": "string", - "x-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 5 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 6 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 8 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 10 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 11 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/Start": { - "post": { - "description": "Could return the Error message in the details containing specific ErrorCode indicating failure reason:\nERROR_CODE_XTRABACKUP_NOT_INSTALLED - xtrabackup is not installed on the service\nERROR_CODE_INVALID_XTRABACKUP - different versions of xtrabackup and xbcloud\nERROR_CODE_INCOMPATIBLE_XTRABACKUP - xtrabackup is not compatible with MySQL for taking a backup", - "tags": [ - "Backups" - ], - "summary": "StartBackup request backup specified service to location.", - "operationId": "StartBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Service identifier.", - "type": "string", - "x-order": 0 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "If empty then name is auto-generated.", - "type": "string", - "x-order": 2 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 3 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 4 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 5 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Unique identifier.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Add": { - "post": { - "tags": [ - "Locations" - ], - "summary": "AddLocation adds backup location.", - "operationId": "AddLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Location name", - "x-order": 0 - }, - "description": { - "type": "string", - "x-order": 1 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Change": { - "post": { - "tags": [ - "Locations" - ], - "summary": "ChangeLocation changes backup location.", - "operationId": "ChangeLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Location name", - "x-order": 1 - }, - "description": { - "type": "string", - "x-order": 2 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 4 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/List": { - "post": { - "tags": [ - "Locations" - ], - "summary": "ListLocations returns a list of all backup locations.", - "operationId": "ListLocations", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "description": "Location represents single Backup Location.", - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "Location name", - "x-order": 1 - }, - "description": { - "type": "string", - "title": "Short description", - "x-order": 2 - }, - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 4 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Remove": { - "post": { - "tags": [ - "Locations" - ], - "summary": "RemoveLocation removes existing backup location.", - "operationId": "RemoveLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "force": { - "type": "boolean", - "title": "Force mode", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/TestConfig": { - "post": { - "tags": [ - "Locations" - ], - "summary": "TestLocationConfig tests backup location and credentials.", - "operationId": "TestLocationConfig", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "filesystem_config": { - "description": "FilesystemLocationConfig represents file system location config.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "s3_config": { - "description": "S3LocationConfig represents S3 bucket configuration.", - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "x-order": 0 - }, - "access_key": { - "type": "string", - "x-order": 1 - }, - "secret_key": { - "type": "string", - "x-order": 2 - }, - "bucket_name": { - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/backup/RestoreHistory/List": { - "post": { - "tags": [ - "RestoreHistory" - ], - "summary": "ListRestoreHistory returns a list of all backup restore history items.", - "operationId": "ListRestoreHistory", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "description": "RestoreHistoryItem represents single backup restore item.", - "type": "object", - "properties": { - "restore_id": { - "description": "Machine-readable restore id.", - "type": "string", - "x-order": 0 - }, - "artifact_id": { - "description": "ID of the artifact used for restore.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Artifact name used for restore.", - "type": "string", - "x-order": 2 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 3 - }, - "location_id": { - "description": "Machine-readable location ID.", - "type": "string", - "x-order": 4 - }, - "location_name": { - "description": "Location name.", - "type": "string", - "x-order": 5 - }, - "service_id": { - "description": "Machine-readable service ID.", - "type": "string", - "x-order": 6 - }, - "service_name": { - "description": "Service name.", - "type": "string", - "x-order": 7 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 8 - }, - "status": { - "description": "RestoreStatus shows the current status of execution of restore.", - "type": "string", - "default": "RESTORE_STATUS_INVALID", - "enum": [ - "RESTORE_STATUS_INVALID", - "RESTORE_STATUS_IN_PROGRESS", - "RESTORE_STATUS_SUCCESS", - "RESTORE_STATUS_ERROR" - ], - "x-order": 9 - }, - "started_at": { - "description": "Restore start time.", - "type": "string", - "format": "date-time", - "x-order": 10 - }, - "finished_at": { - "description": "Restore finish time.", - "type": "string", - "format": "date-time", - "x-order": 11 - }, - "pitr_timestamp": { - "description": "PITR timestamp is filled for PITR restores, empty otherwise.", - "type": "string", - "format": "date-time", - "x-order": 12 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Alerts/List": { - "post": { - "tags": [ - "Alerts" - ], - "summary": "ListAlerts returns a list of all Alerts.", - "operationId": "ListAlerts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "alerts": { - "type": "array", - "items": { - "description": "Alert represents Alert.", - "type": "object", - "properties": { - "alert_id": { - "description": "ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Human-readable summary.", - "type": "string", - "x-order": 1 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 2 - }, - "status": { - "description": "Status represents Alert Rule's and Alert's combined status.\n\n - CLEAR: No alert.\n - PENDING: Pending, but not triggering alert.\n - TRIGGERING: Triggering (firing) alert.\n - SILENCED: Silenced alert.", - "type": "string", - "default": "STATUS_INVALID", - "enum": [ - "STATUS_INVALID", - "CLEAR", - "PENDING", - "TRIGGERING", - "SILENCED" - ], - "x-order": 3 - }, - "labels": { - "description": "Combined labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 4 - }, - "rule": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "params_definitions": { - "description": "Expression parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 8 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.\n\nreserved channels\n pushover_config = 5;\n opsgenie_config = 7;\n victorops_config = 9;\n wechat_config = 10;", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - } - }, - "x-order": 5 - }, - "created_at": { - "description": "Alert creation time.", - "type": "string", - "format": "date-time", - "x-order": 6 - }, - "updated_at": { - "description": "Alert last update time.", - "type": "string", - "format": "date-time", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Alerts/Toggle": { - "post": { - "description": "Pass empty list to apply toggle action to all existing alerts", - "tags": [ - "Alerts" - ], - "summary": "ToggleAlerts allows to switch alerts state between silenced and unsilenced.", - "operationId": "ToggleAlerts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "alert_ids": { - "description": "List of alerts that silence state should be switched. If provided array is empty than all\nexisting alerts are switched.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "silenced": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Add": { - "post": { - "tags": [ - "Channels" - ], - "summary": "AddChannel adds notification channel.", - "operationId": "AddChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 0 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 3 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 4 - }, - "disabled": { - "description": "New channel status.", - "type": "boolean", - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Change": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ChangeChannel changes notification channel.", - "operationId": "ChangeChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary. Empty value will not change it.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "Enables or disables that channel. Should be set.", - "type": "boolean", - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/List": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ListChannels returns a list of all notifation channels.", - "operationId": "ListChannels", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.\n\nreserved channels\n pushover_config = 5;\n opsgenie_config = 7;\n victorops_config = 9;\n wechat_config = 10;", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Remove": { - "post": { - "tags": [ - "Channels" - ], - "summary": "RemoveChannel removes notification channel.", - "operationId": "RemoveChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Create": { - "post": { - "tags": [ - "Rules" - ], - "summary": "CreateAlertRule creates Alerting rule.", - "operationId": "CreateAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "template_name": { - "description": "Template name. Can't be specified simultaneously with source_rule_id.", - "type": "string", - "x-order": 0 - }, - "source_rule_id": { - "description": "ID of the rule that will be used as source. Can't be specified simultaneously with template_name.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 2 - }, - "disabled": { - "description": "New rule status.", - "type": "boolean", - "x-order": 3 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 4 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 5 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 6 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "filters": { - "description": "Filters. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - }, - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Delete": { - "post": { - "tags": [ - "Rules" - ], - "summary": "DeleteAlertRule deletes Alerting rule.", - "operationId": "DeleteAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/List": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ListAlertRules returns a list of all Alerting rules.", - "operationId": "ListAlertRules", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rules": { - "type": "array", - "items": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "params_definitions": { - "description": "Expression parameters definitions.", - "type": "array", - "items": { - "description": "ParamDefinition represents a single query parameter.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable parameter summary.", - "type": "string", - "x-order": 1 - }, - "unit": { - "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 8 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.\n\nreserved channels\n pushover_config = 5;\n opsgenie_config = 7;\n victorops_config = 9;\n wechat_config = 10;", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "type": "object", - "properties": { - "total_items": { - "description": "Total number of results.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "total_pages": { - "description": "Total number of pages.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Toggle": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule.", - "operationId": "ToggleAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Update": { - "post": { - "tags": [ - "Rules" - ], - "summary": "UpdateAlertRule updates Alerting rule.", - "operationId": "UpdateAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name. Should be set.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "New rule status. Should be set.", - "type": "boolean", - "x-order": 2 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 1 - }, - "bool": { - "description": "Bool value.", - "type": "boolean", - "x-order": 2 - }, - "float": { - "description": "Float value.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "string": { - "description": "String value.", - "type": "string", - "x-order": 4 - } - } - }, - "x-order": 3 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - }, - "custom_labels": { - "description": "All custom labels to add or remove (with empty values) to default labels from template.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - }, - "filters": { - "description": "Filters. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n\n!=\n NOT_EQUAL = 2;\n - REGEX: =~\n\n!~\n NOT_REGEX = 4;", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - } - }, - "securityDefinitions": { - "basicAuth": { - "type": "basic" - } - }, - "security": [ - { - "basicAuth": [] - } - ], - "tags": [ - { - "name": "Components" - }, - { - "name": "DBClusters" - }, - { - "name": "Kubernetes" - }, - { - "name": "LogsAPI" - }, - { - "name": "PSMDBClusters" - }, - { - "name": "PXCClusters" - }, - { - "name": "Alerts" - }, - { - "name": "Channels" - }, - { - "name": "Rules" - }, - { - "name": "Alerting" - }, - { - "name": "Artifacts" - }, - { - "name": "Backups" - }, - { - "name": "Locations" - }, - { - "name": "RestoreHistory" - }, - { - "name": "Collector" - }, - { - "name": "Filters" - }, - { - "name": "MetricsNames" - }, - { - "name": "ObjectDetails" - }, - { - "name": "Profile" - }, - { - "name": "Platform" - } - ], - "x-readme": { - "samples-languages": [ - "curl", - "go", - "node", - "python" - ] - } -} \ No newline at end of file diff --git a/managed/services/errors.go b/managed/services/errors.go index ce8573b631..7b09154abb 100644 --- a/managed/services/errors.go +++ b/managed/services/errors.go @@ -20,5 +20,5 @@ import "github.com/pkg/errors" // ErrAdvisorsDisabled means that advisors checks are disabled and can't be executed. var ErrAdvisorsDisabled = errors.New("Advisor checks are disabled") -// ErrAlertingDisabled means Integrated Alerting is disabled and IA APIs can't be executed. +// ErrAlertingDisabled means Percona Alerting is disabled and its APIs can't be executed. var ErrAlertingDisabled = errors.New("Alerting is disabled") diff --git a/managed/services/server/deps.go b/managed/services/server/deps.go index 22885fcf5c..b3cd8cf385 100644 --- a/managed/services/server/deps.go +++ b/managed/services/server/deps.go @@ -114,7 +114,7 @@ type agentsStateUpdater interface { UpdateAgentsState(ctx context.Context) error } -// templatesService is a subset of methods of ia.TemplatesService used by this package. +// templatesService is a subset of methods of alerting.Service used by this package. // We use it instead of real type for testing and to avoid dependency cycle. type templatesService interface { CollectTemplates(ctx context.Context) diff --git a/managed/services/supervisord/supervisord.go b/managed/services/supervisord/supervisord.go index 0efd48d76e..0484e263b0 100644 --- a/managed/services/supervisord/supervisord.go +++ b/managed/services/supervisord/supervisord.go @@ -687,7 +687,6 @@ command = --remoteRead.ignoreRestoreErrors=false --remoteWrite.url=http://127.0.0.1:9090/prometheus --rule=/srv/prometheus/rules/*.yml - --rule=/etc/ia/rules/*.yml --httpListenAddr=` + interfaceToBind + `:8880 {{- range $index, $param := .VMAlertFlags }} {{ $param }} diff --git a/managed/testdata/supervisord.d/vmalert.ini b/managed/testdata/supervisord.d/vmalert.ini index e784596bcb..be3746ef3c 100644 --- a/managed/testdata/supervisord.d/vmalert.ini +++ b/managed/testdata/supervisord.d/vmalert.ini @@ -13,7 +13,6 @@ command = --remoteRead.ignoreRestoreErrors=false --remoteWrite.url=http://127.0.0.1:9090/prometheus --rule=/srv/prometheus/rules/*.yml - --rule=/etc/ia/rules/*.yml --httpListenAddr=127.0.0.1:8880 user = pmm autorestart = true From b80b3cb0bd09024b1d38386590433052f312196d Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 3 Jul 2023 12:05:17 +0200 Subject: [PATCH 20/22] PMM-11079 Refactoring and cleanup --- managed/cmd/pmm-managed/main.go | 11 +++++------ managed/services/types.go | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/managed/cmd/pmm-managed/main.go b/managed/cmd/pmm-managed/main.go index b17fcecdd2..ac63ca19ab 100644 --- a/managed/cmd/pmm-managed/main.go +++ b/managed/cmd/pmm-managed/main.go @@ -894,13 +894,12 @@ func main() { //nolint:cyclop,maintidx prom.MustRegister(checksService) - // Integrated alerts services - templatesService, err := alerting.NewService(db, platformClient, grafanaClient) + alertingService, err := alerting.NewService(db, platformClient, grafanaClient) if err != nil { - l.Fatalf("Could not create templates service: %s", err) + l.Fatalf("Could not create alerting service: %s", err) } // We should collect templates before rules service created, because it will regenerate rule files on startup. - templatesService.CollectTemplates(ctx) + alertingService.CollectTemplates(ctx) agentService := agents.NewAgentService(agentsRegistry) versionService := managementdbaas.NewVersionServiceClient(*versionServiceAPIURLF) @@ -925,7 +924,7 @@ func main() { //nolint:cyclop,maintidx AgentsStateUpdater: agentsStateUpdater, Alertmanager: alertManager, ChecksService: checksService, - TemplatesService: templatesService, + TemplatesService: alertingService, Supervisord: supervisord, TelemetryService: telemetry, AwsInstanceChecker: awsInstanceChecker, @@ -1084,7 +1083,7 @@ func main() { //nolint:cyclop,maintidx alertmanager: alertManager, vmalert: vmalert, settings: settings, - templatesService: templatesService, + templatesService: alertingService, jobsService: jobsService, versionServiceClient: versionService, schedulerService: schedulerService, diff --git a/managed/services/types.go b/managed/services/types.go index 2614d4fed2..49420c2841 100644 --- a/managed/services/types.go +++ b/managed/services/types.go @@ -89,8 +89,6 @@ type CheckResultSummary struct { // FilterParams provides fields needed to filter alerts from AlertManager. type FilterParams struct { - // IsIA specifies if only Integrated Alerts should be matched. - IsIA bool // IsCheck specifies if only Checks/Advisors alerts should be matched. IsCheck bool // AlertID is the ID of alert to be matched (if any). From 72534eaadf69a582705d3a2458196c3c79b67452 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Mon, 3 Jul 2023 12:08:11 +0200 Subject: [PATCH 21/22] PMM-11079 Cleanup --- managed/cmd/pmm-managed/main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/managed/cmd/pmm-managed/main.go b/managed/cmd/pmm-managed/main.go index ac63ca19ab..17ea63ccbb 100644 --- a/managed/cmd/pmm-managed/main.go +++ b/managed/cmd/pmm-managed/main.go @@ -898,7 +898,6 @@ func main() { //nolint:cyclop,maintidx if err != nil { l.Fatalf("Could not create alerting service: %s", err) } - // We should collect templates before rules service created, because it will regenerate rule files on startup. alertingService.CollectTemplates(ctx) agentService := agents.NewAgentService(agentsRegistry) From 3c53eb9bbd30adfce727d68ecbcd5df525696319 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Thu, 28 Sep 2023 18:07:16 +0200 Subject: [PATCH 22/22] PMM-11079 Cleanup after merge --- .../management/alerting/alerting_test.go | 648 ++++-------------- 1 file changed, 151 insertions(+), 497 deletions(-) diff --git a/api-tests/management/alerting/alerting_test.go b/api-tests/management/alerting/alerting_test.go index fe5bc6d57c..9036e1b250 100644 --- a/api-tests/management/alerting/alerting_test.go +++ b/api-tests/management/alerting/alerting_test.go @@ -42,540 +42,110 @@ import ( // Note: Even though the Alerting service checks for alerting enabled or disabled before returning results // we don't enable or disable Alerting explicit in our tests since it is enabled by default through // DISABLE_ALERTING env var. -func TestAlertingAPI(t *testing.T) { +func TestRulesAPI(t *testing.T) { t.Parallel() - client := alertingClient.Default.Alerting - - t.Run("templates", func(t *testing.T) { - t.Parallel() - templateData, err := os.ReadFile("../../testdata/alerting/template.yaml") - require.NoError(t, err) + t.Parallel() + client := alertingClient.Default.Alerting - invalidTemplateData, err := os.ReadFile("../../testdata/alerting/invalid-template.yaml") - require.NoError(t, err) + // Create grafana folder for test alert rules + grafanaClient := grafana.NewClient("127.0.0.1:3000") + ctx := metadata.NewIncomingContext(context.Background(), metadata.New(map[string]string{"Authorization": "Basic " + base64.StdEncoding.EncodeToString([]byte("admin:admin"))})) + folder, err := grafanaClient.CreateFolder(ctx, "test-folder-"+uuid.NewString()) + require.NoError(t, err) - t.Run("add", func(t *testing.T) { - t.Parallel() + t.Cleanup(func() { + assert.NoError(t, grafanaClient.DeleteFolder(ctx, folder.UID, true)) + }) - name := uuid.New().String() - expr := uuid.New().String() - alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: yml, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) + dummyFilter := &alerting.CreateRuleParamsBodyFiltersItems0{ + Type: pointer.ToString("MATCH"), + Label: "threshold", + Regexp: "12", + } - resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: alerting.ListTemplatesBody{ - Reload: true, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) + templateName := createTemplate(t) + t.Cleanup(func() { + deleteTemplate(t, alertingClient.Default.Alerting, templateName) + }) - assertTemplate(t, alertTemplates[0], resp.Payload.Templates) - }) + t.Run("add", func(t *testing.T) { + t.Parallel() - t.Run("add duplicate", func(t *testing.T) { + t.Run("normal from template", func(t *testing.T) { t.Parallel() - name := uuid.New().String() - yaml := fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%") - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: yaml, - }, - Context: pmmapitests.Context, - }) + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + _, err := client.CreateRule(params) require.NoError(t, err) - defer deleteTemplate(t, client, name) - - _, err = client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: yaml, - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, fmt.Sprintf("Template with name \"%s\" already exists.", name)) }) - t.Run("invalid yaml", func(t *testing.T) { + t.Run("builtin_template", func(t *testing.T) { t.Parallel() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: "not a yaml", - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") + params := createAlertRuleParams("pmm_mongodb_restarted", folder.UID, dummyFilter) + params.Body.Params = []*alerting.CreateRuleParamsBodyParamsItems0{{ + Name: "threshold", + Type: pointer.ToString("FLOAT"), + Float: 3.14, + }} + _, err := client.CreateRule(params) + require.NoError(t, err) }) - t.Run("invalid template", func(t *testing.T) { + t.Run("use default value for parameter", func(t *testing.T) { t.Parallel() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(invalidTemplateData), uuid.New().String(), uuid.New().String()), - }, - Context: pmmapitests.Context, - }) - - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + _, err := client.CreateRule(params) + require.NoError(t, err) }) - t.Run("change", func(t *testing.T) { + t.Run("unknown template", func(t *testing.T) { t.Parallel() - t.Run("normal", func(t *testing.T) { - t.Parallel() - - name := uuid.New().String() - expr := uuid.New().String() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(templateData), name, expr, "s", "%"), - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) - - newExpr := uuid.New().String() - alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, newExpr, "s", "%")) - _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ - Body: alerting.UpdateTemplateBody{ - Name: name, - Yaml: yml, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: alerting.ListTemplatesBody{ - Reload: true, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - assertTemplate(t, alertTemplates[0], resp.Payload.Templates) - }) - - t.Run("unknown template", func(t *testing.T) { - t.Parallel() - - name := uuid.New().String() - _, err := client.UpdateTemplate(&alerting.UpdateTemplateParams{ - Body: alerting.UpdateTemplateBody{ - Name: name, - Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf("Template with name \"%s\" not found.", name)) - }) - - t.Run("invalid yaml", func(t *testing.T) { - t.Parallel() - - name := uuid.New().String() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) - - _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ - Body: alerting.UpdateTemplateBody{ - Name: name, - Yaml: "not a yaml", - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") - }) - - t.Run("invalid template", func(t *testing.T) { - t.Parallel() - - name := uuid.New().String() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) - - _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ - Body: alerting.UpdateTemplateBody{ - Name: name, - Yaml: fmt.Sprintf(string(invalidTemplateData), name, uuid.New().String()), - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") - }) + templateName := uuid.New().String() + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + _, err := client.CreateRule(params) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Unknown template %s.", templateName) }) - t.Run("delete", func(t *testing.T) { + t.Run("wrong parameter", func(t *testing.T) { t.Parallel() - t.Run("normal", func(t *testing.T) { - t.Parallel() - - name := uuid.New().String() - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - _, err = client.DeleteTemplate(&alerting.DeleteTemplateParams{ - Body: alerting.DeleteTemplateBody{ - Name: name, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: alerting.ListTemplatesBody{ - Reload: true, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - for _, template := range resp.Payload.Templates { - assert.NotEqual(t, name, template.Name) - } - }) - - t.Run("unknown template", func(t *testing.T) { - t.Parallel() - - name := uuid.New().String() - _, err := client.DeleteTemplate(&alerting.DeleteTemplateParams{ - Body: alerting.DeleteTemplateBody{ - Name: name, - }, - Context: pmmapitests.Context, - }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf("Template with name \"%s\" not found.", name)) - }) - }) - - t.Run("list", func(t *testing.T) { - t.Run("without pagination", func(t *testing.T) { - name := uuid.New().String() - expr := uuid.New().String() - alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: yml, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - defer deleteTemplate(t, client, name) - - resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: alerting.ListTemplatesBody{ - Reload: true, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - assertTemplate(t, alertTemplates[0], resp.Payload.Templates) - }) - - t.Run("with pagination", func(t *testing.T) { - const templatesCount = 5 - - templateNames := make(map[string]struct{}) - - for i := 0; i < templatesCount; i++ { - name := uuid.New().String() - expr := uuid.New().String() - _, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) - _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ - Body: alerting.CreateTemplateBody{ - Yaml: yml, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - - templateNames[name] = struct{}{} - } - defer func() { - for name := range templateNames { - deleteTemplate(t, client, name) - } - }() - - // list rules, so they are all on the first page - body := alerting.ListTemplatesBody{ - PageParams: &alerting.ListTemplatesParamsBodyPageParams{ - PageSize: 30, - Index: 0, - }, - } - listAllTemplates, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: body, - Context: pmmapitests.Context, + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + params.Body.Params = append( + params.Body.Params, + &alerting.CreateRuleParamsBodyParamsItems0{ + Name: "unknown parameter", + Type: pointer.ToString("FLOAT"), + Float: 12, }) - require.NoError(t, err) - - assert.GreaterOrEqual(t, len(listAllTemplates.Payload.Templates), templatesCount) - assert.Equal(t, int32(len(listAllTemplates.Payload.Templates)), listAllTemplates.Payload.Totals.TotalItems) - assert.Equal(t, int32(1), listAllTemplates.Payload.Totals.TotalPages) - - assertFindTemplate := func(list []*alerting.ListTemplatesOKBodyTemplatesItems0, name string) func() bool { - return func() bool { - for _, tmpl := range list { - if tmpl.Name == name { - return true - } - } - return false - } - } - - for name := range templateNames { - assert.Conditionf(t, assertFindTemplate(listAllTemplates.Payload.Templates, name), "template %s not found", name) - } - - // paginate page over page with page size 1 and check the order - it should be the same as in listAllTemplates. - // last iteration checks that there is no elements for not existing page. - for pageIndex := 0; pageIndex <= len(listAllTemplates.Payload.Templates); pageIndex++ { - body := alerting.ListTemplatesBody{ - PageParams: &alerting.ListTemplatesParamsBodyPageParams{ - PageSize: 1, - Index: int32(pageIndex), - }, - } - listOneTemplate, err := client.ListTemplates(&alerting.ListTemplatesParams{ - Body: body, Context: pmmapitests.Context, - }) - require.NoError(t, err) - - assert.Equal(t, listAllTemplates.Payload.Totals.TotalItems, listOneTemplate.Payload.Totals.TotalItems) - assert.GreaterOrEqual(t, listOneTemplate.Payload.Totals.TotalPages, int32(templatesCount)) - - if pageIndex != len(listAllTemplates.Payload.Templates) { - require.Len(t, listOneTemplate.Payload.Templates, 1) - assert.Equal(t, listAllTemplates.Payload.Templates[pageIndex].Name, listOneTemplate.Payload.Templates[0].Name) - } else { - assert.Len(t, listOneTemplate.Payload.Templates, 0) - } - } - }) + _, err := client.CreateRule(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 3.") }) - }) - t.Run("rules", func(t *testing.T) { - t.Parallel() - client := alertingClient.Default.Alerting - - // Create grafana folder for test alert rules - grafanaClient := grafana.NewClient("127.0.0.1:3000") - ctx := metadata.NewIncomingContext(context.Background(), metadata.New(map[string]string{"Authorization": "Basic " + base64.StdEncoding.EncodeToString([]byte("admin:admin"))})) - folder, err := grafanaClient.CreateFolder(ctx, "test-folder-"+uuid.NewString()) - require.NoError(t, err) - - t.Cleanup(func() { - assert.NoError(t, grafanaClient.DeleteFolder(ctx, folder.UID, true)) - }) - - dummyFilter := &alerting.CreateRuleParamsBodyFiltersItems0{ - Type: pointer.ToString("MATCH"), - Label: "threshold", - Regexp: "12", - } - - templateName := createTemplate(t) - t.Cleanup(func() { - deleteTemplate(t, alertingClient.Default.Alerting, templateName) - }) - - t.Run("add", func(t *testing.T) { + t.Run("wrong parameter type", func(t *testing.T) { t.Parallel() - t.Run("normal from template", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, folder.UID, dummyFilter) - _, err := client.CreateRule(params) - require.NoError(t, err) - }) - - t.Run("builtin_template", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams("pmm_mongodb_restarted", folder.UID, dummyFilter) - params.Body.Params = []*alerting.CreateRuleParamsBodyParamsItems0{{ - Name: "threshold", + params := createAlertRuleParams(templateName, folder.UID, dummyFilter) + params.Body.Params = []*alerting.CreateRuleParamsBodyParamsItems0{ + { + Name: "param1", + Type: pointer.ToString("BOOL"), + Bool: true, + }, { + Name: "param2", Type: pointer.ToString("FLOAT"), - Float: 3.14, - }} - _, err := client.CreateRule(params) - require.NoError(t, err) - }) - - t.Run("use default value for parameter", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, folder.UID, dummyFilter) - _, err := client.CreateRule(params) - require.NoError(t, err) - }) - - t.Run("unknown template", func(t *testing.T) { - t.Parallel() - - templateName := uuid.New().String() - params := createAlertRuleParams(templateName, folder.UID, dummyFilter) - _, err := client.CreateRule(params) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Unknown template %s.", templateName) - }) - - t.Run("wrong parameter", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, folder.UID, dummyFilter) - params.Body.Params = append( - params.Body.Params, - &alerting.CreateRuleParamsBodyParamsItems0{ - Name: "unknown parameter", - Type: pointer.ToString("FLOAT"), - Float: 12, - }) - _, err := client.CreateRule(params) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Expression requires 2 parameters, but got 3.") - }) - - t.Run("wrong parameter type", func(t *testing.T) { - t.Parallel() - - params := createAlertRuleParams(templateName, folder.UID, dummyFilter) - params.Body.Params = []*alerting.CreateRuleParamsBodyParamsItems0{ - { - Name: "param1", - Type: pointer.ToString("BOOL"), - Bool: true, - }, { - Name: "param2", - Type: pointer.ToString("FLOAT"), - Float: 12, - }, - } - _, err := client.CreateRule(params) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") - }) + Float: 12, + }, + } + _, err := client.CreateRule(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Parameter param1 has type bool instead of float.") }) }) } -func assertTemplate(t *testing.T, expectedTemplate alert.Template, listTemplates []*alerting.ListTemplatesOKBodyTemplatesItems0) { - t.Helper() - convertParamUnit := func(u string) alert.Unit { - switch u { - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPERCENTAGE: - return alert.Percentage - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitSECONDS: - return alert.Seconds - } - return "INVALID" - } - convertParamType := func(u string) alert.Type { - switch u { - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeFLOAT: - return alert.Float - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeSTRING: - return alert.String - case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeBOOL: - return alert.Bool - } - return "INVALID" - } - var tmpl *alerting.ListTemplatesOKBodyTemplatesItems0 - for _, listTmpl := range listTemplates { - if listTmpl.Name == expectedTemplate.Name { - tmpl = listTmpl - break - } - } - require.NotNilf(t, tmpl, "template %s not found", expectedTemplate.Name) - // IDE doesn't recognize that require stops execution - if tmpl == nil { - return - } - assert.Equal(t, expectedTemplate.Expr, tmpl.Expr) - assert.Equal(t, expectedTemplate.Summary, tmpl.Summary) - assert.Equal(t, "USER_API", *tmpl.Source) - assert.Equal(t, "SEVERITY_WARNING", *tmpl.Severity) - - forDuration := fmt.Sprintf("%.0fs", time.Duration(expectedTemplate.For).Seconds()) - assert.Equal(t, forDuration, tmpl.For) - - require.Len(t, tmpl.Params, len(expectedTemplate.Params)) - for i, expectedParam := range expectedTemplate.Params { - param := tmpl.Params[i] - assert.Equal(t, expectedParam.Name, param.Name) - assert.Equal(t, expectedParam.Summary, param.Summary) - assert.Equal(t, expectedParam.Type, convertParamType(*param.Type)) - assert.Equal(t, expectedParam.Unit, convertParamUnit(*param.Unit)) - switch expectedParam.Type { - case alert.Float: - if expectedParam.Value != nil { - require.NotNil(t, param.Float) - value, err := expectedParam.GetValueForFloat() - require.NoError(t, err) - assert.True(t, param.Float.HasDefault) - assert.Equal(t, value, param.Float.Default) - } - - if len(expectedParam.Range) != 0 { - min, max, err := expectedParam.GetRangeForFloat() - require.NoError(t, err) - assert.True(t, param.Float.HasMax) - assert.True(t, param.Float.HasMin) - assert.Equal(t, min, param.Float.Min) - assert.Equal(t, max, param.Float.Max) - } - - assert.Nil(t, param.Bool) - assert.Nil(t, param.String) - default: - } - } - - assert.Equal(t, expectedTemplate.Labels, tmpl.Labels) - assert.Equal(t, expectedTemplate.Annotations, tmpl.Annotations) - - expectedYAML, err := alert.ToYAML([]alert.Template{expectedTemplate}) - require.NoError(t, err) - assert.Equal(t, expectedYAML, tmpl.Yaml) - - assert.NotEmpty(t, tmpl.CreatedAt) -} - func TestTemplatesAPI(t *testing.T) { t.Parallel() client := alertingClient.Default.Alerting @@ -956,6 +526,90 @@ func TestTemplatesAPI(t *testing.T) { }) } +func assertTemplate(t *testing.T, expectedTemplate alert.Template, listTemplates []*alerting.ListTemplatesOKBodyTemplatesItems0) { + t.Helper() + convertParamUnit := func(u string) alert.Unit { + switch u { + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPERCENTAGE: + return alert.Percentage + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitSECONDS: + return alert.Seconds + } + return "INVALID" + } + convertParamType := func(u string) alert.Type { + switch u { + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeFLOAT: + return alert.Float + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeSTRING: + return alert.String + case alerting.ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeBOOL: + return alert.Bool + } + return "INVALID" + } + var tmpl *alerting.ListTemplatesOKBodyTemplatesItems0 + for _, listTmpl := range listTemplates { + if listTmpl.Name == expectedTemplate.Name { + tmpl = listTmpl + break + } + } + require.NotNilf(t, tmpl, "template %s not found", expectedTemplate.Name) + // IDE doesn't recognize that require stops execution + if tmpl == nil { + return + } + assert.Equal(t, expectedTemplate.Expr, tmpl.Expr) + assert.Equal(t, expectedTemplate.Summary, tmpl.Summary) + assert.Equal(t, "USER_API", *tmpl.Source) + assert.Equal(t, "SEVERITY_WARNING", *tmpl.Severity) + + forDuration := fmt.Sprintf("%.0fs", time.Duration(expectedTemplate.For).Seconds()) + assert.Equal(t, forDuration, tmpl.For) + + require.Len(t, tmpl.Params, len(expectedTemplate.Params)) + for i, expectedParam := range expectedTemplate.Params { + param := tmpl.Params[i] + assert.Equal(t, expectedParam.Name, param.Name) + assert.Equal(t, expectedParam.Summary, param.Summary) + assert.Equal(t, expectedParam.Type, convertParamType(*param.Type)) + assert.Equal(t, expectedParam.Unit, convertParamUnit(*param.Unit)) + switch expectedParam.Type { + case alert.Float: + if expectedParam.Value != nil { + require.NotNil(t, param.Float) + value, err := expectedParam.GetValueForFloat() + require.NoError(t, err) + assert.True(t, param.Float.HasDefault) + assert.Equal(t, value, param.Float.Default) + } + + if len(expectedParam.Range) != 0 { + min, max, err := expectedParam.GetRangeForFloat() + require.NoError(t, err) + assert.True(t, param.Float.HasMax) + assert.True(t, param.Float.HasMin) + assert.Equal(t, min, param.Float.Min) + assert.Equal(t, max, param.Float.Max) + } + + assert.Nil(t, param.Bool) + assert.Nil(t, param.String) + default: + } + } + + assert.Equal(t, expectedTemplate.Labels, tmpl.Labels) + assert.Equal(t, expectedTemplate.Annotations, tmpl.Annotations) + + expectedYAML, err := alert.ToYAML([]alert.Template{expectedTemplate}) + require.NoError(t, err) + assert.Equal(t, expectedYAML, tmpl.Yaml) + + assert.NotEmpty(t, tmpl.CreatedAt) +} + func deleteTemplate(t *testing.T, client alerting.ClientService, name string) { t.Helper()