diff --git a/Gopkg.lock b/Gopkg.lock index 393cf928d6..e88624885a 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -205,7 +205,7 @@ [[projects]] branch = "PMM-2.0" - digest = "1:42cf40fe6ed8892c6dbbe8ce35fbb1191c46840af538910bad4f8e408743442e" + digest = "1:8b7bc9ba6145fb838921ac5ac0895be219aa819a2bdd0699539a13c272a4ff71" name = "github.com/percona/pmm" packages = [ "api/agentpb", @@ -216,7 +216,7 @@ "version", ] pruneopts = "NUT" - revision = "a8172a52b2b6abb28b942f6af12f6053c2d8556c" + revision = "cf45dc2174f6fa5c74411115822ee0170bbf395e" [[projects]] digest = "1:14715f705ff5dfe0ffd6571d7d201dd8e921030f8070321a79380d8ca4ec1a24" diff --git a/main.go b/main.go index 36b35e457b..ed9890c624 100644 --- a/main.go +++ b/main.go @@ -163,10 +163,12 @@ func runGRPCServer(ctx context.Context, deps *serviceDependencies) { mysqlSvc := management.NewMySQLService(deps.db, deps.agentsRegistry) nodeSvc := management.NewNodeService(deps.db, deps.agentsRegistry) serviceSvc := management.NewServiceService(deps.db, deps.agentsRegistry) + mongodbSvc := management.NewMongoDBService(deps.db, deps.agentsRegistry) managementpb.RegisterMySQLServer(gRPCServer, managementgrpc.NewManagementMysqlServer(mysqlSvc)) managementpb.RegisterNodeServer(gRPCServer, managementgrpc.NewManagementNodeServer(nodeSvc)) managementpb.RegisterServiceServer(gRPCServer, managementgrpc.NewManagementServiceServer(serviceSvc)) + managementpb.RegisterMongoDBServer(gRPCServer, managementgrpc.NewManagementMongoDBServer(mongodbSvc)) if *debugF { l.Debug("Reflection and channelz are enabled.") @@ -222,6 +224,7 @@ func runJSONServer(ctx context.Context, logs *logs.Logs) { managementpb.RegisterMySQLHandlerFromEndpoint, managementpb.RegisterNodeHandlerFromEndpoint, managementpb.RegisterServiceHandlerFromEndpoint, + managementpb.RegisterMongoDBHandlerFromEndpoint, } { if err := r(ctx, proxyMux, *gRPCAddrF, opts); err != nil { l.Panic(err) diff --git a/services/management/grpc/mongodb_server.go b/services/management/grpc/mongodb_server.go new file mode 100644 index 0000000000..b62a9056ea --- /dev/null +++ b/services/management/grpc/mongodb_server.go @@ -0,0 +1,39 @@ +// pmm-managed +// Copyright (C) 2017 Percona LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package grpc + +import ( + "context" + + "github.com/percona/pmm/api/managementpb" + + "github.com/percona/pmm-managed/services/management" +) + +type mongodbServer struct { + svc *management.MongoDBService +} + +// NewManagementMongoDBServer creates Management MongoDB Server. +func NewManagementMongoDBServer(s *management.MongoDBService) managementpb.MongoDBServer { + return &mongodbServer{svc: s} +} + +// AddMongoDB adds "MongoDB Service", "MongoDB Exporter Agent" and "QAN MongoDB Profiler". +func (s *mongodbServer) AddMongoDB(ctx context.Context, req *managementpb.AddMongoDBRequest) (*managementpb.AddMongoDBResponse, error) { + return s.svc.Add(ctx, req) +} diff --git a/services/management/grpc/mysql_server.go b/services/management/grpc/mysql_server.go index c444e7489f..ba9ee95e16 100644 --- a/services/management/grpc/mysql_server.go +++ b/services/management/grpc/mysql_server.go @@ -33,7 +33,7 @@ func NewManagementMysqlServer(s *management.MySQLService) managementpb.MySQLServ return &mysqlServer{svc: s} } -// Add adds "MySQL Service", "MySQL Exporter Agent" and "QAN MySQL PerfSchema Agent". -func (s *mysqlServer) Add(ctx context.Context, req *managementpb.AddMySQLRequest) (*managementpb.AddMySQLResponse, error) { +// AddMySQL adds "MySQL Service", "MySQL Exporter Agent" and "QAN MySQL PerfSchema Agent". +func (s *mysqlServer) AddMySQL(ctx context.Context, req *managementpb.AddMySQLRequest) (*managementpb.AddMySQLResponse, error) { return s.svc.Add(ctx, req) } diff --git a/services/management/mongodb.go b/services/management/mongodb.go new file mode 100644 index 0000000000..5d9ce7e05b --- /dev/null +++ b/services/management/mongodb.go @@ -0,0 +1,119 @@ +// pmm-managed +// Copyright (C) 2017 Percona LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package management + +import ( + "context" + + "github.com/AlekSi/pointer" + "github.com/percona/pmm/api/inventorypb" + "github.com/percona/pmm/api/managementpb" + "gopkg.in/reform.v1" + + "github.com/percona/pmm-managed/models" + + // FIXME Refactor, as service shouldn't depend on other service in one abstraction level. + // https://jira.percona.com/browse/PMM-3541 + // See also main_test.go + "github.com/percona/pmm-managed/services/inventory" +) + +// MongoDBService MongoDB Management Service. +//nolint:unused +type MongoDBService struct { + db *reform.DB + registry registry +} + +// NewMongoDBService creates new MySQL Management Service. +func NewMongoDBService(db *reform.DB, registry registry) *MongoDBService { + return &MongoDBService{db, registry} +} + +// Add adds "MongoDB Service", "MongoDB Exporter Agent" and "QAN MongoDB Profiler". +func (s *MongoDBService) Add(ctx context.Context, req *managementpb.AddMongoDBRequest) (res *managementpb.AddMongoDBResponse, err error) { + res = &managementpb.AddMongoDBResponse{} + + if e := s.db.InTransaction(func(tx *reform.TX) error { + service, err := models.AddNewService(tx.Querier, models.MongoDBServiceType, &models.AddDBMSServiceParams{ + ServiceName: req.ServiceName, + NodeID: req.NodeId, + Address: pointer.ToStringOrNil(req.Address), + Port: pointer.ToUint16OrNil(uint16(req.Port)), + }) + + if err != nil { + return err + } + + invService, err := inventory.ToInventoryService(service) + if err != nil { + return err + } + + res.Service = invService.(*inventorypb.MongoDBService) + + if req.MongodbExporter { + params := &models.AddExporterAgentParams{ + PMMAgentID: req.PmmAgentId, + ServiceID: invService.ID(), + Username: req.Username, + Password: req.Password, + } + row, err := models.AgentAddExporter(tx.Querier, models.MongoDBExporterType, params) + if err != nil { + return err + } + + agent, err := inventory.ToInventoryAgent(tx.Querier, row, s.registry) + if err != nil { + return err + } + + res.MongodbExporter = agent.(*inventorypb.MongoDBExporter) + } + + if req.QanMongodbProfiler { + params := &models.AddExporterAgentParams{ + PMMAgentID: req.PmmAgentId, + ServiceID: invService.ID(), + Username: req.Username, + Password: req.Password, + } + + row, err := models.AgentAddExporter(tx.Querier, models.QANMongoDBProfilerAgentType, params) + if err != nil { + return err + } + + qAgent, err := inventory.ToInventoryAgent(tx.Querier, row, s.registry) + if err != nil { + return err + } + + res.QanMongodbProfiler = qAgent.(*inventorypb.QANMongoDBProfilerAgent) + } + + return nil + }); e != nil { + return nil, e + } + + s.registry.SendSetStateRequest(ctx, req.PmmAgentId) + + return res, nil +} diff --git a/services/management/mysql.go b/services/management/mysql.go index aab8a05f48..db796b9ca3 100644 --- a/services/management/mysql.go +++ b/services/management/mysql.go @@ -67,7 +67,6 @@ func (s *MySQLService) Add(ctx context.Context, req *managementpb.AddMySQLReques res.Service = invService.(*inventorypb.MySQLService) if req.MysqldExporter { - params := &models.AddExporterAgentParams{ PMMAgentID: req.PmmAgentId, ServiceID: invService.ID(), @@ -88,7 +87,6 @@ func (s *MySQLService) Add(ctx context.Context, req *managementpb.AddMySQLReques } if req.QanMysqlPerfschema { - params := &models.AddExporterAgentParams{ PMMAgentID: req.PmmAgentId, ServiceID: invService.ID(), diff --git a/vendor/github.com/percona/pmm/api/managementpb/mongodb.pb.go b/vendor/github.com/percona/pmm/api/managementpb/mongodb.pb.go new file mode 100644 index 0000000000..0f07cea5c7 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/managementpb/mongodb.pb.go @@ -0,0 +1,350 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: managementpb/mongodb.proto + +package managementpb + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" + _ "github.com/mwitkow/go-proto-validators" + inventorypb "github.com/percona/pmm/api/inventorypb" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type AddMongoDBRequest struct { + // Node identifier on which a service is been running. Required. + NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // Unique across all Services user-defined name. Required. + ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + // Node and Service access address (DNS name or IP). Required. + Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` + // Service Access port. Required. + Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` + // The "pmm-agent" identifier which should run agents. Required. + PmmAgentId string `protobuf:"bytes,5,opt,name=pmm_agent_id,json=pmmAgentId,proto3" json:"pmm_agent_id,omitempty"` + // Environment name. + Environment string `protobuf:"bytes,6,opt,name=environment,proto3" json:"environment,omitempty"` + // Cluster name. + Cluster string `protobuf:"bytes,7,opt,name=cluster,proto3" json:"cluster,omitempty"` + // Replication set name. + ReplicationSet string `protobuf:"bytes,8,opt,name=replication_set,json=replicationSet,proto3" json:"replication_set,omitempty"` + // MongoDB username for exporter and QAN agent access. + Username string `protobuf:"bytes,9,opt,name=username,proto3" json:"username,omitempty"` + // MongoDB password for exporter and QAN agent access. + Password string `protobuf:"bytes,10,opt,name=password,proto3" json:"password,omitempty"` + // If true, adds mongodb_exporter for provided service. + MongodbExporter bool `protobuf:"varint,11,opt,name=mongodb_exporter,json=mongodbExporter,proto3" json:"mongodb_exporter,omitempty"` + // If true, adds qan-mongodb-profiler-agent for provided service. + QanMongodbProfiler bool `protobuf:"varint,12,opt,name=qan_mongodb_profiler,json=qanMongodbProfiler,proto3" json:"qan_mongodb_profiler,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddMongoDBRequest) Reset() { *m = AddMongoDBRequest{} } +func (m *AddMongoDBRequest) String() string { return proto.CompactTextString(m) } +func (*AddMongoDBRequest) ProtoMessage() {} +func (*AddMongoDBRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_593aa4f9c0b43a5e, []int{0} +} + +func (m *AddMongoDBRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddMongoDBRequest.Unmarshal(m, b) +} +func (m *AddMongoDBRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddMongoDBRequest.Marshal(b, m, deterministic) +} +func (m *AddMongoDBRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMongoDBRequest.Merge(m, src) +} +func (m *AddMongoDBRequest) XXX_Size() int { + return xxx_messageInfo_AddMongoDBRequest.Size(m) +} +func (m *AddMongoDBRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddMongoDBRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMongoDBRequest proto.InternalMessageInfo + +func (m *AddMongoDBRequest) GetNodeId() string { + if m != nil { + return m.NodeId + } + return "" +} + +func (m *AddMongoDBRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *AddMongoDBRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *AddMongoDBRequest) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *AddMongoDBRequest) GetPmmAgentId() string { + if m != nil { + return m.PmmAgentId + } + return "" +} + +func (m *AddMongoDBRequest) GetEnvironment() string { + if m != nil { + return m.Environment + } + return "" +} + +func (m *AddMongoDBRequest) GetCluster() string { + if m != nil { + return m.Cluster + } + return "" +} + +func (m *AddMongoDBRequest) GetReplicationSet() string { + if m != nil { + return m.ReplicationSet + } + return "" +} + +func (m *AddMongoDBRequest) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *AddMongoDBRequest) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *AddMongoDBRequest) GetMongodbExporter() bool { + if m != nil { + return m.MongodbExporter + } + return false +} + +func (m *AddMongoDBRequest) GetQanMongodbProfiler() bool { + if m != nil { + return m.QanMongodbProfiler + } + return false +} + +type AddMongoDBResponse struct { + Service *inventorypb.MongoDBService `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + MongodbExporter *inventorypb.MongoDBExporter `protobuf:"bytes,2,opt,name=mongodb_exporter,json=mongodbExporter,proto3" json:"mongodb_exporter,omitempty"` + QanMongodbProfiler *inventorypb.QANMongoDBProfilerAgent `protobuf:"bytes,3,opt,name=qan_mongodb_profiler,json=qanMongodbProfiler,proto3" json:"qan_mongodb_profiler,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddMongoDBResponse) Reset() { *m = AddMongoDBResponse{} } +func (m *AddMongoDBResponse) String() string { return proto.CompactTextString(m) } +func (*AddMongoDBResponse) ProtoMessage() {} +func (*AddMongoDBResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_593aa4f9c0b43a5e, []int{1} +} + +func (m *AddMongoDBResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddMongoDBResponse.Unmarshal(m, b) +} +func (m *AddMongoDBResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddMongoDBResponse.Marshal(b, m, deterministic) +} +func (m *AddMongoDBResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMongoDBResponse.Merge(m, src) +} +func (m *AddMongoDBResponse) XXX_Size() int { + return xxx_messageInfo_AddMongoDBResponse.Size(m) +} +func (m *AddMongoDBResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddMongoDBResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMongoDBResponse proto.InternalMessageInfo + +func (m *AddMongoDBResponse) GetService() *inventorypb.MongoDBService { + if m != nil { + return m.Service + } + return nil +} + +func (m *AddMongoDBResponse) GetMongodbExporter() *inventorypb.MongoDBExporter { + if m != nil { + return m.MongodbExporter + } + return nil +} + +func (m *AddMongoDBResponse) GetQanMongodbProfiler() *inventorypb.QANMongoDBProfilerAgent { + if m != nil { + return m.QanMongodbProfiler + } + return nil +} + +func init() { + proto.RegisterType((*AddMongoDBRequest)(nil), "management.AddMongoDBRequest") + proto.RegisterType((*AddMongoDBResponse)(nil), "management.AddMongoDBResponse") +} + +func init() { proto.RegisterFile("managementpb/mongodb.proto", fileDescriptor_593aa4f9c0b43a5e) } + +var fileDescriptor_593aa4f9c0b43a5e = []byte{ + // 604 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xd1, 0x6e, 0xd3, 0x3a, + 0x18, 0xc7, 0x4f, 0xba, 0x9d, 0x66, 0x73, 0x7b, 0xce, 0x76, 0xac, 0x73, 0x11, 0x22, 0x60, 0x51, + 0x11, 0x5a, 0x07, 0x34, 0x86, 0x4d, 0xe2, 0x82, 0xbb, 0x4c, 0xec, 0x62, 0x12, 0x9b, 0x20, 0xe3, + 0x02, 0x71, 0x13, 0xb9, 0xf5, 0xb7, 0x60, 0xd1, 0xd8, 0x99, 0xed, 0xb6, 0x70, 0xc1, 0x0d, 0x8f, + 0x00, 0x4f, 0xc4, 0x33, 0xf0, 0x00, 0x48, 0x08, 0xf1, 0x1c, 0x28, 0x8e, 0xb3, 0x66, 0xea, 0x76,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, 0xf8, 0xf2, + 0xda, 0xc4, 0x0e, 0x3e, 0xab, 0x81, 0xb4, 0x21, 0xf1, 0xd1, 0x35, 0x1b, 0xed, 0xd8, 0xd9, 0xe1, + 0xea, 0xec, 0x66, 0xcf, 0xab, 0x21, 0x5e, 0xdf, 0x10, 0x62, 0xcd, 0x5a, 0x0d, 0x5a, 0x56, 0xaf, + 0x92, 0x53, 0xe7, 0xd6, 0xe4, 0xb1, 0x0d, 0xbd, 0x2e, 0xe8, 0xfe, 0x27, 0xe4, 0x3b, 0x16, 0x2b, + 0x84, 0x96, 0x91, 0xf1, 0x9d, 0x78, 0xf9, 0x18, 0xe3, 0x95, 0xeb, 0x1c, 0xde, 0xbd, 0x49, 0xae, + 0x4f, 0x6a, 0x70, 0xff, 0xf3, 0xf7, 0x5f, 0x5f, 0x3b, 0x3b, 0x83, 0x90, 0xcc, 0x9f, 0x90, 0x25, + 0x4a, 0x1c, 0x47, 0x12, 0xc6, 0x9e, 0x79, 0x0f, 0x0e, 0xb3, 0x2f, 0xc9, 0x69, 0xfa, 0x02, 0xf9, + 0x0c, 0xce, 0xe9, 0x6c, 0x6a, 0x70, 0x82, 0x70, 0x22, 0x22, 0x50, 0x4a, 0xaa, 0x48, 0x39, 0xaf, + 0x18, 0x3f, 0x44, 0x7b, 0xe1, 0xee, 0x3d, 0xc2, 0xe0, 0x9c, 0x0b, 0x5e, 0x3f, 0xbb, 0xf6, 0x57, + 0xe4, 0xa8, 0xc2, 0x9b, 0x95, 0xdf, 0xf6, 0xdb, 0xd2, 0xb8, 0x6b, 0xdf, 0xe4, 0xc1, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x8f, 0x3b, 0x53, 0xe8, 0x77, 0x04, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MongoDBClient is the client API for MongoDB service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MongoDBClient interface { + // AddMongoDB adds MongoDB Service and starts several Agents. + // It automatically adds a service to inventory, which is running on provided "node_id", + // then adds "mongodb_exporter", and "qan_mongodb_profiler" agents + // with provided "pmm_agent_id" and other parameters. + AddMongoDB(ctx context.Context, in *AddMongoDBRequest, opts ...grpc.CallOption) (*AddMongoDBResponse, error) +} + +type mongoDBClient struct { + cc *grpc.ClientConn +} + +func NewMongoDBClient(cc *grpc.ClientConn) MongoDBClient { + return &mongoDBClient{cc} +} + +func (c *mongoDBClient) AddMongoDB(ctx context.Context, in *AddMongoDBRequest, opts ...grpc.CallOption) (*AddMongoDBResponse, error) { + out := new(AddMongoDBResponse) + err := c.cc.Invoke(ctx, "/management.MongoDB/AddMongoDB", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MongoDBServer is the server API for MongoDB service. +type MongoDBServer interface { + // AddMongoDB adds MongoDB Service and starts several Agents. + // It automatically adds a service to inventory, which is running on provided "node_id", + // then adds "mongodb_exporter", and "qan_mongodb_profiler" agents + // with provided "pmm_agent_id" and other parameters. + AddMongoDB(context.Context, *AddMongoDBRequest) (*AddMongoDBResponse, error) +} + +func RegisterMongoDBServer(s *grpc.Server, srv MongoDBServer) { + s.RegisterService(&_MongoDB_serviceDesc, srv) +} + +func _MongoDB_AddMongoDB_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddMongoDBRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MongoDBServer).AddMongoDB(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/management.MongoDB/AddMongoDB", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MongoDBServer).AddMongoDB(ctx, req.(*AddMongoDBRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _MongoDB_serviceDesc = grpc.ServiceDesc{ + ServiceName: "management.MongoDB", + HandlerType: (*MongoDBServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddMongoDB", + Handler: _MongoDB_AddMongoDB_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "managementpb/mongodb.proto", +} diff --git a/vendor/github.com/percona/pmm/api/managementpb/mongodb.pb.gw.go b/vendor/github.com/percona/pmm/api/managementpb/mongodb.pb.gw.go new file mode 100644 index 0000000000..27bf250a41 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/managementpb/mongodb.pb.gw.go @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: managementpb/mongodb.proto + +/* +Package managementpb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package managementpb + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_MongoDB_AddMongoDB_0(ctx context.Context, marshaler runtime.Marshaler, client MongoDBClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddMongoDBRequest + 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.AddMongoDB(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterMongoDBHandlerFromEndpoint is same as RegisterMongoDBHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMongoDBHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(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 RegisterMongoDBHandler(ctx, mux, conn) +} + +// RegisterMongoDBHandler registers the http handlers for service MongoDB to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMongoDBHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMongoDBHandlerClient(ctx, mux, NewMongoDBClient(conn)) +} + +// RegisterMongoDBHandlerClient registers the http handlers for service MongoDB +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MongoDBClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MongoDBClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MongoDBClient" to call the correct interceptors. +func RegisterMongoDBHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MongoDBClient) error { + + mux.Handle("POST", pattern_MongoDB_AddMongoDB_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MongoDB_AddMongoDB_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_MongoDB_AddMongoDB_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_MongoDB_AddMongoDB_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "MongoDB", "Add"}, "")) +) + +var ( + forward_MongoDB_AddMongoDB_0 = runtime.ForwardResponseMessage +) diff --git a/vendor/github.com/percona/pmm/api/managementpb/mongodb.validator.pb.go b/vendor/github.com/percona/pmm/api/managementpb/mongodb.validator.pb.go new file mode 100644 index 0000000000..91f7033e22 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/managementpb/mongodb.validator.pb.go @@ -0,0 +1,57 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: managementpb/mongodb.proto + +package managementpb + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" + _ "github.com/mwitkow/go-proto-validators" + github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" + _ "github.com/percona/pmm/api/inventorypb" + _ "google.golang.org/genproto/googleapis/api/annotations" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func (this *AddMongoDBRequest) Validate() error { + if this.NodeId == "" { + return github_com_mwitkow_go_proto_validators.FieldError("NodeId", fmt.Errorf(`value '%v' must not be an empty string`, this.NodeId)) + } + if this.ServiceName == "" { + return github_com_mwitkow_go_proto_validators.FieldError("ServiceName", fmt.Errorf(`value '%v' must not be an empty string`, this.ServiceName)) + } + if this.Address == "" { + return github_com_mwitkow_go_proto_validators.FieldError("Address", fmt.Errorf(`value '%v' must not be an empty string`, this.Address)) + } + if !(this.Port > 0) { + return github_com_mwitkow_go_proto_validators.FieldError("Port", fmt.Errorf(`value '%v' must be greater than '0'`, this.Port)) + } + if this.PmmAgentId == "" { + return github_com_mwitkow_go_proto_validators.FieldError("PmmAgentId", fmt.Errorf(`value '%v' must not be an empty string`, this.PmmAgentId)) + } + return nil +} +func (this *AddMongoDBResponse) Validate() error { + if this.Service != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Service); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Service", err) + } + } + if this.MongodbExporter != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.MongodbExporter); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("MongodbExporter", err) + } + } + if this.QanMongodbProfiler != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.QanMongodbProfiler); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("QanMongodbProfiler", err) + } + } + return nil +} diff --git a/vendor/github.com/percona/pmm/api/managementpb/mysql.pb.go b/vendor/github.com/percona/pmm/api/managementpb/mysql.pb.go index ce1fea9312..751bc647c0 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/mysql.pb.go +++ b/vendor/github.com/percona/pmm/api/managementpb/mysql.pb.go @@ -264,48 +264,48 @@ func init() { proto.RegisterFile("managementpb/mysql.proto", fileDescriptor_ab81 var fileDescriptor_ab81470951176953 = []byte{ // 667 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xdf, 0x4e, 0xdb, 0x3c, - 0x18, 0xc6, 0xbf, 0x96, 0xd2, 0x82, 0x5b, 0x28, 0x9f, 0xf5, 0x49, 0x9f, 0xd7, 0x31, 0x91, 0x95, - 0x03, 0x0a, 0x5b, 0x93, 0xc1, 0xa4, 0x1d, 0xec, 0x2c, 0x48, 0x1c, 0xa0, 0x01, 0x82, 0x74, 0x93, - 0xa6, 0x9d, 0x44, 0x6e, 0xfd, 0x12, 0xa2, 0x25, 0x76, 0x6a, 0xbb, 0xed, 0x38, 0xdd, 0x25, 0x6c, - 0xb7, 0x31, 0x69, 0x17, 0xb3, 0x0b,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x40, 0x0a, 0x9e, 0xbc, 0x10, 0x52, 0x4d, + 0x40, 0x77, 0x51, 0xc2, 0x04, 0xd5, 0x46, 0xe1, 0x44, 0x69, 0x90, 0xa4, 0x66, 0xdc, 0x7c, 0x89, + 0x77, 0x51, 0x4b, 0x42, 0x1c, 0x06, 0x23, 0xd3, 0x19, 0x4f, 0x81, 0x26, 0x75, 0x43, 0x6c, 0x2c, + 0xc8, 0x03, 0xd0, 0xb8, 0x8d, 0xea, 0x13, 0x05, 0xd2, 0xd4, 0xbc, 0x66, 0x88, 0x62, 0x9d, 0x78, + 0x31, 0x55, 0x6a, 0x26, 0x24, 0x23, 0x28, 0xf5, 0xf2, 0x35, 0x7e, 0x8a, 0x9a, 0x63, 0xca, 0xbd, + 0x62, 0x6f, 0x23, 0x7d, 0xba, 0x31, 0xe5, 0xef, 0xf2, 0xed, 0x19, 0x52, 0x44, 0x34, 0x0b, 0xe4, + 0x22, 0x4f, 0xd9, 0x45, 0x2d, 0x33, 0x7f, 0xcc, 0x83, 0xcf, 0x49, 0x77, 0x40, 0x92, 0xf5, 0x4e, + 0xa9, 0x57, 0x77, 0x37, 0x52, 0xf9, 0x38, 0x53, 0xf1, 0x0b, 0xf4, 0x20, 0xc9, 0x32, 0xaa, 0x17, + 0x83, 0xbc, 0x52, 0xa3, 0x6b, 0x88, 0x28, 0xd9, 0x30, 0x34, 0x1e, 0x53, 0x7e, 0x96, 0x58, 0x17, + 0x85, 0x83, 0xf7, 0xd1, 0xff, 0xf3, 0x1d, 0x2a, 0x14, 0xb3, 0x50, 0xf8, 0xa4, 0x65, 0xf0, 0x56, + 0x8e, 0x0f, 0x52, 0xb9, 0xfb, 0xbd, 0x8c, 0x36, 0xe7, 0x13, 0xa3, 0x62, 0xc1, 0x15, 0xe0, 0x03, + 0x54, 0xcb, 0xde, 0xba, 0x19, 0x99, 0xc6, 0xe1, 0x43, 0xab, 0x18, 0x51, 0xcb, 0xa0, 0x83, 0xd4, + 0x76, 0x73, 0x0e, 0x1f, 0xdd, 0x2f, 0xa7, 0x6c, 0xb6, 0x3e, 0xba, 0xbb, 0xb5, 0xa8, 0xec, 0x5e, + 0xa5, 0x6f, 0xff, 0x51, 0xe9, 0x8a, 0x09, 0xea, 0x2e, 0x04, 0x5d, 0x3a, 0xe7, 0x26, 0x2b, 0x29, + 0x7a, 0x60, 0x20, 0x33, 0x39, 0x4b, 0xbb, 0xf1, 0x66, 0x59, 0x37, 0x2a, 0x26, 0x72, 0x7b, 0x49, + 0x64, 0xd6, 0x98, 0x34, 0xef, 0x6e, 0xbb, 0x0e, 0x15, 0x5a, 0x35, 0x14, 0xfe, 0x88, 0xea, 0x79, + 0xdb, 0xf0, 0x63, 0x6b, 0x7e, 0x79, 0x58, 0x77, 0x3e, 0xbf, 0xf6, 0xd6, 0x72, 0x33, 0xed, 0x74, + 0x77, 0xe7, 0xcb, 0xcf, 0x3f, 0xdf, 0xca, 0x4f, 0xba, 0xc4, 0x9e, 0x1e, 0xd8, 0x73, 0xd0, 0x36, + 0x94, 0xed, 0x30, 0xf6, 0xba, 0xb4, 0x7f, 0xe4, 0x7d, 0x75, 0xce, 0xdd, 0x53, 0x54, 0x63, 0x70, + 0x45, 0x27, 0xa1, 0xc6, 0x0e, 0xc2, 0x0e, 0xef, 0x80, 0x94, 0x42, 0x76, 0x64, 0x96, 0x64, 0xe1, + 0x67, 0x68, 0xaf, 0xbd, 0xbb, 0x63, 0x33, 0xb8, 0x0a, 0x78, 0x90, 0x5e, 0x10, 0x8b, 0xb7, 0xdd, + 0x71, 0x82, 0xe7, 0xe7, 0x7e, 0x68, 0x2e, 0x5a, 0xc3, 0xaa, 0xb9, 0x3d, 0x5e, 0xfe, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0xee, 0xa5, 0xee, 0x54, 0x1f, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -320,11 +320,11 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MySQLClient interface { - // Add MySQL adds MySQL Service and starts several Agents. + // AddMySQL adds MySQL Service and starts several Agents. // It automatically adds a service to inventory, which is running on provided "node_id", // then adds "mysqld_exporter", and "qan_mysql_perfschema" agents // with provided "pmm_agent_id" and other parameters. - Add(ctx context.Context, in *AddMySQLRequest, opts ...grpc.CallOption) (*AddMySQLResponse, error) + AddMySQL(ctx context.Context, in *AddMySQLRequest, opts ...grpc.CallOption) (*AddMySQLResponse, error) } type mySQLClient struct { @@ -335,9 +335,9 @@ func NewMySQLClient(cc *grpc.ClientConn) MySQLClient { return &mySQLClient{cc} } -func (c *mySQLClient) Add(ctx context.Context, in *AddMySQLRequest, opts ...grpc.CallOption) (*AddMySQLResponse, error) { +func (c *mySQLClient) AddMySQL(ctx context.Context, in *AddMySQLRequest, opts ...grpc.CallOption) (*AddMySQLResponse, error) { out := new(AddMySQLResponse) - err := c.cc.Invoke(ctx, "/management.MySQL/Add", in, out, opts...) + err := c.cc.Invoke(ctx, "/management.MySQL/AddMySQL", in, out, opts...) if err != nil { return nil, err } @@ -346,31 +346,31 @@ func (c *mySQLClient) Add(ctx context.Context, in *AddMySQLRequest, opts ...grpc // MySQLServer is the server API for MySQL service. type MySQLServer interface { - // Add MySQL adds MySQL Service and starts several Agents. + // AddMySQL adds MySQL Service and starts several Agents. // It automatically adds a service to inventory, which is running on provided "node_id", // then adds "mysqld_exporter", and "qan_mysql_perfschema" agents // with provided "pmm_agent_id" and other parameters. - Add(context.Context, *AddMySQLRequest) (*AddMySQLResponse, error) + AddMySQL(context.Context, *AddMySQLRequest) (*AddMySQLResponse, error) } func RegisterMySQLServer(s *grpc.Server, srv MySQLServer) { s.RegisterService(&_MySQL_serviceDesc, srv) } -func _MySQL_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _MySQL_AddMySQL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddMySQLRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MySQLServer).Add(ctx, in) + return srv.(MySQLServer).AddMySQL(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/management.MySQL/Add", + FullMethod: "/management.MySQL/AddMySQL", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MySQLServer).Add(ctx, req.(*AddMySQLRequest)) + return srv.(MySQLServer).AddMySQL(ctx, req.(*AddMySQLRequest)) } return interceptor(ctx, in, info, handler) } @@ -380,8 +380,8 @@ var _MySQL_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MySQLServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Add", - Handler: _MySQL_Add_Handler, + MethodName: "AddMySQL", + Handler: _MySQL_AddMySQL_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/vendor/github.com/percona/pmm/api/managementpb/mysql.pb.gw.go b/vendor/github.com/percona/pmm/api/managementpb/mysql.pb.gw.go index eb08607a74..154b356391 100644 --- a/vendor/github.com/percona/pmm/api/managementpb/mysql.pb.gw.go +++ b/vendor/github.com/percona/pmm/api/managementpb/mysql.pb.gw.go @@ -28,7 +28,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -func request_MySQL_Add_0(ctx context.Context, marshaler runtime.Marshaler, client MySQLClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_MySQL_AddMySQL_0(ctx context.Context, marshaler runtime.Marshaler, client MySQLClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq AddMySQLRequest var metadata runtime.ServerMetadata @@ -40,7 +40,7 @@ func request_MySQL_Add_0(ctx context.Context, marshaler runtime.Marshaler, clien return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Add(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.AddMySQL(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } @@ -83,7 +83,7 @@ func RegisterMySQLHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "MySQLClient" to call the correct interceptors. func RegisterMySQLHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MySQLClient) error { - mux.Handle("POST", pattern_MySQL_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_MySQL_AddMySQL_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) @@ -92,14 +92,14 @@ func RegisterMySQLHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_MySQL_Add_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_MySQL_AddMySQL_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_MySQL_Add_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MySQL_AddMySQL_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -107,9 +107,9 @@ func RegisterMySQLHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_MySQL_Add_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "MySQL", "Add"}, "")) + pattern_MySQL_AddMySQL_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "MySQL", "Add"}, "")) ) var ( - forward_MySQL_Add_0 = runtime.ForwardResponseMessage + forward_MySQL_AddMySQL_0 = runtime.ForwardResponseMessage )