diff --git a/.mockery.yaml b/.mockery.yaml index dcd62a20f75..d456b273ae5 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -38,7 +38,6 @@ packages: interfaces: agentsRegistry: agentsStateUpdater: - apiKeyProvider: checksService: connectionChecker: grafanaClient: diff --git a/admin/commands/annotation.go b/admin/commands/annotation.go index b6e0dfaf0dd..cec8202dc49 100644 --- a/admin/commands/annotation.go +++ b/admin/commands/annotation.go @@ -25,7 +25,7 @@ import ( nodes "github.com/percona/pmm/api/inventory/v1/json/client/nodes_service" services "github.com/percona/pmm/api/inventory/v1/json/client/services_service" managementClient "github.com/percona/pmm/api/management/v1/json/client" - annotation "github.com/percona/pmm/api/management/v1/json/client/annotation_service" + "github.com/percona/pmm/api/management/v1/json/client/service" ) var annotationResultT = ParseTemplate(` @@ -156,8 +156,8 @@ func (cmd *AnnotationCommand) RunCmd() (Result, error) { return nil, err } - _, err = managementClient.Default.AnnotationService.AddAnnotation(&annotation.AddAnnotationParams{ - Body: annotation.AddAnnotationBody{ + _, err = managementClient.Default.Service.AddAnnotation(&service.AddAnnotationParams{ + Body: service.AddAnnotationBody{ Text: cmd.Text, Tags: cmd.Tags, NodeName: nodeName, diff --git a/admin/commands/management/management.go b/admin/commands/management/management.go index 31c49e268c9..2a9c0350852 100644 --- a/admin/commands/management/management.go +++ b/admin/commands/management/management.go @@ -16,15 +16,14 @@ package management import ( - node "github.com/percona/pmm/api/management/v1/json/client/node_service" "github.com/percona/pmm/api/management/v1/json/client/service" ) var ( allNodeTypes = map[string]string{ - "generic": node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE, - "container": node.RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE, - "remote": node.RegisterNodeBodyNodeTypeNODETYPEREMOTENODE, + "generic": service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE, + "container": service.RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE, + "remote": service.RegisterNodeBodyNodeTypeNODETYPEREMOTENODE, } allServiceTypes = map[string]string{ diff --git a/admin/commands/management/register.go b/admin/commands/management/register.go index 962cf0cea35..39158a68498 100644 --- a/admin/commands/management/register.go +++ b/admin/commands/management/register.go @@ -21,7 +21,7 @@ import ( "github.com/percona/pmm/admin/commands" "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" + "github.com/percona/pmm/api/management/v1/json/client/service" ) var registerResultT = commands.ParseTemplate(` @@ -34,10 +34,10 @@ Warning: {{ .Warning }} `) type registerResult struct { - GenericNode *node.RegisterNodeOKBodyGenericNode `json:"generic_node"` - ContainerNode *node.RegisterNodeOKBodyContainerNode `json:"container_node"` - PMMAgent *node.RegisterNodeOKBodyPMMAgent `json:"pmm_agent"` - Warning string `json:"warning"` + GenericNode *service.RegisterNodeOKBodyGenericNode `json:"generic_node"` + ContainerNode *service.RegisterNodeOKBodyContainerNode `json:"container_node"` + PMMAgent *service.RegisterNodeOKBodyPMMAgent `json:"pmm_agent"` + Warning string `json:"warning"` } func (res *registerResult) Result() {} @@ -70,8 +70,8 @@ type RegisterCommand struct { func (cmd *RegisterCommand) RunCmd() (commands.Result, error) { customLabels := commands.ParseCustomLabels(cmd.CustomLabels) - params := &node.RegisterNodeParams{ - Body: node.RegisterNodeBody{ + params := &service.RegisterNodeParams{ + Body: service.RegisterNodeBody{ NodeType: pointer.ToString(allNodeTypes[cmd.NodeType]), NodeName: cmd.NodeName, MachineID: cmd.MachineID, @@ -91,7 +91,7 @@ func (cmd *RegisterCommand) RunCmd() (commands.Result, error) { }, Context: commands.Ctx, } - resp, err := client.Default.NodeService.RegisterNode(params) + resp, err := client.Default.Service.RegisterNode(params) if err != nil { return nil, err } diff --git a/admin/commands/management/register_test.go b/admin/commands/management/register_test.go index b002a91ba00..34d3f97d115 100644 --- a/admin/commands/management/register_test.go +++ b/admin/commands/management/register_test.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/assert" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" + "github.com/percona/pmm/api/management/v1/json/client/service" ) func TestRegisterResult(t *testing.T) { @@ -31,7 +31,7 @@ func TestRegisterResult(t *testing.T) { { name: "Success", result: registerResult{ - PMMAgent: &node.RegisterNodeOKBodyPMMAgent{ + PMMAgent: &service.RegisterNodeOKBodyPMMAgent{ AgentID: "/agent_id/new_id", RunsOnNodeID: "/node_id/second_id", }, @@ -45,7 +45,7 @@ Node ID : /node_id/second_id { name: "With warning", result: registerResult{ - PMMAgent: &node.RegisterNodeOKBodyPMMAgent{ + PMMAgent: &service.RegisterNodeOKBodyPMMAgent{ AgentID: "/agent_id/warning", RunsOnNodeID: "/node_id/warning_node", }, diff --git a/admin/commands/summary.go b/admin/commands/summary.go index b45c2ac4eec..2f9def70ba1 100644 --- a/admin/commands/summary.go +++ b/admin/commands/summary.go @@ -41,7 +41,7 @@ import ( agents_info "github.com/percona/pmm/api/agentlocal/v1/json/client/agent_local_service" "github.com/percona/pmm/api/inventory/v1/types" "github.com/percona/pmm/api/server/v1/json/client" - "github.com/percona/pmm/api/server/v1/json/client/server" + server "github.com/percona/pmm/api/server/v1/json/client/server_service" "github.com/percona/pmm/version" ) @@ -166,7 +166,7 @@ func addClientData(ctx context.Context, zipW *zip.Writer) { // addServerData adds logs.zip from PMM Server to zip file. func addServerData(ctx context.Context, zipW *zip.Writer, usePprof bool) { var buf bytes.Buffer - _, err := client.Default.Server.Logs(&server.LogsParams{Context: ctx, Pprof: &usePprof}, &buf) + _, err := client.Default.ServerService.Logs(&server.LogsParams{Context: ctx, Pprof: &usePprof}, &buf) if err != nil { logrus.Errorf("%s", err) return diff --git a/agent/commands/clients.go b/agent/commands/clients.go index 051cb566637..ae5319bbbb3 100644 --- a/agent/commands/clients.go +++ b/agent/commands/clients.go @@ -36,7 +36,7 @@ import ( "github.com/percona/pmm/agent/config" agentlocalClient "github.com/percona/pmm/api/agentlocal/v1/json/client" managementClient "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" + "github.com/percona/pmm/api/management/v1/json/client/service" "github.com/percona/pmm/utils/tlsconfig" ) @@ -162,8 +162,8 @@ func ParseCustomLabels(labels string) (map[string]string, error) { // This method is not thread-safe. func serverRegister(cfgSetup *config.Setup) (agentID, token string, _ error) { //nolint:nonamedreturns nodeTypes := map[string]string{ - "generic": node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE, - "container": node.RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE, + "generic": service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE, + "container": service.RegisterNodeBodyNodeTypeNODETYPECONTAINERNODE, } var disableCollectors []string @@ -179,8 +179,8 @@ func serverRegister(cfgSetup *config.Setup) (agentID, token string, _ error) { / return "", "", err } - res, err := managementClient.Default.NodeService.RegisterNode(&node.RegisterNodeParams{ - Body: node.RegisterNodeBody{ + res, err := managementClient.Default.Service.RegisterNode(&service.RegisterNodeParams{ + Body: service.RegisterNodeBody{ NodeType: pointer.ToString(nodeTypes[cfgSetup.NodeType]), NodeName: cfgSetup.NodeName, MachineID: cfgSetup.MachineID, diff --git a/agent/commands/setup.go b/agent/commands/setup.go index a685c846cd9..8861c9f1efe 100644 --- a/agent/commands/setup.go +++ b/agent/commands/setup.go @@ -27,7 +27,7 @@ import ( "github.com/percona/pmm/agent/config" agent_local "github.com/percona/pmm/api/agentlocal/v1/json/client/agent_local_service" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" + "github.com/percona/pmm/api/management/v1/json/client/service" ) // Setup implements `pmm-agent setup` command. @@ -142,7 +142,7 @@ func register(cfg *config.Config, l *logrus.Entry) { l.Debugf("Register error: %#v", err) if err != nil { msg := err.Error() - if e, _ := err.(*node.RegisterNodeDefault); e != nil { //nolint:errorlint + if e, _ := err.(*service.RegisterNodeDefault); e != nil { //nolint:errorlint msg = e.Payload.Message + "" switch e.Code() { case http.StatusConflict: diff --git a/api-tests/backup/backups_test.go b/api-tests/backup/backups_test.go index aedd8bb4f5e..93797d2f621 100644 --- a/api-tests/backup/backups_test.go +++ b/api-tests/backup/backups_test.go @@ -30,16 +30,15 @@ import ( backups "github.com/percona/pmm/api/backup/v1/json/client/backups_service" locations "github.com/percona/pmm/api/backup/v1/json/client/locations_service" managementClient "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" service "github.com/percona/pmm/api/management/v1/json/client/service" ) func TestScheduleBackup(t *testing.T) { t.Run("mongo", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := management.RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := management.RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer management.RemovePMMAgentWithSubAgents(t, pmmAgentID) diff --git a/api-tests/management/annotation_test.go b/api-tests/management/annotation_test.go index 26a482cf46f..60814eecda2 100644 --- a/api-tests/management/annotation_test.go +++ b/api-tests/management/annotation_test.go @@ -27,7 +27,7 @@ import ( nodes "github.com/percona/pmm/api/inventory/v1/json/client/nodes_service" services "github.com/percona/pmm/api/inventory/v1/json/client/services_service" "github.com/percona/pmm/api/management/v1/json/client" - annotation "github.com/percona/pmm/api/management/v1/json/client/annotation_service" + annotation "github.com/percona/pmm/api/management/v1/json/client/service" ) func TestAddAnnotation(t *testing.T) { @@ -39,7 +39,7 @@ func TestAddAnnotation(t *testing.T) { }, Context: pmmapitests.Context, } - _, err := client.Default.AnnotationService.AddAnnotation(params) + _, err := client.Default.Service.AddAnnotation(params) require.NoError(t, err) }) @@ -51,7 +51,7 @@ func TestAddAnnotation(t *testing.T) { }, Context: pmmapitests.Context, } - _, err := client.Default.AnnotationService.AddAnnotation(params) + _, err := client.Default.Service.AddAnnotation(params) pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAnnotationRequest.Text: value length must be at least 1 runes") }) @@ -63,7 +63,7 @@ func TestAddAnnotation(t *testing.T) { }, Context: pmmapitests.Context, } - _, err := client.Default.AnnotationService.AddAnnotation(params) + _, err := client.Default.Service.AddAnnotation(params) pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, `Service with name "no-service" not found.`) }) @@ -75,7 +75,7 @@ func TestAddAnnotation(t *testing.T) { }, Context: pmmapitests.Context, } - _, err := client.Default.AnnotationService.AddAnnotation(params) + _, err := client.Default.Service.AddAnnotation(params) pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, `Node with name "no-node" not found.`) }) @@ -121,7 +121,7 @@ func TestAddAnnotation(t *testing.T) { }, Context: pmmapitests.Context, } - _, err = client.Default.AnnotationService.AddAnnotation(paramsAdd) + _, err = client.Default.Service.AddAnnotation(paramsAdd) require.NoError(t, err) }) @@ -147,7 +147,7 @@ func TestAddAnnotation(t *testing.T) { }, Context: pmmapitests.Context, } - _, err = client.Default.AnnotationService.AddAnnotation(paramsAdd) + _, err = client.Default.Service.AddAnnotation(paramsAdd) require.NoError(t, err) }) } diff --git a/api-tests/management/haproxy_test.go b/api-tests/management/haproxy_test.go index 9d73570b8c3..588c88d100d 100644 --- a/api-tests/management/haproxy_test.go +++ b/api-tests/management/haproxy_test.go @@ -29,16 +29,15 @@ import ( nodes "github.com/percona/pmm/api/inventory/v1/json/client/nodes_service" services "github.com/percona/pmm/api/inventory/v1/json/client/services_service" "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" "github.com/percona/pmm/api/management/v1/json/client/service" ) func TestAddHAProxy(t *testing.T) { t.Run("Basic", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "genericNode-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -104,9 +103,9 @@ func TestAddHAProxy(t *testing.T) { t.Run("With labels", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "genericNode-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -252,9 +251,9 @@ func TestAddHAProxy(t *testing.T) { t.Run("With the same name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "genericNode-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) diff --git a/api-tests/management/helpers.go b/api-tests/management/helpers.go index 909ff6c4131..4af5dc607e5 100644 --- a/api-tests/management/helpers.go +++ b/api-tests/management/helpers.go @@ -29,19 +29,19 @@ import ( agents "github.com/percona/pmm/api/inventory/v1/json/client/agents_service" nodes "github.com/percona/pmm/api/inventory/v1/json/client/nodes_service" "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" + "github.com/percona/pmm/api/management/v1/json/client/service" ) // AgentStatusUnknown means agent is not connected and we don't know anything about its status. var AgentStatusUnknown = inventoryv1.AgentStatus_name[int32(inventoryv1.AgentStatus_AGENT_STATUS_UNKNOWN)] -func RegisterGenericNode(t pmmapitests.TestingT, body node.RegisterNodeBody) (string, string) { +func RegisterGenericNode(t pmmapitests.TestingT, body service.RegisterNodeBody) (string, string) { t.Helper() - params := node.RegisterNodeParams{ + params := service.RegisterNodeParams{ Context: pmmapitests.Context, Body: body, } - registerOK, err := client.Default.NodeService.RegisterNode(¶ms) + registerOK, err := client.Default.Service.RegisterNode(¶ms) require.NoError(t, err) require.NotNil(t, registerOK) require.NotNil(t, registerOK.Payload.PMMAgent) @@ -51,14 +51,14 @@ func RegisterGenericNode(t pmmapitests.TestingT, body node.RegisterNodeBody) (st return registerOK.Payload.GenericNode.NodeID, registerOK.Payload.PMMAgent.AgentID } -func registerContainerNode(t pmmapitests.TestingT, body node.RegisterNodeBody) (string, string) { +func registerContainerNode(t pmmapitests.TestingT, body service.RegisterNodeBody) (string, string) { t.Helper() - params := node.RegisterNodeParams{ + params := service.RegisterNodeParams{ Context: pmmapitests.Context, Body: body, } - registerOK, err := client.Default.NodeService.RegisterNode(¶ms) + registerOK, err := client.Default.Service.RegisterNode(¶ms) require.NoError(t, err) require.NotNil(t, registerOK) require.NotNil(t, registerOK.Payload.PMMAgent) diff --git a/api-tests/management/mongodb_test.go b/api-tests/management/mongodb_test.go index 8c8aba3bc25..f809c2a6006 100644 --- a/api-tests/management/mongodb_test.go +++ b/api-tests/management/mongodb_test.go @@ -28,16 +28,15 @@ import ( agents "github.com/percona/pmm/api/inventory/v1/json/client/agents_service" services "github.com/percona/pmm/api/inventory/v1/json/client/services_service" "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" "github.com/percona/pmm/api/management/v1/json/client/service" ) func TestAddMongoDB(t *testing.T) { t.Run("Basic", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -110,9 +109,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("With agents", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name-for-all-fields") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -203,9 +202,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("With labels", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name-for-all-fields") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -262,9 +261,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("With the same name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-the-same-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -308,9 +307,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("With add_node block", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -427,9 +426,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("With Wrong Node Type", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "generic-node-for-wrong-node-type") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -458,9 +457,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("Empty Service Name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -476,9 +475,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("Empty Address", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -499,9 +498,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("Empty Port", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -523,9 +522,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("Empty Pmm Agent ID", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -547,9 +546,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("Address And Socket Conflict.", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -575,9 +574,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("Socket", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-mongo-socket-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -647,9 +646,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("With MetricsModePush", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -722,9 +721,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("With MetricsModePull", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -796,9 +795,9 @@ func TestAddMongoDB(t *testing.T) { t.Run("With MetricsModeAuto", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -873,9 +872,9 @@ func TestAddMongoDB(t *testing.T) { func TestRemoveMongoDB(t *testing.T) { addMongoDB := func(t *testing.T, serviceName, nodeName string, withAgents bool) (nodeID string, pmmAgentID string, serviceID string) { t.Helper() - nodeID, pmmAgentID = RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID = RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) params := &service.AddMongoDBParams{ diff --git a/api-tests/management/mysql_test.go b/api-tests/management/mysql_test.go index 9ebdaa5b30a..959ba98c616 100644 --- a/api-tests/management/mysql_test.go +++ b/api-tests/management/mysql_test.go @@ -28,16 +28,15 @@ import ( agents "github.com/percona/pmm/api/inventory/v1/json/client/agents_service" services "github.com/percona/pmm/api/inventory/v1/json/client/services_service" "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" "github.com/percona/pmm/api/management/v1/json/client/service" ) func TestAddMySQL(t *testing.T) { t.Run("Basic", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -112,9 +111,9 @@ func TestAddMySQL(t *testing.T) { t.Run("With agents", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-all-fields-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -223,9 +222,9 @@ func TestAddMySQL(t *testing.T) { t.Run("With labels", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-all-fields-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -284,9 +283,9 @@ func TestAddMySQL(t *testing.T) { t.Run("With the same name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-the-same-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -332,9 +331,9 @@ func TestAddMySQL(t *testing.T) { t.Run("With add_node block", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -455,9 +454,9 @@ func TestAddMySQL(t *testing.T) { t.Run("With Wrong Node Type", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "generic-node-for-wrong-node-type") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -487,9 +486,9 @@ func TestAddMySQL(t *testing.T) { t.Run("Empty Service Name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -505,9 +504,9 @@ func TestAddMySQL(t *testing.T) { t.Run("Empty Address And Socket", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -530,9 +529,9 @@ func TestAddMySQL(t *testing.T) { t.Run("Empty Port", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -556,9 +555,9 @@ func TestAddMySQL(t *testing.T) { t.Run("Address And Socket Conflict.", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -584,9 +583,9 @@ func TestAddMySQL(t *testing.T) { t.Run("Empty Pmm Agent ID", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -608,9 +607,9 @@ func TestAddMySQL(t *testing.T) { t.Run("Empty username", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -633,9 +632,9 @@ func TestAddMySQL(t *testing.T) { t.Run("With MetricsModePush", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -710,9 +709,9 @@ func TestAddMySQL(t *testing.T) { t.Run("With MetricsModePull", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -786,9 +785,9 @@ func TestAddMySQL(t *testing.T) { t.Run("With MetricsModeAuto", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -865,9 +864,9 @@ func TestAddMySQL(t *testing.T) { func TestRemoveMySQL(t *testing.T) { addMySQL := func(t *testing.T, serviceName, nodeName string, withAgents bool) (nodeID string, pmmAgentID string, serviceID string) { t.Helper() - nodeID, pmmAgentID = RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID = RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) params := &service.AddMySQLParams{ diff --git a/api-tests/management/nodes_test.go b/api-tests/management/nodes_test.go index ade3932a26a..cfc3abea5a4 100644 --- a/api-tests/management/nodes_test.go +++ b/api-tests/management/nodes_test.go @@ -29,7 +29,7 @@ import ( agents "github.com/percona/pmm/api/inventory/v1/json/client/agents_service" nodes "github.com/percona/pmm/api/inventory/v1/json/client/nodes_service" "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" + node "github.com/percona/pmm/api/management/v1/json/client/service" ) func TestNodeRegister(t *testing.T) { @@ -79,7 +79,7 @@ func TestNodeRegister(t *testing.T) { Context: pmmapitests.Context, Body: body, } - _, err := client.Default.NodeService.RegisterNode(¶ms) + _, err := client.Default.Service.RegisterNode(¶ms) wantErr := fmt.Sprintf("Node with name %q already exists.", nodeName) pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, wantErr) }) @@ -106,7 +106,7 @@ func TestNodeRegister(t *testing.T) { Context: pmmapitests.Context, Body: body, } - node, err := client.Default.NodeService.RegisterNode(¶ms) + node, err := client.Default.Service.RegisterNode(¶ms) assert.NoError(t, err) defer pmmapitests.RemoveNodes(t, node.Payload.GenericNode.NodeID) @@ -135,7 +135,7 @@ func TestNodeRegister(t *testing.T) { Context: pmmapitests.Context, Body: body, } - _, err := client.Default.NodeService.RegisterNode(¶ms) + _, err := client.Default.Service.RegisterNode(¶ms) wantErr := fmt.Sprintf("Node with instance %q and region %q already exists.", body.Address, body.Region) pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, wantErr) }) @@ -163,7 +163,7 @@ func TestNodeRegister(t *testing.T) { Context: pmmapitests.Context, Body: body, } - node, err := client.Default.NodeService.RegisterNode(¶ms) + node, err := client.Default.Service.RegisterNode(¶ms) assert.NoError(t, err) defer pmmapitests.RemoveNodes(t, node.Payload.GenericNode.NodeID) @@ -430,7 +430,7 @@ func TestNodeRegister(t *testing.T) { Context: pmmapitests.Context, Body: node.RegisterNodeBody{}, } - registerOK, err := client.Default.NodeService.RegisterNode(¶ms) + registerOK, err := client.Default.Service.RegisterNode(¶ms) pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid RegisterNodeRequest.NodeName: value length must be at least 1 runes") require.Nil(t, registerOK) }) @@ -442,7 +442,7 @@ func TestNodeRegister(t *testing.T) { NodeName: pmmapitests.TestString(t, "node-name"), }, } - registerOK, err := client.Default.NodeService.RegisterNode(¶ms) + registerOK, err := client.Default.Service.RegisterNode(¶ms) pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, `Unsupported Node type "NODE_TYPE_UNSPECIFIED".`) require.Nil(t, registerOK) }) diff --git a/api-tests/management/postgresql_test.go b/api-tests/management/postgresql_test.go index 17e46c433a9..2038ffe5263 100644 --- a/api-tests/management/postgresql_test.go +++ b/api-tests/management/postgresql_test.go @@ -28,7 +28,6 @@ import ( agents "github.com/percona/pmm/api/inventory/v1/json/client/agents_service" services "github.com/percona/pmm/api/inventory/v1/json/client/services_service" "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" "github.com/percona/pmm/api/management/v1/json/client/service" ) @@ -37,9 +36,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("Basic", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -116,9 +115,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("With agents", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-all-fields-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -227,9 +226,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("With labels", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-all-fields-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -284,9 +283,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("With the same name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-the-same-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -333,9 +332,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("With add_node block", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -459,9 +458,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("With Wrong Node Type", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "generic-node-for-wrong-node-type") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -491,9 +490,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("Empty Service Name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -509,9 +508,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("Empty Address", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -533,9 +532,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("Empty Port", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -558,9 +557,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("Empty Pmm Agent ID", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -582,9 +581,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("Address And Socket Conflict.", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -610,9 +609,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("With MetricsModePush", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -688,9 +687,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("With MetricsModePull", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -765,9 +764,9 @@ func TestAddPostgreSQL(t *testing.T) { t.Run("With MetricsModeAuto", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -845,9 +844,9 @@ func TestAddPostgreSQL(t *testing.T) { func TestRemovePostgreSQL(t *testing.T) { addPostgreSQL := func(t *testing.T, serviceName, nodeName string, withAgents bool) (nodeID string, pmmAgentID string, serviceID string) { t.Helper() - nodeID, pmmAgentID = RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID = RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) params := &service.AddPostgreSQLParams{ diff --git a/api-tests/management/proxysql_test.go b/api-tests/management/proxysql_test.go index 6961b6a814a..9ef1c344c04 100644 --- a/api-tests/management/proxysql_test.go +++ b/api-tests/management/proxysql_test.go @@ -28,16 +28,15 @@ import ( agents "github.com/percona/pmm/api/inventory/v1/json/client/agents_service" services "github.com/percona/pmm/api/inventory/v1/json/client/services_service" "github.com/percona/pmm/api/management/v1/json/client" - node "github.com/percona/pmm/api/management/v1/json/client/node_service" "github.com/percona/pmm/api/management/v1/json/client/service" ) func TestAddProxySQL(t *testing.T) { t.Run("Basic", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -111,9 +110,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("With agents", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-all-fields-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -189,9 +188,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("With labels", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-all-fields-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -250,9 +249,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("With the same name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-the-same-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -298,9 +297,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("With add_node block", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-for-basic-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -420,9 +419,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("With Wrong Node Type", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "generic-node-for-wrong-node-type") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -452,9 +451,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("Empty Service Name", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -470,9 +469,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("Empty Address And Socket", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -494,9 +493,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("Empty Port", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -519,9 +518,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("Address And Socket Conflict.", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -547,9 +546,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("Empty Pmm Agent ID", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -571,9 +570,9 @@ func TestAddProxySQL(t *testing.T) { t.Run("Empty username", func(t *testing.T) { nodeName := pmmapitests.TestString(t, "node-name") - nodeID, pmmAgentID := RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID := RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) defer pmmapitests.RemoveNodes(t, nodeID) defer RemovePMMAgentWithSubAgents(t, pmmAgentID) @@ -598,9 +597,9 @@ func TestAddProxySQL(t *testing.T) { func TestRemoveProxySQL(t *testing.T) { addProxySQL := func(t *testing.T, serviceName, nodeName string) (nodeID string, pmmAgentID string, serviceID string) { t.Helper() - nodeID, pmmAgentID = RegisterGenericNode(t, node.RegisterNodeBody{ + nodeID, pmmAgentID = RegisterGenericNode(t, service.RegisterNodeBody{ NodeName: nodeName, - NodeType: pointer.ToString(node.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), + NodeType: pointer.ToString(service.RegisterNodeBodyNodeTypeNODETYPEGENERICNODE), }) params := &service.AddProxySQLParams{ diff --git a/api-tests/server/logs_test.go b/api-tests/server/logs_test.go index 3411a6cdb04..abee317d5ee 100644 --- a/api-tests/server/logs_test.go +++ b/api-tests/server/logs_test.go @@ -27,12 +27,12 @@ import ( pmmapitests "github.com/percona/pmm/api-tests" serverClient "github.com/percona/pmm/api/server/v1/json/client" - "github.com/percona/pmm/api/server/v1/json/client/server" + "github.com/percona/pmm/api/server/v1/json/client/server_service" ) func TestDownloadLogs(t *testing.T) { var buf bytes.Buffer - res, err := serverClient.Default.Server.Logs(&server.LogsParams{ + res, err := serverClient.Default.ServerService.Logs(&server_service.LogsParams{ Context: pmmapitests.Context, }, &buf) require.NoError(t, err) diff --git a/api/MIGRATION_TO_V3.md b/api/MIGRATION_TO_V3.md index df79414cf8c..e7dfee48eae 100644 --- a/api/MIGRATION_TO_V3.md +++ b/api/MIGRATION_TO_V3.md @@ -8,13 +8,13 @@ } ``` -| Current | Migrate to | Comments | -| ------------------------------ | ------------------------------------- | ---------------------------- | -| POST /v1/updates/Check | GET /v1/updates | | -| POST /v1/updates/Start | POST /v1/updates:start | | -| POST /v1/updates/Status | GET /v1/updates/status?log_offset=200 | "auth_token" - pass via headers | -| POST /v1/management/HAProxy/Add | POST /management/v1/services/HAProxy | | -| POST /v1/management/Service/Remove | DELETE /management/v1/services/{id} | {service_id} or {service_name} | +| Current | Migrate to | Comments | +| ------------------------------ | -------------------------------------------- | ------------------------------- | +| POST /v1/updates/Check | GET /updates/v1/update | | +| POST /v1/updates/Start | POST /updates/v1/update:start | | +| POST /v1/updates/Status | GET /updates/v1/update/status?log_offset=200 | "auth_token" - pass via headers | +| POST /v1/management/HAProxy/Add | POST /management/v1/services/HAProxy | | +| POST /v1/management/Service/Remove | DELETE /management/v1/services/{id} | {service_id} or {service_name} | // POST /v1/management/Service/Remove => DELETE /management/v1/services/{id} diff --git a/api/management/v1/agent/agent.pb.go b/api/management/v1/agent/agent.pb.go index 12f0258cad9..76a919e6d58 100644 --- a/api/management/v1/agent/agent.pb.go +++ b/api/management/v1/agent/agent.pb.go @@ -536,7 +536,7 @@ type UniversalAgent_MySQLOptions struct { unknownFields protoimpl.UnknownFields // True if TLS key is set. - IsTlsKeySet bool `protobuf:"varint,3,opt,name=is_tls_key_set,json=isTlsKeySet,proto3" json:"is_tls_key_set,omitempty"` + IsTlsKeySet bool `protobuf:"varint,1,opt,name=is_tls_key_set,json=isTlsKeySet,proto3" json:"is_tls_key_set,omitempty"` } func (x *UniversalAgent_MySQLOptions) Reset() { @@ -672,15 +672,15 @@ type UniversalAgent_MongoDBOptions struct { // True if TLS certificate file password is set. IsTlsCertificateKeyFilePasswordSet bool `protobuf:"varint,2,opt,name=is_tls_certificate_key_file_password_set,json=isTlsCertificateKeyFilePasswordSet,proto3" json:"is_tls_certificate_key_file_password_set,omitempty"` // MongoDB auth mechanism. - AuthenticationMechanism string `protobuf:"bytes,4,opt,name=authentication_mechanism,json=authenticationMechanism,proto3" json:"authentication_mechanism,omitempty"` + AuthenticationMechanism string `protobuf:"bytes,3,opt,name=authentication_mechanism,json=authenticationMechanism,proto3" json:"authentication_mechanism,omitempty"` // MongoDB auth database. - AuthenticationDatabase string `protobuf:"bytes,5,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"` + AuthenticationDatabase string `protobuf:"bytes,4,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"` // MongoDB stats collections. - StatsCollections []string `protobuf:"bytes,6,rep,name=stats_collections,json=statsCollections,proto3" json:"stats_collections,omitempty"` + StatsCollections []string `protobuf:"bytes,5,rep,name=stats_collections,json=statsCollections,proto3" json:"stats_collections,omitempty"` // MongoDB collections limit. - CollectionsLimit int32 `protobuf:"varint,7,opt,name=collections_limit,json=collectionsLimit,proto3" json:"collections_limit,omitempty"` + CollectionsLimit int32 `protobuf:"varint,6,opt,name=collections_limit,json=collectionsLimit,proto3" json:"collections_limit,omitempty"` // True if all collectors are enabled. - EnableAllCollectors bool `protobuf:"varint,8,opt,name=enable_all_collectors,json=enableAllCollectors,proto3" json:"enable_all_collectors,omitempty"` + EnableAllCollectors bool `protobuf:"varint,7,opt,name=enable_all_collectors,json=enableAllCollectors,proto3" json:"enable_all_collectors,omitempty"` } func (x *UniversalAgent_MongoDBOptions) Reset() { @@ -770,9 +770,9 @@ type UniversalAgent_PostgreSQLOptions struct { unknownFields protoimpl.UnknownFields // True if TLS key is set. - IsSslKeySet bool `protobuf:"varint,3,opt,name=is_ssl_key_set,json=isSslKeySet,proto3" json:"is_ssl_key_set,omitempty"` + IsSslKeySet bool `protobuf:"varint,1,opt,name=is_ssl_key_set,json=isSslKeySet,proto3" json:"is_ssl_key_set,omitempty"` // Limit of databases for auto-discovery. - AutoDiscoveryLimit int32 `protobuf:"varint,4,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` + AutoDiscoveryLimit int32 `protobuf:"varint,2,opt,name=auto_discovery_limit,json=autoDiscoveryLimit,proto3" json:"auto_discovery_limit,omitempty"` } func (x *UniversalAgent_PostgreSQLOptions) Reset() { @@ -834,7 +834,7 @@ var file_management_v1_agent_agent_proto_rawDesc = []byte{ 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, - 0xc7, 0x15, 0x0a, 0x0e, 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x41, 0x67, 0x65, + 0xa9, 0x15, 0x0a, 0x0e, 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x15, 0x69, 0x73, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, @@ -951,95 +951,93 @@ var file_management_v1_agent_agent_proto_rawDesc = []byte{ 0x52, 0x0b, 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x18, 0x28, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x1a, 0x3f, 0x0a, 0x0c, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x4f, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x1a, 0x33, 0x0a, 0x0c, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x74, 0x6c, 0x73, - 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x69, 0x73, 0x54, 0x6c, 0x73, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x74, 0x4a, 0x04, 0x08, 0x01, 0x10, - 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x1a, 0xc9, 0x01, 0x0a, 0x0c, 0x41, 0x7a, 0x75, 0x72, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x69, 0x73, 0x5f, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x53, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x27, 0x0a, - 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, - 0x74, 0x49, 0x64, 0x1a, 0xaa, 0x03, 0x0a, 0x0e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x74, 0x6c, 0x73, + 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x69, 0x73, 0x54, 0x6c, 0x73, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x74, 0x1a, 0xc9, 0x01, 0x0a, 0x0c, + 0x41, 0x7a, 0x75, 0x72, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x69, 0x73, 0x5f, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x73, 0x65, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x53, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x1a, 0xa4, 0x03, 0x0a, 0x0e, 0x4d, 0x6f, 0x6e, 0x67, + 0x6f, 0x44, 0x42, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x1a, 0x69, 0x73, + 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, + 0x69, 0x73, 0x54, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x53, 0x65, 0x74, 0x12, 0x54, 0x0a, 0x28, 0x69, 0x73, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, - 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x54, 0x6c, - 0x73, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x53, - 0x65, 0x74, 0x12, 0x54, 0x0a, 0x28, 0x69, 0x73, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x69, 0x6c, - 0x65, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x22, 0x69, 0x73, 0x54, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x74, 0x12, 0x39, 0x0a, 0x18, 0x61, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x63, 0x68, 0x61, - 0x6e, 0x69, 0x73, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x61, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, - 0x69, 0x73, 0x6d, 0x12, 0x37, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x11, - 0x73, 0x74, 0x61, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x73, 0x43, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x6c, - 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, - 0x1a, 0x76, 0x0a, 0x11, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x73, 0x73, 0x6c, 0x5f, - 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, - 0x73, 0x53, 0x73, 0x6c, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x75, - 0x74, 0x6f, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x75, 0x74, 0x6f, 0x44, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4a, 0x04, 0x08, 0x01, - 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 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, 0x22, 0x4b, 0x0a, 0x11, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, - 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x4b, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, - 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x69, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x73, 0x32, 0xbc, 0x01, 0x0a, 0x0c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0xab, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x73, + 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x22, 0x69, 0x73, 0x54, 0x6c, 0x73, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x46, 0x69, 0x6c, + 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x74, 0x12, 0x39, 0x0a, 0x18, + 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, + 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, + 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x12, 0x37, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, + 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x73, 0x74, 0x61, + 0x74, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, + 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x1a, 0x6a, + 0x0a, 0x11, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x73, 0x73, 0x6c, 0x5f, 0x6b, 0x65, + 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x53, + 0x73, 0x6c, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x75, 0x74, 0x6f, + 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x75, 0x74, 0x6f, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, 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, 0x22, 0x4b, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x4b, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, + 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, + 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x73, 0x32, 0xbc, 0x01, 0x0a, 0x0c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xab, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x31, 0x12, 0x0b, 0x4c, - 0x69, 0x73, 0x74, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x22, 0x52, 0x65, 0x74, 0x75, - 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x6c, - 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x4c, 0x69, - 0x73, 0x74, 0x42, 0xb1, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 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, 0x2f, 0x76, 0x31, - 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x3b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0d, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x19, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x31, 0x12, + 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x22, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, + 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2f, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0xb1, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 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, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x3b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0d, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x19, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/management/v1/agent/agent.proto b/api/management/v1/agent/agent.proto index e9d7ccc1ff6..33b1f0493da 100644 --- a/api/management/v1/agent/agent.proto +++ b/api/management/v1/agent/agent.proto @@ -8,10 +8,8 @@ import "protoc-gen-openapiv2/options/annotations.proto"; message UniversalAgent { message MySQLOptions { - reserved 1; // tls_ca - reserved 2; // tls_cert // True if TLS key is set. - bool is_tls_key_set = 3; + bool is_tls_key_set = 1; } message AzureOptions { @@ -32,26 +30,23 @@ message UniversalAgent { bool is_tls_certificate_key_set = 1; // True if TLS certificate file password is set. bool is_tls_certificate_key_file_password_set = 2; - reserved 3; // tls_ca // MongoDB auth mechanism. - string authentication_mechanism = 4; + string authentication_mechanism = 3; // MongoDB auth database. - string authentication_database = 5; + string authentication_database = 4; // MongoDB stats collections. - repeated string stats_collections = 6; + repeated string stats_collections = 5; // MongoDB collections limit. - int32 collections_limit = 7; + int32 collections_limit = 6; // True if all collectors are enabled. - bool enable_all_collectors = 8; + bool enable_all_collectors = 7; } message PostgreSQLOptions { - reserved 1; // ssl_ca - reserved 2; // ssl_cert // True if TLS key is set. - bool is_ssl_key_set = 3; + bool is_ssl_key_set = 1; // Limit of databases for auto-discovery. - int32 auto_discovery_limit = 4; + int32 auto_discovery_limit = 2; } // Unique agent identifier. diff --git a/api/management/v1/annotation.pb.go b/api/management/v1/annotation.pb.go index c118b4fe832..1e4cfe19204 100644 --- a/api/management/v1/annotation.pb.go +++ b/api/management/v1/annotation.pb.go @@ -15,7 +15,7 @@ import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" + _ "google.golang.org/protobuf/types/known/emptypb" ) const ( @@ -123,30 +123,19 @@ var file_management_v1_annotation_proto_rawDesc = []byte{ 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x32, - 0xb2, 0x01, 0x0a, 0x11, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x41, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x4e, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x41, 0x64, 0x64, 0x20, 0x41, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x10, 0x41, 0x64, 0x64, 0x73, 0x20, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 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, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x41, 0x64, 0x64, 0x42, 0xb0, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x41, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 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, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x42, + 0xb0, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 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, 0x2f, + 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -165,15 +154,12 @@ var ( file_management_v1_annotation_proto_msgTypes = make([]protoimpl.MessageInfo, 1) file_management_v1_annotation_proto_goTypes = []interface{}{ (*AddAnnotationRequest)(nil), // 0: management.v1.AddAnnotationRequest - (*emptypb.Empty)(nil), // 1: google.protobuf.Empty } ) var file_management_v1_annotation_proto_depIdxs = []int32{ - 0, // 0: management.v1.AnnotationService.AddAnnotation:input_type -> management.v1.AddAnnotationRequest - 1, // 1: management.v1.AnnotationService.AddAnnotation:output_type -> google.protobuf.Empty - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type + 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 @@ -206,7 +192,7 @@ func file_management_v1_annotation_proto_init() { NumEnums: 0, NumMessages: 1, NumExtensions: 0, - NumServices: 1, + NumServices: 0, }, GoTypes: file_management_v1_annotation_proto_goTypes, DependencyIndexes: file_management_v1_annotation_proto_depIdxs, diff --git a/api/management/v1/annotation.pb.gw.go b/api/management/v1/annotation.pb.gw.go deleted file mode 100644 index 44f8528224e..00000000000 --- a/api/management/v1/annotation.pb.gw.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: management/v1/annotation.proto - -/* -Package managementv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package managementv1 - -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_AnnotationService_AddAnnotation_0(ctx context.Context, marshaler runtime.Marshaler, client AnnotationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddAnnotationRequest - 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.AddAnnotation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_AnnotationService_AddAnnotation_0(ctx context.Context, marshaler runtime.Marshaler, server AnnotationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddAnnotationRequest - 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.AddAnnotation(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterAnnotationServiceHandlerServer registers the http handlers for service AnnotationService to "mux". -// UnaryRPC :call AnnotationServiceServer 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 RegisterAnnotationServiceHandlerFromEndpoint instead. -func RegisterAnnotationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AnnotationServiceServer) error { - mux.Handle("POST", pattern_AnnotationService_AddAnnotation_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, "/management.v1.AnnotationService/AddAnnotation", runtime.WithHTTPPathPattern("/v1/management/Annotations/Add")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AnnotationService_AddAnnotation_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_AnnotationService_AddAnnotation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterAnnotationServiceHandlerFromEndpoint is same as RegisterAnnotationServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAnnotationServiceHandlerFromEndpoint(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 RegisterAnnotationServiceHandler(ctx, mux, conn) -} - -// RegisterAnnotationServiceHandler registers the http handlers for service AnnotationService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAnnotationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAnnotationServiceHandlerClient(ctx, mux, NewAnnotationServiceClient(conn)) -} - -// RegisterAnnotationServiceHandlerClient registers the http handlers for service AnnotationService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AnnotationServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AnnotationServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AnnotationServiceClient" to call the correct interceptors. -func RegisterAnnotationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AnnotationServiceClient) error { - mux.Handle("POST", pattern_AnnotationService_AddAnnotation_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, "/management.v1.AnnotationService/AddAnnotation", runtime.WithHTTPPathPattern("/v1/management/Annotations/Add")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AnnotationService_AddAnnotation_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_AnnotationService_AddAnnotation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var pattern_AnnotationService_AddAnnotation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "Annotations", "Add"}, "")) - -var forward_AnnotationService_AddAnnotation_0 = runtime.ForwardResponseMessage diff --git a/api/management/v1/annotation.proto b/api/management/v1/annotation.proto index b630c7c359c..9fcdfe93628 100644 --- a/api/management/v1/annotation.proto +++ b/api/management/v1/annotation.proto @@ -2,9 +2,6 @@ syntax = "proto3"; package management.v1; -import "google/api/annotations.proto"; -import "google/protobuf/empty.proto"; -import "protoc-gen-openapiv2/options/annotations.proto"; import "validate/validate.proto"; // AddAnnotationRequest is a params to add new annotation. @@ -18,18 +15,3 @@ message AddAnnotationRequest { // Used for annotate services. repeated string service_names = 4; } - -// Annotation service provides public methods for managing Annotations. -service AnnotationService { - // AddAnnotation adds annotation. - rpc AddAnnotation(AddAnnotationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/management/Annotations/Add" - body: "*" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Annotation" - description: "Adds annotation." - }; - } -} diff --git a/api/management/v1/annotation_grpc.pb.go b/api/management/v1/annotation_grpc.pb.go deleted file mode 100644 index 304799768c0..00000000000 --- a/api/management/v1/annotation_grpc.pb.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: management/v1/annotation.proto - -package managementv1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// 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 ( - AnnotationService_AddAnnotation_FullMethodName = "/management.v1.AnnotationService/AddAnnotation" -) - -// AnnotationServiceClient is the client API for AnnotationService 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 AnnotationServiceClient interface { - // AddAnnotation adds annotation. - AddAnnotation(ctx context.Context, in *AddAnnotationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type annotationServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAnnotationServiceClient(cc grpc.ClientConnInterface) AnnotationServiceClient { - return &annotationServiceClient{cc} -} - -func (c *annotationServiceClient) AddAnnotation(ctx context.Context, in *AddAnnotationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, AnnotationService_AddAnnotation_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AnnotationServiceServer is the server API for AnnotationService service. -// All implementations must embed UnimplementedAnnotationServiceServer -// for forward compatibility -type AnnotationServiceServer interface { - // AddAnnotation adds annotation. - AddAnnotation(context.Context, *AddAnnotationRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedAnnotationServiceServer() -} - -// UnimplementedAnnotationServiceServer must be embedded to have forward compatible implementations. -type UnimplementedAnnotationServiceServer struct{} - -func (UnimplementedAnnotationServiceServer) AddAnnotation(context.Context, *AddAnnotationRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddAnnotation not implemented") -} -func (UnimplementedAnnotationServiceServer) mustEmbedUnimplementedAnnotationServiceServer() {} - -// UnsafeAnnotationServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AnnotationServiceServer will -// result in compilation errors. -type UnsafeAnnotationServiceServer interface { - mustEmbedUnimplementedAnnotationServiceServer() -} - -func RegisterAnnotationServiceServer(s grpc.ServiceRegistrar, srv AnnotationServiceServer) { - s.RegisterService(&AnnotationService_ServiceDesc, srv) -} - -func _AnnotationService_AddAnnotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddAnnotationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AnnotationServiceServer).AddAnnotation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AnnotationService_AddAnnotation_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AnnotationServiceServer).AddAnnotation(ctx, req.(*AddAnnotationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AnnotationService_ServiceDesc is the grpc.ServiceDesc for AnnotationService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AnnotationService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "management.v1.AnnotationService", - HandlerType: (*AnnotationServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AddAnnotation", - Handler: _AnnotationService_AddAnnotation_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "management/v1/annotation.proto", -} diff --git a/api/management/v1/json/client/annotation_service/annotation_service_client.go b/api/management/v1/json/client/annotation_service/annotation_service_client.go deleted file mode 100644 index a7048109172..00000000000 --- a/api/management/v1/json/client/annotation_service/annotation_service_client.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package annotation_service - -// 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 annotation service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for annotation service 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 { - AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddAnnotation adds annotation - -Adds annotation. -*/ -func (a *Client) AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAddAnnotationParams() - } - op := &runtime.ClientOperation{ - ID: "AddAnnotation", - Method: "POST", - PathPattern: "/v1/management/Annotations/Add", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &AddAnnotationReader{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.(*AddAnnotationOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*AddAnnotationDefault) - 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/management/v1/json/client/node_service/node_service_client.go b/api/management/v1/json/client/node_service/node_service_client.go deleted file mode 100644 index 241618cb6ca..00000000000 --- a/api/management/v1/json/client/node_service/node_service_client.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_service - -// 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 node service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for node service 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 { - RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -RegisterNode registers node - -Registers a new Node and pmm-agent. -*/ -func (a *Client) RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewRegisterNodeParams() - } - op := &runtime.ClientOperation{ - ID: "RegisterNode", - Method: "POST", - PathPattern: "/v1/management/Node/Register", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &RegisterNodeReader{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.(*RegisterNodeOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*RegisterNodeDefault) - 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/management/v1/json/client/pmm_management_api_client.go b/api/management/v1/json/client/pmm_management_api_client.go index fe5c9e991a8..ba4d958f3e9 100644 --- a/api/management/v1/json/client/pmm_management_api_client.go +++ b/api/management/v1/json/client/pmm_management_api_client.go @@ -10,8 +10,6 @@ import ( httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - "github.com/percona/pmm/api/management/v1/json/client/annotation_service" - "github.com/percona/pmm/api/management/v1/json/client/node_service" "github.com/percona/pmm/api/management/v1/json/client/service" ) @@ -57,8 +55,6 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMManagem cli := new(PMMManagementAPI) cli.Transport = transport - cli.AnnotationService = annotation_service.New(transport, formats) - cli.NodeService = node_service.New(transport, formats) cli.Service = service.New(transport, formats) return cli } @@ -104,10 +100,6 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { // PMMManagementAPI is a client for PMM management API type PMMManagementAPI struct { - AnnotationService annotation_service.ClientService - - NodeService node_service.ClientService - Service service.ClientService Transport runtime.ClientTransport @@ -116,7 +108,5 @@ type PMMManagementAPI struct { // SetTransport changes the transport on the client and all its subresources func (c *PMMManagementAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport - c.AnnotationService.SetTransport(transport) - c.NodeService.SetTransport(transport) c.Service.SetTransport(transport) } diff --git a/api/management/v1/json/client/annotation_service/add_annotation_parameters.go b/api/management/v1/json/client/service/add_annotation_parameters.go similarity index 99% rename from api/management/v1/json/client/annotation_service/add_annotation_parameters.go rename to api/management/v1/json/client/service/add_annotation_parameters.go index 141ce596979..297ffbfc2a8 100644 --- a/api/management/v1/json/client/annotation_service/add_annotation_parameters.go +++ b/api/management/v1/json/client/service/add_annotation_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package annotation_service +package service // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/api/management/v1/json/client/annotation_service/add_annotation_responses.go b/api/management/v1/json/client/service/add_annotation_responses.go similarity index 99% rename from api/management/v1/json/client/annotation_service/add_annotation_responses.go rename to api/management/v1/json/client/service/add_annotation_responses.go index 4e147002e2a..abdba7bdda3 100644 --- a/api/management/v1/json/client/annotation_service/add_annotation_responses.go +++ b/api/management/v1/json/client/service/add_annotation_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package annotation_service +package service // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/api/management/v1/json/client/node_service/register_node_parameters.go b/api/management/v1/json/client/service/register_node_parameters.go similarity index 99% rename from api/management/v1/json/client/node_service/register_node_parameters.go rename to api/management/v1/json/client/service/register_node_parameters.go index daca21549e9..f0ff6510aec 100644 --- a/api/management/v1/json/client/node_service/register_node_parameters.go +++ b/api/management/v1/json/client/service/register_node_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package node_service +package service // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/api/management/v1/json/client/node_service/register_node_responses.go b/api/management/v1/json/client/service/register_node_responses.go similarity index 99% rename from api/management/v1/json/client/node_service/register_node_responses.go rename to api/management/v1/json/client/service/register_node_responses.go index 240c6e2a1e1..03d54186f26 100644 --- a/api/management/v1/json/client/node_service/register_node_responses.go +++ b/api/management/v1/json/client/service/register_node_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package node_service +package service // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/api/management/v1/json/client/service/service_client.go b/api/management/v1/json/client/service/service_client.go index 595612cd0e9..48e6222d56d 100644 --- a/api/management/v1/json/client/service/service_client.go +++ b/api/management/v1/json/client/service/service_client.go @@ -28,6 +28,8 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { + AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) + AddExternal(params *AddExternalParams, opts ...ClientOption) (*AddExternalOK, error) AddHAProxy(params *AddHAProxyParams, opts ...ClientOption) (*AddHAProxyOK, error) @@ -44,11 +46,52 @@ type ClientService interface { DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) + RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) + RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) SetTransport(transport runtime.ClientTransport) } +/* +AddAnnotation adds annotation + +Adds an annotation. +*/ +func (a *Client) AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddAnnotationParams() + } + op := &runtime.ClientOperation{ + ID: "AddAnnotation", + Method: "POST", + PathPattern: "/v1/management/Annotations/Add", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddAnnotationReader{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.(*AddAnnotationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*AddAnnotationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* AddExternal adds external service @@ -361,6 +404,45 @@ func (a *Client) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (* return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +RegisterNode registers node + +Registers a new Node and pmm-agent. +*/ +func (a *Client) RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRegisterNodeParams() + } + op := &runtime.ClientOperation{ + ID: "RegisterNode", + Method: "POST", + PathPattern: "/v1/management/Node/Register", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RegisterNodeReader{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.(*RegisterNodeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RegisterNodeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* RemoveService removes service diff --git a/api/management/v1/json/v1.json b/api/management/v1/json/v1.json index 7e969439e5f..c2ce227c7e2 100644 --- a/api/management/v1/json/v1.json +++ b/api/management/v1/json/v1.json @@ -17,9 +17,9 @@ "paths": { "/v1/management/Annotations/Add": { "post": { - "description": "Adds annotation.", + "description": "Adds an annotation.", "tags": [ - "AnnotationService" + "Service" ], "summary": "Add Annotation", "operationId": "AddAnnotation", @@ -2143,7 +2143,7 @@ "post": { "description": "Registers a new Node and pmm-agent.", "tags": [ - "NodeService" + "Service" ], "summary": "Register Node", "operationId": "RegisterNode", @@ -4817,12 +4817,6 @@ } }, "tags": [ - { - "name": "AnnotationService" - }, - { - "name": "NodeService" - }, { "name": "Service" } diff --git a/api/management/v1/node.pb.go b/api/management/v1/node.pb.go index c5e606e29fa..22a8748d249 100644 --- a/api/management/v1/node.pb.go +++ b/api/management/v1/node.pb.go @@ -528,31 +528,19 @@ var file_management_v1_node_proto_rawDesc = []byte{ 0x6e, 0x74, 0x52, 0x08, 0x70, 0x6d, 0x6d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x32, 0xc7, 0x01, 0x0a, - 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb7, 0x01, 0x0a, - 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0x92, 0x41, 0x34, 0x12, 0x0d, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x23, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x4e, 0x6f, 0x64, 0x65, - 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x6d, 0x6d, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 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, 0x4e, 0x6f, 0x64, 0x65, 0x2f, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x42, 0xaa, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x4e, 0x6f, - 0x64, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 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, - 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0xaa, 0x01, 0x0a, + 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x76, 0x31, 0x42, 0x09, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x35, 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, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -592,10 +580,8 @@ var file_management_v1_node_proto_depIdxs = []int32{ 7, // 5: management.v1.RegisterNodeResponse.generic_node:type_name -> inventory.v1.GenericNode 8, // 6: management.v1.RegisterNodeResponse.container_node:type_name -> inventory.v1.ContainerNode 9, // 7: management.v1.RegisterNodeResponse.pmm_agent:type_name -> inventory.v1.PMMAgent - 1, // 8: management.v1.NodeService.RegisterNode:input_type -> management.v1.RegisterNodeRequest - 2, // 9: management.v1.NodeService.RegisterNode:output_type -> management.v1.RegisterNodeResponse - 9, // [9:10] is the sub-list for method output_type - 8, // [8:9] is the sub-list for method input_type + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name 8, // [8:8] is the sub-list for extension extendee 0, // [0:8] is the sub-list for field type_name @@ -653,7 +639,7 @@ func file_management_v1_node_proto_init() { NumEnums: 0, NumMessages: 5, NumExtensions: 0, - NumServices: 1, + NumServices: 0, }, GoTypes: file_management_v1_node_proto_goTypes, DependencyIndexes: file_management_v1_node_proto_depIdxs, diff --git a/api/management/v1/node.pb.gw.go b/api/management/v1/node.pb.gw.go deleted file mode 100644 index 0e58d00bc4c..00000000000 --- a/api/management/v1/node.pb.gw.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: management/v1/node.proto - -/* -Package managementv1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package managementv1 - -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_NodeService_RegisterNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RegisterNodeRequest - 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.RegisterNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_NodeService_RegisterNode_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RegisterNodeRequest - 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.RegisterNode(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterNodeServiceHandlerServer registers the http handlers for service NodeService to "mux". -// UnaryRPC :call NodeServiceServer 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 RegisterNodeServiceHandlerFromEndpoint instead. -func RegisterNodeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeServiceServer) error { - mux.Handle("POST", pattern_NodeService_RegisterNode_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, "/management.v1.NodeService/RegisterNode", runtime.WithHTTPPathPattern("/v1/management/Node/Register")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_NodeService_RegisterNode_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_NodeService_RegisterNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterNodeServiceHandlerFromEndpoint is same as RegisterNodeServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterNodeServiceHandlerFromEndpoint(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 RegisterNodeServiceHandler(ctx, mux, conn) -} - -// RegisterNodeServiceHandler registers the http handlers for service NodeService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterNodeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterNodeServiceHandlerClient(ctx, mux, NewNodeServiceClient(conn)) -} - -// RegisterNodeServiceHandlerClient registers the http handlers for service NodeService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "NodeServiceClient" to call the correct interceptors. -func RegisterNodeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeServiceClient) error { - mux.Handle("POST", pattern_NodeService_RegisterNode_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, "/management.v1.NodeService/RegisterNode", runtime.WithHTTPPathPattern("/v1/management/Node/Register")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_NodeService_RegisterNode_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_NodeService_RegisterNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var pattern_NodeService_RegisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "Node", "Register"}, "")) - -var forward_NodeService_RegisterNode_0 = runtime.ForwardResponseMessage diff --git a/api/management/v1/node.proto b/api/management/v1/node.proto index 6184c49fdec..938d09fea30 100644 --- a/api/management/v1/node.proto +++ b/api/management/v1/node.proto @@ -79,18 +79,3 @@ message RegisterNodeResponse { // Warning message. string warning = 5; } - -// Node service provides public Management API methods for Nodes. -service NodeService { - // RegisterNode registers a new Node and pmm-agent. - rpc RegisterNode(RegisterNodeRequest) returns (RegisterNodeResponse) { - option (google.api.http) = { - post: "/v1/management/Node/Register" - body: "*" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Register Node" - description: "Registers a new Node and pmm-agent." - }; - } -} diff --git a/api/management/v1/node_grpc.pb.go b/api/management/v1/node_grpc.pb.go deleted file mode 100644 index 7ec1704b1fb..00000000000 --- a/api/management/v1/node_grpc.pb.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: management/v1/node.proto - -package managementv1 - -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 ( - NodeService_RegisterNode_FullMethodName = "/management.v1.NodeService/RegisterNode" -) - -// NodeServiceClient is the client API for NodeService 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 NodeServiceClient interface { - // RegisterNode registers a new Node and pmm-agent. - RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) -} - -type nodeServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient { - return &nodeServiceClient{cc} -} - -func (c *nodeServiceClient) RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) { - out := new(RegisterNodeResponse) - err := c.cc.Invoke(ctx, NodeService_RegisterNode_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NodeServiceServer is the server API for NodeService service. -// All implementations must embed UnimplementedNodeServiceServer -// for forward compatibility -type NodeServiceServer interface { - // RegisterNode registers a new Node and pmm-agent. - RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) - mustEmbedUnimplementedNodeServiceServer() -} - -// UnimplementedNodeServiceServer must be embedded to have forward compatible implementations. -type UnimplementedNodeServiceServer struct{} - -func (UnimplementedNodeServiceServer) RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterNode not implemented") -} -func (UnimplementedNodeServiceServer) mustEmbedUnimplementedNodeServiceServer() {} - -// UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to NodeServiceServer will -// result in compilation errors. -type UnsafeNodeServiceServer interface { - mustEmbedUnimplementedNodeServiceServer() -} - -func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) { - s.RegisterService(&NodeService_ServiceDesc, srv) -} - -func _NodeService_RegisterNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).RegisterNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: NodeService_RegisterNode_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).RegisterNode(ctx, req.(*RegisterNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var NodeService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "management.v1.NodeService", - HandlerType: (*NodeServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RegisterNode", - Handler: _NodeService_RegisterNode_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "management/v1/node.proto", -} diff --git a/api/management/v1/service.pb.go b/api/management/v1/service.pb.go index 47eaee02d1f..24d39a55e38 100644 --- a/api/management/v1/service.pb.go +++ b/api/management/v1/service.pb.go @@ -106,7 +106,9 @@ var file_management_v1_service_proto_rawDesc = []byte{ 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x61, 0x70, 0x72, @@ -114,210 +116,233 @@ var file_management_v1_service_proto_rawDesc = []byte{ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, - 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1c, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, - 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x17, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x72, - 0x64, 0x73, 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, 0x96, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0xc1, 0x15, 0x0a, 0x07, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x86, 0x03, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaf, 0x02, - 0x92, 0x41, 0x85, 0x02, 0x12, 0x14, 0x41, 0x64, 0x64, 0x20, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0xec, 0x01, 0x41, 0x64, 0x64, - 0x73, 0x20, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x20, 0x49, - 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, - 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, - 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, - 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, - 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, 0x64, 0x65, 0x5f, - 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, - 0x6e, 0x20, 0x22, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x72, 0x22, 0x20, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x69, + 0x6f, 0x1a, 0x18, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, + 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x67, + 0x72, 0x65, 0x73, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x73, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x64, 0x73, 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, 0x96, 0x01, 0x0a, 0x14, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x9d, 0x18, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x9f, 0x01, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x51, 0x92, 0x41, 0x25, 0x12, 0x0e, 0x41, 0x64, 0x64, 0x20, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x13, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 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, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x41, + 0x64, 0x64, 0x12, 0xb7, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, + 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0x92, 0x41, + 0x34, 0x12, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, + 0x1a, 0x23, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x20, 0x61, 0x20, 0x6e, 0x65, + 0x77, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x6d, 0x6d, 0x2d, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 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, 0x4e, + 0x6f, 0x64, 0x65, 0x2f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x86, 0x03, 0x0a, + 0x0b, 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x21, 0x2e, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, + 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xaf, 0x02, 0x92, 0x41, 0x85, 0x02, 0x12, 0x14, 0x41, 0x64, 0x64, 0x20, + 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x1a, 0xec, 0x01, 0x41, 0x64, 0x64, 0x73, 0x20, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x64, 0x64, + 0x73, 0x20, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x72, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, + 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, + 0x22, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, + 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x22, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, 0x20, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, + 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, + 0x20, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x72, 0x75, + 0x6e, 0x73, 0x5f, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x41, 0x64, 0x64, 0x12, 0xcb, 0x02, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, + 0x72, 0x6f, 0x78, 0x79, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf7, 0x01, 0x92, 0x41, 0xce, 0x01, + 0x12, 0x0b, 0x41, 0x64, 0x64, 0x20, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x1a, 0xbe, 0x01, + 0x41, 0x64, 0x64, 0x73, 0x20, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x61, + 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x64, 0x64, + 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, - 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x72, 0x75, 0x6e, 0x73, 0x5f, 0x6f, 0x6e, 0x5f, - 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, - 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x2f, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x41, 0x64, 0x64, 0x12, - 0xcb, 0x02, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x20, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0xf7, 0x01, 0x92, 0x41, 0xce, 0x01, 0x12, 0x0b, 0x41, 0x64, 0x64, 0x20, - 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x1a, 0xbe, 0x01, 0x41, 0x64, 0x64, 0x73, 0x20, 0x48, - 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, - 0x6e, 0x64, 0x20, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x72, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, - 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x20, - 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x22, 0x65, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, - 0x20, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, - 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x2f, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x41, 0x64, 0x64, 0x12, 0x80, 0x03, - 0x0a, 0x08, 0x41, 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x79, - 0x53, 0x51, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x79, - 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb2, 0x02, 0x92, 0x41, - 0x8b, 0x02, 0x12, 0x09, 0x41, 0x64, 0x64, 0x20, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x1a, 0xfd, 0x01, - 0x41, 0x64, 0x64, 0x73, 0x20, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x73, 0x65, - 0x76, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x49, 0x74, - 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, - 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, - 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, - 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, - 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, - 0x73, 0x20, 0x22, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x72, 0x22, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x22, 0x71, 0x61, 0x6e, 0x5f, 0x6d, 0x79, - 0x73, 0x71, 0x6c, 0x5f, 0x70, 0x65, 0x72, 0x66, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x20, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x70, 0x6d, 0x6d, 0x5f, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, - 0x72, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x2f, 0x41, 0x64, 0x64, - 0x12, 0x8d, 0x03, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x12, - 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb9, 0x02, 0x92, 0x41, 0x90, 0x02, 0x12, 0x0b, 0x41, 0x64, 0x64, - 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x1a, 0x80, 0x02, 0x41, 0x64, 0x64, 0x73, 0x20, - 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x73, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x6c, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x61, 0x75, - 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x64, 0x64, 0x73, - 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, - 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, 0x64, 0x65, 0x5f, - 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x22, - 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, - 0x22, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x22, 0x71, 0x61, 0x6e, 0x5f, 0x6d, 0x6f, 0x6e, 0x67, - 0x6f, 0x64, 0x62, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x22, 0x20, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x70, 0x6d, 0x6d, 0x5f, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x5f, 0x69, 0x64, 0x22, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x2f, 0x41, 0x64, 0x64, - 0x12, 0xf8, 0x02, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, - 0x51, 0x4c, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, - 0x72, 0x65, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9b, 0x02, - 0x92, 0x41, 0xef, 0x01, 0x12, 0x0e, 0x41, 0x64, 0x64, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, - 0x65, 0x53, 0x51, 0x4c, 0x1a, 0xdc, 0x01, 0x41, 0x64, 0x64, 0x73, 0x20, 0x50, 0x6f, 0x73, 0x74, - 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, - 0x6e, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, - 0x65, 0x73, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x20, 0x49, 0x74, 0x20, - 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x64, - 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, - 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, - 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x22, 0x70, 0x6f, - 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, - 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, + 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, + 0x61, 0x6e, 0x20, 0x22, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x65, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, 0x20, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2f, + 0x41, 0x64, 0x64, 0x12, 0x80, 0x03, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, 0x4c, + 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xb2, 0x02, 0x92, 0x41, 0x8b, 0x02, 0x12, 0x09, 0x41, 0x64, 0x64, 0x20, 0x4d, 0x79, + 0x53, 0x51, 0x4c, 0x1a, 0xfd, 0x01, 0x41, 0x64, 0x64, 0x73, 0x20, 0x4d, 0x79, 0x53, 0x51, 0x4c, + 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x73, 0x20, 0x73, 0x65, 0x76, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, + 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, + 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x22, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, 0x5f, + 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x22, + 0x71, 0x61, 0x6e, 0x5f, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x70, 0x65, 0x72, 0x66, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x22, 0x20, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x69, 0x74, + 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x70, 0x6d, 0x6d, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x2e, 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, 0x50, 0x6f, 0x73, - 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x2f, 0x41, 0x64, 0x64, 0x12, 0xe9, 0x02, 0x0a, 0x0b, - 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x12, 0x21, 0x2e, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x92, 0x02, 0x92, 0x41, 0xe8, 0x01, 0x12, 0x0c, 0x41, 0x64, 0x64, 0x20, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x1a, 0xd7, 0x01, 0x41, 0x64, 0x64, 0x73, 0x20, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x73, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x6c, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x61, 0x75, - 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x64, 0x64, 0x73, - 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, - 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2c, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, 0x20, 0x77, - 0x69, 0x74, 0x68, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x70, 0x6d, + 0x72, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x4d, 0x79, 0x53, + 0x51, 0x4c, 0x2f, 0x41, 0x64, 0x64, 0x12, 0x8d, 0x03, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x4d, 0x6f, + 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, + 0x44, 0x42, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb9, 0x02, 0x92, 0x41, 0x90, + 0x02, 0x12, 0x0b, 0x41, 0x64, 0x64, 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x1a, 0x80, + 0x02, 0x41, 0x64, 0x64, 0x73, 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x20, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, + 0x20, 0x73, 0x65, 0x76, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x20, 0x49, 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, + 0x79, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x77, + 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, + 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, + 0x22, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, + 0x61, 0x64, 0x64, 0x73, 0x20, 0x22, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x65, 0x78, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x22, 0x71, 0x61, + 0x6e, 0x5f, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x72, 0x22, 0x20, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x70, 0x6d, 0x6d, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, + 0x44, 0x42, 0x2f, 0x41, 0x64, 0x64, 0x12, 0xf8, 0x02, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x50, 0x6f, + 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x74, + 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, + 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x9b, 0x02, 0x92, 0x41, 0xef, 0x01, 0x12, 0x0e, 0x41, 0x64, 0x64, 0x20, + 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x1a, 0xdc, 0x01, 0x41, 0x64, 0x64, + 0x73, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, + 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x72, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, + 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, + 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, + 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, + 0x64, 0x73, 0x20, 0x22, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x5f, 0x65, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x70, 0x6d, 0x6d, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x22, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, 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, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x2f, 0x41, 0x64, + 0x64, 0x12, 0xe9, 0x02, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, + 0x4c, 0x12, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x92, 0x02, 0x92, 0x41, 0xe8, 0x01, 0x12, + 0x0c, 0x41, 0x64, 0x64, 0x20, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x1a, 0xd7, 0x01, + 0x41, 0x64, 0x64, 0x73, 0x20, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, + 0x20, 0x73, 0x65, 0x76, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x20, 0x49, 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, + 0x79, 0x20, 0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x77, + 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, + 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x22, 0x6e, 0x6f, 0x64, + 0x65, 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x73, + 0x20, 0x22, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x72, 0x22, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x64, 0x20, 0x22, 0x70, 0x6d, 0x6d, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x22, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, + 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x2f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x2f, 0x41, 0x64, 0x64, 0x12, 0xa7, 0x01, + 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x12, 0x21, 0x2e, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x92, 0x41, 0x28, 0x12, 0x0c, 0x44, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x20, 0x52, 0x44, 0x53, 0x1a, 0x18, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x73, 0x20, 0x52, 0x44, 0x53, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x53, 0x51, 0x4c, 0x2f, 0x41, 0x64, 0x64, 0x12, 0xa7, 0x01, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x12, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, - 0x92, 0x41, 0x28, 0x12, 0x0c, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x52, 0x44, - 0x53, 0x1a, 0x18, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x73, 0x20, 0x52, 0x44, 0x53, - 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x52, 0x44, 0x53, 0x2f, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x12, 0x88, 0x01, 0x0a, 0x06, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x12, 0x1c, 0x2e, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, - 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x44, - 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x92, 0x41, 0x1d, 0x12, 0x07, - 0x41, 0x64, 0x64, 0x20, 0x52, 0x44, 0x53, 0x1a, 0x12, 0x41, 0x64, 0x64, 0x73, 0x20, 0x52, 0x44, - 0x53, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x52, 0x44, 0x53, 0x2f, 0x41, 0x64, 0x64, 0x12, 0xaf, 0x01, 0x0a, - 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x23, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x61, 0x92, 0x41, 0x36, - 0x12, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x1a, 0x24, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, 0x61, 0x20, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x20, 0x61, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 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, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0xad, - 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 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, 0x2f, 0x76, 0x31, 0x3b, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, - 0x58, 0xaa, 0x02, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x19, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x52, 0x44, 0x53, 0x2f, 0x44, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x88, 0x01, 0x0a, 0x06, 0x41, 0x64, 0x64, 0x52, + 0x44, 0x53, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x41, 0x92, 0x41, 0x1d, 0x12, 0x07, 0x41, 0x64, 0x64, 0x20, 0x52, 0x44, 0x53, 0x1a, 0x12, 0x41, + 0x64, 0x64, 0x73, 0x20, 0x52, 0x44, 0x53, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x52, 0x44, 0x53, 0x2f, 0x41, + 0x64, 0x64, 0x12, 0xaf, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x61, 0x92, 0x41, 0x36, 0x12, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x24, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, + 0x61, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6c, 0x6f, 0x6e, 0x67, 0x20, + 0x77, 0x69, 0x74, 0x68, 0x20, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 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, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x42, 0xad, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 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, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -337,48 +362,55 @@ var ( file_management_v1_service_proto_goTypes = []interface{}{ (*RemoveServiceRequest)(nil), // 0: management.v1.RemoveServiceRequest (v1.ServiceType)(0), // 1: inventory.v1.ServiceType - (*AddExternalRequest)(nil), // 2: management.v1.AddExternalRequest - (*AddHAProxyRequest)(nil), // 3: management.v1.AddHAProxyRequest - (*AddMySQLRequest)(nil), // 4: management.v1.AddMySQLRequest - (*AddMongoDBRequest)(nil), // 5: management.v1.AddMongoDBRequest - (*AddPostgreSQLRequest)(nil), // 6: management.v1.AddPostgreSQLRequest - (*AddProxySQLRequest)(nil), // 7: management.v1.AddProxySQLRequest - (*DiscoverRDSRequest)(nil), // 8: management.v1.DiscoverRDSRequest - (*AddRDSRequest)(nil), // 9: management.v1.AddRDSRequest - (*AddExternalResponse)(nil), // 10: management.v1.AddExternalResponse - (*AddHAProxyResponse)(nil), // 11: management.v1.AddHAProxyResponse - (*AddMySQLResponse)(nil), // 12: management.v1.AddMySQLResponse - (*AddMongoDBResponse)(nil), // 13: management.v1.AddMongoDBResponse - (*AddPostgreSQLResponse)(nil), // 14: management.v1.AddPostgreSQLResponse - (*AddProxySQLResponse)(nil), // 15: management.v1.AddProxySQLResponse - (*DiscoverRDSResponse)(nil), // 16: management.v1.DiscoverRDSResponse - (*AddRDSResponse)(nil), // 17: management.v1.AddRDSResponse - (*emptypb.Empty)(nil), // 18: google.protobuf.Empty + (*AddAnnotationRequest)(nil), // 2: management.v1.AddAnnotationRequest + (*RegisterNodeRequest)(nil), // 3: management.v1.RegisterNodeRequest + (*AddExternalRequest)(nil), // 4: management.v1.AddExternalRequest + (*AddHAProxyRequest)(nil), // 5: management.v1.AddHAProxyRequest + (*AddMySQLRequest)(nil), // 6: management.v1.AddMySQLRequest + (*AddMongoDBRequest)(nil), // 7: management.v1.AddMongoDBRequest + (*AddPostgreSQLRequest)(nil), // 8: management.v1.AddPostgreSQLRequest + (*AddProxySQLRequest)(nil), // 9: management.v1.AddProxySQLRequest + (*DiscoverRDSRequest)(nil), // 10: management.v1.DiscoverRDSRequest + (*AddRDSRequest)(nil), // 11: management.v1.AddRDSRequest + (*emptypb.Empty)(nil), // 12: google.protobuf.Empty + (*RegisterNodeResponse)(nil), // 13: management.v1.RegisterNodeResponse + (*AddExternalResponse)(nil), // 14: management.v1.AddExternalResponse + (*AddHAProxyResponse)(nil), // 15: management.v1.AddHAProxyResponse + (*AddMySQLResponse)(nil), // 16: management.v1.AddMySQLResponse + (*AddMongoDBResponse)(nil), // 17: management.v1.AddMongoDBResponse + (*AddPostgreSQLResponse)(nil), // 18: management.v1.AddPostgreSQLResponse + (*AddProxySQLResponse)(nil), // 19: management.v1.AddProxySQLResponse + (*DiscoverRDSResponse)(nil), // 20: management.v1.DiscoverRDSResponse + (*AddRDSResponse)(nil), // 21: management.v1.AddRDSResponse } ) var file_management_v1_service_proto_depIdxs = []int32{ 1, // 0: management.v1.RemoveServiceRequest.service_type:type_name -> inventory.v1.ServiceType - 2, // 1: management.v1.Service.AddExternal:input_type -> management.v1.AddExternalRequest - 3, // 2: management.v1.Service.AddHAProxy:input_type -> management.v1.AddHAProxyRequest - 4, // 3: management.v1.Service.AddMySQL:input_type -> management.v1.AddMySQLRequest - 5, // 4: management.v1.Service.AddMongoDB:input_type -> management.v1.AddMongoDBRequest - 6, // 5: management.v1.Service.AddPostgreSQL:input_type -> management.v1.AddPostgreSQLRequest - 7, // 6: management.v1.Service.AddProxySQL:input_type -> management.v1.AddProxySQLRequest - 8, // 7: management.v1.Service.DiscoverRDS:input_type -> management.v1.DiscoverRDSRequest - 9, // 8: management.v1.Service.AddRDS:input_type -> management.v1.AddRDSRequest - 0, // 9: management.v1.Service.RemoveService:input_type -> management.v1.RemoveServiceRequest - 10, // 10: management.v1.Service.AddExternal:output_type -> management.v1.AddExternalResponse - 11, // 11: management.v1.Service.AddHAProxy:output_type -> management.v1.AddHAProxyResponse - 12, // 12: management.v1.Service.AddMySQL:output_type -> management.v1.AddMySQLResponse - 13, // 13: management.v1.Service.AddMongoDB:output_type -> management.v1.AddMongoDBResponse - 14, // 14: management.v1.Service.AddPostgreSQL:output_type -> management.v1.AddPostgreSQLResponse - 15, // 15: management.v1.Service.AddProxySQL:output_type -> management.v1.AddProxySQLResponse - 16, // 16: management.v1.Service.DiscoverRDS:output_type -> management.v1.DiscoverRDSResponse - 17, // 17: management.v1.Service.AddRDS:output_type -> management.v1.AddRDSResponse - 18, // 18: management.v1.Service.RemoveService:output_type -> google.protobuf.Empty - 10, // [10:19] is the sub-list for method output_type - 1, // [1:10] is the sub-list for method input_type + 2, // 1: management.v1.Service.AddAnnotation:input_type -> management.v1.AddAnnotationRequest + 3, // 2: management.v1.Service.RegisterNode:input_type -> management.v1.RegisterNodeRequest + 4, // 3: management.v1.Service.AddExternal:input_type -> management.v1.AddExternalRequest + 5, // 4: management.v1.Service.AddHAProxy:input_type -> management.v1.AddHAProxyRequest + 6, // 5: management.v1.Service.AddMySQL:input_type -> management.v1.AddMySQLRequest + 7, // 6: management.v1.Service.AddMongoDB:input_type -> management.v1.AddMongoDBRequest + 8, // 7: management.v1.Service.AddPostgreSQL:input_type -> management.v1.AddPostgreSQLRequest + 9, // 8: management.v1.Service.AddProxySQL:input_type -> management.v1.AddProxySQLRequest + 10, // 9: management.v1.Service.DiscoverRDS:input_type -> management.v1.DiscoverRDSRequest + 11, // 10: management.v1.Service.AddRDS:input_type -> management.v1.AddRDSRequest + 0, // 11: management.v1.Service.RemoveService:input_type -> management.v1.RemoveServiceRequest + 12, // 12: management.v1.Service.AddAnnotation:output_type -> google.protobuf.Empty + 13, // 13: management.v1.Service.RegisterNode:output_type -> management.v1.RegisterNodeResponse + 14, // 14: management.v1.Service.AddExternal:output_type -> management.v1.AddExternalResponse + 15, // 15: management.v1.Service.AddHAProxy:output_type -> management.v1.AddHAProxyResponse + 16, // 16: management.v1.Service.AddMySQL:output_type -> management.v1.AddMySQLResponse + 17, // 17: management.v1.Service.AddMongoDB:output_type -> management.v1.AddMongoDBResponse + 18, // 18: management.v1.Service.AddPostgreSQL:output_type -> management.v1.AddPostgreSQLResponse + 19, // 19: management.v1.Service.AddProxySQL:output_type -> management.v1.AddProxySQLResponse + 20, // 20: management.v1.Service.DiscoverRDS:output_type -> management.v1.DiscoverRDSResponse + 21, // 21: management.v1.Service.AddRDS:output_type -> management.v1.AddRDSResponse + 12, // 22: management.v1.Service.RemoveService:output_type -> google.protobuf.Empty + 12, // [12:23] is the sub-list for method output_type + 1, // [1:12] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name @@ -389,10 +421,12 @@ func file_management_v1_service_proto_init() { if File_management_v1_service_proto != nil { return } + file_management_v1_annotation_proto_init() file_management_v1_external_proto_init() file_management_v1_haproxy_proto_init() file_management_v1_mongodb_proto_init() file_management_v1_mysql_proto_init() + file_management_v1_node_proto_init() file_management_v1_postgresql_proto_init() file_management_v1_proxysql_proto_init() file_management_v1_rds_proto_init() diff --git a/api/management/v1/service.pb.gw.go b/api/management/v1/service.pb.gw.go index 7f0264a62cd..aa71495f4a7 100644 --- a/api/management/v1/service.pb.gw.go +++ b/api/management/v1/service.pb.gw.go @@ -33,6 +33,70 @@ var ( _ = metadata.Join ) +func request_Service_AddAnnotation_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddAnnotationRequest + 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.AddAnnotation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Service_AddAnnotation_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddAnnotationRequest + 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.AddAnnotation(ctx, &protoReq) + return msg, metadata, err +} + +func request_Service_RegisterNode_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterNodeRequest + 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.RegisterNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Service_RegisterNode_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterNodeRequest + 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.RegisterNode(ctx, &protoReq) + return msg, metadata, err +} + func request_Service_AddExternal_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq AddExternalRequest var metadata runtime.ServerMetadata @@ -326,6 +390,54 @@ func local_request_Service_RemoveService_0(ctx context.Context, marshaler runtim // 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 RegisterServiceHandlerFromEndpoint instead. func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error { + mux.Handle("POST", pattern_Service_AddAnnotation_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, "/management.v1.Service/AddAnnotation", runtime.WithHTTPPathPattern("/v1/management/Annotations/Add")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_AddAnnotation_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_Service_AddAnnotation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + mux.Handle("POST", pattern_Service_RegisterNode_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, "/management.v1.Service/RegisterNode", runtime.WithHTTPPathPattern("/v1/management/Node/Register")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_RegisterNode_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_Service_RegisterNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle("POST", pattern_Service_AddExternal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -582,6 +694,48 @@ func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *gr // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "ServiceClient" to call the correct interceptors. func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error { + mux.Handle("POST", pattern_Service_AddAnnotation_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, "/management.v1.Service/AddAnnotation", runtime.WithHTTPPathPattern("/v1/management/Annotations/Add")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_AddAnnotation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_AddAnnotation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + mux.Handle("POST", pattern_Service_RegisterNode_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, "/management.v1.Service/RegisterNode", runtime.WithHTTPPathPattern("/v1/management/Node/Register")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_RegisterNode_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_RegisterNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle("POST", pattern_Service_AddExternal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -775,6 +929,10 @@ func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl } var ( + pattern_Service_AddAnnotation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "Annotations", "Add"}, "")) + + pattern_Service_RegisterNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "Node", "Register"}, "")) + pattern_Service_AddExternal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "External", "Add"}, "")) pattern_Service_AddHAProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "HAProxy", "Add"}, "")) @@ -795,6 +953,10 @@ var ( ) var ( + forward_Service_AddAnnotation_0 = runtime.ForwardResponseMessage + + forward_Service_RegisterNode_0 = runtime.ForwardResponseMessage + forward_Service_AddExternal_0 = runtime.ForwardResponseMessage forward_Service_AddHAProxy_0 = runtime.ForwardResponseMessage diff --git a/api/management/v1/service.proto b/api/management/v1/service.proto index 0153e9a9225..e4629057a71 100644 --- a/api/management/v1/service.proto +++ b/api/management/v1/service.proto @@ -6,10 +6,12 @@ import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "inventory/v1/nodes.proto"; import "inventory/v1/services.proto"; +import "management/v1/annotation.proto"; import "management/v1/external.proto"; import "management/v1/haproxy.proto"; import "management/v1/mongodb.proto"; import "management/v1/mysql.proto"; +import "management/v1/node.proto"; import "management/v1/postgresql.proto"; import "management/v1/proxysql.proto"; import "management/v1/rds.proto"; @@ -28,6 +30,28 @@ message RemoveServiceRequest { // Service service provides public methods for managing and querying Services. service Service { + // AddAnnotation adds an annotation. + rpc AddAnnotation(AddAnnotationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/management/Annotations/Add" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Add Annotation" + description: "Adds an annotation." + }; + } + // RegisterNode registers a new Node and pmm-agent. + rpc RegisterNode(RegisterNodeRequest) returns (RegisterNodeResponse) { + option (google.api.http) = { + post: "/v1/management/Node/Register" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Register Node" + description: "Registers a new Node and pmm-agent." + }; + } // AddExternal adds external service and adds external exporter. // It automatically adds a service to inventory, which is running on provided "node_id", // then adds an "external exporter" agent to inventory, which is running on provided "runs_on_node_id". diff --git a/api/management/v1/service_grpc.pb.go b/api/management/v1/service_grpc.pb.go index e7e010a7413..6058fee9fcd 100644 --- a/api/management/v1/service_grpc.pb.go +++ b/api/management/v1/service_grpc.pb.go @@ -21,6 +21,8 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( + Service_AddAnnotation_FullMethodName = "/management.v1.Service/AddAnnotation" + Service_RegisterNode_FullMethodName = "/management.v1.Service/RegisterNode" Service_AddExternal_FullMethodName = "/management.v1.Service/AddExternal" Service_AddHAProxy_FullMethodName = "/management.v1.Service/AddHAProxy" Service_AddMySQL_FullMethodName = "/management.v1.Service/AddMySQL" @@ -36,6 +38,10 @@ const ( // // 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 ServiceClient interface { + // AddAnnotation adds an annotation. + AddAnnotation(ctx context.Context, in *AddAnnotationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // RegisterNode registers a new Node and pmm-agent. + RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) // AddExternal adds external service and adds external exporter. // It automatically adds a service to inventory, which is running on provided "node_id", // then adds an "external exporter" agent to inventory, which is running on provided "runs_on_node_id". @@ -78,6 +84,24 @@ func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { return &serviceClient{cc} } +func (c *serviceClient) AddAnnotation(ctx context.Context, in *AddAnnotationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Service_AddAnnotation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) { + out := new(RegisterNodeResponse) + err := c.cc.Invoke(ctx, Service_RegisterNode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *serviceClient) AddExternal(ctx context.Context, in *AddExternalRequest, opts ...grpc.CallOption) (*AddExternalResponse, error) { out := new(AddExternalResponse) err := c.cc.Invoke(ctx, Service_AddExternal_FullMethodName, in, out, opts...) @@ -163,6 +187,10 @@ func (c *serviceClient) RemoveService(ctx context.Context, in *RemoveServiceRequ // All implementations must embed UnimplementedServiceServer // for forward compatibility type ServiceServer interface { + // AddAnnotation adds an annotation. + AddAnnotation(context.Context, *AddAnnotationRequest) (*emptypb.Empty, error) + // RegisterNode registers a new Node and pmm-agent. + RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) // AddExternal adds external service and adds external exporter. // It automatically adds a service to inventory, which is running on provided "node_id", // then adds an "external exporter" agent to inventory, which is running on provided "runs_on_node_id". @@ -201,6 +229,14 @@ type ServiceServer interface { // UnimplementedServiceServer must be embedded to have forward compatible implementations. type UnimplementedServiceServer struct{} +func (UnimplementedServiceServer) AddAnnotation(context.Context, *AddAnnotationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddAnnotation not implemented") +} + +func (UnimplementedServiceServer) RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterNode not implemented") +} + func (UnimplementedServiceServer) AddExternal(context.Context, *AddExternalRequest) (*AddExternalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddExternal not implemented") } @@ -249,6 +285,42 @@ func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { s.RegisterService(&Service_ServiceDesc, srv) } +func _Service_AddAnnotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddAnnotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).AddAnnotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_AddAnnotation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).AddAnnotation(ctx, req.(*AddAnnotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_RegisterNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).RegisterNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_RegisterNode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).RegisterNode(ctx, req.(*RegisterNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Service_AddExternal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddExternalRequest) if err := dec(in); err != nil { @@ -418,6 +490,14 @@ var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "management.v1.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "AddAnnotation", + Handler: _Service_AddAnnotation_Handler, + }, + { + MethodName: "RegisterNode", + Handler: _Service_RegisterNode_Handler, + }, { MethodName: "AddExternal", Handler: _Service_AddExternal_Handler, diff --git a/api/nginx/nginx.conf b/api/nginx/nginx.conf index 730479d2a97..63d5765d7f4 100644 --- a/api/nginx/nginx.conf +++ b/api/nginx/nginx.conf @@ -1,5 +1,5 @@ # This file is for serving Swagger docs during development. -# For pmm-managed work, please use devcontainer. +# For pmm-managed, please use devcontainer. daemon off; diff --git a/api/server/v1/json/client/pmm_server_api_client.go b/api/server/v1/json/client/pmm_server_api_client.go index 657962b8e47..46b708ab6e9 100644 --- a/api/server/v1/json/client/pmm_server_api_client.go +++ b/api/server/v1/json/client/pmm_server_api_client.go @@ -10,7 +10,6 @@ import ( httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - serverops "github.com/percona/pmm/api/server/v1/json/client/server" "github.com/percona/pmm/api/server/v1/json/client/server_service" ) @@ -56,7 +55,6 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMServerA cli := new(PMMServerAPI) cli.Transport = transport - cli.Server = serverops.New(transport, formats) cli.ServerService = server_service.New(transport, formats) return cli } @@ -102,8 +100,6 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { // PMMServerAPI is a client for PMM server API type PMMServerAPI struct { - Server serverops.ClientService - ServerService server_service.ClientService Transport runtime.ClientTransport @@ -112,6 +108,5 @@ type PMMServerAPI struct { // SetTransport changes the transport on the client and all its subresources func (c *PMMServerAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport - c.Server.SetTransport(transport) c.ServerService.SetTransport(transport) } diff --git a/api/server/v1/json/client/server/server_client.go b/api/server/v1/json/client/server/server_client.go deleted file mode 100644 index 3f42053606d..00000000000 --- a/api/server/v1/json/client/server/server_client.go +++ /dev/null @@ -1,80 +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 ( - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new server API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for server 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 { - Logs(params *LogsParams, writer io.Writer, opts ...ClientOption) (*LogsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -Logs logs - -Returns the PMM Server logs. -*/ -func (a *Client) Logs(params *LogsParams, writer io.Writer, opts ...ClientOption) (*LogsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewLogsParams() - } - op := &runtime.ClientOperation{ - ID: "Logs", - Method: "GET", - PathPattern: "/logs.zip", - ProducesMediaTypes: []string{"application/zip"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &LogsReader{formats: a.formats, writer: writer}, - 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.(*LogsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*LogsDefault) - 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/server/v1/json/client/server/logs_parameters.go b/api/server/v1/json/client/server_service/logs_parameters.go similarity index 99% rename from api/server/v1/json/client/server/logs_parameters.go rename to api/server/v1/json/client/server_service/logs_parameters.go index 2463907eae1..eac190ca90c 100644 --- a/api/server/v1/json/client/server/logs_parameters.go +++ b/api/server/v1/json/client/server_service/logs_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package server +package server_service // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/api/server/v1/json/client/server/logs_responses.go b/api/server/v1/json/client/server_service/logs_responses.go similarity index 99% rename from api/server/v1/json/client/server/logs_responses.go rename to api/server/v1/json/client/server_service/logs_responses.go index ef66827e2e3..184f633ddd4 100644 --- a/api/server/v1/json/client/server/logs_responses.go +++ b/api/server/v1/json/client/server_service/logs_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package server +package server_service // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/api/server/v1/json/client/server_service/server_service_client.go b/api/server/v1/json/client/server_service/server_service_client.go index 9278a2ac687..a843debece7 100644 --- a/api/server/v1/json/client/server_service/server_service_client.go +++ b/api/server/v1/json/client/server_service/server_service_client.go @@ -6,6 +6,8 @@ package server_service // Editing this file might prove futile when you re-run the swagger generate command import ( + "io" + "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" ) @@ -38,6 +40,8 @@ type ClientService interface { LeaderHealthCheck(params *LeaderHealthCheckParams, opts ...ClientOption) (*LeaderHealthCheckOK, error) + Logs(params *LogsParams, writer io.Writer, opts ...ClientOption) (*LogsOK, error) + Readiness(params *ReadinessParams, opts ...ClientOption) (*ReadinessOK, error) StartUpdate(params *StartUpdateParams, opts ...ClientOption) (*StartUpdateOK, error) @@ -244,6 +248,45 @@ func (a *Client) LeaderHealthCheck(params *LeaderHealthCheckParams, opts ...Clie return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +Logs logs + +Returns the PMM Server logs. +*/ +func (a *Client) Logs(params *LogsParams, writer io.Writer, opts ...ClientOption) (*LogsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLogsParams() + } + op := &runtime.ClientOperation{ + ID: "Logs", + Method: "GET", + PathPattern: "/logs.zip", + ProducesMediaTypes: []string{"application/zip"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &LogsReader{formats: a.formats, writer: writer}, + 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.(*LogsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*LogsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* Readiness checks server readiness diff --git a/api/server/v1/json/header.json b/api/server/v1/json/header.json index 3dbc7c393af..f98148cb939 100644 --- a/api/server/v1/json/header.json +++ b/api/server/v1/json/header.json @@ -12,7 +12,7 @@ "/logs.zip": { "get": { "tags": [ - "Server" + "ServerService" ], "description": "Returns the PMM Server logs.", "summary": "Logs", diff --git a/api/server/v1/json/v1.json b/api/server/v1/json/v1.json index c1caff5570f..bc6e1b30ec3 100644 --- a/api/server/v1/json/v1.json +++ b/api/server/v1/json/v1.json @@ -22,7 +22,7 @@ "application/zip" ], "tags": [ - "Server" + "ServerService" ], "summary": "Logs", "operationId": "Logs", diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index fa419e48e12..c593cc1c34a 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -23,7 +23,7 @@ "application/zip" ], "tags": [ - "Server" + "ServerService" ], "summary": "Logs", "operationId": "Logs", @@ -17042,9 +17042,9 @@ }, "/v1/management/Annotations/Add": { "post": { - "description": "Adds annotation.", + "description": "Adds an annotation.", "tags": [ - "AnnotationService" + "Service" ], "summary": "Add Annotation", "operationId": "AddAnnotation", @@ -19961,7 +19961,7 @@ "post": { "description": "Registers a new Node and pmm-agent.", "tags": [ - "NodeService" + "Service" ], "summary": "Register Node", "operationId": "RegisterNode", @@ -27772,12 +27772,6 @@ { "name": "ServicesService" }, - { - "name": "AnnotationService" - }, - { - "name": "NodeService" - }, { "name": "Service" }, diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 920f4fc77d7..ca7b3ed99d8 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -22,7 +22,7 @@ "application/zip" ], "tags": [ - "Server" + "ServerService" ], "summary": "Logs", "operationId": "Logs", @@ -4997,9 +4997,9 @@ }, "/v1/management/Annotations/Add": { "post": { - "description": "Adds annotation.", + "description": "Adds an annotation.", "tags": [ - "AnnotationService" + "Service" ], "summary": "Add Annotation", "operationId": "AddAnnotation", @@ -7123,7 +7123,7 @@ "post": { "description": "Registers a new Node and pmm-agent.", "tags": [ - "NodeService" + "Service" ], "summary": "Register Node", "operationId": "RegisterNode", @@ -13245,12 +13245,6 @@ { "name": "UserService" }, - { - "name": "AnnotationService" - }, - { - "name": "NodeService" - }, { "name": "Service" }, diff --git a/descriptor.bin b/descriptor.bin index f9cd4e11bb7..12c52451e6b 100644 Binary files a/descriptor.bin and b/descriptor.bin differ diff --git a/managed/cmd/pmm-managed/main.go b/managed/cmd/pmm-managed/main.go index 95360a21358..c05961a5b3c 100644 --- a/managed/cmd/pmm-managed/main.go +++ b/managed/cmd/pmm-managed/main.go @@ -265,18 +265,15 @@ func runGRPCServer(ctx context.Context, deps *gRPCServerDeps) { inventoryv1.RegisterServicesServiceServer(gRPCServer, inventorygrpc.NewServicesServer(servicesSvc, mgmtServices)) inventoryv1.RegisterAgentsServiceServer(gRPCServer, inventorygrpc.NewAgentsServer(agentsSvc)) - nodeSvc := management.NewNodeService(deps.db, deps.grafanaClient) agentSvc := management.NewAgentService(deps.db, deps.agentsRegistry) - serviceSvc := management.NewServiceService(deps.db, deps.agentsRegistry, deps.agentsStateUpdater, deps.connectionCheck, deps.serviceInfoBroker, deps.vmdb, deps.versionCache) + serviceSvc := management.NewServiceService(deps.db, deps.agentsRegistry, deps.agentsStateUpdater, deps.connectionCheck, deps.serviceInfoBroker, deps.vmdb, deps.versionCache, deps.grafanaClient) - managementv1.RegisterNodeServiceServer(gRPCServer, nodeSvc) agentv1beta1.RegisterAgentServiceServer(gRPCServer, agentSvc) nodev1beta1.RegisterMgmtNodeServiceServer(gRPCServer, management.NewMgmtNodeService(deps.db, deps.agentsRegistry, v1.NewAPI(*deps.vmClient))) servicev1beta1.RegisterMgmtServiceServer(gRPCServer, management.NewMgmtServiceService(deps.db, deps.agentsRegistry, deps.agentsStateUpdater, deps.vmdb, v1.NewAPI(*deps.vmClient))) managementv1.RegisterServiceServer(gRPCServer, serviceSvc) actionsv1.RegisterActionsServiceServer(gRPCServer, managementgrpc.NewActionsServer(deps.actions, deps.db)) azurev1beta1.RegisterAzureDatabaseServiceServer(gRPCServer, management.NewAzureDatabaseService(deps.db, deps.agentsRegistry, deps.agentsStateUpdater, deps.connectionCheck, deps.serviceInfoBroker)) - managementv1.RegisterAnnotationServiceServer(gRPCServer, management.NewAnnotationService(deps.db, deps.grafanaClient)) advisorsv1.RegisterAdvisorServiceServer(gRPCServer, management.NewChecksAPIService(deps.checksService)) rolev1beta1.RegisterRoleServiceServer(gRPCServer, management.NewRoleService(deps.db)) @@ -367,14 +364,12 @@ func runHTTP1Server(ctx context.Context, deps *http1ServerDeps) { inventoryv1.RegisterServicesServiceHandlerFromEndpoint, inventoryv1.RegisterAgentsServiceHandlerFromEndpoint, - managementv1.RegisterNodeServiceHandlerFromEndpoint, agentv1beta1.RegisterAgentServiceHandlerFromEndpoint, nodev1beta1.RegisterMgmtNodeServiceHandlerFromEndpoint, servicev1beta1.RegisterMgmtServiceHandlerFromEndpoint, managementv1.RegisterServiceHandlerFromEndpoint, actionsv1.RegisterActionsServiceHandlerFromEndpoint, azurev1beta1.RegisterAzureDatabaseServiceHandlerFromEndpoint, - managementv1.RegisterAnnotationServiceHandlerFromEndpoint, advisorsv1.RegisterAdvisorServiceHandlerFromEndpoint, rolev1beta1.RegisterRoleServiceHandlerFromEndpoint, diff --git a/managed/services/management/annotation.go b/managed/services/management/annotation.go index 2da4c7af9dd..36a44f738d2 100644 --- a/managed/services/management/annotation.go +++ b/managed/services/management/annotation.go @@ -25,32 +25,15 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" - "gopkg.in/reform.v1" managementv1 "github.com/percona/pmm/api/management/v1" "github.com/percona/pmm/managed/models" ) -// AnnotationService Annotation Service. -type AnnotationService struct { - db *reform.DB - grafanaClient grafanaClient - - managementv1.UnimplementedAnnotationServiceServer -} - -// NewAnnotationService create new Annotation Service. -func NewAnnotationService(db *reform.DB, grafanaClient grafanaClient) *AnnotationService { - return &AnnotationService{ - db: db, - grafanaClient: grafanaClient, - } -} - // AddAnnotation create annotation in grafana. // //nolint:unparam -func (as *AnnotationService) AddAnnotation(ctx context.Context, req *managementv1.AddAnnotationRequest) (*empty.Empty, error) { +func (as *ServiceService) AddAnnotation(ctx context.Context, req *managementv1.AddAnnotationRequest) (*empty.Empty, error) { headers, ok := metadata.FromIncomingContext(ctx) if !ok { return nil, fmt.Errorf("cannot get headers from metadata") diff --git a/managed/services/management/annotation_test.go b/managed/services/management/annotation_test.go index dc4a276cf94..220ee3062e5 100644 --- a/managed/services/management/annotation_test.go +++ b/managed/services/management/annotation_test.go @@ -37,61 +37,78 @@ import ( ) func TestAnnotations(t *testing.T) { - authorization := "admin:admin" - setup := func(t *testing.T) (ctx context.Context, db *reform.DB, teardown func(t *testing.T)) { + const authorization string = "admin:admin" + + setup := func(t *testing.T) (context.Context, *ServiceService, *reform.DB, *mockGrafanaClient, func(t *testing.T)) { t.Helper() - ctx = metadata.NewIncomingContext(context.Background(), metadata.New(map[string]string{"authorization": authorization})) + ctx := metadata.NewIncomingContext(context.Background(), metadata.New(map[string]string{"authorization": authorization})) ctx = logger.Set(ctx, t.Name()) uuid.SetRand(&tests.IDReader{}) sqlDB := testdb.Open(t, models.SetupFixtures, nil) - db = reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) + db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) + + ar := &mockAgentsRegistry{} + ar.Test(t) + state := &mockAgentsStateUpdater{} + state.Test(t) + cc := &mockConnectionChecker{} + cc.Test(t) + sib := &mockServiceInfoBroker{} + sib.Test(t) + vmdb := &mockPrometheusService{} + vmdb.Test(t) + vc := &mockVersionCache{} + vc.Test(t) + grafanaClient := &mockGrafanaClient{} + grafanaClient.Test(t) + + s := NewServiceService(db, ar, state, cc, sib, vmdb, vc, grafanaClient) - teardown = func(t *testing.T) { + teardown := func(t *testing.T) { t.Helper() uuid.SetRand(nil) require.NoError(t, sqlDB.Close()) + + ar.AssertExpectations(t) + state.AssertExpectations(t) + cc.AssertExpectations(t) + sib.AssertExpectations(t) + vmdb.AssertExpectations(t) + vc.AssertExpectations(t) + grafanaClient.AssertExpectations(t) } - return + return ctx, s, db, grafanaClient, teardown } t.Run("Non-existing service", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) - _, err := s.AddAnnotation(ctx, &managementv1.AddAnnotationRequest{ + ctx, ss, _, _, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ss.AddAnnotation(ctx, &managementv1.AddAnnotationRequest{ Text: "Some text", ServiceNames: []string{"no-service"}, }) tests.AssertGRPCError(t, status.New(codes.NotFound, `Service with name "no-service" not found.`), err) - - grafanaClient.AssertExpectations(t) }) t.Run("Non-existing node", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, _, _, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) _, err := s.AddAnnotation(ctx, &managementv1.AddAnnotationRequest{ Text: "Some text", NodeName: "no-node", }) tests.AssertGRPCError(t, status.New(codes.NotFound, `Node with name "no-node" not found.`), err) - - grafanaClient.AssertExpectations(t) }) t.Run("Existing service", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, db, grafanaClient, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) _, err := models.AddNewService(db.Querier, models.MySQLServiceType, &models.AddDBMSServiceParams{ ServiceName: "service-test", @@ -109,15 +126,11 @@ func TestAnnotations(t *testing.T) { ServiceNames: []string{"service-test"}, }) require.NoError(t, err) - - grafanaClient.AssertExpectations(t) }) t.Run("Existing node", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, db, grafanaClient, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) _, err := models.CreateNode(db.Querier, models.GenericNodeType, &models.CreateNodeParams{ NodeName: "node-test", @@ -132,15 +145,11 @@ func TestAnnotations(t *testing.T) { NodeName: "node-test", }) require.NoError(t, err) - - grafanaClient.AssertExpectations(t) }) t.Run("Non-existing service and non-existing node", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, _, _, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) _, err := s.AddAnnotation(ctx, &managementv1.AddAnnotationRequest{ Text: "Some text", @@ -148,15 +157,11 @@ func TestAnnotations(t *testing.T) { ServiceNames: []string{"no-service"}, }) tests.AssertGRPCError(t, status.New(codes.NotFound, `Service with name "no-service" not found.`), err) - - grafanaClient.AssertExpectations(t) }) t.Run("Empty service and empty node", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, _, grafanaClient, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) expectedTags := []string{"pmm_annotation"} expectedText := "Some text" @@ -170,10 +175,8 @@ func TestAnnotations(t *testing.T) { }) t.Run("Existing service and non-existing node", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, db, _, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) _, err := models.AddNewService(db.Querier, models.MySQLServiceType, &models.AddDBMSServiceParams{ ServiceName: "service-test", @@ -189,15 +192,11 @@ func TestAnnotations(t *testing.T) { NodeName: "node-test", }) tests.AssertGRPCError(t, status.New(codes.NotFound, `Node with name "node-test" not found.`), err) - - grafanaClient.AssertExpectations(t) }) t.Run("Existing service and existing node", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, db, grafanaClient, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) _, err := models.CreateNode(db.Querier, models.GenericNodeType, &models.CreateNodeParams{ NodeName: "node-test", @@ -221,15 +220,11 @@ func TestAnnotations(t *testing.T) { NodeName: "node-test", }) require.NoError(t, err) - - grafanaClient.AssertExpectations(t) }) t.Run("More services", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, db, grafanaClient, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) _, err := models.AddNewService(db.Querier, models.MySQLServiceType, &models.AddDBMSServiceParams{ ServiceName: "service-test", @@ -255,15 +250,11 @@ func TestAnnotations(t *testing.T) { ServiceNames: []string{"service-test", "service-test2"}, }) require.NoError(t, err) - - grafanaClient.AssertExpectations(t) }) t.Run("More services, but one non-existing", func(t *testing.T) { - ctx, db, teardown := setup(t) - defer teardown(t) - grafanaClient := &mockGrafanaClient{} - s := NewAnnotationService(db, grafanaClient) + ctx, s, db, _, teardown := setup(t) + t.Cleanup(func() { teardown(t) }) _, err := models.AddNewService(db.Querier, models.MySQLServiceType, &models.AddDBMSServiceParams{ ServiceName: "service-test", @@ -278,7 +269,5 @@ func TestAnnotations(t *testing.T) { ServiceNames: []string{"service-test", "no-service"}, }) tests.AssertGRPCError(t, status.New(codes.NotFound, `Service with name "no-service" not found.`), err) - - grafanaClient.AssertExpectations(t) }) } diff --git a/managed/services/management/deps.go b/managed/services/management/deps.go index 0fbd2afb519..a4f2ef8a555 100644 --- a/managed/services/management/deps.go +++ b/managed/services/management/deps.go @@ -67,6 +67,8 @@ type checksService interface { // We use it instead of real type for testing and to avoid dependency cycle. type grafanaClient interface { CreateAnnotation(context.Context, []string, time.Time, string, string) (string, error) + CreateAdminAPIKey(ctx context.Context, name string) (int64, string, error) + IsAPIKeyAuth(headers http.Header) bool } // jobsService is a subset of methods of agents.JobsService used by this package. @@ -97,8 +99,3 @@ type versionCache interface { type victoriaMetricsClient interface { Query(ctx context.Context, query string, ts time.Time, opts ...v1.Option) (model.Value, v1.Warnings, error) } - -type apiKeyProvider interface { - CreateAdminAPIKey(ctx context.Context, name string) (int64, string, error) - IsAPIKeyAuth(headers http.Header) bool -} diff --git a/managed/services/management/mock_api_key_provider_test.go b/managed/services/management/mock_api_key_provider_test.go deleted file mode 100644 index f7aed1af97d..00000000000 --- a/managed/services/management/mock_api_key_provider_test.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package management - -import ( - context "context" - http "net/http" - - mock "github.com/stretchr/testify/mock" -) - -// mockApiKeyProvider is an autogenerated mock type for the apiKeyProvider type -type mockApiKeyProvider struct { - mock.Mock -} - -// CreateAdminAPIKey provides a mock function with given fields: ctx, name -func (_m *mockApiKeyProvider) CreateAdminAPIKey(ctx context.Context, name string) (int64, string, error) { - ret := _m.Called(ctx, name) - - if len(ret) == 0 { - panic("no return value specified for CreateAdminAPIKey") - } - - var r0 int64 - var r1 string - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, string) (int64, string, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) int64); ok { - r0 = rf(ctx, name) - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) string); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Get(1).(string) - } - - if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { - r2 = rf(ctx, name) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// IsAPIKeyAuth provides a mock function with given fields: headers -func (_m *mockApiKeyProvider) IsAPIKeyAuth(headers http.Header) bool { - ret := _m.Called(headers) - - if len(ret) == 0 { - panic("no return value specified for IsAPIKeyAuth") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(http.Header) bool); ok { - r0 = rf(headers) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// newMockApiKeyProvider creates a new instance of mockApiKeyProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockApiKeyProvider(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockApiKeyProvider { - mock := &mockApiKeyProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/mock_grafana_client_test.go b/managed/services/management/mock_grafana_client_test.go index ec7617fff88..975d0948a3e 100644 --- a/managed/services/management/mock_grafana_client_test.go +++ b/managed/services/management/mock_grafana_client_test.go @@ -4,6 +4,7 @@ package management import ( context "context" + http "net/http" time "time" mock "github.com/stretchr/testify/mock" @@ -14,6 +15,41 @@ type mockGrafanaClient struct { mock.Mock } +// CreateAdminAPIKey provides a mock function with given fields: ctx, name +func (_m *mockGrafanaClient) CreateAdminAPIKey(ctx context.Context, name string) (int64, string, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for CreateAdminAPIKey") + } + + var r0 int64 + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string) (int64, string, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) int64); ok { + r0 = rf(ctx, name) + } else { + r0 = ret.Get(0).(int64) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) string); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Get(1).(string) + } + + if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = rf(ctx, name) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + // CreateAnnotation provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 func (_m *mockGrafanaClient) CreateAnnotation(_a0 context.Context, _a1 []string, _a2 time.Time, _a3 string, _a4 string) (string, error) { ret := _m.Called(_a0, _a1, _a2, _a3, _a4) @@ -42,6 +78,24 @@ func (_m *mockGrafanaClient) CreateAnnotation(_a0 context.Context, _a1 []string, return r0, r1 } +// IsAPIKeyAuth provides a mock function with given fields: headers +func (_m *mockGrafanaClient) IsAPIKeyAuth(headers http.Header) bool { + ret := _m.Called(headers) + + if len(ret) == 0 { + panic("no return value specified for IsAPIKeyAuth") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(http.Header) bool); ok { + r0 = rf(headers) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + // newMockGrafanaClient creates a new instance of mockGrafanaClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockGrafanaClient(t interface { diff --git a/managed/services/management/node.go b/managed/services/management/node.go index ccb6c55fdb4..c64ce791c9e 100644 --- a/managed/services/management/node.go +++ b/managed/services/management/node.go @@ -34,27 +34,8 @@ import ( "github.com/percona/pmm/managed/services" ) -// NodeService represents service for working with nodes. -type NodeService struct { - db *reform.DB - akp apiKeyProvider - - l *logrus.Entry - - managementv1.UnimplementedNodeServiceServer -} - -// NewNodeService creates NodeService instance. -func NewNodeService(db *reform.DB, akp apiKeyProvider) *NodeService { - return &NodeService{ - db: db, - akp: akp, - l: logrus.WithField("component", "node"), - } -} - // RegisterNode performs the registration of a new node. -func (s *NodeService) RegisterNode(ctx context.Context, req *managementv1.RegisterNodeRequest) (*managementv1.RegisterNodeResponse, error) { +func (s *ServiceService) RegisterNode(ctx context.Context, req *managementv1.RegisterNodeRequest) (*managementv1.RegisterNodeResponse, error) { res := &managementv1.RegisterNodeResponse{} e := s.db.InTransaction(func(tx *reform.TX) error { @@ -138,11 +119,12 @@ func (s *NodeService) RegisterNode(ctx context.Context, req *managementv1.Regist return nil, e } + l := logrus.WithField("component", "node") // get authorization from headers. md, ok := metadata.FromIncomingContext(ctx) if !ok { msg := "Couldn't create Admin API Key: cannot get headers from metadata" - s.l.Errorln(msg) + l.Errorln(msg) res.Warning = msg return res, nil } @@ -152,12 +134,12 @@ func (s *NodeService) RegisterNode(ctx context.Context, req *managementv1.Regist } headers := make(http.Header) headers.Set("Authorization", authorizationHeaders[0]) - if !s.akp.IsAPIKeyAuth(headers) { + if !s.grafanaClient.IsAPIKeyAuth(headers) { apiKeyName := fmt.Sprintf("pmm-agent-%s-%d", req.NodeName, rand.Int63()) //nolint:gosec - _, res.Token, e = s.akp.CreateAdminAPIKey(ctx, apiKeyName) + _, res.Token, e = s.grafanaClient.CreateAdminAPIKey(ctx, apiKeyName) if e != nil { msg := fmt.Sprintf("Couldn't create Admin API Key: %s", e) - s.l.Errorln(msg) + l.Errorln(msg) res.Warning = msg } } diff --git a/managed/services/management/node_test.go b/managed/services/management/node_test.go index 3e21a0efaee..b5d77ded105 100644 --- a/managed/services/management/node_test.go +++ b/managed/services/management/node_test.go @@ -39,16 +39,16 @@ import ( func TestNodeService(t *testing.T) { t.Run("Register", func(t *testing.T) { - setup := func(t *testing.T) (ctx context.Context, s *NodeService, teardown func(t *testing.T)) { + setup := func(t *testing.T) (context.Context, *ServiceService, func(t *testing.T)) { t.Helper() - ctx = logger.Set(context.Background(), t.Name()) + ctx := logger.Set(context.Background(), t.Name()) uuid.SetRand(&tests.IDReader{}) sqlDB := testdb.Open(t, models.SetupFixtures, nil) db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - teardown = func(t *testing.T) { + teardown := func(t *testing.T) { t.Helper() uuid.SetRand(nil) @@ -58,18 +58,39 @@ func TestNodeService(t *testing.T) { "Authorization": "Basic username:password", }) ctx = metadata.NewIncomingContext(ctx, md) - var apiKeyProvider mockApiKeyProvider - apiKeyProvider.Test(t) - apiKeyProvider.On("IsAPIKeyAuth", mock.Anything).Return(false) - apiKeyProvider.On("CreateAdminAPIKey", ctx, mock.AnythingOfType("string")).Return(int64(0), "test-token", nil) - s = NewNodeService(db, &apiKeyProvider) + vmdb := &mockPrometheusService{} + vmdb.Test(t) - return + state := &mockAgentsStateUpdater{} + state.Test(t) + + ar := &mockAgentsRegistry{} + ar.Test(t) + + cc := &mockConnectionChecker{} + cc.Test(t) + + sib := &mockServiceInfoBroker{} + sib.Test(t) + + vc := &mockVersionCache{} + vc.Test(t) + + grafanaClient := &mockGrafanaClient{} + grafanaClient.Test(t) + + grafanaClient.Test(t) + grafanaClient.On("IsAPIKeyAuth", mock.Anything).Return(false) + grafanaClient.On("CreateAdminAPIKey", ctx, mock.AnythingOfType("string")).Return(int64(0), "test-token", nil) + + s := NewServiceService(db, ar, state, cc, sib, vmdb, vc, grafanaClient) + + return ctx, s, teardown } t.Run("New", func(t *testing.T) { ctx, s, teardown := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) res, err := s.RegisterNode(ctx, &managementv1.RegisterNodeRequest{ NodeType: inventoryv1.NodeType_NODE_TYPE_GENERIC_NODE, diff --git a/managed/services/management/rds_test.go b/managed/services/management/rds_test.go index c0cdecca5a2..757913a8907 100644 --- a/managed/services/management/rds_test.go +++ b/managed/services/management/rds_test.go @@ -65,6 +65,8 @@ func TestRDSService(t *testing.T) { vmdb.Test(t) vc := &mockVersionCache{} vc.Test(t) + grafanaClient := &mockGrafanaClient{} + grafanaClient.Test(t) defer func() { cc.AssertExpectations(t) @@ -75,7 +77,7 @@ func TestRDSService(t *testing.T) { vc.AssertExpectations(t) }() - s := NewServiceService(db, ar, state, cc, sib, vmdb, vc) + s := NewServiceService(db, ar, state, cc, sib, vmdb, vc, grafanaClient) t.Run("DiscoverRDS", func(t *testing.T) { t.Run("ListRegions", func(t *testing.T) { diff --git a/managed/services/management/service.go b/managed/services/management/service.go index c0f610d03db..2b2acdc465a 100644 --- a/managed/services/management/service.go +++ b/managed/services/management/service.go @@ -32,13 +32,14 @@ import ( // ServiceService represents service for working with services. type ServiceService struct { - db *reform.DB - r agentsRegistry - state agentsStateUpdater - cc connectionChecker - sib serviceInfoBroker - vmdb prometheusService - vc versionCache + db *reform.DB + r agentsRegistry + state agentsStateUpdater + cc connectionChecker + sib serviceInfoBroker + vmdb prometheusService + vc versionCache + grafanaClient grafanaClient managementv1.UnimplementedServiceServer } @@ -52,15 +53,17 @@ func NewServiceService( sib serviceInfoBroker, vmdb prometheusService, vc versionCache, + grafanaClient grafanaClient, ) *ServiceService { return &ServiceService{ - db: db, - r: r, - state: state, - cc: cc, - sib: sib, - vmdb: vmdb, - vc: vc, + db: db, + r: r, + state: state, + cc: cc, + sib: sib, + vmdb: vmdb, + vc: vc, + grafanaClient: grafanaClient, } } diff --git a/managed/services/management/service_test.go b/managed/services/management/service_test.go index 025d3f6e88d..0d1a8e79269 100644 --- a/managed/services/management/service_test.go +++ b/managed/services/management/service_test.go @@ -66,6 +66,9 @@ func TestServiceService(t *testing.T) { vc := &mockVersionCache{} vc.Test(t) + grafanaClient := &mockGrafanaClient{} + grafanaClient.Test(t) + teardown := func(t *testing.T) { t.Helper() uuid.SetRand(nil) @@ -74,8 +77,13 @@ func TestServiceService(t *testing.T) { vmdb.AssertExpectations(t) state.AssertExpectations(t) ar.AssertExpectations(t) + cc.AssertExpectations(t) + sib.AssertExpectations(t) + vc.AssertExpectations(t) + grafanaClient.AssertExpectations(t) } - s := NewServiceService(db, ar, state, cc, sib, vmdb, vc) + + s := NewServiceService(db, ar, state, cc, sib, vmdb, vc, grafanaClient) return ctx, s, teardown, vmdb }